synvert-core 0.63.0 → 0.63.1
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/synvert/core/rewriter/gem_spec.rb +1 -1
- data/lib/synvert/core/version.rb +1 -1
- data/spec/synvert/core/rewriter/gem_spec_spec.rb +10 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5739f84132a6ece2551028571b7e6cb458812524f51ea11de6175eb621592d21
|
4
|
+
data.tar.gz: a55b00a9431cacbe740405294b351cd8c5a1face1f2c20ba3a61897316dc7bd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba153f740ea4d281dde99359dcf864beb49bdac33db3833878eebb9ba020966bb8957426936e65f7fc00ce84b76f7bb79fe2c01a5984ea155c5a4f6845c6e5b7
|
7
|
+
data.tar.gz: 6ff6c82355e35e6f86a42f01bcbd57b4e25d6c0ccef0079b89d4980bca26a983bf187526f9f5af150ee7a970d906b3cb22dd69b1af9f84263d3d8231d4673df7
|
data/CHANGELOG.md
CHANGED
@@ -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)
|
data/lib/synvert/core/version.rb
CHANGED
@@ -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(
|
22
|
-
expect(File).to receive(:read).with(
|
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(
|
29
|
-
expect(File).to receive(:read).with(
|
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(
|
36
|
-
expect(File).to receive(:read).with(
|
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(
|
43
|
-
expect(File).to receive(:read).with(
|
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(
|
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.
|
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.
|
221
|
+
rubygems_version: 3.3.7
|
222
222
|
signing_key:
|
223
223
|
specification_version: 4
|
224
224
|
summary: convert ruby code to better syntax.
|