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 +4 -4
- data/lib/versionate.rb +2 -0
- data/lib/versionate/adapters/bundler.rb +28 -0
- data/lib/versionate/api_adapter.rb +1 -3
- data/lib/versionate/version.rb +1 -1
- data/lib/versionate/versioner.rb +3 -1
- metadata +15 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e9a0fe27d0ee30b28b1c4b87a6cffd6d18f57b4
|
4
|
+
data.tar.gz: 42b58bb8da573a8ae476eb85f73736d54aa24db0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e72710b7b7420f7529ca444972e9249c88f7377b58576baa5401a4f22049966e9665ba51a23b5928fe0c34ad5356d3a0b03376da90b6918b298619475df8d937
|
7
|
+
data.tar.gz: 00c0022c6b882615f88e64f522bd2a5b26b9e9d8b6244261a423d490c04ab320ac4a3d0d29851353703a6f8695a5b15489d7e663611a058b3080e9186bcb9d9f
|
data/lib/versionate.rb
CHANGED
@@ -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
|
data/lib/versionate/version.rb
CHANGED
data/lib/versionate/versioner.rb
CHANGED
@@ -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.
|
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:
|
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:
|
28
|
+
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
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: '
|
40
|
+
version: '1.8'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: thor
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
48
|
-
type: :
|
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.
|
54
|
+
version: '0.19'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: coveralls
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
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: '
|
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.
|
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:
|