Hello community, here is the log from the commit of package rubygem-power_assert for openSUSE:Factory checked in at 2017-09-12 19:56:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-power_assert (Old) and /work/SRC/openSUSE:Factory/.rubygem-power_assert.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-power_assert" Tue Sep 12 19:56:36 2017 rev:12 rq:523548 version:1.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-power_assert/rubygem-power_assert.changes 2017-06-08 15:01:37.730660449 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-power_assert.new/rubygem-power_assert.changes 2017-09-12 19:56:40.356297901 +0200 @@ -1,0 +2,6 @@ +Mon Sep 11 12:47:11 UTC 2017 - co...@suse.com + +- updated to version 1.1.0 + no changelog found + +------------------------------------------------------------------- Old: ---- power_assert-1.0.2.gem New: ---- power_assert-1.1.0.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-power_assert.spec ++++++ --- /var/tmp/diff_new_pack.7Druzp/_old 2017-09-12 19:56:40.912219733 +0200 +++ /var/tmp/diff_new_pack.7Druzp/_new 2017-09-12 19:56:40.916219171 +0200 @@ -24,7 +24,7 @@ # Name: rubygem-power_assert -Version: 1.0.2 +Version: 1.1.0 Release: 0 %define mod_name power_assert %define mod_full_name %{mod_name}-%{version} @@ -34,7 +34,7 @@ BuildRequires: %{ruby} BuildRequires: ruby-macros >= 5 Url: https://github.com/k-tsj/power_assert -Source: http://rubygems.org/gems/%{mod_full_name}.gem +Source: https://rubygems.org/gems/%{mod_full_name}.gem Source1: gem2rpm.yml Summary: Power Assert for Ruby License: BSD-2-Clause or Ruby ++++++ power_assert-1.0.2.gem -> power_assert-1.1.0.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/.travis.yml new/.travis.yml --- old/.travis.yml 2017-05-04 03:13:02.000000000 +0200 +++ new/.travis.yml 2017-08-19 08:50:16.000000000 +0200 @@ -3,12 +3,19 @@ rvm: - 2.0.0-p648 - 2.1.10 - - 2.2.6 - - 2.3.3 - - 2.4.0 + - 2.2.7 + - 2.3.4 + - 2.4.1 - ruby-head +env: + - TEST_SYMLINK="no" + - TEST_SYMLINK="yes" matrix: allow_failures: - rvm: ruby-head before_install: - gem update bundler +before_script: + - bundle exec rake before_script +after_script: + - bundle exec rake after_script diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.rdoc new/README.rdoc --- old/README.rdoc 2017-05-04 03:13:02.000000000 +0200 +++ new/README.rdoc 2017-08-19 08:50:16.000000000 +0200 @@ -6,12 +6,16 @@ It is useful for testing, providing which value wasn't correct when the condition is not satisfied. == Related Projects +In general, you don't need to use this library directly. +Use following test frameworks or extensions instead. + * {test-unit}[https://github.com/test-unit/test-unit](>= 3.0.0) + * {Document}[http://test-unit.github.io/test-unit/en/Test/Unit/Assertions.html#assert-instance_method] * {minitest-power_assert}[https://github.com/hsbt/minitest-power_assert] -* {pry-power_assert}[https://github.com/yui-knk/pry-power_assert] * {rspec-power_assert}[https://github.com/joker1007/rspec-power_assert] -* {power_p}[https://github.com/k-tsj/power_p] +* {pry-power_assert}[https://github.com/yui-knk/pry-power_assert] * {pry-byebug-power_assert}[https://github.com/k-tsj/pry-byebug-power_assert] +* {power_p}[https://github.com/k-tsj/power_p] == Requirement * CRuby 2.0.0 or later diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Rakefile new/Rakefile --- old/Rakefile 2017-05-04 03:13:02.000000000 +0200 +++ new/Rakefile 2017-08-19 08:50:16.000000000 +0200 @@ -4,7 +4,8 @@ task :default => :test Rake::TestTask.new(:test) do |t| # helper(simplecov) must be required before loading power_assert - t.ruby_opts = ["-w", "-r./test/test_helper"] + helper_path = File.realpath("test/test_helper.rb") + t.ruby_opts = ["-w", "-r#{helper_path}"] t.test_files = FileList["test/**/*_test.rb"].exclude do |i| begin return false unless defined?(RubyVM) @@ -16,9 +17,43 @@ end end +# ruby/ruby:test/pathname/test_pathname.rb +def has_symlink? + begin + File.symlink("", "") + rescue NotImplementedError, Errno::EACCES + return false + rescue Errno::ENOENT + end + return true +end + +SYMLINK_DIRS = ["lib", "test"] + +task :before_script do + if ENV["TEST_SYMLINK"] == "yes" and has_symlink? + SYMLINK_DIRS.each do |d| + File.rename(d, ".#{d}") + File.symlink(".#{d}", d) + end + end +end + +task :after_script do + SYMLINK_DIRS.each do |d| + if File.symlink?(d) and File.directory?(".#{d}") + File.unlink(d) + File.rename(".#{d}", d) + end + unless File.directory?(d) + raise "#{d} should be directory" + end + end +end + desc "Run the benchmark suite" -task('benchmark') do - Dir.glob('benchmarks/bm_*.rb').each do |f| +task :benchmark do + Dir.glob("benchmark/bm_*.rb").each do |f| load(f) end end Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/power_assert/context.rb new/lib/power_assert/context.rb --- old/lib/power_assert/context.rb 2017-05-04 03:13:02.000000000 +0200 +++ new/lib/power_assert/context.rb 2017-08-19 08:50:16.000000000 +0200 @@ -5,18 +5,19 @@ module PowerAssert class Context - Value = Struct.new(:name, :value, :column) - - attr_reader :message_proc + Value = Struct.new(:name, :value, :lineno, :column) def initialize(base_caller_length) @fired = false @target_thread = Thread.current method_id_set = nil - return_values = [] + @return_values = [] trace_alias_method = PowerAssert.configuration._trace_alias_method @trace_return = TracePoint.new(:return, :c_return) do |tp| - method_id_set ||= @parser.method_id_set + unless method_id_set + next unless Thread.current == @target_thread + method_id_set = @parser.method_id_set + end method_id = SUPPORT_ALIAS_METHOD ? tp.callee_id : trace_alias_method && tp.event == :return ? tp.binding.eval('::Kernel.__callee__') : tp.method_id @@ -31,18 +32,19 @@ val = PowerAssert.configuration.lazy_inspection ? tp.return_value : InspectedValue.new(SafeInspectable.new(tp.return_value).inspect) - return_values << Value[method_id.to_s, val, nil] + @return_values << Value[method_id.to_s, val, locs[idx].lineno, nil] end end end - @message_proc = -> { - raise RuntimeError, 'call #yield or #enable at first' unless fired? - @message ||= build_assertion_message(@parser.line, @parser.idents, @parser.binding, return_values).freeze - } end def message - @message_proc.() + raise 'call #yield or #enable at first' unless fired? + @message ||= build_assertion_message(@parser, @return_values).freeze + end + + def message_proc + -> { message } end private @@ -51,24 +53,26 @@ @fired end - def build_assertion_message(line, idents, proc_binding, return_values) + def build_assertion_message(parser, return_values) if PowerAssert.configuration._colorize_message - line = Pry::Code.new(line).highlighted + line = Pry::Code.new(parser.line).highlighted + else + line = parser.line end - path = detect_path(idents, return_values) + path = detect_path(parser, return_values) return line unless path - delete_unidentified_calls(return_values, path) - methods, refs = path.partition {|i| i.type == :method } - return_values.zip(methods) do |i, j| + return_values, methods_in_path = find_all_identified_calls(return_values, path) + return_values.zip(methods_in_path) do |i, j| unless i.name == j.name warn "power_assert: [BUG] Failed to get column: #{i.name}" return line end i.column = j.column end - ref_values = refs.map {|i| Value[i.name, proc_binding.eval(i.name), i.column] } + refs_in_path = path.find_all {|i| i.type == :ref } + ref_values = refs_in_path.map {|i| Value[i.name, parser.binding.eval(i.name), parser.lineno, i.column] } vals = (return_values + ref_values).find_all(&:column).sort_by(&:column).reverse return line if vals.empty? @@ -88,9 +92,9 @@ lines.join("\n") end - def detect_path(idents, return_values) - return @parser.call_paths.flatten.uniq if @parser.method_id_set.empty? - all_paths = @parser.call_paths + def detect_path(parser, return_values) + return parser.call_paths.flatten.uniq if parser.method_id_set.empty? + all_paths = parser.call_paths return_value_names = return_values.map(&:name) uniq_calls = uniq_calls(all_paths) uniq_call = return_value_names.find {|i| uniq_calls.include?(i) } @@ -108,12 +112,14 @@ all_calls.find_all {|_, call_count| call_count == 1 }.map {|name, _| name } end - def delete_unidentified_calls(return_values, path) + def find_all_identified_calls(return_values, path) return_value_num_of_calls = enum_count_by(return_values, &:name) path_num_of_calls = enum_count_by(path.find_all {|ident| ident.type == :method }, &:name) identified_calls = return_value_num_of_calls.find_all {|name, num| path_num_of_calls[name] == num }.map(&:first) - return_values.delete_if {|val| ! identified_calls.include?(val.name) } - path.delete_if {|ident| ident.type == :method and ! identified_calls.include?(ident.name) } + [ + return_values.find_all {|val| identified_calls.include?(val.name) }, + path.find_all {|ident| ident.type == :method and identified_calls.include?(ident.name) } + ] end def enum_count_by(enum, &blk) @@ -152,7 +158,7 @@ lineno = locs.last.lineno if File.exist?(path) line ||= open(path).each_line.drop(lineno - 1).first - @parser = Parser.new(line, path, lineno, @assertion_proc.binding, assertion_method.to_s) + @parser = Parser.new(line, path, lineno, @assertion_proc.binding, assertion_method.to_s, @assertion_proc) end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/power_assert/enable_tracepoint_events.rb new/lib/power_assert/enable_tracepoint_events.rb --- old/lib/power_assert/enable_tracepoint_events.rb 2017-05-04 03:13:02.000000000 +0200 +++ new/lib/power_assert/enable_tracepoint_events.rb 2017-08-19 08:50:16.000000000 +0200 @@ -13,37 +13,37 @@ module PowerAssert # set redefined flag basic_classes = [ - Fixnum, Float, String, Array, Hash, Bignum, Symbol, Time, Regexp + Fixnum, Float, String, Array, Hash, Bignum, Symbol, Time, Regexp, NilClass, TrueClass, FalseClass ] basic_operators = [ :+, :-, :*, :/, :%, :==, :===, :<, :<=, :<<, :[], :[]=, - :length, :size, :empty?, :succ, :>, :>=, :!, :!=, :=~, :freeze + :length, :size, :empty?, :succ, :>, :>=, :!, :!=, :=~, :freeze, :-@, :max, :min ] - class Bug11182 + bug11182 = Class.new do def fixed? true end end - private_constant :Bug11182 - refine Bug11182 do + refine bug11182 do def fixed? end end - class Bug11182Sub < Bug11182 + _ = Class.new(bug11182) do alias _fixed? fixed? protected :_fixed? end - private_constant :Bug11182Sub - if (Bug11182.new.fixed? rescue false) + if (bug11182.new.fixed? rescue false) basic_classes.each do |klass| basic_operators.each do |bop| - refine(klass) do - define_method(bop) {} + if klass.public_method_defined?(bop) + refine(klass) do + define_method(bop) {} + end end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/power_assert/parser.rb new/lib/power_assert/parser.rb --- old/lib/power_assert/parser.rb 2017-05-04 03:13:02.000000000 +0200 +++ new/lib/power_assert/parser.rb 2017-08-19 08:50:16.000000000 +0200 @@ -6,7 +6,7 @@ attr_reader :line, :path, :lineno, :binding - def initialize(line, path, lineno, binding, assertion_method_name = nil) + def initialize(line, path, lineno, binding, assertion_method_name = nil, assertion_proc = nil) @line = line @line_for_parsing = valid_syntax?(line) ? line : slice_expression(line) @path = path @@ -14,6 +14,7 @@ @binding = binding @proc_local_variables = binding.eval('local_variables').map(&:to_s) @assertion_method_name = assertion_method_name + @assertion_proc = assertion_proc end def idents diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/power_assert/version.rb new/lib/power_assert/version.rb --- old/lib/power_assert/version.rb 2017-05-04 03:13:02.000000000 +0200 +++ new/lib/power_assert/version.rb 2017-08-19 08:50:16.000000000 +0200 @@ -1,3 +1,3 @@ module PowerAssert - VERSION = "1.0.2" + VERSION = "1.1.0" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/power_assert.rb new/lib/power_assert.rb --- old/lib/power_assert.rb 2017-05-04 03:13:02.000000000 +0200 +++ new/lib/power_assert.rb 2017-08-19 08:50:16.000000000 +0200 @@ -22,9 +22,16 @@ require 'power_assert/context' module PowerAssert - POWER_ASSERT_LIB_DIR = __dir__ - IGNORED_LIB_DIRS = {PowerAssert => POWER_ASSERT_LIB_DIR} - private_constant :POWER_ASSERT_LIB_DIR, :IGNORED_LIB_DIRS + POWER_ASSERT_LIB_DIR = File.dirname(caller_locations(1, 1).first.path) + INTERNAL_LIB_DIRS = {PowerAssert => POWER_ASSERT_LIB_DIR} + private_constant :POWER_ASSERT_LIB_DIR, :INTERNAL_LIB_DIRS + + # For backward compatibility + IGNORED_LIB_DIRS = INTERNAL_LIB_DIRS + private_constant :IGNORED_LIB_DIRS + if respond_to?(:deprecate_constant) + deprecate_constant :IGNORED_LIB_DIRS + end class << self def start(assertion_proc_or_source, assertion_method: nil, source_binding: TOPLEVEL_BINDING) @@ -46,27 +53,27 @@ end def app_caller_locations - caller_locations.drop_while {|i| ignored_file?(i.path) }.take_while {|i| ! ignored_file?(i.path) } + caller_locations.drop_while {|i| internal_file?(i.path) }.take_while {|i| ! internal_file?(i.path) } end def app_context? top_frame = caller_locations.drop_while {|i| i.path.start_with?(POWER_ASSERT_LIB_DIR) }.first - top_frame and ! ignored_file?(top_frame.path) + top_frame and ! internal_file?(top_frame.path) end private - def ignored_file?(file) - setup_ignored_lib_dir(Byebug, :attach, 2) if defined?(Byebug) - setup_ignored_lib_dir(PryByebug, :start_with_pry_byebug, 2, Pry) if defined?(PryByebug) - IGNORED_LIB_DIRS.find do |_, dir| + def internal_file?(file) + setup_internal_lib_dir(Byebug, :attach, 2) if defined?(Byebug) + setup_internal_lib_dir(PryByebug, :start_with_pry_byebug, 2, Pry) if defined?(PryByebug) + INTERNAL_LIB_DIRS.find do |_, dir| file.start_with?(dir) end end - def setup_ignored_lib_dir(lib, mid, depth, lib_obj = lib) - unless IGNORED_LIB_DIRS.key?(lib) - IGNORED_LIB_DIRS[lib] = lib_dir(lib_obj, mid, depth) + def setup_internal_lib_dir(lib, mid, depth, lib_obj = lib) + unless INTERNAL_LIB_DIRS.key?(lib) + INTERNAL_LIB_DIRS[lib] = lib_dir(lib_obj, mid, depth) end rescue NameError end @@ -76,8 +83,11 @@ end if defined?(RubyVM) + CLEAR_CACHE_ISEQ = RubyVM::InstructionSequence.compile('using PowerAssert.const_get(:Empty)') + private_constant :CLEAR_CACHE_ISEQ + def clear_global_method_cache - eval('using PowerAssert.const_get(:Empty)', TOPLEVEL_BINDING) + CLEAR_CACHE_ISEQ.eval end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2017-05-04 03:13:02.000000000 +0200 +++ new/metadata 2017-08-19 08:50:16.000000000 +0200 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: power_assert version: !ruby/object:Gem::Version - version: 1.0.2 + version: 1.1.0 platform: ruby authors: - Kazuki Tsujimoto autorequire: bindir: exe cert_chain: [] -date: 2017-05-04 00:00:00.000000000 Z +date: 2017-08-19 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: test-unit @@ -146,7 +146,7 @@ version: '0' requirements: [] rubyforge_project: -rubygems_version: 2.6.8 +rubygems_version: 2.6.11 signing_key: specification_version: 4 summary: Power Assert for Ruby diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/power_assert.gemspec new/power_assert.gemspec --- old/power_assert.gemspec 2017-05-04 03:13:02.000000000 +0200 +++ new/power_assert.gemspec 2017-08-19 08:50:16.000000000 +0200 @@ -13,7 +13,7 @@ s.description = "Power Assert for Ruby. Power Assert shows each value of variables and method calls in the expression. It is useful for testing, providing which value wasn't correct when the condition is not satisfied." s.files = `git ls-files -z`.split("\x0").reject do |f| - f.match(%r{^(test|spec|features|benchmarks)/}) + f.match(%r{^(test|spec|features|benchmark)/}) end s.bindir = 'exe' s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }