tumbler 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +8 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +9 -3
- data/README.rdoc +11 -3
- data/Rakefile +4 -0
- data/lib/template/Gemfile.erb +0 -1
- data/lib/tumbler/manager.rb +1 -0
- data/lib/tumbler/rake_tasks.rb +13 -8
- data/lib/tumbler/version.rb +1 -1
- data/spec/changelog_spec.rb +2 -0
- data/spec/spec_helper.rb +4 -0
- data/spec/tasks_spec.rb +2 -0
- data/spec/version_spec.rb +24 -20
- metadata +17 -3
data/CHANGELOG
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
== 0.0.10
|
2
|
+
|
3
|
+
* Added preflight task for easy injection of arbitrary code before tumbler runs. (Joshua Hull, bdb7ed7)
|
4
|
+
* More explicit instructions for releasing in two steps (Joshua Hull, a836489)
|
5
|
+
* Cleaned up spec, removed debug output (Joshua Hull, 75e2b2d)
|
6
|
+
* Removed whitespace (Joshua Hull, 6a66d7d)
|
7
|
+
* Gem#push on successful bumps (Joshua Hull, c359a1d)
|
8
|
+
|
1
9
|
== 0.0.9
|
2
10
|
|
3
11
|
* Allow custom binding to be passed when rendering erb (Nathan Esquenazi, 4ccc567)
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -16,15 +16,19 @@ dependencies:
|
|
16
16
|
group:
|
17
17
|
- :default
|
18
18
|
version: ">= 0"
|
19
|
+
mocha:
|
20
|
+
group:
|
21
|
+
- :development
|
22
|
+
version: ">= 0"
|
19
23
|
json:
|
20
24
|
group:
|
21
25
|
- :default
|
22
26
|
version: ">= 0"
|
23
|
-
|
27
|
+
callsite:
|
24
28
|
group:
|
25
29
|
- :default
|
26
30
|
version: ">= 0"
|
27
|
-
|
31
|
+
bundler:
|
28
32
|
group:
|
29
33
|
- :default
|
30
34
|
version: ">= 0"
|
@@ -41,11 +45,13 @@ specs:
|
|
41
45
|
version: 1.2.8
|
42
46
|
- json:
|
43
47
|
version: 1.4.3
|
48
|
+
- mocha:
|
49
|
+
version: 0.9.8
|
44
50
|
- rspec:
|
45
51
|
version: 1.3.0
|
46
52
|
- versionomy:
|
47
53
|
version: 0.4.0
|
48
|
-
hash:
|
54
|
+
hash: 85f3afef38338d73c791177045f3c5d9b77a14b4
|
49
55
|
sources:
|
50
56
|
- Rubygems:
|
51
57
|
uri: http://gemcutter.org
|
data/README.rdoc
CHANGED
@@ -74,13 +74,21 @@ Once you've got Tumbler up and running in your gem, you will have access to the
|
|
74
74
|
rake version:push # Push current version into git
|
75
75
|
rake version:tag # Tag current version into git
|
76
76
|
|
77
|
-
|
77
|
+
There is a special rake task you can override, <tt>'tumbler:preflight'</tt>, if you'd like to run specs or do some other task before any of the tumbler tasks get invoked. For instance, to invoke +spec+ before you run your main tasks, you could add:
|
78
78
|
|
79
|
-
|
79
|
+
task 'tumbler:preflight' do
|
80
|
+
Rake::Task["spec"].invoke
|
81
|
+
end
|
82
|
+
|
83
|
+
==== Releasing Your Gem
|
84
|
+
|
85
|
+
If you do the following,
|
80
86
|
|
81
87
|
rake version:(tiny|minor|major):release
|
82
88
|
|
83
|
-
|
89
|
+
you will bump the version, tag it in git, regenerate the changelog from your git commits and push the whole thing to rubygems and your remote.
|
90
|
+
|
91
|
+
If you prefer you can do it in two steps (which give you a chance to edit the generated changelog)
|
84
92
|
|
85
93
|
rake version:(tiny|minor|major):bump
|
86
94
|
rake version:push
|
data/Rakefile
CHANGED
data/lib/template/Gemfile.erb
CHANGED
data/lib/tumbler/manager.rb
CHANGED
data/lib/tumbler/rake_tasks.rb
CHANGED
@@ -16,47 +16,52 @@ module Tumbler
|
|
16
16
|
|
17
17
|
def activate_project_tasks(protect_namespace)
|
18
18
|
tasks = proc do
|
19
|
+
namespace :tumbler do
|
20
|
+
task :preflight do
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
19
24
|
namespace :gem do
|
20
25
|
desc "Build the gem"
|
21
|
-
task :build do
|
26
|
+
task :build => 'tumbler:preflight' do
|
22
27
|
@manager.gem.build
|
23
28
|
end
|
24
29
|
|
25
30
|
desc "Push the gem"
|
26
|
-
task :push do
|
31
|
+
task :push => 'tumbler:preflight' do
|
27
32
|
@manager.gem.push
|
28
33
|
end
|
29
34
|
|
30
35
|
desc "Install the gem"
|
31
|
-
task :install do
|
36
|
+
task :install => 'tumbler:preflight' do
|
32
37
|
@manager.gem.install
|
33
38
|
end
|
34
39
|
end
|
35
40
|
|
36
41
|
namespace :version do
|
37
42
|
desc "Tag current version into git"
|
38
|
-
task :tag do
|
43
|
+
task :tag => 'tumbler:preflight' do
|
39
44
|
@manager.tag
|
40
45
|
end
|
41
46
|
|
42
47
|
desc "Push current version into git"
|
43
|
-
task :push do
|
48
|
+
task :push => 'tumbler:preflight' do
|
44
49
|
@manager.tag_and_push
|
45
50
|
end
|
46
51
|
|
47
52
|
@manager.version.field_names.each do |field|
|
48
53
|
namespace field do
|
49
54
|
desc "Bump version from #{@manager.version.to_s} -> #{@manager.version.value.bump(field).to_s}"
|
50
|
-
task :bump do
|
55
|
+
task :bump => 'tumbler:preflight' do
|
51
56
|
@manager.bump_and_commit(field)
|
52
57
|
end
|
53
58
|
|
54
|
-
task :push do
|
59
|
+
task :push => 'tumbler:preflight' do
|
55
60
|
@manager.tag_and_push(field)
|
56
61
|
end
|
57
62
|
|
58
63
|
desc "Bump version from #{@manager.version.to_s} -> #{@manager.version.value.bump(field).to_s} and push"
|
59
|
-
task :release do
|
64
|
+
task :release => 'tumbler:preflight' do
|
60
65
|
@manager.bump_and_push(field)
|
61
66
|
end
|
62
67
|
end
|
data/lib/tumbler/version.rb
CHANGED
data/spec/changelog_spec.rb
CHANGED
@@ -14,6 +14,7 @@ describe Tumbler::Manager::Changelog do
|
|
14
14
|
tumbler.sh 'touch file2'
|
15
15
|
tumbler.sh 'git add file2'
|
16
16
|
tumbler.sh 'git commit file2 -m"added file2"'
|
17
|
+
Tumbler::Gem.any_instance.stubs(:push).once.returns(true)
|
17
18
|
tumbler.bump_and_push(:tiny)
|
18
19
|
tumbler.version.to_s.should == '0.0.1'
|
19
20
|
changelog = File.read(tumbler.changelog.file)
|
@@ -29,6 +30,7 @@ describe Tumbler::Manager::Changelog do
|
|
29
30
|
tumbler.sh 'touch file2'
|
30
31
|
tumbler.sh 'git add file2'
|
31
32
|
tumbler.sh 'git commit file2 -m"added file2"'
|
33
|
+
Tumbler::Gem.any_instance.stubs(:push).once.returns(true)
|
32
34
|
tumbler.bump_and_push(:tiny)
|
33
35
|
tumbler.version.to_s.should == '0.0.1'
|
34
36
|
File.exist?(File.join(tumbler.base, 'CHANGELOG')).should be_false
|
data/spec/spec_helper.rb
CHANGED
@@ -1,11 +1,15 @@
|
|
1
1
|
require 'tempfile'
|
2
2
|
require 'fileutils'
|
3
|
+
require 'mocha'
|
3
4
|
|
4
5
|
$LOAD_PATH << File.basename(__FILE__)
|
5
6
|
$LOAD_PATH << File.join(File.basename(__FILE__), '..', 'lib')
|
6
7
|
|
7
8
|
require 'tumbler'
|
8
9
|
|
10
|
+
Tumbler::Gem.any_instance.stubs(:install).raises
|
11
|
+
Tumbler::Gem.any_instance.stubs(:push).raises
|
12
|
+
|
9
13
|
def create_app(name = 'test', opts = {})
|
10
14
|
temp_dir(name) do |dir|
|
11
15
|
temp_dir("remote-#{name}.git") do |remote_dir|
|
data/spec/tasks_spec.rb
CHANGED
@@ -30,6 +30,7 @@ describe Tumbler do
|
|
30
30
|
|
31
31
|
it "should successfully push after a bump" do
|
32
32
|
create_app do |app|
|
33
|
+
Tumbler::Gem.any_instance.stubs(:push).once.returns(true)
|
33
34
|
app.bump_and_commit(:minor)
|
34
35
|
app.tag_and_push
|
35
36
|
app.reload
|
@@ -42,6 +43,7 @@ describe Tumbler do
|
|
42
43
|
context "version bumping & pushing" do
|
43
44
|
it "should create a nice changelog" do
|
44
45
|
create_app do |app|
|
46
|
+
Tumbler::Gem.any_instance.stubs(:push).times(4).returns(true)
|
45
47
|
app.sh 'touch test1; git add test1; git commit test1 -m"Added test1"'
|
46
48
|
app.bump_and_push(:minor)
|
47
49
|
app.sh 'touch test2; git add test2; git commit test2 -m"Added test2"'
|
data/spec/version_spec.rb
CHANGED
@@ -2,46 +2,50 @@ require 'spec/spec_helper'
|
|
2
2
|
|
3
3
|
describe 'Tumbler#version' do
|
4
4
|
it "should read the current version" do
|
5
|
-
create_app('test', :version => '0.1.2') { |
|
6
|
-
|
5
|
+
create_app('test', :version => '0.1.2') { |app|
|
6
|
+
app.version.to_s.should == '0.1.2'
|
7
7
|
}
|
8
8
|
end
|
9
9
|
|
10
10
|
it "should bump the current version by minor" do
|
11
|
-
create_app('test', :version => '0.1.2') { |
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
create_app('test', :version => '0.1.2') { |app|
|
12
|
+
Tumbler::Gem.any_instance.stubs(:push).once.returns(true)
|
13
|
+
app.bump_and_push(:minor)
|
14
|
+
app.version.to_s.should == '0.2.0'
|
15
|
+
app.tags.should include('0.2.0')
|
16
16
|
}
|
17
17
|
end
|
18
18
|
|
19
19
|
it "should bump the current version by tiny" do
|
20
|
-
create_app('test', :version => '0.1.2') { |
|
21
|
-
|
22
|
-
|
20
|
+
create_app('test', :version => '0.1.2') { |app|
|
21
|
+
Tumbler::Gem.any_instance.stubs(:push).once.returns(true)
|
22
|
+
app.bump_and_push(:tiny)
|
23
|
+
app.version.to_s.should == '0.1.3'
|
23
24
|
}
|
24
25
|
end
|
25
26
|
|
26
27
|
it "should bump the current version by major" do
|
27
|
-
create_app('test', :version => '0.1.2') { |
|
28
|
-
|
29
|
-
|
28
|
+
create_app('test', :version => '0.1.2') { |app|
|
29
|
+
Tumbler::Gem.any_instance.stubs(:push).once.returns(true)
|
30
|
+
app.bump_and_push(:major)
|
31
|
+
app.version.to_s.should == '1.0.0'
|
30
32
|
}
|
31
33
|
end
|
32
34
|
|
33
35
|
it "should bump the current version by major" do
|
34
|
-
create_app('test', :version => '0.1.2') { |
|
35
|
-
|
36
|
-
|
36
|
+
create_app('test', :version => '0.1.2') { |app|
|
37
|
+
Tumbler::Gem.any_instance.stubs(:push).once.returns(true)
|
38
|
+
app.bump_and_push(:major)
|
39
|
+
app.version.to_s.should == '1.0.0'
|
37
40
|
}
|
38
41
|
end
|
39
42
|
|
40
43
|
it "should not let you tag the same version twice" do
|
41
|
-
create_app('test', :version => '0.1.2') { |
|
42
|
-
|
43
|
-
|
44
|
-
|
44
|
+
create_app('test', :version => '0.1.2') { |app|
|
45
|
+
Tumbler::Gem.any_instance.stubs(:push).once.returns(true)
|
46
|
+
app.bump_and_push(:major)
|
47
|
+
app.version.to_s.should == '1.0.0'
|
48
|
+
proc {app.tag_and_push(:major)}.should raise_error
|
45
49
|
|
46
50
|
}
|
47
51
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tumbler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 10
|
10
|
+
version: 0.0.10
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Joshua Hull
|
@@ -116,6 +116,20 @@ dependencies:
|
|
116
116
|
requirement: *id007
|
117
117
|
type: :development
|
118
118
|
name: fakeweb
|
119
|
+
- !ruby/object:Gem::Dependency
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
122
|
+
none: false
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
hash: 3
|
127
|
+
segments:
|
128
|
+
- 0
|
129
|
+
version: "0"
|
130
|
+
requirement: *id008
|
131
|
+
type: :development
|
132
|
+
name: mocha
|
119
133
|
description: Description
|
120
134
|
email: joshbuddy@gmail.com
|
121
135
|
executables:
|