matching_bundle 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Readme.md CHANGED
@@ -15,12 +15,15 @@ If there is a specific bundler version locked in the gemfile it will be used.
15
15
  ...
16
16
 
17
17
  If you need sudo to install gems do something like:
18
+
18
19
  sudo matching_bundle --version # matching version is installed
19
20
  matching_bundle install # matching version is used
20
21
 
21
22
  TODO
22
23
  ====
23
24
  - parse --gemfile option
25
+ - use highest matching version
26
+ - add a --no-install flag so only local versions are used
24
27
 
25
28
  Author
26
29
  ======
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -45,8 +45,8 @@ class MatchingBundle
45
45
  end
46
46
 
47
47
  def self.bundler_requirement(gemfile_content)
48
- if found = gemfile_content.match(/^\s*bundler \((.*)\)/)
49
- found[1]
50
- end
48
+ found = gemfile_content.scan(/^\s*bundler \((.*)\)/)
49
+ versions = found.map(&:last)
50
+ versions.find{|version| version =~ /^=\s*\d/ } || versions.first
51
51
  end
52
52
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{matching_bundle}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Michael Grosser"]
12
- s.date = %q{2011-05-09}
12
+ s.date = %q{2011-11-19}
13
13
  s.default_executable = %q{matching_bundle}
14
14
  s.email = %q{michael@grosser.it}
15
15
  s.executables = ["matching_bundle"]
@@ -6,16 +6,27 @@ describe MatchingBundle do
6
6
  end
7
7
 
8
8
  describe :bundler_requirement do
9
+ def requirement(*args)
10
+ MatchingBundle.bundler_requirement(*args)
11
+ end
12
+
9
13
  it "finds nothing when there is nothing" do
10
- MatchingBundle.bundler_requirement("").should == nil
14
+ requirement("").should == nil
11
15
  end
12
16
 
13
17
  it "finds a direct requirement" do
14
- MatchingBundle.bundler_requirement("asd\n bundler (1.0.1)").should == "1.0.1"
18
+ gemfile = "asd\n bundler (1.0.1)"
19
+ requirement(gemfile).should == "1.0.1"
15
20
  end
16
21
 
17
22
  it "finds a indirect requirement" do
18
- MatchingBundle.bundler_requirement("asd\n bundler (~>1.0.1)").should == "~>1.0.1"
23
+ gemfile = "asd\n bundler (~>1.0.1)"
24
+ requirement(gemfile).should == "~>1.0.1"
25
+ end
26
+
27
+ it "finds dependencies before other requirements" do
28
+ gemfile = "asd\n bundler (~>1.0.1)\nDEPENDENCIES\n bundler (= 1.1.rc)"
29
+ requirement(gemfile).should == "= 1.1.rc"
19
30
  end
20
31
  end
21
32
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: matching_bundle
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Grosser
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-09 00:00:00 +02:00
18
+ date: 2011-11-19 00:00:00 -08:00
19
19
  default_executable: matching_bundle
20
20
  dependencies: []
21
21