rake-version 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -1
- data/.screenrc +5 -0
- data/Gemfile +5 -7
- data/Gemfile.lock +21 -28
- data/README.md +5 -0
- data/VERSION +1 -1
- data/lib/rake-version.rb +0 -1
- data/lib/rake-version/config.rb +1 -3
- data/lib/rake-version/copier.rb +11 -3
- data/rake-version.gemspec +18 -23
- data/spec/copier_spec.rb +4 -1
- data/spec/helper.rb +0 -1
- metadata +25 -46
data/.rvmrc
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# development environment upon cd'ing into the directory
|
5
5
|
|
6
6
|
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional.
|
7
|
-
environment_id="ruby-1.9.
|
7
|
+
environment_id="ruby-1.9.2@rake-version"
|
8
8
|
|
9
9
|
#
|
10
10
|
# First we attempt to load the desired environment directly from the environment
|
data/.screenrc
ADDED
data/Gemfile
CHANGED
@@ -4,19 +4,17 @@ source "http://rubygems.org"
|
|
4
4
|
# gem "activesupport", ">= 2.3.5"
|
5
5
|
|
6
6
|
gem 'rake', '~> 0.9.2'
|
7
|
-
gem 'upoj-rb', '~> 0.0.5'
|
8
7
|
|
9
8
|
# Add dependencies to develop your gem here.
|
10
9
|
# Include everything needed to run rake, tests, features, etc.
|
11
10
|
group :development do
|
12
|
-
gem 'rspec', '~> 2.
|
13
|
-
gem 'shoulda', '~> 2.11.3'
|
11
|
+
gem 'rspec', '~> 2.11.0'
|
14
12
|
gem 'bundler'
|
15
|
-
gem 'jeweler', '~> 1.8.
|
16
|
-
gem 'simplecov', '~> 0.
|
17
|
-
gem 'yard', '~> 0.
|
13
|
+
gem 'jeweler', '~> 1.8.4'
|
14
|
+
gem 'simplecov', '~> 0.6.4'
|
15
|
+
gem 'yard', '~> 0.8.2.1'
|
18
16
|
gem 'rdiscount', '~> 1.6.8'
|
19
|
-
gem 'travis-lint', '~> 1.
|
17
|
+
gem 'travis-lint', '~> 1.4.0'
|
20
18
|
end
|
21
19
|
|
22
20
|
group :test do
|
data/Gemfile.lock
CHANGED
@@ -6,38 +6,33 @@ GEM
|
|
6
6
|
activesupport (3.0.0)
|
7
7
|
diff-lcs (1.1.3)
|
8
8
|
git (1.2.5)
|
9
|
-
hashr (0.0.
|
10
|
-
jeweler (1.8.
|
9
|
+
hashr (0.0.22)
|
10
|
+
jeweler (1.8.4)
|
11
11
|
bundler (~> 1.0)
|
12
12
|
git (>= 1.2.5)
|
13
13
|
rake
|
14
14
|
rdoc
|
15
|
-
json (1.
|
16
|
-
multi_json (1.
|
17
|
-
paint (0.8.4)
|
15
|
+
json (1.7.5)
|
16
|
+
multi_json (1.3.6)
|
18
17
|
rake (0.9.2.2)
|
19
18
|
rdiscount (1.6.8)
|
20
19
|
rdoc (3.12)
|
21
20
|
json (~> 1.4)
|
22
|
-
rspec (2.
|
23
|
-
rspec-core (~> 2.
|
24
|
-
rspec-expectations (~> 2.
|
25
|
-
rspec-mocks (~> 2.
|
26
|
-
rspec-core (2.
|
27
|
-
rspec-expectations (2.
|
28
|
-
diff-lcs (~> 1.1.
|
29
|
-
rspec-mocks (2.
|
30
|
-
|
31
|
-
|
32
|
-
multi_json (~> 1.0.3)
|
21
|
+
rspec (2.11.0)
|
22
|
+
rspec-core (~> 2.11.0)
|
23
|
+
rspec-expectations (~> 2.11.0)
|
24
|
+
rspec-mocks (~> 2.11.0)
|
25
|
+
rspec-core (2.11.1)
|
26
|
+
rspec-expectations (2.11.2)
|
27
|
+
diff-lcs (~> 1.1.3)
|
28
|
+
rspec-mocks (2.11.2)
|
29
|
+
simplecov (0.6.4)
|
30
|
+
multi_json (~> 1.0)
|
33
31
|
simplecov-html (~> 0.5.3)
|
34
32
|
simplecov-html (0.5.3)
|
35
|
-
travis-lint (1.
|
33
|
+
travis-lint (1.4.0)
|
36
34
|
hashr (>= 0.0.19)
|
37
|
-
|
38
|
-
active_support (>= 2)
|
39
|
-
paint
|
40
|
-
yard (0.7.5)
|
35
|
+
yard (0.8.2.1)
|
41
36
|
|
42
37
|
PLATFORMS
|
43
38
|
ruby
|
@@ -45,12 +40,10 @@ PLATFORMS
|
|
45
40
|
DEPENDENCIES
|
46
41
|
active_support (>= 2)
|
47
42
|
bundler
|
48
|
-
jeweler (~> 1.8.
|
43
|
+
jeweler (~> 1.8.4)
|
49
44
|
rake (~> 0.9.2)
|
50
45
|
rdiscount (~> 1.6.8)
|
51
|
-
rspec (~> 2.
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
upoj-rb (~> 0.0.5)
|
56
|
-
yard (~> 0.7.5)
|
46
|
+
rspec (~> 2.11.0)
|
47
|
+
simplecov (~> 0.6.4)
|
48
|
+
travis-lint (~> 1.4.0)
|
49
|
+
yard (~> 0.8.2.1)
|
data/README.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
**Rake tasks for version management.**
|
4
4
|
|
5
|
+
Tested with <a href="https://www.relishapp.com/rspec">RSpec</a>, <a href="https://github.com/thoughtbot/shoulda">shoulda</a> and <a href="http://travis-ci.org/#!/AlphaHydrae/rake-version">Travis CI</a>.
|
6
|
+
|
7
|
+
* master [![Build Status](https://secure.travis-ci.org/AlphaHydrae/rake-version.png?branch=master)](http://travis-ci.org/AlphaHydrae/rake-version)
|
8
|
+
* develop [![Build Status](https://secure.travis-ci.org/AlphaHydrae/rake-version.png?branch=develop)](http://travis-ci.org/AlphaHydrae/rake-version)
|
9
|
+
|
5
10
|
## License (MIT)
|
6
11
|
|
7
12
|
Copyright (c) 2011 Alpha Hydrae
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/lib/rake-version.rb
CHANGED
data/lib/rake-version/config.rb
CHANGED
@@ -13,9 +13,7 @@ module RakeVersion
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def copy *args
|
16
|
-
|
17
|
-
args.unshift "src/**/*.#{@extension}" if args.blank?
|
18
|
-
args << options if options.present?
|
16
|
+
args.unshift "src/**/*.#{@extension}" if args.empty?
|
19
17
|
@copiers << Copier.new(*args)
|
20
18
|
self
|
21
19
|
end
|
data/lib/rake-version/copier.rb
CHANGED
@@ -5,11 +5,11 @@ module RakeVersion
|
|
5
5
|
class Copier
|
6
6
|
|
7
7
|
def initialize *args
|
8
|
-
options =
|
8
|
+
@options = args.last.kind_of?(Hash) ? args.pop : {}
|
9
9
|
|
10
10
|
@file_patterns = args.collect{ |arg| check_file_pattern arg }
|
11
|
-
@version_pattern = check_version_pattern(
|
12
|
-
@replace_all = !!
|
11
|
+
@version_pattern = check_version_pattern(option(:version)) || /\d+\.\d+\.\d+/
|
12
|
+
@replace_all = !!option(:all)
|
13
13
|
end
|
14
14
|
|
15
15
|
def copy version, context
|
@@ -18,6 +18,14 @@ module RakeVersion
|
|
18
18
|
|
19
19
|
private
|
20
20
|
|
21
|
+
def option sym
|
22
|
+
if @options.key? sym
|
23
|
+
@options[sym]
|
24
|
+
elsif @options.key? sym.to_s
|
25
|
+
@options[sym.to_s]
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
21
29
|
def check_file_pattern pattern
|
22
30
|
unless [ String, Regexp ].any?{ |klass| pattern.kind_of? klass }
|
23
31
|
raise BadFilePattern, "Expected file pattern to be a glob string or regexp, got #{pattern.class.name}."
|
data/rake-version.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "rake-version"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["AlphaHydrae"]
|
12
|
-
s.date = "2012-
|
12
|
+
s.date = "2012-08-31"
|
13
13
|
s.description = "Rake tasks for version management."
|
14
14
|
s.email = "hydrae.alpha@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
".document",
|
21
21
|
".rspec",
|
22
22
|
".rvmrc",
|
23
|
+
".screenrc",
|
23
24
|
".travis.yml",
|
24
25
|
"Gemfile",
|
25
26
|
"Gemfile.lock",
|
@@ -54,38 +55,32 @@ Gem::Specification.new do |s|
|
|
54
55
|
|
55
56
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
56
57
|
s.add_runtime_dependency(%q<rake>, ["~> 0.9.2"])
|
57
|
-
s.
|
58
|
-
s.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
|
59
|
-
s.add_development_dependency(%q<shoulda>, ["~> 2.11.3"])
|
58
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.11.0"])
|
60
59
|
s.add_development_dependency(%q<bundler>, [">= 0"])
|
61
|
-
s.add_development_dependency(%q<jeweler>, ["~> 1.8.
|
62
|
-
s.add_development_dependency(%q<simplecov>, ["~> 0.
|
63
|
-
s.add_development_dependency(%q<yard>, ["~> 0.
|
60
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
|
61
|
+
s.add_development_dependency(%q<simplecov>, ["~> 0.6.4"])
|
62
|
+
s.add_development_dependency(%q<yard>, ["~> 0.8.2.1"])
|
64
63
|
s.add_development_dependency(%q<rdiscount>, ["~> 1.6.8"])
|
65
|
-
s.add_development_dependency(%q<travis-lint>, ["~> 1.
|
64
|
+
s.add_development_dependency(%q<travis-lint>, ["~> 1.4.0"])
|
66
65
|
else
|
67
66
|
s.add_dependency(%q<rake>, ["~> 0.9.2"])
|
68
|
-
s.add_dependency(%q<
|
69
|
-
s.add_dependency(%q<rspec>, ["~> 2.8.0"])
|
70
|
-
s.add_dependency(%q<shoulda>, ["~> 2.11.3"])
|
67
|
+
s.add_dependency(%q<rspec>, ["~> 2.11.0"])
|
71
68
|
s.add_dependency(%q<bundler>, [">= 0"])
|
72
|
-
s.add_dependency(%q<jeweler>, ["~> 1.8.
|
73
|
-
s.add_dependency(%q<simplecov>, ["~> 0.
|
74
|
-
s.add_dependency(%q<yard>, ["~> 0.
|
69
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
70
|
+
s.add_dependency(%q<simplecov>, ["~> 0.6.4"])
|
71
|
+
s.add_dependency(%q<yard>, ["~> 0.8.2.1"])
|
75
72
|
s.add_dependency(%q<rdiscount>, ["~> 1.6.8"])
|
76
|
-
s.add_dependency(%q<travis-lint>, ["~> 1.
|
73
|
+
s.add_dependency(%q<travis-lint>, ["~> 1.4.0"])
|
77
74
|
end
|
78
75
|
else
|
79
76
|
s.add_dependency(%q<rake>, ["~> 0.9.2"])
|
80
|
-
s.add_dependency(%q<
|
81
|
-
s.add_dependency(%q<rspec>, ["~> 2.8.0"])
|
82
|
-
s.add_dependency(%q<shoulda>, ["~> 2.11.3"])
|
77
|
+
s.add_dependency(%q<rspec>, ["~> 2.11.0"])
|
83
78
|
s.add_dependency(%q<bundler>, [">= 0"])
|
84
|
-
s.add_dependency(%q<jeweler>, ["~> 1.8.
|
85
|
-
s.add_dependency(%q<simplecov>, ["~> 0.
|
86
|
-
s.add_dependency(%q<yard>, ["~> 0.
|
79
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
80
|
+
s.add_dependency(%q<simplecov>, ["~> 0.6.4"])
|
81
|
+
s.add_dependency(%q<yard>, ["~> 0.8.2.1"])
|
87
82
|
s.add_dependency(%q<rdiscount>, ["~> 1.6.8"])
|
88
|
-
s.add_dependency(%q<travis-lint>, ["~> 1.
|
83
|
+
s.add_dependency(%q<travis-lint>, ["~> 1.4.0"])
|
89
84
|
end
|
90
85
|
end
|
91
86
|
|
data/spec/copier_spec.rb
CHANGED
@@ -30,11 +30,13 @@ describe RakeVersion::Copier do
|
|
30
30
|
|
31
31
|
it "should accept a regexp as the version option" do
|
32
32
|
lambda{ RakeVersion::Copier.new :version => /version/ }.should_not raise_error
|
33
|
+
lambda{ RakeVersion::Copier.new 'version' => /version/ }.should_not raise_error
|
33
34
|
end
|
34
35
|
|
35
36
|
it "should only accept a regexp as the version option" do
|
36
37
|
[ true, false, [], {}, Object.new, :symbol ].each do |invalid|
|
37
38
|
lambda{ RakeVersion::Copier.new :version => invalid }.should raise_error(RakeVersion::BadVersionPattern)
|
39
|
+
lambda{ RakeVersion::Copier.new 'version' => invalid }.should raise_error(RakeVersion::BadVersionPattern)
|
38
40
|
end
|
39
41
|
end
|
40
42
|
|
@@ -74,7 +76,8 @@ describe RakeVersion::Copier do
|
|
74
76
|
end
|
75
77
|
|
76
78
|
def mock_file file
|
77
|
-
|
79
|
+
contents = COPIER_SAMPLE_FILES[file] ? COPIER_SAMPLE_FILES[file].dup : nil
|
80
|
+
double("file #{file}", :read => contents, :rewind => nil, :write => nil)
|
78
81
|
end
|
79
82
|
|
80
83
|
it "should copy the version to ruby files with a glob string" do
|
data/spec/helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rake-version
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-31 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
|
-
requirement: &
|
16
|
+
requirement: &70340903490360 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,43 +21,21 @@ dependencies:
|
|
21
21
|
version: 0.9.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: upoj-rb
|
27
|
-
requirement: &70202486865480 !ruby/object:Gem::Requirement
|
28
|
-
none: false
|
29
|
-
requirements:
|
30
|
-
- - ~>
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 0.0.5
|
33
|
-
type: :runtime
|
34
|
-
prerelease: false
|
35
|
-
version_requirements: *70202486865480
|
24
|
+
version_requirements: *70340903490360
|
36
25
|
- !ruby/object:Gem::Dependency
|
37
26
|
name: rspec
|
38
|
-
requirement: &
|
39
|
-
none: false
|
40
|
-
requirements:
|
41
|
-
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: 2.8.0
|
44
|
-
type: :development
|
45
|
-
prerelease: false
|
46
|
-
version_requirements: *70202486862340
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: shoulda
|
49
|
-
requirement: &70202486859000 !ruby/object:Gem::Requirement
|
27
|
+
requirement: &70340903488920 !ruby/object:Gem::Requirement
|
50
28
|
none: false
|
51
29
|
requirements:
|
52
30
|
- - ~>
|
53
31
|
- !ruby/object:Gem::Version
|
54
|
-
version: 2.11.
|
32
|
+
version: 2.11.0
|
55
33
|
type: :development
|
56
34
|
prerelease: false
|
57
|
-
version_requirements: *
|
35
|
+
version_requirements: *70340903488920
|
58
36
|
- !ruby/object:Gem::Dependency
|
59
37
|
name: bundler
|
60
|
-
requirement: &
|
38
|
+
requirement: &70340903487440 !ruby/object:Gem::Requirement
|
61
39
|
none: false
|
62
40
|
requirements:
|
63
41
|
- - ! '>='
|
@@ -65,43 +43,43 @@ dependencies:
|
|
65
43
|
version: '0'
|
66
44
|
type: :development
|
67
45
|
prerelease: false
|
68
|
-
version_requirements: *
|
46
|
+
version_requirements: *70340903487440
|
69
47
|
- !ruby/object:Gem::Dependency
|
70
48
|
name: jeweler
|
71
|
-
requirement: &
|
49
|
+
requirement: &70340903465520 !ruby/object:Gem::Requirement
|
72
50
|
none: false
|
73
51
|
requirements:
|
74
52
|
- - ~>
|
75
53
|
- !ruby/object:Gem::Version
|
76
|
-
version: 1.8.
|
54
|
+
version: 1.8.4
|
77
55
|
type: :development
|
78
56
|
prerelease: false
|
79
|
-
version_requirements: *
|
57
|
+
version_requirements: *70340903465520
|
80
58
|
- !ruby/object:Gem::Dependency
|
81
59
|
name: simplecov
|
82
|
-
requirement: &
|
60
|
+
requirement: &70340903463980 !ruby/object:Gem::Requirement
|
83
61
|
none: false
|
84
62
|
requirements:
|
85
63
|
- - ~>
|
86
64
|
- !ruby/object:Gem::Version
|
87
|
-
version: 0.
|
65
|
+
version: 0.6.4
|
88
66
|
type: :development
|
89
67
|
prerelease: false
|
90
|
-
version_requirements: *
|
68
|
+
version_requirements: *70340903463980
|
91
69
|
- !ruby/object:Gem::Dependency
|
92
70
|
name: yard
|
93
|
-
requirement: &
|
71
|
+
requirement: &70340903462340 !ruby/object:Gem::Requirement
|
94
72
|
none: false
|
95
73
|
requirements:
|
96
74
|
- - ~>
|
97
75
|
- !ruby/object:Gem::Version
|
98
|
-
version: 0.
|
76
|
+
version: 0.8.2.1
|
99
77
|
type: :development
|
100
78
|
prerelease: false
|
101
|
-
version_requirements: *
|
79
|
+
version_requirements: *70340903462340
|
102
80
|
- !ruby/object:Gem::Dependency
|
103
81
|
name: rdiscount
|
104
|
-
requirement: &
|
82
|
+
requirement: &70340903460760 !ruby/object:Gem::Requirement
|
105
83
|
none: false
|
106
84
|
requirements:
|
107
85
|
- - ~>
|
@@ -109,18 +87,18 @@ dependencies:
|
|
109
87
|
version: 1.6.8
|
110
88
|
type: :development
|
111
89
|
prerelease: false
|
112
|
-
version_requirements: *
|
90
|
+
version_requirements: *70340903460760
|
113
91
|
- !ruby/object:Gem::Dependency
|
114
92
|
name: travis-lint
|
115
|
-
requirement: &
|
93
|
+
requirement: &70340903458560 !ruby/object:Gem::Requirement
|
116
94
|
none: false
|
117
95
|
requirements:
|
118
96
|
- - ~>
|
119
97
|
- !ruby/object:Gem::Version
|
120
|
-
version: 1.
|
98
|
+
version: 1.4.0
|
121
99
|
type: :development
|
122
100
|
prerelease: false
|
123
|
-
version_requirements: *
|
101
|
+
version_requirements: *70340903458560
|
124
102
|
description: Rake tasks for version management.
|
125
103
|
email: hydrae.alpha@gmail.com
|
126
104
|
executables: []
|
@@ -132,6 +110,7 @@ files:
|
|
132
110
|
- .document
|
133
111
|
- .rspec
|
134
112
|
- .rvmrc
|
113
|
+
- .screenrc
|
135
114
|
- .travis.yml
|
136
115
|
- Gemfile
|
137
116
|
- Gemfile.lock
|
@@ -169,7 +148,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
169
148
|
version: '0'
|
170
149
|
segments:
|
171
150
|
- 0
|
172
|
-
hash:
|
151
|
+
hash: 979223545522422935
|
173
152
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
174
153
|
none: false
|
175
154
|
requirements:
|