tumbler 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG CHANGED
@@ -1,3 +1,11 @@
1
+ == 0.0.2
2
+
3
+
4
+
5
+ == 0.0.1
6
+
7
+ * added current directory to load path (Joshua Hull, 45c5db5)
8
+
1
9
  == 0.0.1
2
10
 
3
11
  * rollback version (Joshua Hull, 5c14fd9)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -1,9 +1,9 @@
1
1
  class Tumbler
2
- class Raketasks
2
+ class RakeTasks
3
3
 
4
4
  def self.register(base, name)
5
5
  if manager = Tumbler.load(base)
6
- tasks = Raketasks.new(manager)
6
+ tasks = RakeTasks.new(manager)
7
7
  tasks.activate_project_tasks(name)
8
8
  else
9
9
  raise "This is not properly configured for tumbler probably due to a lack of a Tumbler configuration file."
@@ -33,18 +33,7 @@ class Tumbler
33
33
  end
34
34
  end
35
35
 
36
- namespace :git do
37
- task :check_clean do
38
- @manager.clean? or raise("There are files that need to be committed first.")
39
- end
40
-
41
- task :check_uptodate do
42
- @manager.update or raise("Unable to update first.")
43
- end
44
- end
45
-
46
36
  namespace :version do
47
-
48
37
  desc "Tag current version into git"
49
38
  task :tag do
50
39
  @manager.tag
@@ -62,9 +51,19 @@ class Tumbler
62
51
  @manager.bump_and_commit(field)
63
52
  end
64
53
 
54
+ task :push do
55
+ @manager.tag_and_push(field)
56
+ end
57
+
58
+ desc "Bump version from #{@manager.version.to_s} -> #{@manager.version.value.bump(field).to_s} and push"
59
+ task :release do
60
+ @manager.bump_and_push(field)
61
+ end
62
+
65
63
  desc "Bump version from #{@manager.version.to_s} -> #{@manager.version.value.bump(field).to_s} and push"
66
64
  task :release do
67
65
  @manager.bump_and_push(field)
66
+ @manager.gem.push
68
67
  end
69
68
  end
70
69
  end
data/lib/tumbler.rb CHANGED
@@ -3,6 +3,7 @@ require 'versionomy'
3
3
  require 'bundler'
4
4
 
5
5
  Callsite.activate_kernel_dir_methods
6
+
6
7
  $LOAD_PATH << __DIR__
7
8
 
8
9
  require 'tumbler/runner'
@@ -31,7 +32,7 @@ class Tumbler
31
32
 
32
33
  def self.use_rake_tasks(name = nil)
33
34
  root = File.dirname(Callsite.parse(caller).find{|c| c.filename =~ /Rakefile/}.filename)
34
- Tumbler::Raketasks.register(File.expand_path(root), name)
35
+ Tumbler::RakeTasks.register(File.expand_path(root), name)
35
36
  end
36
37
 
37
38
  def self.load(base)
data/spec/spec_helper.rb CHANGED
@@ -6,7 +6,7 @@ $LOAD_PATH << File.join(File.basename(__FILE__), '..', 'lib')
6
6
 
7
7
  require 'tumbler'
8
8
 
9
- def create_app(name, opts = {})
9
+ def create_app(name = 'test', opts = {})
10
10
  temp_dir(name) do |dir|
11
11
  temp_dir("remote-#{name}.git") do |remote_dir|
12
12
  Tumbler::Generate.app(dir, name, opts).write
@@ -0,0 +1,80 @@
1
+ require 'spec/spec_helper'
2
+
3
+ describe Tumbler do
4
+ before(:all) do
5
+ ENV['RUBYLIB'] = File.expand_path(File.join(__DIR__, '..', 'lib'))
6
+ end
7
+
8
+ #before(:each) do
9
+ # dir = File.expand_path(File.join(__DIR__, 'tmp'))
10
+ # FileUtils.mkdir_p(dir)
11
+ # @dir, @app = create_bare_app('test', :dir => dir)
12
+ #end
13
+ #
14
+ #after(:each) do
15
+ # FileUtils.rm_rf(@dir)
16
+ # $".delete "tumbler/gemspec.rb" # we need to delete this so each gemspec can be generated fresh
17
+ #end
18
+
19
+ it "should gem.build" do
20
+ create_app do |app|
21
+ app.gem.build
22
+ File.exist?("#{app.base}/test-0.0.0.gem").should be_true
23
+ end
24
+ end
25
+
26
+ context "version bumping" do
27
+ it "shouldn't write a new tag" do
28
+ create_app do |app|
29
+ app.bump_and_commit(:minor)
30
+ app.tags.should == ['0.0.0']
31
+ end
32
+ end
33
+
34
+ it "should increment the locally stored version" do
35
+ create_app do |app|
36
+ app.bump_and_commit(:minor)
37
+ app.reload
38
+ app.version.to_s.should == '0.1.0'
39
+ end
40
+ end
41
+
42
+ it "should successfully push after a bump" do
43
+ create_app do |app|
44
+ app.bump_and_commit(:minor)
45
+ app.tag_and_push
46
+ app.reload
47
+ app.version.to_s.should == '0.1.0'
48
+ app.tags.should == %w(0.0.0 0.1.0)
49
+ end
50
+ end
51
+ end
52
+
53
+ context "version bumping & pushing" do
54
+ it "should create a nice changelog" do
55
+ create_app do |app|
56
+ app.sh 'touch test1; git add test1; git commit test1 -m"Added test1"'
57
+ app.bump_and_push(:minor)
58
+ app.sh 'touch test2; git add test2; git commit test2 -m"Added test2"'
59
+ app.sh 'touch test2-1; git add test2-1; git commit test2-1 -m"Added test2-1"'
60
+ app.bump_and_push(:minor)
61
+ app.sh 'touch test3; git add test3; git commit test3 -m"Added test3"'
62
+ app.bump_and_push(:minor)
63
+ app.sh 'touch test4; git add test4; git commit test4 -m"Added test4"'
64
+ app.bump_and_push(:minor)
65
+ app.reload
66
+ changelog = File.read(app.changelog.file)
67
+ changelog.should match(/== 0\.4\.0\s+\* Added test4 \(.*?\)\n\n==/)
68
+ changelog.should match(/== 0\.3\.0\s+\* Added test3 \(.*?\)\n\n==/)
69
+ changelog.should match(/== 0\.2\.0\s+\* Added test2-1 \(.*?\)\n\* Added test2 \(.*?\)\n\n==/)
70
+ changelog.should match(/== 0\.1\.0\s+\* Added test1 \(.*?\)\n\n$/)
71
+ end
72
+ end
73
+ end
74
+
75
+ #
76
+ # @app.bump_and_commit(:minor)
77
+ # @app.tag_and_push
78
+ #end
79
+
80
+ end
data/test1 ADDED
File without changes
data/thinking2.txt ADDED
@@ -0,0 +1,72 @@
1
+ You left the chat by being disconnected from the server.
2
+ [4:53pm] You were promoted to operator by ChanServ.
3
+ [4:53pm] You rejoined the room.
4
+ [4:53pm] nesquena: the issue is that when using :git => "xxx" in gemfile, bundler is relying on the dynamic gemspec directly
5
+ [4:53pm] nesquena: but its not clear to me why this causes everything to break hard
6
+ [4:54pm] You left the chat by being disconnected from the server.
7
+ [4:54pm] calvino.freenode.net: [freenode-info] channel flooding and no channel staff around to help? Please check with freenode support: http://freenode.net/faq.shtml#gettinghelp
8
+ [4:54pm] You rejoined the room.
9
+ [4:54pm] You were promoted to operator by ChanServ.
10
+ [4:55pm] nesquena: joshbuddy: i noticed tumbler relies on a VERSION file similar to jeweler. for some reason i have heard multiple people recommend using a version.rb file with a GemName::Version syntax instead. have you ever heard that before?
11
+ [4:55pm] nesquena: heres where padrino moved from VERSION to a version.rb: http://github.com/padrino/padrino-framework/issuesearch?state=closed&q=version#issue/88
12
+ [4:55pm] nesquena: and where sinatra did: http://github.com/sinatra/sinatra/commit/e1638a43ad3a5c5ea70db56944a5230cc86e537a
13
+ [4:55pm] achiu joined the chat room.
14
+ [4:55pm] achiu was promoted to operator by ChanServ.
15
+ [4:55pm] joshbuddy: nesquena: oh, well, i'll just follow that then
16
+ [4:55pm] joshbuddy: should be easy to change
17
+ [4:56pm] nesquena: joshbuddy: yea seems like it has partially to do with rip only taking the lib folder
18
+ [4:56pm] joshbuddy: not sure why its best practice though
19
+ [4:56pm] nesquena: joshbuddy: so any attempt to read version fails miserably
20
+ [4:56pm] joshbuddy: oh, i suppose thats valid
21
+ [4:56pm] joshbuddy: i'll fix that, thanks!
22
+ [4:56pm] nesquena: joshbuddy: sure, they sort of discuss it in the comments here: http://github.com/sinatra/sinatra/commit/e1638a43ad3a5c5ea70db56944a5230cc86e537a
23
+ [4:56pm] nesquena: joshbuddy: isnt a big deal but thot id let you know since id like padrino to use tumbler too!
24
+ [4:57pm] joshbuddy: well, i'd like to follow the current state of the art
25
+ [4:57pm] nesquena: joshbuddy: yea i figured as much. tumbler is looking awesome
26
+ [4:58pm] joshbuddy: thanks! just wanna finish it already!
27
+ [4:58pm] nesquena: joshbuddy: and i would love to put it into padrino for 0.9.12
28
+ [4:58pm] joshbuddy: uup
29
+ [4:58pm] joshbuddy: thats the goal
30
+ [4:58pm] joshbuddy: and raise everyone's boats
31
+ [4:59pm] nesquena: joshbuddy: yea i can easily see it taking over for jeweler once the kinks are worked out
32
+ [4:59pm] joshbuddy: yeah, exactly.
33
+ [4:59pm] joshbuddy: but i don't want to release until it does what it minimially promises
34
+ [4:59pm] nesquena: joshbuddy: we should definately put it on rubyflow, im even down to write a padrino blog post about it or you are welcome to also
35
+ [4:59pm] nesquena: joshbuddy: yea definately
36
+ [4:59pm] joshbuddy: and the key there, is really really good testing
37
+ [4:59pm] joshbuddy: yup
38
+ [5:01pm] nesquena: joshbuddy: in padrino the way we update version is just to gsub it into the version.rb file:
39
+ [5:01pm] nesquena: version_text = File.read(version_path).sub(/VERSION = '[\d\.]+'/, "VERSION = '#{args.version}'")
40
+ [5:01pm] nesquena: not sure its the best but it gets the job done
41
+ [5:01pm] joshbuddy: i'll do something like it for now ..
42
+ [5:02pm] nesquena: joshbuddy: yea you can even keep the sytax
43
+ [5:03pm] nesquena: use_version do
44
+ [5:03pm] nesquena: filename 'padrino-core/lib/version.rb'
45
+ [5:03pm] nesquena: end
46
+ [5:03pm] joshbuddy: thats exactly what i'm thinkin'
47
+ [5:03pm] RichGuk: Man you guys talk to quick.
48
+ [5:03pm] RichGuk: *reads up*
49
+ [5:03pm] nesquena: joshbuddy: although im not sure thats better than version_file 'padrino-core/lib/version.rb'
50
+ [5:03pm] nesquena: more dsl declarative
51
+ [5:04pm] joshbuddy: well, i suspect there are other version options ..
52
+ [5:04pm] joshbuddy: in fact, there are ..
53
+ [5:04pm] joshbuddy: its not documented yet, but you can have fields in there..
54
+ [5:04pm] joshbuddy: to indicate which version fields you want to be able to act one
55
+ [5:04pm] joshbuddy: on
56
+ [5:06pm] nesquena: joshbuddy: what do you mean which to act on? like major, tiny, minor?
57
+ [5:06pm] nesquena: what about something like: joshbuddy: i was
58
+ [5:06pm] nesquena: http://gist.github.com/441270
59
+ [5:06pm] joshbuddy: nesquena: exactly
60
+ [5:06pm] nesquena: joshbuddy: ok not a big deal, works either way
61
+ [5:06pm] joshbuddy: oh, thats nicer!
62
+ [5:06pm] joshbuddy: but _file ..
63
+ [5:07pm] joshbuddy: seems odd ..
64
+ [5:07pm] nesquena: joshbuddy: yea because i think in the 80% case it will be much cleaner
65
+ [5:07pm] joshbuddy: when changelog doesn't get it too
66
+ [5:07pm] nesquena: joshbuddy: ok just version then
67
+ [5:07pm] joshbuddy: nono, i'm thinking changelog_file
68
+ [5:07pm] joshbuddy:
69
+ [5:07pm] nesquena: http://gist.github.com/441270
70
+ [5:07pm] nesquena: oh
71
+ [5:07pm] nesquena: haha
72
+ [5:07pm] nesquena: yea that makes sense. i think that looks pretty clean
data/tumbler-0.0.1.gem ADDED
Binary file
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: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Joshua Hull
@@ -151,13 +151,17 @@ files:
151
151
  - spec/generate_spec.rb
152
152
  - spec/spec.opts
153
153
  - spec/spec_helper.rb
154
+ - spec/tasks_spec.rb
154
155
  - spec/updater_spec.rb
155
156
  - spec/version_spec.rb
156
157
  - template/Gemfile
157
158
  - template/Rakefile
158
159
  - template/generic.Tumbler.erb
159
160
  - template/generic.gemspec.erb
161
+ - test1
160
162
  - thinking.txt
163
+ - thinking2.txt
164
+ - tumbler-0.0.1.gem
161
165
  - tumbler.gemspec
162
166
  has_rdoc: true
163
167
  homepage: http://github.com/joshbuddy/tumbler
@@ -200,5 +204,6 @@ test_files:
200
204
  - spec/generate_spec.rb
201
205
  - spec/spec.opts
202
206
  - spec/spec_helper.rb
207
+ - spec/tasks_spec.rb
203
208
  - spec/updater_spec.rb
204
209
  - spec/version_spec.rb