Hello community,
here is the log from the commit of package rubygem-power_assert for
openSUSE:Factory checked in at 2018-06-29 22:33:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-power_assert (Old)
and /work/SRC/openSUSE:Factory/.rubygem-power_assert.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-power_assert"
Fri Jun 29 22:33:56 2018 rev:14 rq:618907 version:1.1.3
Changes:
--------
---
/work/SRC/openSUSE:Factory/rubygem-power_assert/rubygem-power_assert.changes
2017-11-01 11:09:24.374281885 +0100
+++
/work/SRC/openSUSE:Factory/.rubygem-power_assert.new/rubygem-power_assert.changes
2018-06-29 22:34:03.274123958 +0200
@@ -1,0 +2,12 @@
+Mon Jun 25 08:12:16 UTC 2018 - [email protected]
+
+- updated to version 1.1.3
+ no changelog found
+
+-------------------------------------------------------------------
+Sun Jun 10 01:21:13 UTC 2018 - [email protected]
+
+- updated to version 1.1.2
+ no changelog found
+
+-------------------------------------------------------------------
Old:
----
power_assert-1.1.1.gem
New:
----
power_assert-1.1.3.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-power_assert.spec ++++++
--- /var/tmp/diff_new_pack.jIyanf/_old 2018-06-29 22:34:03.594123680 +0200
+++ /var/tmp/diff_new_pack.jIyanf/_new 2018-06-29 22:34:03.594123680 +0200
@@ -1,7 +1,7 @@
#
# spec file for package rubygem-power_assert
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -24,7 +24,7 @@
#
Name: rubygem-power_assert
-Version: 1.1.1
+Version: 1.1.3
Release: 0
%define mod_name power_assert
%define mod_full_name %{mod_name}-%{version}
@@ -37,7 +37,7 @@
Source: https://rubygems.org/gems/%{mod_full_name}.gem
Source1: gem2rpm.yml
Summary: Power Assert for Ruby
-License: BSD-2-Clause or Ruby
+License: BSD-2-Clause OR Ruby
Group: Development/Languages/Ruby
%description
++++++ power_assert-1.1.1.gem -> power_assert-1.1.3.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/.travis.yml new/.travis.yml
--- old/.travis.yml 2017-10-25 08:52:37.000000000 +0200
+++ new/.travis.yml 2018-06-24 11:57:59.000000000 +0200
@@ -3,9 +3,10 @@
rvm:
- 2.0.0-p648
- 2.1.10
- - 2.2.7
- - 2.3.4
- - 2.4.1
+ - 2.2.10
+ - 2.3.7
+ - 2.4.4
+ - 2.5.1
- ruby-head
env:
- TEST_SYMLINK="no"
@@ -14,8 +15,9 @@
allow_failures:
- rvm: ruby-head
before_install:
- - gem update bundler
+ - gem update --system
+ - gem update bundler
before_script:
- - bundle exec rake before_script
+ - bundle exec rake before_script
after_script:
- - bundle exec rake after_script
+ - bundle exec rake after_script
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/BSDL new/BSDL
--- old/BSDL 2017-10-25 08:52:37.000000000 +0200
+++ new/BSDL 2018-06-24 11:57:59.000000000 +0200
@@ -1,4 +1,4 @@
-Copyright (C) 2014-2017 Kazuki Tsujimoto, All rights reserved.
+Copyright (C) 2014 Kazuki Tsujimoto
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/COPYING new/COPYING
--- old/COPYING 2017-10-25 08:52:37.000000000 +0200
+++ new/COPYING 2018-06-24 11:57:59.000000000 +0200
@@ -1,4 +1,4 @@
-Copyright (C) 2014-2017 Kazuki Tsujimoto, All rights reserved.
+Copyright (C) 2014 Kazuki Tsujimoto
You can redistribute it and/or modify it under either the terms of the
2-clause BSDL (see the file BSDL), or the conditions below:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/README.rdoc new/README.rdoc
--- old/README.rdoc 2017-10-25 08:52:37.000000000 +0200
+++ new/README.rdoc 2018-06-24 11:57:59.000000000 +0200
@@ -5,6 +5,13 @@
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.
+ Failure:
+ assert { 3.times.to_a.include?(3) }
+ | | |
+ | | false
+ | [0, 1, 2]
+ #<Enumerator: 3:times>
+
== Related Projects
In general, you don't need to use this library directly.
Use following test frameworks or extensions instead.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Rakefile new/Rakefile
--- old/Rakefile 2017-10-25 08:52:37.000000000 +0200
+++ new/Rakefile 2018-06-24 11:57:59.000000000 +0200
@@ -8,8 +8,8 @@
t.ruby_opts = ["-w", "-r#{helper_path}"]
t.test_files = FileList["test/**/*_test.rb"].exclude do |i|
begin
- return false unless defined?(RubyVM)
- RubyVM::InstructionSequence.compile(open(i).read)
+ next false unless defined?(RubyVM)
+ RubyVM::InstructionSequence.compile(File.read(i))
false
rescue SyntaxError
true
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-10-25 08:52:37.000000000 +0200
+++ new/lib/power_assert/context.rb 2018-06-24 11:57:59.000000000 +0200
@@ -5,7 +5,7 @@
module PowerAssert
class Context
- Value = Struct.new(:name, :value, :lineno, :column)
+ Value = Struct.new(:name, :value, :lineno, :column, :display_offset)
def initialize(base_caller_length)
@fired = false
@@ -14,26 +14,30 @@
@return_values = []
trace_alias_method = PowerAssert.configuration._trace_alias_method
@trace_return = TracePoint.new(:return, :c_return) do |tp|
- 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
- next if ! method_id_set[method_id]
- next if tp.event == :c_return and
- not (@parser.lineno == tp.lineno and @parser.path == tp.path)
- locs = PowerAssert.app_caller_locations
- diff = locs.length - base_caller_length
- if (tp.event == :c_return && diff == 1 || tp.event == :return && diff
<= 2) and Thread.current == @target_thread
- idx = -(base_caller_length + 1)
- if @parser.path == locs[idx].path and @parser.lineno ==
locs[idx].lineno
- val = PowerAssert.configuration.lazy_inspection ?
- tp.return_value :
- InspectedValue.new(SafeInspectable.new(tp.return_value).inspect)
- @return_values << Value[method_id.to_s, val, locs[idx].lineno, nil]
+ begin
+ 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
+ next if ! method_id_set[method_id]
+ next if tp.event == :c_return and
+ not (@parser.lineno == tp.lineno and @parser.path == tp.path)
+ locs = PowerAssert.app_caller_locations
+ diff = locs.length - base_caller_length
+ if (tp.event == :c_return && diff == 1 || tp.event == :return &&
diff <= 2) and Thread.current == @target_thread
+ idx = -(base_caller_length + 1)
+ if @parser.path == locs[idx].path and @parser.lineno ==
locs[idx].lineno
+ val = PowerAssert.configuration.lazy_inspection ?
+ tp.return_value :
+
InspectedValue.new(SafeInspectable.new(tp.return_value).inspect)
+ @return_values << Value[method_id.to_s, val, locs[idx].lineno,
nil]
+ end
+ end
+ rescue Exception => e
+ warn "power_assert: [BUG] Failed to trace: #{e.class}: #{e.message}"
end
end
end
@@ -63,21 +67,22 @@
path = detect_path(parser, return_values)
return line unless path
+ c2d = column2display_offset(parser.line)
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
+ i.display_offset = c2d[j.column]
end
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
+ ref_values = refs_in_path.map {|i| Value[i.name,
parser.binding.eval(i.name), parser.lineno, i.column, c2d[i.column]] }
+ vals = (return_values +
ref_values).find_all(&:display_offset).sort_by(&:display_offset).reverse
return line if vals.empty?
- fmt = (0..vals[0].column).map do |i|
- if vals.find {|v| v.column == i }
+ fmt = (0..vals[0].display_offset).map do |i|
+ if vals.find {|v| v.display_offset == i }
"%<#{i}>s"
else
line[i] == "\t" ? "\t" : ' '
@@ -85,12 +90,12 @@
end.join
lines = []
lines << line.chomp
- lines << sprintf(fmt, vals.each_with_object({}) {|v, h|
h[v.column.to_s.to_sym] = '|' }).chomp
+ lines << sprintf(fmt, vals.each_with_object({}) {|v, h|
h[v.display_offset.to_s.to_sym] = '|' }).chomp
vals.each do |i|
- inspected_val = SafeInspectable.new(Formatter.new(i.value,
i.column)).inspect
+ inspected_val = SafeInspectable.new(Formatter.new(i.value,
i.display_offset)).inspect
inspected_val.each_line do |l|
map_to = vals.each_with_object({}) do |j, h|
- h[j.column.to_s.to_sym] = [l, '|', ' '][i.column <=> j.column]
+ h[j.display_offset.to_s.to_sym] = [l, '|', ' '][i.display_offset
<=> j.display_offset]
end
lines << encoding_safe_rstrip(sprintf(fmt, map_to))
end
@@ -142,6 +147,16 @@
str
end
end
+
+ def column2display_offset(str)
+ display_offset = 0
+ str.each_char.with_object([]) do |c, r|
+ c.bytesize.times do
+ r << display_offset
+ end
+ display_offset += c.ascii_only? ? 1 : 2 # FIXME
+ end
+ end
end
private_constant :Context
@@ -163,7 +178,9 @@
path = locs.last.path
lineno = locs.last.lineno
if File.exist?(path)
- line ||= open(path).each_line.drop(lineno - 1).first
+ line ||= File.open(path) {|fp| fp.each_line.drop(lineno - 1).first
}
+ end
+ if line
@parser = Parser.new(line, path, lineno, @assertion_proc.binding,
assertion_method.to_s, @assertion_proc)
end
end
@@ -194,7 +211,7 @@
path = target_frame.path
lineno = target_frame.lineno
if File.exist?(path)
- line = open(path).each_line.drop(lineno - 1).first
+ line = File.open(path) {|fp| fp.each_line.drop(lineno - 1).first }
@parser = Parser.new(line, path, lineno, binding)
else
@parser = Parser::DUMMY
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-10-25 08:52:37.000000000 +0200
+++ new/lib/power_assert/parser.rb 2018-06-24 11:57:59.000000000 +0200
@@ -8,7 +8,7 @@
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)
+ @line_for_parsing = (valid_syntax?(line) ? line :
slice_expression(line)).b
@path = path
@lineno = lineno
@binding = binding
@@ -94,11 +94,12 @@
handle_columnless_ident(extract_idents(sexp[1]), op,
extract_idents(sexp[3]))
end
when :call
- with_safe_op = sexp[2] == :"&."
- if sexp[3] == :call
- handle_columnless_ident(extract_idents(sexp[1]), :call, [],
with_safe_op)
+ _, recv, (op_sym, op_name, _), method = sexp
+ with_safe_op = ((op_sym == :@op and op_name == '&.') or op_sym ==
:"&.")
+ if method == :call
+ handle_columnless_ident(extract_idents(recv), :call, [],
with_safe_op)
else
- extract_idents(sexp[1]) + (with_safe_op ?
[Branch[extract_idents(sexp[3]), []]] : extract_idents(sexp[3]))
+ extract_idents(recv) + (with_safe_op ?
[Branch[extract_idents(method), []]] : extract_idents(method))
end
when :array
sexp[1] ? sexp[1].flat_map {|s| extract_idents(s) } : []
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-10-25 08:52:37.000000000 +0200
+++ new/lib/power_assert/version.rb 2018-06-24 11:57:59.000000000 +0200
@@ -1,3 +1,3 @@
module PowerAssert
- VERSION = "1.1.1"
+ VERSION = "1.1.3"
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-10-25 08:52:37.000000000 +0200
+++ new/lib/power_assert.rb 2018-06-24 11:57:59.000000000 +0200
@@ -1,6 +1,6 @@
# power_assert.rb
#
-# Copyright (C) 2014-2017 Kazuki Tsujimoto, All rights reserved.
+# Copyright (C) 2014 Kazuki Tsujimoto
begin
unless defined?(Byebug)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2017-10-25 08:52:37.000000000 +0200
+++ new/metadata 2018-06-24 11:57:59.000000000 +0200
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: power_assert
version: !ruby/object:Gem::Version
- version: 1.1.1
+ version: 1.1.3
platform: ruby
authors:
- Kazuki Tsujimoto
autorequire:
bindir: exe
cert_chain: []
-date: 2017-10-25 00:00:00.000000000 Z
+date: 2018-06-24 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: test-unit
@@ -94,6 +94,20 @@
- - ">="
- !ruby/object:Gem::Version
version: '0'
+- !ruby/object:Gem::Dependency
+ name: benchmark-ips
+ requirement: !ruby/object:Gem::Requirement
+ requirements:
+ - - ">="
+ - !ruby/object:Gem::Version
+ version: '0'
+ type: :development
+ prerelease: false
+ version_requirements: !ruby/object:Gem::Requirement
+ requirements:
+ - - ">="
+ - !ruby/object:Gem::Version
+ version: '0'
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.
@@ -146,7 +160,7 @@
version: '0'
requirements: []
rubyforge_project:
-rubygems_version: 2.6.11
+rubygems_version: 2.7.6
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-10-25 08:52:37.000000000 +0200
+++ new/power_assert.gemspec 2018-06-24 11:57:59.000000000 +0200
@@ -24,6 +24,7 @@
s.add_development_dependency 'bundler'
s.add_development_dependency 'pry'
s.add_development_dependency 'byebug'
+ s.add_development_dependency 'benchmark-ips'
s.extra_rdoc_files = ['README.rdoc']
s.rdoc_options = ['--main', 'README.rdoc']
s.licenses = ['2-clause BSDL', "Ruby's"]