safedep 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +4 -0
- data/README.md +8 -4
- data/lib/safedep/runner.rb +7 -0
- data/lib/safedep/version.rb +1 -1
- data/spec/safedep/runner_spec.rb +15 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2d198c2e776fbd9a652cdf6b86cc024f8435ad2
|
4
|
+
data.tar.gz: 46a70f118954452d2db915ef213b36d225bb5f54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f0e2df394f4d2bb542593d7279dbbf4f1941a2930519cfa7bc57054ab15c1646bddbf037daf1f43ceecb1854acec8ec53a3abb23569736d36e719af7bf6c755
|
7
|
+
data.tar.gz: 622be6b932f9a390507248a268649bd8063855355ddc4fea6ed4fb40c1b6c4f88de093ac3b48787cbbea857c32f23e736b1ae5db4fa8210a006801b451451bb5
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -8,11 +8,9 @@
|
|
8
8
|
|
9
9
|
**safedep** automatically writes missing version specifiers for dependencies in your `Gemfile`.
|
10
10
|
|
11
|
-
|
11
|
+
* [Using >= Considered Harmful (or, What’s Wrong With >=) « Katz Got Your Tongue?](http://yehudakatz.com/2010/08/21/using-considered-harmful-or-whats-wrong-with/)
|
12
12
|
|
13
|
-
|
14
|
-
$ gem install safedep
|
15
|
-
```
|
13
|
+
Version specifier with `>=` is considered harmful, then dependencies without version speicifier must be super harmful. :)
|
16
14
|
|
17
15
|
## Example
|
18
16
|
|
@@ -65,6 +63,12 @@ index 5ff2c3c..488dd41 100644
|
|
65
63
|
end
|
66
64
|
```
|
67
65
|
|
66
|
+
## Installation
|
67
|
+
|
68
|
+
```bash
|
69
|
+
$ gem install safedep
|
70
|
+
```
|
71
|
+
|
68
72
|
## Usage
|
69
73
|
|
70
74
|
Just run `safedep` command in your project's root directory,
|
data/lib/safedep/runner.rb
CHANGED
@@ -20,7 +20,14 @@ module Safedep
|
|
20
20
|
|
21
21
|
dependencies.each do |dep|
|
22
22
|
next if should_ignore?(dep)
|
23
|
+
|
23
24
|
lockfile_dep = gemfile_lock.find_dependency(dep.name)
|
25
|
+
|
26
|
+
unless lockfile_dep
|
27
|
+
fail Error, "#{dep.name.inspect} definition is not found in #{gemfile_lock.path}. " \
|
28
|
+
'Please run `bundle install`.'
|
29
|
+
end
|
30
|
+
|
24
31
|
dep.version_specifier = safe_version_specifier(lockfile_dep.version)
|
25
32
|
end
|
26
33
|
|
data/lib/safedep/version.rb
CHANGED
data/spec/safedep/runner_spec.rb
CHANGED
@@ -31,7 +31,7 @@ module Safedep
|
|
31
31
|
|
32
32
|
context 'when there is no Gemfile.lock' do
|
33
33
|
it 'raises error' do
|
34
|
-
expect { runner.run }.to raise_error(/Gemfile
|
34
|
+
expect { runner.run }.to raise_error(/Gemfile\.lock/)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -58,6 +58,20 @@ module Safedep
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
+
context 'when a dependency specified in Gemfile does not exist in Gemfile.lock', :gemfile, :lockfile do
|
62
|
+
let!(:lockfile) do
|
63
|
+
require 'safedep/gemfile_lock'
|
64
|
+
create_file(lockfile_path, invalid_lockfile_source)
|
65
|
+
Safedep::GemfileLock.new(lockfile_path)
|
66
|
+
end
|
67
|
+
|
68
|
+
let(:invalid_lockfile_source) { lockfile_source.gsub(/.*rspec.*\n/, '') }
|
69
|
+
|
70
|
+
it 'raises error' do
|
71
|
+
expect { runner.run }.to raise_error(/rspec.+Gemfile\.lock/)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
61
75
|
context 'when Configuration#skipped_groups is specified', :gemspec, :gemfile, :lockfile do
|
62
76
|
before do
|
63
77
|
configuration.skipped_groups = ['development']
|