safedep 0.1.1 → 0.1.2

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: 073181294c53aaa47b98decfae315f69483ecaba
4
- data.tar.gz: 892e8eea3c963afb826c387e01f407423da13e8e
3
+ metadata.gz: d2d198c2e776fbd9a652cdf6b86cc024f8435ad2
4
+ data.tar.gz: 46a70f118954452d2db915ef213b36d225bb5f54
5
5
  SHA512:
6
- metadata.gz: 7332be02da69cffbd75edb5c83c5036797fe0863ac55ff9fb3bb54b8a1d0ac7939ae5e170919b9ab29ac63e6f783ff45f49d5751687c54cb7889dc477841cd11
7
- data.tar.gz: 38c86e5409d9352418e91021fac8970b96d96f7ea21d0ce630566e2efa6f2c7747ffb09f099a7e169691d55c4018d8a4237ac39b8023aac346262d44ce68387c
6
+ metadata.gz: 2f0e2df394f4d2bb542593d7279dbbf4f1941a2930519cfa7bc57054ab15c1646bddbf037daf1f43ceecb1854acec8ec53a3abb23569736d36e719af7bf6c755
7
+ data.tar.gz: 622be6b932f9a390507248a268649bd8063855355ddc4fea6ed4fb40c1b6c4f88de093ac3b48787cbbea857c32f23e736b1ae5db4fa8210a006801b451451bb5
@@ -14,6 +14,9 @@ LineLength:
14
14
  MethodLength:
15
15
  Max: 15
16
16
 
17
+ AbcSize:
18
+ Max: 20
19
+
17
20
  RegexpLiteral:
18
21
  Exclude:
19
22
  - '*.gemspec'
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Development
4
4
 
5
+ ## v0.1.2
6
+
7
+ * Handle error raised when dependency definition is not found in `Gemfile.lock`.
8
+
5
9
  ## v0.1.1
6
10
 
7
11
  * Fix unaligned help message.
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
- ## Installation
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
- ```bash
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,
@@ -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
 
@@ -3,7 +3,7 @@ module Safedep
3
3
  module Version
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- PATCH = 1
6
+ PATCH = 2
7
7
 
8
8
  def self.to_s
9
9
  [MAJOR, MINOR, PATCH].join('.')
@@ -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.lock/)
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']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safedep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuji Nakayama