versionate 0.3.0 → 0.4.0

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
  SHA1:
3
- metadata.gz: 3bda0008ebbf950eb249f938fc4f6e96fdc611e7
4
- data.tar.gz: 18dfec73c19aaaa909b2248c4af80c6ad840e70e
3
+ metadata.gz: 2e9a0fe27d0ee30b28b1c4b87a6cffd6d18f57b4
4
+ data.tar.gz: 42b58bb8da573a8ae476eb85f73736d54aa24db0
5
5
  SHA512:
6
- metadata.gz: aa45fd05c5adc3b6a90f945a132a28da5bbe8972128bc5b255052f739fd0cc6297f37f99efc4c3be8f7da4a7b820e6a87780430d5c3174cd0743406fe61388fe
7
- data.tar.gz: 9f84a1ca603c9b123768e5ce3c55760cd581d27e38e3cc839a3cdc8146c0eb15deee341fbbc977095ad6a73b136f8bbd1cebfe30b0762cb7ae5ce4e0adb58914
6
+ metadata.gz: e72710b7b7420f7529ca444972e9249c88f7377b58576baa5401a4f22049966e9665ba51a23b5928fe0c34ad5356d3a0b03376da90b6918b298619475df8d937
7
+ data.tar.gz: 00c0022c6b882615f88e64f522bd2a5b26b9e9d8b6244261a423d490c04ab320ac4a3d0d29851353703a6f8695a5b15489d7e663611a058b3080e9186bcb9d9f
@@ -1,4 +1,6 @@
1
1
  require "versionate/version"
2
+ require "versionate/adapters/bundler"
3
+
2
4
  require "versionate/api_adapter"
3
5
  require "versionate/configuration"
4
6
  require "versionate/versioner"
@@ -0,0 +1,28 @@
1
+ require 'bundler'
2
+
3
+ module Versionate
4
+ module Adapters
5
+ class Bundler
6
+ def self.info(gem_name)
7
+ found = specs.find { |spec| spec.name == gem_name.to_s }
8
+
9
+ if found.nil?
10
+ error = "Could not find '#{gem_name}'. Please run `bundle install`."
11
+ raise Gem::LoadError.new error
12
+ end
13
+
14
+ { "version" => found.version.to_s }
15
+ end
16
+
17
+ def self.versions(gem_name)
18
+ [ { "number" => info(gem_name)["version"] } ]
19
+ end
20
+
21
+ private
22
+
23
+ def self.specs
24
+ @specs ||= ::Bundler.load.specs
25
+ end
26
+ end
27
+ end
28
+ end
@@ -1,5 +1,3 @@
1
- require 'gems'
2
-
3
1
  module Versionate
4
2
  class ApiAdapter
5
3
  def provider
@@ -7,7 +5,7 @@ module Versionate
7
5
  when :test
8
6
  GemsMock
9
7
  when :production
10
- ::Gems
8
+ Adapters::Bundler
11
9
  end
12
10
  end
13
11
  end
@@ -1,3 +1,3 @@
1
1
  module Versionate
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -1,3 +1,5 @@
1
+ require 'stringio'
2
+
1
3
  module Versionate
2
4
  class Versioner
3
5
  GEM_REGEXP = /^\s*gem ['"](?<name>.+?)['"](?<extra>,.+$?)?/
@@ -25,7 +27,7 @@ module Versionate
25
27
  stable = !options["pre"]
26
28
 
27
29
  orig_file = File.open(filename)
28
- tmp = StringIO.new
30
+ tmp = ::StringIO.new
29
31
 
30
32
  orig_file.each do |line|
31
33
  gem_name = gem_and_only_gem_from_line line
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: versionate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sindre Moen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-27 00:00:00.000000000 Z
11
+ date: 2015-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gems
@@ -25,47 +25,47 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.8'
27
27
  - !ruby/object:Gem::Dependency
28
- name: thor
28
+ name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.19'
33
+ version: '1.8'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.19'
40
+ version: '1.8'
41
41
  - !ruby/object:Gem::Dependency
42
- name: coveralls
42
+ name: thor
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.7'
48
- type: :development
47
+ version: '0.19'
48
+ type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0.7'
54
+ version: '0.19'
55
55
  - !ruby/object:Gem::Dependency
56
- name: bundler
56
+ name: coveralls
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.3'
61
+ version: '0.7'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.3'
68
+ version: '0.7'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -106,6 +106,7 @@ files:
106
106
  - Rakefile
107
107
  - bin/versionate
108
108
  - lib/versionate.rb
109
+ - lib/versionate/adapters/bundler.rb
109
110
  - lib/versionate/api_adapter.rb
110
111
  - lib/versionate/cli.rb
111
112
  - lib/versionate/configuration.rb
@@ -131,8 +132,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
132
  version: '0'
132
133
  requirements: []
133
134
  rubyforge_project:
134
- rubygems_version: 2.2.2
135
+ rubygems_version: 2.4.5
135
136
  signing_key:
136
137
  specification_version: 4
137
138
  summary: Appends versions to your Gemfile's gem listings
138
139
  test_files: []
140
+ has_rdoc: