tumbler 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ == 0.0.16
2
+
3
+ * No longer need to manipulate $" (Joshua Hull, 4f9eee3)
4
+ * Favour creating an explicit helper vs using a constant (Joshua Hull, 3b42cae)
5
+ * Remove space before parentheses. (Joshua Hull, 1a08408)
6
+
1
7
  == 0.0.15
2
8
 
3
9
  * Nicer output for generation and updating (Joshua Hull, ef03bbe)
@@ -66,6 +66,38 @@ If you'd prefer to have the tumbler tasks namespaced, provide use_rake_tasks wit
66
66
 
67
67
  Tumbler.use_rake_tasks('tumbler')
68
68
 
69
+ Within your gemspec then, you would have something like tumbler's gemspec:
70
+
71
+ # -*- encoding: utf-8 -*-
72
+
73
+ require 'lib/tumbler'
74
+
75
+ tumbler = Tumbler::GemspecHelper.new
76
+
77
+ Gem::Specification.new do |s|
78
+ s.name = tumbler.name
79
+ s.version = tumbler.version
80
+
81
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
82
+ s.rubyforge_project = tumbler.name
83
+ s.authors = ["Joshua Hull"]
84
+ s.date = tumbler.date
85
+ s.description = "Let's make gem development fun! Tumbler provides common gem management tasks using a common set of 'best practices' out of the box."
86
+ s.summary = "Common gem generation and management tasks"
87
+ s.email = %q{joshbuddy@gmail.com}
88
+ s.extra_rdoc_files = tumbler.files('README.rdoc')
89
+ s.files = tumbler.files
90
+ s.homepage = %q{http://github.com/joshbuddy/tumbler}
91
+ s.rdoc_options = ["--charset=UTF-8"]
92
+ s.require_paths = ["lib"]
93
+ s.rubygems_version = %q{1.3.7}
94
+ s.test_files = tumbler.files(/^spec/)
95
+ s.executables = tumbler.bin_files
96
+
97
+ # dependencies
98
+ tumbler.inject_dependencies(s)
99
+ end
100
+
69
101
  === Available Rake Tasks
70
102
 
71
103
  Once you've got Tumbler up and running in your gem, you will have access to the following tasks:
@@ -1,25 +1,25 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
- require 'tumbler/gemspec'
3
+ require 'tumbler'
4
+ tumbler = Tumbler::GemspecHelper.new
4
5
 
5
6
  Gem::Specification.new do |s|
6
- s.name = <%= @name.inspect %>
7
- s.version = Tumbler::Gemspec.version
8
-
7
+ s.name = tumbler.name
8
+ s.version = tumbler.version
9
9
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
10
- s.rubyforge_project = <%= @name.inspect %>
10
+ s.rubyforge_project = tumbler.name
11
11
  s.authors = <%=[git_name].inspect%>
12
- s.date = Tumbler::Gemspec.date
12
+ s.date = tumbler.date
13
13
  s.description = %q{Description}
14
14
  s.email = <%=git_email.inspect%>
15
- s.files = Tumbler::Gemspec.files
15
+ s.files = tumbler.files
16
16
  # s.homepage = %q{http://github.com/<%= github_user %>/<%= @name %>}
17
17
  s.rdoc_options = ["--charset=UTF-8"]
18
18
  s.require_paths = ["lib"]
19
19
  s.rubygems_version = %q{1.3.7}
20
20
  s.summary = %q{This is awesome.}
21
- s.test_files = Tumbler::Gemspec.files(/^test/)
21
+ s.test_files = tumbler.files(/^test/)
22
22
 
23
23
  # dependencies
24
- Tumbler::Gemspec.inject_dependencies(s)
24
+ tumbler.inject_dependencies(s)
25
25
  end
@@ -1,3 +1,16 @@
1
+ warn <<-HERE_DOC
2
+ It's probably a lot better to use Tumbler within your gemspec the follow way:
3
+
4
+ require 'tumbler'
5
+ tumbler = Tumbler::GemspecHelper.new
6
+
7
+ As opposed to:
8
+
9
+ require 'tumbler/gemspec'
10
+
11
+ The gemspec helper will have all the same methods as the Tumbler::Gemspec constant used before.
12
+ HERE_DOC
13
+
1
14
  require File.join(File.dirname(__FILE__), '..', 'tumbler') unless Kernel.const_defined?(:Tumbler)
2
15
  root = File.expand_path(File.dirname(Callsite.parse(caller).find{|c| c.filename =~ /\.gemspec$/}.filename))
3
16
  Tumbler.send(:remove_const, :Gemspec) if (Tumbler.const_defined?(:Gemspec))
@@ -1,6 +1,10 @@
1
1
  module Tumbler
2
2
  class GemspecHelper
3
- def initialize(manager)
3
+ def initialize(manager = nil)
4
+ unless manager
5
+ root = File.expand_path(File.dirname(Callsite.parse(caller).find{|c| c.filename =~ /\.gemspec$/}.filename))
6
+ manager = Tumbler.load(root)
7
+ end
4
8
  @manager = manager
5
9
  end
6
10
 
@@ -6,7 +6,7 @@ module Tumbler
6
6
  Colors = [:green, :cyan, :blue, :magenta]
7
7
 
8
8
  def inform(msg, &block)
9
- $stderr.puts (' ' * $informer_indent << msg.color(Colors[$informer_indent % Colors.size]))
9
+ $stderr.puts(' ' * $informer_indent << msg.color(Colors[$informer_indent % Colors.size]))
10
10
  $informer_indent += 1
11
11
  begin
12
12
  block.call if block
@@ -42,7 +42,7 @@ module Tumbler
42
42
  raise # (see below)
43
43
 
44
44
  # You probably want to use inject the dependencies using either
45
- # add_bundler_depenedencies or Tumbler::Gemspec.inject_dependencies(spec) (where spec is your Gemspec)
45
+ # add_bundler_depenedencies or tumbler.inject_dependencies(spec) (where spec is your Gemspec)
46
46
  HERE_DOC
47
47
  end
48
48
  end
@@ -1,3 +1,3 @@
1
1
  module Tumbler
2
- VERSION = '0.0.15'
2
+ VERSION = '0.0.16'
3
3
  end
@@ -2,7 +2,6 @@ require File.join(File.dirname(__FILE__),'teststrap')
2
2
 
3
3
  context "Manager::Changelog" do
4
4
  setup { $".delete "tumbler/gemspec.rb" }
5
- teardown { $".delete "tumbler/gemspec.rb" } # we need to delete this so each gemspec can be generated fresh
6
5
 
7
6
  context "generates changelog" do
8
7
  setup { @tumbler, @dir, @test_dir = create_app('test') }
@@ -2,7 +2,6 @@ require File.join(File.dirname(__FILE__),'teststrap')
2
2
 
3
3
  context "Generate" do
4
4
  setup { @test_dir = temp_dir('test') }
5
- teardown { $".delete "tumbler/gemspec.rb" } # we need to delete this so each gemspec can be generated fresh
6
5
  teardown{ FileUtils.rm_rf(@test_dir) }
7
6
 
8
7
  context "suppress changelog creation if disabled" do
@@ -12,7 +12,6 @@ context "Updater" do
12
12
  end
13
13
  teardown do
14
14
  FileUtils.rm_rf @target
15
- $".delete "tumbler/gemspec.rb" # we need to delete this so each gemspec can be generated fresh
16
15
  end
17
16
 
18
17
  context "fetches the version number" do
@@ -65,7 +64,7 @@ context "Updater" do
65
64
  Tumbler::Updater.new("#{@target}/rails", :name => 'rails').update
66
65
  end
67
66
  asserts("finds inject_dependencies once") do
68
- File.read("#{@target}/rails/rails.gemspec").scan(/Tumbler::Gemspec.inject_dependencies/)
67
+ File.read("#{@target}/rails/rails.gemspec").scan(/tumbler.inject_dependencies/)
69
68
  end.size 1
70
69
  end
71
70
 
@@ -1,27 +1,29 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
- require 'lib/tumbler/gemspec'
3
+ require 'lib/tumbler'
4
+
5
+ tumbler = Tumbler::GemspecHelper.new
4
6
 
5
7
  Gem::Specification.new do |s|
6
- s.name = Tumbler::Gemspec.name
7
- s.version = Tumbler::Gemspec.version
8
+ s.name = tumbler.name
9
+ s.version = tumbler.version
8
10
 
9
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
10
- s.rubyforge_project = Tumbler::Gemspec.name
12
+ s.rubyforge_project = tumbler.name
11
13
  s.authors = ["Joshua Hull"]
12
- s.date = Tumbler::Gemspec.date
14
+ s.date = tumbler.date
13
15
  s.description = "Let's make gem development fun! Tumbler provides common gem management tasks using a common set of 'best practices' out of the box."
14
16
  s.summary = "Common gem generation and management tasks"
15
17
  s.email = %q{joshbuddy@gmail.com}
16
- s.extra_rdoc_files = Tumbler::Gemspec.files('README.rdoc')
17
- s.files = Tumbler::Gemspec.files
18
+ s.extra_rdoc_files = tumbler.files('README.rdoc')
19
+ s.files = tumbler.files
18
20
  s.homepage = %q{http://github.com/joshbuddy/tumbler}
19
21
  s.rdoc_options = ["--charset=UTF-8"]
20
22
  s.require_paths = ["lib"]
21
23
  s.rubygems_version = %q{1.3.7}
22
- s.test_files = Tumbler::Gemspec.files(/^spec/)
23
- s.executables = Tumbler::Gemspec.bin_files
24
+ s.test_files = tumbler.files(/^spec/)
25
+ s.executables = tumbler.bin_files
24
26
 
25
27
  # dependencies
26
- Tumbler::Gemspec.inject_dependencies(s)
28
+ tumbler.inject_dependencies(s)
27
29
  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: 1
4
+ hash: 63
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 15
10
- version: 0.0.15
9
+ - 16
10
+ version: 0.0.16
11
11
  platform: ruby
12
12
  authors:
13
13
  - Joshua Hull