synvert-core 0.63.0 → 0.63.1

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
  SHA256:
3
- metadata.gz: a008b0eb8cb6152ae896c550c0b5317f7c9679f9b23f4203c270e34b04f6f76a
4
- data.tar.gz: 38ac175aabd6f7b8f598408bcc0615905bc9ee237070d514da3bc2aee30b96be
3
+ metadata.gz: 5739f84132a6ece2551028571b7e6cb458812524f51ea11de6175eb621592d21
4
+ data.tar.gz: a55b00a9431cacbe740405294b351cd8c5a1face1f2c20ba3a61897316dc7bd4
5
5
  SHA512:
6
- metadata.gz: e4d2c687d3f1f77ef46347718eec9753d920de3cefe410add119197814a24b8cd246c9442dd5ab09e163b719b9cd326088974d2c3519aa78a14a0fef38986457
7
- data.tar.gz: 75dd1ce3fa81439af5667eedf08b5b071394e6f025d3f31887527393c8cfd9057d8d58e9b3306cb8b3150898b065c85c1094f015308b6091844f12f9b0aa4464
6
+ metadata.gz: ba153f740ea4d281dde99359dcf864beb49bdac33db3833878eebb9ba020966bb8957426936e65f7fc00ce84b76f7bb79fe2c01a5984ea155c5a4f6845c6e5b7
7
+ data.tar.gz: 6ff6c82355e35e6f86a42f01bcbd57b4e25d6c0ccef0079b89d4980bca26a983bf187526f9f5af150ee7a970d906b3cb22dd69b1af9f84263d3d8231d4673df7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.63.1 (2022-02-26)
4
+
5
+ * Read absolute path of Gemfile.lock
6
+
3
7
  ## 0.63.0 (2022-02-26)
4
8
 
5
9
  * Add `to` option to `InsertAction`
@@ -19,7 +19,7 @@ module Synvert::Core
19
19
  # @return [Boolean] true if matches, otherwise false.
20
20
  # @raise [Synvert::Core::GemfileLockNotFound] raise if Gemfile.lock does not exist.
21
21
  def match?
22
- gemfile_lock_path = File.join(Configuration.path, 'Gemfile.lock')
22
+ gemfile_lock_path = File.expand_path(File.join(Configuration.path, 'Gemfile.lock'))
23
23
 
24
24
  # if Gemfile.lock does not exist, just ignore this check
25
25
  return true unless File.exist?(gemfile_lock_path)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Synvert
4
4
  module Core
5
- VERSION = '0.63.0'
5
+ VERSION = '0.63.1'
6
6
  end
7
7
  end
@@ -15,38 +15,39 @@ module Synvert::Core
15
15
  rake (10.1.1)
16
16
  slop (3.4.7)
17
17
  EOS
18
+ let(:lock_path) { File.absolute_path('./Gemfile.lock') }
18
19
  before { allow(File).to receive(:exist?).with(File.join(ENV['HOME'], '.gem/specs')).and_return(false) }
19
20
 
20
21
  it 'returns true if version in Gemfile.lock is greater than definition' do
21
- expect(File).to receive(:exist?).with('./Gemfile.lock').and_return(true)
22
- expect(File).to receive(:read).with('./Gemfile.lock').and_return(gemfile_lock_content)
22
+ expect(File).to receive(:exist?).with(lock_path).and_return(true)
23
+ expect(File).to receive(:read).with(lock_path).and_return(gemfile_lock_content)
23
24
  gem_spec = Rewriter::GemSpec.new('ast', '~> 1.1')
24
25
  expect(gem_spec).to be_match
25
26
  end
26
27
 
27
28
  it 'returns true if version in Gemfile.lock is equal to definition' do
28
- expect(File).to receive(:exist?).with('./Gemfile.lock').and_return(true)
29
- expect(File).to receive(:read).with('./Gemfile.lock').and_return(gemfile_lock_content)
29
+ expect(File).to receive(:exist?).with(lock_path).and_return(true)
30
+ expect(File).to receive(:read).with(lock_path).and_return(gemfile_lock_content)
30
31
  gem_spec = Rewriter::GemSpec.new('ast', '1.1.0')
31
32
  expect(gem_spec).to be_match
32
33
  end
33
34
 
34
35
  it 'returns false if version in Gemfile.lock is less than definition' do
35
- expect(File).to receive(:exist?).with('./Gemfile.lock').and_return(true)
36
- expect(File).to receive(:read).with('./Gemfile.lock').and_return(gemfile_lock_content)
36
+ expect(File).to receive(:exist?).with(lock_path).and_return(true)
37
+ expect(File).to receive(:read).with(lock_path).and_return(gemfile_lock_content)
37
38
  gem_spec = Rewriter::GemSpec.new('ast', '> 1.2.0')
38
39
  expect(gem_spec).not_to be_match
39
40
  end
40
41
 
41
42
  it 'returns false if gem does not exist in Gemfile.lock' do
42
- expect(File).to receive(:exist?).with('./Gemfile.lock').and_return(true)
43
- expect(File).to receive(:read).with('./Gemfile.lock').and_return(gemfile_lock_content)
43
+ expect(File).to receive(:exist?).with(lock_path).and_return(true)
44
+ expect(File).to receive(:read).with(lock_path).and_return(gemfile_lock_content)
44
45
  gem_spec = Rewriter::GemSpec.new('synvert', '1.0.0')
45
46
  expect(gem_spec).not_to be_match
46
47
  end
47
48
 
48
49
  it 'raise Synvert::Core::GemfileLockNotFound if Gemfile.lock does not exist' do
49
- expect(File).to receive(:exist?).with('./Gemfile.lock').and_return(false)
50
+ expect(File).to receive(:exist?).with(lock_path).and_return(false)
50
51
  gem_spec = Rewriter::GemSpec.new('ast', '1.1.0')
51
52
  expect(gem_spec).to be_match
52
53
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synvert-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.63.0
4
+ version: 0.63.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang
@@ -218,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
218
  - !ruby/object:Gem::Version
219
219
  version: '0'
220
220
  requirements: []
221
- rubygems_version: 3.3.3
221
+ rubygems_version: 3.3.7
222
222
  signing_key:
223
223
  specification_version: 4
224
224
  summary: convert ruby code to better syntax.