transpec 3.2.2 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 58cd705324fe09e4e69f7c931b8a90a27c49aea0
4
- data.tar.gz: 586b58141d745f603892162073cf555fe2fb505b
3
+ metadata.gz: 776c4008f4f9b8774ba45005e5a01ff5ea623355
4
+ data.tar.gz: 590eb411838be93f6073e91e1ac62db2a2cd5169
5
5
  SHA512:
6
- metadata.gz: 47f097ebd2bcd013d61e4a75562b713594b4b10d937508c59fc73f34b907a3ee837389d7ce75f9a4dc9d6c97b6cd101d971a77c2a2a3260948941c172fa88e40
7
- data.tar.gz: f4afeaee5e87ef876c78d0afc95d8362977e1d0e5903b5f09d459463084dde87995036e5741ef313528420f7a23704a0f380844dec2fc5bafe2cae492f3f4f68
6
+ metadata.gz: ba23453c7453fda5bd427dc4ba09c56a98dc9da01c08627e2f31e7b9f1b6ab1f6c659559e5ef2237dc83cca0a491e2400b7141d5ebe67c8bcad385be859a5423
7
+ data.tar.gz: 8196d68cc2beaa8a10bdf6b99dfad2d11671bb97f654474f46e9ba5672b41a4ffa90da3cc75201d084e0c0d3487f9353eed5821110687f66d17bf13961444fac
@@ -83,3 +83,9 @@ GuardClause:
83
83
 
84
84
  ModuleLength:
85
85
  Enabled: false
86
+
87
+ Security/JSONLoad:
88
+ Enabled: false
89
+
90
+ Security/MarshalLoad:
91
+ Enabled: false
@@ -2,22 +2,25 @@ language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
- - 2.1
6
- - 2.2
7
- - 2.3.0
5
+ - 2.1.10
6
+ - 2.2.6
7
+ - 2.3.3
8
+ - 2.4.0
8
9
  - ruby-head
9
10
  - jruby-19mode
10
- - jruby-9.0.0.0
11
+ - jruby-9.1.7.0
11
12
  env:
12
13
  - RSPEC_VERSION=2.14
13
14
  - RSPEC_VERSION=2.99
14
15
  - RSPEC_VERSION=3.0
15
- - RSPEC_VERSION=3.4
16
- - RSPEC_VERSION=head
16
+ - RSPEC_VERSION=3.5
17
+ - RSPEC_VERSION=master
17
18
  matrix:
18
19
  allow_failures:
19
20
  - rvm: ruby-head
20
- before_install: gem update --remote bundler
21
+ before_install:
22
+ - gem update --system # https://github.com/sickill/rainbow/issues/49
23
+ - gem update --remote bundler
21
24
  script: bundle exec rake ci
22
25
  sudo: false
23
26
  cache: bundler
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Development
4
4
 
5
+ ## v3.3.0
6
+
7
+ * Support `json` gem 2.x and `activesupport` gem 5.x.
8
+
5
9
  ## v3.2.2
6
10
 
7
11
  * Use `parser` gem 2.3.0.7 or later.
data/Gemfile CHANGED
@@ -3,22 +3,22 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  group :development, :test do
6
- version = ENV['RSPEC_VERSION'] || '2.14'
6
+ rspec_version = ENV['RSPEC_VERSION'] || '2.14'
7
7
 
8
- case version
9
- when 'head'
10
- %w(rspec rspec-core rspec-expectations rspec-mocks rspec-support).each do |lib|
11
- gem lib, git: "git://github.com/rspec/#{lib}.git"
12
- end
8
+ case rspec_version
13
9
  when /^\d+\.\d+$/
14
- gem 'rspec', "~> #{version}.0"
10
+ gem 'rspec', "~> #{rspec_version}.0"
15
11
  else
16
- fail 'RSPEC_VERSION must be specified as "major.minor" like "2.14", or "head".'
12
+ %w(rspec rspec-core rspec-expectations rspec-mocks rspec-support).each do |lib|
13
+ gem lib, git: "https://github.com/rspec/#{lib}.git", branch: rspec_version
14
+ end
17
15
  end
18
16
 
17
+ # We cannot update rake to 12.x since it breaks compatibility with RSpec 2.x.
18
+ # https://github.com/rspec/rspec-core/pull/2197
19
19
  gem 'rake', '~> 11.0'
20
20
  gem 'simplecov', '~> 0.7'
21
- gem 'rubocop', '~> 0.24'
21
+ gem 'rubocop', '~> 0.39'
22
22
  end
23
23
 
24
24
  group :development do
data/README.md CHANGED
@@ -1454,15 +1454,16 @@ Transpec is tested on the following Ruby implementations:
1454
1454
  * MRI
1455
1455
  * 1.9.3
1456
1456
  * 2.0.0
1457
- * 2.1
1458
- * 2.2
1459
- * 2.3
1457
+ * 2.1.10
1458
+ * 2.2.6
1459
+ * 2.3.3
1460
+ * 2.4.0
1460
1461
  * JRuby
1461
- * 1.7 in 1.9 mode
1462
- * 9.0.0.0
1462
+ * 1.9 mode
1463
+ * 9.1.7.0
1463
1464
 
1464
1465
  ## License
1465
1466
 
1466
- Copyright (c) 2013–2016 Yuji Nakayama
1467
+ Copyright (c) 2013–2017 Yuji Nakayama
1467
1468
 
1468
1469
  See the [LICENSE.txt](LICENSE.txt) for details.
@@ -1473,14 +1473,17 @@ Will be converted to:
1473
1473
  Transpec is tested on the following Ruby implementations:
1474
1474
 
1475
1475
  * MRI
1476
- * 1.9.3
1477
- * 2.0.0
1478
- * 2.1
1479
- * 2.2
1480
- * 2.3
1476
+ <%= travis_config['rvm'].grep(/\A\d/).map { |version| " * #{version}" }.join("\n") %>
1481
1477
  * JRuby
1482
- * 1.7 in 1.9 mode
1483
- * 9.0.0.0
1478
+ <%=
1479
+ travis_config['rvm'].grep(/\Ajruby-/).map do |name|
1480
+ version = name.sub('jruby-', '')
1481
+ if /\A(?<major>\d)(?<minor>\d)mode\z/ =~ version
1482
+ version = "#{major}.#{minor} mode"
1483
+ end
1484
+ " * #{version}"
1485
+ end.join("\n")
1486
+ %>
1484
1487
 
1485
1488
  ## License
1486
1489
 
@@ -97,7 +97,7 @@ module Transpec
97
97
  literal = '{ '
98
98
 
99
99
  hash.each_with_index do |(key, value), index|
100
- literal << ', ' unless index == 0
100
+ literal << ', ' unless index.zero?
101
101
  literal << "#{key.inspect} => #{value.inspect}"
102
102
  end
103
103
 
@@ -13,8 +13,7 @@ module Transpec
13
13
  attr_reader :data
14
14
 
15
15
  def self.load(string_or_io)
16
- options = { object_class: CompatibleOpenStruct, symbolize_names: true }
17
- data = JSON.load(string_or_io, nil, options)
16
+ data = JSON.load(string_or_io, nil, object_class: CompatibleOpenStruct)
18
17
  new(data)
19
18
  end
20
19
 
@@ -70,7 +70,7 @@ module Transpec
70
70
  def <=>(other)
71
71
  COMPARISON_ATTRIBUTES.each do |attribute|
72
72
  result = send(attribute) <=> other.send(attribute)
73
- return result unless result == 0
73
+ return result unless result.zero?
74
74
  end
75
75
  0
76
76
  end
@@ -125,7 +125,7 @@ module Transpec
125
125
  def pluralize(number, thing, options = {})
126
126
  text = ''
127
127
 
128
- if number == 0 && options[:no_for_zero]
128
+ if number.zero? && options[:no_for_zero]
129
129
  text = 'no'
130
130
  else
131
131
  text << number.to_s
@@ -26,7 +26,7 @@ module Transpec
26
26
  super &&
27
27
  receiver_node.nil? &&
28
28
  [:have, :have_exactly, :have_at_least, :have_at_most].include?(method_name) &&
29
- node.sibling_index == 0
29
+ node.sibling_index.zero?
30
30
  end
31
31
 
32
32
  def conversion_target?
@@ -43,7 +43,7 @@ module Transpec
43
43
  explicit_subject? ? 'self' : 'subject'
44
44
  end
45
45
 
46
- def collection_accessor_inspection_code # rubocop:disable MethodLength
46
+ def collection_accessor_inspection_code
47
47
  # `expect(owner).to have(n).things` invokes private owner#things with Object#__send__
48
48
  # if the owner does not respond to any of #size, #count and #length.
49
49
  #
@@ -4,8 +4,8 @@ module Transpec
4
4
  # http://semver.org/
5
5
  module Version
6
6
  MAJOR = 3
7
- MINOR = 2
8
- PATCH = 2
7
+ MINOR = 3
8
+ PATCH = 0
9
9
 
10
10
  def self.to_s
11
11
  [MAJOR, MINOR, PATCH].join('.')
@@ -3,6 +3,7 @@
3
3
  tasks = %w(spec)
4
4
 
5
5
  if RSpec::Core::Version::STRING.start_with?('2.14') && RUBY_ENGINE != 'jruby'
6
+ tasks << 'style' if RUBY_VERSION >= '2.0.0'
6
7
  tasks.concat(%w(readme:check test:all))
7
8
  end
8
9
 
@@ -187,4 +187,11 @@ class READMEContext
187
187
  replacement << match
188
188
  end
189
189
  end
190
+
191
+ def travis_config
192
+ @travis_config ||= begin
193
+ require 'yaml'
194
+ YAML.parse_file('.travis.yml').to_ruby
195
+ end
196
+ end
190
197
  end
@@ -27,6 +27,6 @@ Gem::Specification.new do |spec|
27
27
  spec.add_runtime_dependency 'astrolabe', '~> 1.2'
28
28
  spec.add_runtime_dependency 'bundler', '~> 1.3'
29
29
  spec.add_runtime_dependency 'rainbow', '>= 1.99.1', '< 3.0'
30
- spec.add_runtime_dependency 'json', '~> 1.8'
31
- spec.add_runtime_dependency 'activesupport', '>= 3.0', '< 5.0'
30
+ spec.add_runtime_dependency 'json', '>= 1.8', '< 3.0'
31
+ spec.add_runtime_dependency 'activesupport', '>= 3.0', '< 6.0'
32
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: transpec
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.2
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuji Nakayama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-25 00:00:00.000000000 Z
11
+ date: 2017-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parser
@@ -76,16 +76,22 @@ dependencies:
76
76
  name: json
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - "~>"
79
+ - - ">="
80
80
  - !ruby/object:Gem::Version
81
81
  version: '1.8'
82
+ - - "<"
83
+ - !ruby/object:Gem::Version
84
+ version: '3.0'
82
85
  type: :runtime
83
86
  prerelease: false
84
87
  version_requirements: !ruby/object:Gem::Requirement
85
88
  requirements:
86
- - - "~>"
89
+ - - ">="
87
90
  - !ruby/object:Gem::Version
88
91
  version: '1.8'
92
+ - - "<"
93
+ - !ruby/object:Gem::Version
94
+ version: '3.0'
89
95
  - !ruby/object:Gem::Dependency
90
96
  name: activesupport
91
97
  requirement: !ruby/object:Gem::Requirement
@@ -95,7 +101,7 @@ dependencies:
95
101
  version: '3.0'
96
102
  - - "<"
97
103
  - !ruby/object:Gem::Version
98
- version: '5.0'
104
+ version: '6.0'
99
105
  type: :runtime
100
106
  prerelease: false
101
107
  version_requirements: !ruby/object:Gem::Requirement
@@ -105,7 +111,7 @@ dependencies:
105
111
  version: '3.0'
106
112
  - - "<"
107
113
  - !ruby/object:Gem::Version
108
- version: '5.0'
114
+ version: '6.0'
109
115
  description: Transpec converts your specs to the latest RSpec syntax with static and
110
116
  dynamic code analysis.
111
117
  email:
@@ -237,7 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
243
  version: '0'
238
244
  requirements: []
239
245
  rubyforge_project:
240
- rubygems_version: 2.5.1
246
+ rubygems_version: 2.6.8
241
247
  signing_key:
242
248
  specification_version: 4
243
249
  summary: The RSpec syntax converter