Hello community,
here is the log from the commit of package rubygem-rspec-support for
openSUSE:Factory checked in at 2017-05-27 13:11:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-rspec-support (Old)
and /work/SRC/openSUSE:Factory/.rubygem-rspec-support.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-rspec-support"
Sat May 27 13:11:43 2017 rev:6 rq:497703 version:3.6.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/rubygem-rspec-support/rubygem-rspec-support.changes
2016-07-16 22:11:09.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.rubygem-rspec-support.new/rubygem-rspec-support.changes
2017-05-27 13:11:50.050904099 +0200
@@ -1,0 +2,25 @@
+Tue May 23 10:18:18 UTC 2017 - [email protected]
+
+- updated to version 3.6.0
+ see installed Changelog.md
+
+ ### 3.6.0 / 2017-05-04
+ [Full
Changelog](http://github.com/rspec/rspec-support/compare/v3.6.0.beta2...3.6.0)
+
+ Enhancements:
+
+ * Import `Source` classes from rspec-core. (Yuji Nakayama, #315)
+
+ ### 3.6.0.beta2 / 2016-12-12
+ [Full
Changelog](http://github.com/rspec/rspec-support/compare/v3.6.0.beta1...v3.6.0.beta2)
+
+ No user-facing changes.
+
+ ### 3.6.0.beta1 / 2016-10-09
+ [Full
Changelog](http://github.com/rspec/rspec-support/compare/v3.5.0...v3.6.0.beta1)
+
+ Bug Fixes:
+
+ * Prevent truncated formatted object output from mangling console codes.
(#294, Anson Kelly)
+
+-------------------------------------------------------------------
Old:
----
rspec-support-3.5.0.gem
New:
----
rspec-support-3.6.0.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-rspec-support.spec ++++++
--- /var/tmp/diff_new_pack.gTfRY7/_old 2017-05-27 13:11:50.494841335 +0200
+++ /var/tmp/diff_new_pack.gTfRY7/_new 2017-05-27 13:11:50.498840769 +0200
@@ -1,7 +1,7 @@
#
# spec file for package rubygem-rspec-support
#
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 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-rspec-support
-Version: 3.5.0
+Version: 3.6.0
Release: 0
%define mod_name rspec-support
%define mod_full_name %{mod_name}-%{version}
++++++ rspec-support-3.5.0.gem -> rspec-support-3.6.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Changelog.md new/Changelog.md
--- old/Changelog.md 2016-07-01 17:48:07.000000000 +0200
+++ new/Changelog.md 2017-05-05 01:59:55.000000000 +0200
@@ -1,7 +1,26 @@
+### 3.6.0 / 2017-05-04
+[Full
Changelog](http://github.com/rspec/rspec-support/compare/v3.6.0.beta2...3.6.0)
+
+Enhancements:
+
+* Import `Source` classes from rspec-core. (Yuji Nakayama, #315)
+
+### 3.6.0.beta2 / 2016-12-12
+[Full
Changelog](http://github.com/rspec/rspec-support/compare/v3.6.0.beta1...v3.6.0.beta2)
+
+No user-facing changes.
+
+### 3.6.0.beta1 / 2016-10-09
+[Full
Changelog](http://github.com/rspec/rspec-support/compare/v3.5.0...v3.6.0.beta1)
+
+Bug Fixes:
+
+* Prevent truncated formatted object output from mangling console codes.
(#294, Anson Kelly)
+
### 3.5.0 / 2016-07-01
[Full
Changelog](http://github.com/rspec/rspec-support/compare/v3.5.0.beta4...v3.5.0)
-**No user facing changes since beat4**
+**No user facing changes since beta4**
### 3.5.0.beta4 / 2016-06-05
[Full
Changelog](http://github.com/rspec/rspec-support/compare/v3.5.0.beta3...v3.5.0.beta4)
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
Binary files old/checksums.yaml.gz.sig and new/checksums.yaml.gz.sig differ
Binary files old/data.tar.gz.sig and new/data.tar.gz.sig differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/support/object_formatter.rb
new/lib/rspec/support/object_formatter.rb
--- old/lib/rspec/support/object_formatter.rb 2016-07-01 17:48:07.000000000
+0200
+++ new/lib/rspec/support/object_formatter.rb 2017-05-05 01:59:55.000000000
+0200
@@ -37,8 +37,8 @@
if formatted_object.length < max_formatted_output_length
return formatted_object
else
- beginning = formatted_object[0 .. max_formatted_output_length / 2]
- ending = formatted_object[-max_formatted_output_length / 2 ..-1]
+ beginning = truncate_string formatted_object, 0,
max_formatted_output_length / 2
+ ending = truncate_string formatted_object,
-max_formatted_output_length / 2, -1
return beginning + ELLIPSIS + ending
end
end
@@ -243,7 +243,26 @@
DescribableMatcherInspector,
DelegatorInspector,
InspectableObjectInspector
- ]
+ ].tap do |classes|
+ # 2.4 has improved BigDecimal formatting so we do not need
+ # to provide our own.
+ # https://github.com/ruby/bigdecimal/pull/42
+ classes.delete(BigDecimalInspector) if RUBY_VERSION >= '2.4'
+ end
+
+ private
+
+ # Returns the substring defined by the start_index and end_index
+ # If the string ends with a partial ANSI code code then that
+ # will be removed as printing partial ANSI
+ # codes to the terminal can lead to corruption
+ def truncate_string(str, start_index, end_index)
+ cut_str = str[start_index..end_index]
+
+ # ANSI color codes are like: \e[33m so anything with \e[ and a
+ # number without a 'm' is an incomplete color code
+ cut_str.sub(/\e\[\d+$/, '')
+ end
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/support/ruby_features.rb
new/lib/rspec/support/ruby_features.rb
--- old/lib/rspec/support/ruby_features.rb 2016-07-01 17:48:07.000000000
+0200
+++ new/lib/rspec/support/ruby_features.rb 2017-05-05 01:59:55.000000000
+0200
@@ -28,6 +28,14 @@
RUBY_PLATFORM == 'java'
end
+ def jruby_version
+ @jruby_version ||= ComparableVersion.new(JRUBY_VERSION)
+ end
+
+ def jruby_9000?
+ jruby? && JRUBY_VERSION >= '9.0.0.0'
+ end
+
def rbx?
defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
end
@@ -71,9 +79,10 @@
ripper_requirements.push(false) if Ruby.rbx?
if Ruby.jruby?
- ripper_requirements.push(ComparableVersion.new(JRUBY_VERSION) >=
'1.7.5')
- # Ripper on JRuby 9.0.0.0.rc1 or later reports wrong line number.
- ripper_requirements.push(ComparableVersion.new(JRUBY_VERSION) <
'9.0.0.0.rc1')
+ ripper_requirements.push(Ruby.jruby_version >= '1.7.5')
+ # Ripper on JRuby 9.0.0.0.rc1 or later reports wrong line number
+ # or cannot parse source including `:if`.
+ ripper_requirements.push(Ruby.jruby_version < '9.0.0.0.rc1')
end
if ripper_requirements.all?
@@ -141,6 +150,10 @@
# rubocop:enable Lint/Eval
end
+ def module_refinement_supported?
+ Module.method_defined?(:refine) ||
Module.private_method_defined?(:refine)
+ end
+
def module_prepends_supported?
Module.method_defined?(:prepend) ||
Module.private_method_defined?(:prepend)
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/support/source/location.rb
new/lib/rspec/support/source/location.rb
--- old/lib/rspec/support/source/location.rb 1970-01-01 01:00:00.000000000
+0100
+++ new/lib/rspec/support/source/location.rb 2017-05-05 01:59:55.000000000
+0200
@@ -0,0 +1,21 @@
+module RSpec
+ module Support
+ class Source
+ # @private
+ # Represents a source location of node or token.
+ Location = Struct.new(:line, :column) do
+ include Comparable
+
+ def self.location?(array)
+ array.is_a?(Array) && array.size == 2 && array.all? { |e|
e.is_a?(Integer) }
+ end
+
+ def <=>(other)
+ line_comparison = (line <=> other.line)
+ return line_comparison unless line_comparison == 0
+ column <=> other.column
+ end
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/support/source/node.rb
new/lib/rspec/support/source/node.rb
--- old/lib/rspec/support/source/node.rb 1970-01-01 01:00:00.000000000
+0100
+++ new/lib/rspec/support/source/node.rb 2017-05-05 01:59:55.000000000
+0200
@@ -0,0 +1,107 @@
+RSpec::Support.require_rspec_support 'source/location'
+
+module RSpec
+ module Support
+ class Source
+ # @private
+ # A wrapper for Ripper AST node which is generated with `Ripper.sexp`.
+ class Node
+ include Enumerable
+
+ attr_reader :sexp, :parent
+
+ def self.sexp?(array)
+ array.is_a?(Array) && array.first.is_a?(Symbol)
+ end
+
+ def initialize(ripper_sexp, parent=nil)
+ @sexp = ripper_sexp.freeze
+ @parent = parent
+ end
+
+ def type
+ sexp[0]
+ end
+
+ def args
+ @args ||= raw_args.map do |raw_arg|
+ if Node.sexp?(raw_arg)
+ Node.new(raw_arg, self)
+ elsif Location.location?(raw_arg)
+ Location.new(*raw_arg)
+ elsif raw_arg.is_a?(Array)
+ ExpressionSequenceNode.new(raw_arg, self)
+ else
+ raw_arg
+ end
+ end.freeze
+ end
+
+ def children
+ @children ||= args.select { |arg| arg.is_a?(Node) }.freeze
+ end
+
+ def location
+ @location ||= args.find { |arg| arg.is_a?(Location) }
+ end
+
+ def each(&block)
+ return to_enum(__method__) unless block_given?
+
+ yield self
+
+ children.each do |child|
+ child.each(&block)
+ end
+ end
+
+ def each_ancestor
+ return to_enum(__method__) unless block_given?
+
+ current_node = self
+
+ while (current_node = current_node.parent)
+ yield current_node
+ end
+ end
+
+ def inspect
+ "#<#{self.class} #{type}>"
+ end
+
+ private
+
+ def raw_args
+ sexp[1..-1] || []
+ end
+ end
+
+ # @private
+ # Basically `Ripper.sexp` generates arrays whose first element is a
symbol (type of sexp),
+ # but it exceptionally generates typeless arrays for expression sequence:
+ #
+ # Ripper.sexp('foo; bar')
+ # => [
+ # :program,
+ # [ # Typeless array
+ # [:vcall, [:@ident, "foo", [1, 0]]],
+ # [:vcall, [:@ident, "bar", [1, 5]]]
+ # ]
+ # ]
+ #
+ # We wrap typeless arrays in this pseudo type node
+ # so that it can be handled in the same way as other type node.
+ class ExpressionSequenceNode < Node
+ def type
+ :_expression_sequence
+ end
+
+ private
+
+ def raw_args
+ sexp
+ end
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/support/source/token.rb
new/lib/rspec/support/source/token.rb
--- old/lib/rspec/support/source/token.rb 1970-01-01 01:00:00.000000000
+0100
+++ new/lib/rspec/support/source/token.rb 2017-05-05 01:59:55.000000000
+0200
@@ -0,0 +1,87 @@
+RSpec::Support.require_rspec_support 'source/location'
+
+module RSpec
+ module Support
+ class Source
+ # @private
+ # A wrapper for Ripper token which is generated with `Ripper.lex`.
+ class Token
+ CLOSING_TYPES_BY_OPENING_TYPE = {
+ :on_lbracket => :on_rbracket,
+ :on_lparen => :on_rparen,
+ :on_lbrace => :on_rbrace,
+ :on_heredoc_beg => :on_heredoc_end
+ }.freeze
+
+ CLOSING_KEYWORDS_BY_OPENING_KEYWORD = {
+ 'def' => 'end',
+ 'do' => 'end',
+ }.freeze
+
+ attr_reader :token
+
+ def self.tokens_from_ripper_tokens(ripper_tokens)
+ ripper_tokens.map { |ripper_token| new(ripper_token) }.freeze
+ end
+
+ def initialize(ripper_token)
+ @token = ripper_token.freeze
+ end
+
+ def location
+ @location ||= Location.new(*token[0])
+ end
+
+ def type
+ token[1]
+ end
+
+ def string
+ token[2]
+ end
+
+ def ==(other)
+ token == other.token
+ end
+
+ alias_method :eql?, :==
+
+ def inspect
+ "#<#{self.class} #{type} #{string.inspect}>"
+ end
+
+ def keyword?
+ type == :on_kw
+ end
+
+ def opening?
+ opening_delimiter? || opening_keyword?
+ end
+
+ def closed_by?(other)
+ closed_by_delimiter?(other) || closed_by_keyword?(other)
+ end
+
+ private
+
+ def opening_delimiter?
+ CLOSING_TYPES_BY_OPENING_TYPE.key?(type)
+ end
+
+ def opening_keyword?
+ return false unless keyword?
+ CLOSING_KEYWORDS_BY_OPENING_KEYWORD.key?(string)
+ end
+
+ def closed_by_delimiter?(other)
+ other.type == CLOSING_TYPES_BY_OPENING_TYPE[type]
+ end
+
+ def closed_by_keyword?(other)
+ return false unless other.keyword?
+ other.string == CLOSING_KEYWORDS_BY_OPENING_KEYWORD[string]
+ end
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/support/source.rb
new/lib/rspec/support/source.rb
--- old/lib/rspec/support/source.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/lib/rspec/support/source.rb 2017-05-05 01:59:55.000000000 +0200
@@ -0,0 +1,75 @@
+RSpec::Support.require_rspec_support 'encoded_string'
+RSpec::Support.require_rspec_support 'ruby_features'
+
+module RSpec
+ module Support
+ # @private
+ # Represents a Ruby source file and provides access to AST and tokens.
+ class Source
+ attr_reader :source, :path
+
+ def self.from_file(path)
+ source = File.read(path)
+ new(source, path)
+ end
+
+ if String.method_defined?(:encoding)
+ def initialize(source_string, path=nil)
+ @source = RSpec::Support::EncodedString.new(source_string,
Encoding.default_external)
+ @path = path ? File.expand_path(path) : '(string)'
+ end
+ else # for 1.8.7
+ # :nocov:
+ def initialize(source_string, path=nil)
+ @source = RSpec::Support::EncodedString.new(source_string)
+ @path = path ? File.expand_path(path) : '(string)'
+ end
+ # :nocov:
+ end
+
+ def lines
+ @lines ||= source.split("\n")
+ end
+
+ def inspect
+ "#<#{self.class} #{path}>"
+ end
+
+ if RSpec::Support::RubyFeatures.ripper_supported?
+ RSpec::Support.require_rspec_support 'source/node'
+ RSpec::Support.require_rspec_support 'source/token'
+
+ def ast
+ @ast ||= begin
+ require 'ripper'
+ sexp = Ripper.sexp(source)
+ raise SyntaxError unless sexp
+ Node.new(sexp)
+ end
+ end
+
+ def tokens
+ @tokens ||= begin
+ require 'ripper'
+ tokens = Ripper.lex(source)
+ Token.tokens_from_ripper_tokens(tokens)
+ end
+ end
+
+ def nodes_by_line_number
+ @nodes_by_line_number ||= begin
+ nodes_by_line_number = ast.select(&:location).group_by { |node|
node.location.line }
+ Hash.new { |hash, key| hash[key] = [] }.merge(nodes_by_line_number)
+ end
+ end
+
+ def tokens_by_line_number
+ @tokens_by_line_number ||= begin
+ nodes_by_line_number = tokens.group_by { |token|
token.location.line }
+ Hash.new { |hash, key| hash[key] = [] }.merge(nodes_by_line_number)
+ end
+ end
+ end
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/support/spec/in_sub_process.rb
new/lib/rspec/support/spec/in_sub_process.rb
--- old/lib/rspec/support/spec/in_sub_process.rb 2016-07-01
17:48:07.000000000 +0200
+++ new/lib/rspec/support/spec/in_sub_process.rb 2017-05-05
01:59:55.000000000 +0200
@@ -3,40 +3,57 @@
module InSubProcess
if Process.respond_to?(:fork) && !(Ruby.jruby? && RUBY_VERSION ==
'1.8.7')
+ UnmarshableObject = Struct.new(:error)
+
# Useful as a way to isolate a global change to a subprocess.
# rubocop:disable MethodLength
def in_sub_process(prevent_warnings=true)
- readme, writeme = IO.pipe
+ exception_reader, exception_writer = IO.pipe
+ result_reader, result_writer = IO.pipe
pid = Process.fork do
- exception = nil
warning_preventer = $stderr =
RSpec::Support::StdErrSplitter.new($stderr)
begin
- yield
+ result = yield
warning_preventer.verify_no_warnings! if prevent_warnings
- rescue Support::AllExceptionsExceptOnesWeMustNotRescue => e
- exception = e
+ # rubocop:disable Lint/HandleExceptions
+ rescue Support::AllExceptionsExceptOnesWeMustNotRescue => exception
+ # rubocop:enable Lint/HandleExceptions
end
- writeme.write Marshal.dump(exception)
+ exception_writer.write
marshal_dump_with_unmarshable_object_handling(exception)
+ exception_reader.close
+ exception_writer.close
+
+ result_writer.write
marshal_dump_with_unmarshable_object_handling(result)
+ result_reader.close
+ result_writer.close
- readme.close
- writeme.close
exit! # prevent at_exit hooks from running (e.g. minitest)
end
- writeme.close
+ exception_writer.close
+ result_writer.close
Process.waitpid(pid)
- exception = Marshal.load(readme.read)
- readme.close
-
+ exception = Marshal.load(exception_reader.read)
+ exception_reader.close
raise exception if exception
+
+ result = Marshal.load(result_reader.read)
+ result_reader.close
+ result
end
# rubocop:enable MethodLength
alias :in_sub_process_if_possible :in_sub_process
+
+ def marshal_dump_with_unmarshable_object_handling(object)
+ Marshal.dump(object)
+ rescue TypeError => error
+ Marshal.dump(UnmarshableObject.new(error))
+ end
else
def in_sub_process(*)
skip "This spec requires forking to work properly, " \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/support/spec/shell_out.rb
new/lib/rspec/support/spec/shell_out.rb
--- old/lib/rspec/support/spec/shell_out.rb 2016-07-01 17:48:07.000000000
+0200
+++ new/lib/rspec/support/spec/shell_out.rb 2017-05-05 01:59:55.000000000
+0200
@@ -60,7 +60,9 @@
# Ignore bundler + rubygems warning.
l =~ %r{site_ruby/\d\.\d\.\d/rubygems} ||
# This is required for windows for some reason
- l =~ %r{lib/bundler/rubygems}
+ l =~ %r{lib/bundler/rubygems} ||
+ # This is a JRuby file that generates warnings on 9.0.3.0
+ l =~ %r{lib/ruby/stdlib/jar}
end.join("\n")
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/rspec/support/version.rb
new/lib/rspec/support/version.rb
--- old/lib/rspec/support/version.rb 2016-07-01 17:48:07.000000000 +0200
+++ new/lib/rspec/support/version.rb 2017-05-05 01:59:55.000000000 +0200
@@ -1,7 +1,7 @@
module RSpec
module Support
module Version
- STRING = '3.5.0'
+ STRING = '3.6.0'
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2016-07-01 17:48:07.000000000 +0200
+++ new/metadata 2017-05-05 01:59:55.000000000 +0200
@@ -1,7 +1,7 @@
--- !ruby/object:Gem::Specification
name: rspec-support
version: !ruby/object:Gem::Version
- version: 3.5.0
+ version: 3.6.0
platform: ruby
authors:
- David Chelimsky
@@ -48,7 +48,7 @@
ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
F3MdtaDehhjC
-----END CERTIFICATE-----
-date: 2016-07-01 00:00:00.000000000 Z
+date: 2017-05-04 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: bundler
@@ -116,6 +116,10 @@
- lib/rspec/support/recursive_const_methods.rb
- lib/rspec/support/reentrant_mutex.rb
- lib/rspec/support/ruby_features.rb
+- lib/rspec/support/source.rb
+- lib/rspec/support/source/location.rb
+- lib/rspec/support/source/node.rb
+- lib/rspec/support/source/token.rb
- lib/rspec/support/spec.rb
- lib/rspec/support/spec/deprecation_helpers.rb
- lib/rspec/support/spec/formatting_support.rb
@@ -149,8 +153,8 @@
version: '0'
requirements: []
rubyforge_project:
-rubygems_version: 2.5.1
+rubygems_version: 2.4.5.2
signing_key:
specification_version: 4
-summary: rspec-support-3.5.0
+summary: rspec-support-3.6.0
test_files: []
Binary files old/metadata.gz.sig and new/metadata.gz.sig differ