pessimize 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c84764b0002e60db1928db7244cc116ab9ca0e8
4
- data.tar.gz: 6a58830374832bc5b6e97d296bf6dc1c39261353
3
+ metadata.gz: 0fe16d5f3ed338da50ef9e974677d68d3a81ed29
4
+ data.tar.gz: 77d7c52462e561032b06ce9e2561e61e24e3f247
5
5
  SHA512:
6
- metadata.gz: 1f828ae79b8fd349cdc695c3ecb5c016a978bb1f7118f05203760722e0596ead8e6e675b3112519d0510440eee477565730e0ed8401f08b7e0f9d2404d59edcb
7
- data.tar.gz: 6d85027b5ce9166f30d0afeb301dee955151c8551dbd1f4cd2711d6d14f49bca3f16b1b7831c61d6221019cb2bdfc27b0b1e4abb9ce2dfe868f5af7a6f1ba5d0
6
+ metadata.gz: d43cd538191fb744cf15419cd975e490a03e50238cb3454862311c187e15bc056738bafea92f5469c7746da214fba5aa034939b542f99bf9ea07e8cc11e6e881
7
+ data.tar.gz: 4edc8c8f15b4c704c12696290e747deaa0e17078d6df97e1113b1d71091adbddbaa7b3a1808379896be4ad04a9eb88c9c18855157a2566c9ef60b2dc4425c172
@@ -1,7 +1,11 @@
1
1
  language: ruby
2
2
  before_install: gem install bundler
3
3
  rvm:
4
+ - 2.2.3
5
+ - 2.2.0
6
+ - 2.1.5
4
7
  - 2.0.0
5
8
  - 1.9.3
6
9
  - 1.9.2
7
10
  - jruby-1.7.10
11
+ - jruby-1.7.19
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ === Pessimize 0.4.0
2
+ * Specify version of codeclimate-test-reporter to avert a breaking change (introduced in 1.0.0)
3
+ * Fix documentation link for pessimistic operator (issue #19)
4
+ * Support comments in the Gemfile tokenization (issue #15)
5
+
1
6
  === Pessimize 0.3.0
2
7
 
3
8
  Features:
data/README.md CHANGED
@@ -86,5 +86,5 @@ The pessimistic constraint operator will only allow the final number of the vers
86
86
  5. Create new Pull Request
87
87
 
88
88
  [1]: http://gembundler.com
89
- [2]: http://docs.rubygems.org/read/chapter/16#page74
89
+ [2]: http://guides.rubygems.org/patterns/#declaring-dependencies
90
90
  [3]: https://github.com/joonty/pessimize/issues/5
@@ -42,7 +42,7 @@ module Pessimize
42
42
  end
43
43
 
44
44
  def all_gem_tokens_collected?(current_token, next_token)
45
- next_token[1] == :on_nl
45
+ [:on_nl, :on_comment].include?(next_token[1])
46
46
  end
47
47
 
48
48
  class TokenCompiler
@@ -1,3 +1,3 @@
1
1
  module Pessimize
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -18,7 +18,7 @@ This is for people who work with projects that use bundler, such as rails projec
18
18
  gem.add_dependency 'trollop'
19
19
  gem.add_development_dependency 'rspec', '~> 2.13.0'
20
20
  gem.add_development_dependency 'rake', '~> 10.0.3'
21
- gem.add_development_dependency "codeclimate-test-reporter"
21
+ gem.add_development_dependency 'codeclimate-test-reporter', '~> 0.6.0'
22
22
 
23
23
  gem.files = `git ls-files`.split($/)
24
24
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -71,6 +71,22 @@ module Pessimize
71
71
 
72
72
  end
73
73
 
74
+ context "creating a gem with a comment" do
75
+ let(:gem) { Gem.new(Ripper.lex('gem "blah" # It blahs')) }
76
+ subject { gem }
77
+
78
+ its(:name) { should == "blah" }
79
+
80
+ context "after setting the version" do
81
+ before do
82
+ gem.version = "~> 2.1"
83
+ end
84
+
85
+ its(:to_s) { should == 'gem "blah", "~> 2.1" # It blahs' }
86
+ end
87
+
88
+ end
89
+
74
90
  context "creating a gem using new lines for arguments" do
75
91
  let(:gem_string) { <<GEM.strip
76
92
  gem "blah",
@@ -186,5 +186,69 @@ GEM
186
186
  its(:to_s) { should == expected_defn }
187
187
  end
188
188
  end
189
+
190
+ context "with multiple gem definitions separated with comments" do
191
+
192
+ let(:gem_defn) { <<-GEM
193
+ source "https://rubygems.org"
194
+
195
+ gem "monkey", "2.0.0" # a comment to throw things off
196
+
197
+ gem "thor", ">= 1.3.0"
198
+ GEM
199
+ }
200
+
201
+ subject(:gemfile) { Gemfile.new(gem_defn) }
202
+
203
+ its(:to_s) { should == gem_defn }
204
+
205
+ describe "#gems" do
206
+ subject(:gems) { gemfile.gems }
207
+
208
+ its(:length) { should == 2 }
209
+
210
+ describe "the first gem" do
211
+ subject(:gem) { gems[0] }
212
+
213
+ its(:name) { should == "monkey" }
214
+ its(:version) { should == "2.0.0" }
215
+ its(:to_s) { should == ' "monkey", "2.0.0" ' }
216
+
217
+ context "setting the version" do
218
+ before do
219
+ gem.version = "~> 2.0.0"
220
+ end
221
+
222
+ its(:to_s) { should == ' "monkey", "~> 2.0.0" ' }
223
+ end
224
+ end
225
+
226
+ describe "the second gem" do
227
+ subject { gems[1] }
228
+
229
+ its(:name) { should == "thor" }
230
+ its(:version) { should == ">= 1.3.0" }
231
+ end
232
+ end
233
+
234
+ context "after setting the gem versions" do
235
+ before do
236
+ gemfile.gems.each do |gem|
237
+ gem.version = "~> 1.0.0"
238
+ end
239
+ end
240
+
241
+ let(:expected_defn) { <<-GEM
242
+ source "https://rubygems.org"
243
+
244
+ gem "monkey", "~> 1.0.0" # a comment to throw things off
245
+
246
+ gem "thor", "~> 1.0.0"
247
+ GEM
248
+ }
249
+
250
+ its(:to_s) { should == expected_defn }
251
+ end
252
+ end
189
253
  end
190
254
  end
@@ -1,4 +1,4 @@
1
- require "codeclimate-test-reporter"
1
+ require 'codeclimate-test-reporter'
2
2
  CodeClimate::TestReporter.start
3
3
  require 'rspec'
4
4
  require 'pessimize'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pessimize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Cairns
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-11 00:00:00.000000000 Z
11
+ date: 2018-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: codeclimate-test-reporter
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: 0.6.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: 0.6.0
83
83
  description: |-
84
84
  Add the pessimistic constraint operator to all gems in your Gemfile, restricting the maximum update version.
85
85
 
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  requirements: []
141
141
  rubyforge_project:
142
- rubygems_version: 2.2.2
142
+ rubygems_version: 2.5.2.1
143
143
  signing_key:
144
144
  specification_version: 4
145
145
  summary: Add the pessimistic constraint operator to all gems in your Gemfile, restricting