technicalpickles-jeweler 1.1.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/ChangeLog.markdown +28 -0
- data/README.markdown +13 -0
- data/Rakefile +4 -53
- data/VERSION.yml +2 -2
- data/jeweler.gemspec +9 -2
- data/lib/jeweler.rb +12 -1
- data/lib/jeweler/commands.rb +2 -0
- data/lib/jeweler/commands/check_dependencies.rb +52 -0
- data/lib/jeweler/commands/release_to_gemcutter.rb +27 -0
- data/lib/jeweler/gemcutter_tasks.rb +35 -0
- data/lib/jeweler/generator.rb +24 -16
- data/lib/jeweler/generator/bacon_mixin.rb +4 -0
- data/lib/jeweler/generator/micronaut_mixin.rb +3 -0
- data/lib/jeweler/generator/minitest_mixin.rb +3 -0
- data/lib/jeweler/generator/options.rb +4 -0
- data/lib/jeweler/generator/rdoc_mixin.rb +9 -0
- data/lib/jeweler/generator/rspec_mixin.rb +3 -0
- data/lib/jeweler/generator/shoulda_mixin.rb +3 -0
- data/lib/jeweler/generator/yard_mixin.rb +14 -0
- data/lib/jeweler/tasks.rb +18 -0
- data/lib/jeweler/templates/Rakefile +11 -2
- data/test/jeweler/commands/test_release_to_gemcutter.rb +39 -0
- data/test/test_helper.rb +20 -0
- metadata +9 -2
data/ChangeLog.markdown
CHANGED
@@ -1,3 +1,31 @@
|
|
1
|
+
# jeweler 1.2.0 2009-08-06
|
2
|
+
* Generator now adds development dependencies appropriate to your testing framework
|
3
|
+
* Added check_dependencies tasks for verifying gem dependencies are installed
|
4
|
+
* Fixed typo in generated yard task
|
5
|
+
* Fixed generator from having a lot of extra newlines
|
6
|
+
|
7
|
+
# jeweler 1.1.0 2009-08-05
|
8
|
+
|
9
|
+
* Support for generating a project that uses yard instead of rdoc
|
10
|
+
* Generated gemspec now includes comments about it being generated by jeweler
|
11
|
+
* Only use sudo for installing on non-windows platforms [#1]
|
12
|
+
* Fixed rake release to be repeatable on the same version [#16]
|
13
|
+
* Fixed rake rubyforge:setup to not create duplicate packages
|
14
|
+
* Use a more recent version of ruby-git
|
15
|
+
* Fixes various issues with reading values out of ~/.gitconfig [#26] [#21] [#19]
|
16
|
+
* Experimenting with a rake task to check development time dependencies [#22]
|
17
|
+
* Fixed generated rdoc task to load from VERSION instead of VERSION.yml
|
18
|
+
|
19
|
+
# jeweler 1.0.2 2009-07-29
|
20
|
+
|
21
|
+
* Don't include git ignored files for default gemspec's files and test_files
|
22
|
+
* Fixed rspec generator to allow specs to be run directly
|
23
|
+
* Removed misleading docstring for version_required rake task [#17]
|
24
|
+
* Includes some notes about contributed in generated README
|
25
|
+
* Added support for generating a project to use reek and roodi
|
26
|
+
|
27
|
+
# jeweler 1.0.1 2009-05-15
|
28
|
+
|
1
29
|
# jeweler 0.11.1
|
2
30
|
|
3
31
|
* Lots of internal refactorings to how project generation happens
|
data/README.markdown
CHANGED
@@ -53,6 +53,7 @@ It supports a number of options:
|
|
53
53
|
* --shoulda: generate test_helper.rb and test ready for shoulda (this is the default)
|
54
54
|
* --rspec: generate spec_helper.rb and spec ready for rspec
|
55
55
|
* --bacon: generate spec_helper.rb and spec ready for bacon
|
56
|
+
* --gemcutter: setup releasing to gemcutter
|
56
57
|
* --rubyforge: setup releasing to rubyforge
|
57
58
|
|
58
59
|
### Default options
|
@@ -98,6 +99,18 @@ It does the following for you:
|
|
98
99
|
* Push to GitHub (which results in a gem being build)
|
99
100
|
* Tag the version and push to GitHub
|
100
101
|
|
102
|
+
## Releasing to Gemcutter
|
103
|
+
|
104
|
+
Jeweler can also handle releasing to [Gemcutter](http://gemcutter.org). There are a few steps you need to do before doing any Gemcutter releases with Jeweler:
|
105
|
+
|
106
|
+
* [Create an account on Gemcutter](http://gemcutter.org/sign_up)
|
107
|
+
* Install the Gemcutter gem: sudo gem install gemcutter
|
108
|
+
* Run 'gemcutter tumble' to set up gemcutter
|
109
|
+
|
110
|
+
With all that setup out of the way, you can now release to Gemcutter with impunity. This would release the current version of your gem.
|
111
|
+
|
112
|
+
$ rake gemcutter:release
|
113
|
+
|
101
114
|
## Releasing to RubyForge
|
102
115
|
|
103
116
|
Jeweler can also handle releasing to [RubyForge](http://rubyforge.org). There are a few steps you need to do before doing any RubyForge releases with Jeweler:
|
data/Rakefile
CHANGED
@@ -28,6 +28,8 @@ begin
|
|
28
28
|
gem.add_development_dependency "redgreen"
|
29
29
|
end
|
30
30
|
|
31
|
+
Jeweler::GemcutterTasks.new
|
32
|
+
|
31
33
|
Jeweler::RubyforgeTasks.new do |t|
|
32
34
|
t.doc_task = :yardoc
|
33
35
|
end
|
@@ -90,63 +92,12 @@ rescue LoadError
|
|
90
92
|
end
|
91
93
|
end
|
92
94
|
|
93
|
-
begin
|
94
|
-
require 'rake/contrib/sshpublisher'
|
95
|
-
namespace :rubyforge do
|
96
|
-
|
97
|
-
desc "Release gem and RDoc documentation to RubyForge"
|
98
|
-
task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
|
99
|
-
|
100
|
-
namespace :release do
|
101
|
-
desc "Publish RDoc to RubyForge."
|
102
|
-
task :docs => [:rdoc] do
|
103
|
-
config = YAML.load(
|
104
|
-
File.read(File.expand_path('~/.rubyforge/user-config.yml'))
|
105
|
-
)
|
106
|
-
|
107
|
-
host = "#{config['username']}@rubyforge.org"
|
108
|
-
remote_dir = "/var/www/gforge-projects/pickles"
|
109
|
-
local_dir = 'rdoc'
|
110
|
-
|
111
|
-
Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
|
112
|
-
end
|
113
|
-
end
|
114
|
-
end
|
115
|
-
rescue LoadError
|
116
|
-
puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
|
117
|
-
end
|
118
|
-
|
119
95
|
if ENV["RUN_CODE_RUN"] == "true"
|
120
96
|
task :default => [:test, :features]
|
121
97
|
else
|
122
98
|
task :default => :test
|
123
99
|
end
|
124
100
|
|
125
|
-
namespace :development_dependencies do
|
126
|
-
task :check do
|
127
|
-
missing_dependencies = Rake.application.jeweler.gemspec.development_dependencies.select do |dependency|
|
128
|
-
begin
|
129
|
-
Gem.activate dependency.name, dependency.version_requirements.to_s
|
130
|
-
false
|
131
|
-
rescue LoadError => e
|
132
|
-
true
|
133
|
-
end
|
134
|
-
end
|
135
|
-
|
136
|
-
#require 'ruby-debug'; breakpoint
|
137
|
-
|
138
|
-
if missing_dependencies.empty?
|
139
|
-
puts "Development dependencies seem to be installed."
|
140
|
-
else
|
141
|
-
puts "Missing some dependencies. Install them with the following commands:"
|
142
|
-
missing_dependencies.each do |dependency|
|
143
|
-
puts %Q{\tgem install #{dependency.name} --version "#{dependency.version_requirements}"}
|
144
|
-
end
|
145
|
-
abort "Run the specified gem commands before trying to run this again: #{$0} #{ARGV.join(' ')}"
|
146
|
-
end
|
147
|
-
|
148
|
-
end
|
149
|
-
end
|
150
101
|
|
151
|
-
task :test =>
|
152
|
-
task :features =>
|
102
|
+
task :test => :check_dependencies
|
103
|
+
task :features => :check_dependencies
|
data/VERSION.yml
CHANGED
data/jeweler.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{jeweler}
|
8
|
-
s.version = "1.1
|
8
|
+
s.version = "1.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Josh Nichols"]
|
12
|
-
s.date = %q{2009-08-
|
12
|
+
s.date = %q{2009-08-18}
|
13
13
|
s.default_executable = %q{jeweler}
|
14
14
|
s.description = %q{Simple and opinionated helper for creating Rubygem projects on GitHub}
|
15
15
|
s.email = %q{josh@technicalpickles.com}
|
@@ -51,8 +51,10 @@ Gem::Specification.new do |s|
|
|
51
51
|
"lib/jeweler.rb",
|
52
52
|
"lib/jeweler/commands.rb",
|
53
53
|
"lib/jeweler/commands/build_gem.rb",
|
54
|
+
"lib/jeweler/commands/check_dependencies.rb",
|
54
55
|
"lib/jeweler/commands/install_gem.rb",
|
55
56
|
"lib/jeweler/commands/release.rb",
|
57
|
+
"lib/jeweler/commands/release_to_gemcutter.rb",
|
56
58
|
"lib/jeweler/commands/release_to_rubyforge.rb",
|
57
59
|
"lib/jeweler/commands/setup_rubyforge.rb",
|
58
60
|
"lib/jeweler/commands/validate_gemspec.rb",
|
@@ -63,6 +65,7 @@ Gem::Specification.new do |s|
|
|
63
65
|
"lib/jeweler/commands/version/write.rb",
|
64
66
|
"lib/jeweler/commands/write_gemspec.rb",
|
65
67
|
"lib/jeweler/errors.rb",
|
68
|
+
"lib/jeweler/gemcutter_tasks.rb",
|
66
69
|
"lib/jeweler/gemspec_helper.rb",
|
67
70
|
"lib/jeweler/generator.rb",
|
68
71
|
"lib/jeweler/generator/application.rb",
|
@@ -70,9 +73,11 @@ Gem::Specification.new do |s|
|
|
70
73
|
"lib/jeweler/generator/micronaut_mixin.rb",
|
71
74
|
"lib/jeweler/generator/minitest_mixin.rb",
|
72
75
|
"lib/jeweler/generator/options.rb",
|
76
|
+
"lib/jeweler/generator/rdoc_mixin.rb",
|
73
77
|
"lib/jeweler/generator/rspec_mixin.rb",
|
74
78
|
"lib/jeweler/generator/shoulda_mixin.rb",
|
75
79
|
"lib/jeweler/generator/testunit_mixin.rb",
|
80
|
+
"lib/jeweler/generator/yard_mixin.rb",
|
76
81
|
"lib/jeweler/rubyforge_tasks.rb",
|
77
82
|
"lib/jeweler/specification.rb",
|
78
83
|
"lib/jeweler/tasks.rb",
|
@@ -127,6 +132,7 @@ Gem::Specification.new do |s|
|
|
127
132
|
"test/jeweler/commands/test_build_gem.rb",
|
128
133
|
"test/jeweler/commands/test_install_gem.rb",
|
129
134
|
"test/jeweler/commands/test_release.rb",
|
135
|
+
"test/jeweler/commands/test_release_to_gemcutter.rb",
|
130
136
|
"test/jeweler/commands/test_release_to_rubyforge.rb",
|
131
137
|
"test/jeweler/commands/test_setup_rubyforge.rb",
|
132
138
|
"test/jeweler/commands/test_validate_gemspec.rb",
|
@@ -166,6 +172,7 @@ Gem::Specification.new do |s|
|
|
166
172
|
"test/jeweler/commands/test_build_gem.rb",
|
167
173
|
"test/jeweler/commands/test_install_gem.rb",
|
168
174
|
"test/jeweler/commands/test_release.rb",
|
175
|
+
"test/jeweler/commands/test_release_to_gemcutter.rb",
|
169
176
|
"test/jeweler/commands/test_release_to_rubyforge.rb",
|
170
177
|
"test/jeweler/commands/test_setup_rubyforge.rb",
|
171
178
|
"test/jeweler/commands/test_validate_gemspec.rb",
|
data/lib/jeweler.rb
CHANGED
@@ -13,6 +13,7 @@ require 'jeweler/generator/application'
|
|
13
13
|
require 'jeweler/commands'
|
14
14
|
|
15
15
|
require 'jeweler/tasks'
|
16
|
+
require 'jeweler/gemcutter_tasks'
|
16
17
|
require 'jeweler/rubyforge_tasks'
|
17
18
|
|
18
19
|
require 'jeweler/specification'
|
@@ -120,7 +121,11 @@ class Jeweler
|
|
120
121
|
def release
|
121
122
|
Jeweler::Commands::Release.build_for(self).run
|
122
123
|
end
|
123
|
-
|
124
|
+
|
125
|
+
def release_gem_to_gemcutter
|
126
|
+
Jeweler::Commands::ReleaseToGemcutter.build_for(self).run
|
127
|
+
end
|
128
|
+
|
124
129
|
def release_gem_to_rubyforge
|
125
130
|
Jeweler::Commands::ReleaseToRubyforge.build_for(self).run
|
126
131
|
end
|
@@ -129,6 +134,12 @@ class Jeweler
|
|
129
134
|
Jeweler::Commands::SetupRubyforge.build_for(self).run
|
130
135
|
end
|
131
136
|
|
137
|
+
def check_dependencies(type = nil)
|
138
|
+
command = Jeweler::Commands::CheckDependencies.build_for(self)
|
139
|
+
command.type = type
|
140
|
+
|
141
|
+
command.run
|
142
|
+
end
|
132
143
|
|
133
144
|
def in_git_repo?
|
134
145
|
File.exists?(File.join(self.base_dir, '.git'))
|
data/lib/jeweler/commands.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
require 'jeweler/commands/build_gem'
|
2
2
|
require 'jeweler/commands/install_gem'
|
3
|
+
require 'jeweler/commands/check_dependencies'
|
3
4
|
require 'jeweler/commands/release'
|
5
|
+
require 'jeweler/commands/release_to_gemcutter'
|
4
6
|
require 'jeweler/commands/release_to_rubyforge'
|
5
7
|
require 'jeweler/commands/setup_rubyforge'
|
6
8
|
require 'jeweler/commands/validate_gemspec'
|
@@ -0,0 +1,52 @@
|
|
1
|
+
class Jeweler
|
2
|
+
module Commands
|
3
|
+
class CheckDependencies
|
4
|
+
class MissingDependenciesError < RuntimeError
|
5
|
+
attr_accessor :dependencies, :type
|
6
|
+
end
|
7
|
+
|
8
|
+
attr_accessor :gemspec, :type
|
9
|
+
|
10
|
+
def run
|
11
|
+
missing_dependencies = dependencies.select do |dependency|
|
12
|
+
begin
|
13
|
+
Gem.activate dependency.name, dependency.version_requirements.to_s
|
14
|
+
false
|
15
|
+
rescue LoadError => e
|
16
|
+
true
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
if missing_dependencies.empty?
|
21
|
+
puts "#{type || 'All'} dependencies seem to be installed."
|
22
|
+
else
|
23
|
+
puts "Missing some dependencies. Install them with the following commands:"
|
24
|
+
missing_dependencies.each do |dependency|
|
25
|
+
puts %Q{\tgem install #{dependency.name} --version "#{dependency.version_requirements}"}
|
26
|
+
end
|
27
|
+
|
28
|
+
abort "Run the specified gem commands before trying to run this again: #{$0} #{ARGV.join(' ')}"
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
def dependencies
|
34
|
+
case type
|
35
|
+
when :runtime, :development
|
36
|
+
gemspec.send("#{type}_dependencies")
|
37
|
+
else
|
38
|
+
gemspec.dependencies
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.build_for(jeweler)
|
44
|
+
command = new
|
45
|
+
|
46
|
+
command.gemspec = jeweler.gemspec
|
47
|
+
|
48
|
+
command
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class Jeweler
|
2
|
+
module Commands
|
3
|
+
class ReleaseToGemcutter
|
4
|
+
attr_accessor :gemspec, :version, :output, :gemspec_helper
|
5
|
+
|
6
|
+
def initialize
|
7
|
+
self.output = $stdout
|
8
|
+
end
|
9
|
+
|
10
|
+
def run
|
11
|
+
command = "gem push #{@gemspec_helper.gem_path}"
|
12
|
+
output.puts "Executing #{command.inspect}:"
|
13
|
+
sh command
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.build_for(jeweler)
|
17
|
+
command = new
|
18
|
+
command.gemspec = jeweler.gemspec
|
19
|
+
command.gemspec_helper = jeweler.gemspec_helper
|
20
|
+
command.version = jeweler.version
|
21
|
+
command.output = jeweler.output
|
22
|
+
command
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/tasklib'
|
3
|
+
|
4
|
+
class Jeweler
|
5
|
+
# Rake tasks for putting a Jeweler gem on Gemcutter.
|
6
|
+
#
|
7
|
+
# Jeweler::Tasks.new needs to be used before this.
|
8
|
+
#
|
9
|
+
# Basic usage:
|
10
|
+
#
|
11
|
+
# Jeweler::Gemcutter.new
|
12
|
+
#
|
13
|
+
# Easy enough, right?
|
14
|
+
#
|
15
|
+
class GemcutterTasks < ::Rake::TaskLib
|
16
|
+
attr_accessor :jeweler
|
17
|
+
|
18
|
+
def initialize
|
19
|
+
yield self if block_given?
|
20
|
+
|
21
|
+
self.jeweler = Rake.application.jeweler
|
22
|
+
|
23
|
+
define
|
24
|
+
end
|
25
|
+
|
26
|
+
def define
|
27
|
+
namespace :gemcutter do
|
28
|
+
desc "Release gem to Gemcutter"
|
29
|
+
task :release => [:gemspec, :build] do
|
30
|
+
jeweler.release_gem_to_gemcutter
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/lib/jeweler/generator.rb
CHANGED
@@ -11,6 +11,9 @@ require 'jeweler/generator/rspec_mixin'
|
|
11
11
|
require 'jeweler/generator/shoulda_mixin'
|
12
12
|
require 'jeweler/generator/testunit_mixin'
|
13
13
|
|
14
|
+
require 'jeweler/generator/rdoc_mixin'
|
15
|
+
require 'jeweler/generator/yard_mixin'
|
16
|
+
|
14
17
|
class Jeweler
|
15
18
|
class NoGitUserName < StandardError
|
16
19
|
end
|
@@ -29,12 +32,12 @@ class Jeweler
|
|
29
32
|
|
30
33
|
class Generator
|
31
34
|
attr_accessor :target_dir, :user_name, :user_email, :summary,
|
32
|
-
:project_name, :github_username, :github_token,
|
35
|
+
:description, :project_name, :github_username, :github_token,
|
33
36
|
:repo, :should_create_repo,
|
34
37
|
:testing_framework, :documentation_framework,
|
35
|
-
:should_use_cucumber, :
|
36
|
-
:should_use_reek, :should_use_roodi,
|
37
|
-
:
|
38
|
+
:should_use_cucumber, :should_setup_gemcutter,
|
39
|
+
:should_setup_rubyforge, :should_use_reek, :should_use_roodi,
|
40
|
+
:development_dependencies
|
38
41
|
|
39
42
|
DEFAULT_TESTING_FRAMEWORK = :shoulda
|
40
43
|
DEFAULT_DOCUMENTATION_FRAMEWORK = :rdoc
|
@@ -44,6 +47,8 @@ class Jeweler
|
|
44
47
|
raise NoGitHubRepoNameGiven
|
45
48
|
end
|
46
49
|
|
50
|
+
self.development_dependencies = []
|
51
|
+
|
47
52
|
self.project_name = project_name
|
48
53
|
|
49
54
|
self.testing_framework = (options[:testing_framework] || DEFAULT_TESTING_FRAMEWORK).to_sym
|
@@ -56,6 +61,14 @@ class Jeweler
|
|
56
61
|
raise ArgumentError, "Unsupported testing framework (#{testing_framework})"
|
57
62
|
end
|
58
63
|
|
64
|
+
begin
|
65
|
+
generator_mixin_name = "#{self.documentation_framework.to_s.capitalize}Mixin"
|
66
|
+
generator_mixin = self.class.const_get(generator_mixin_name)
|
67
|
+
extend generator_mixin
|
68
|
+
rescue NameError => e
|
69
|
+
raise ArgumentError, "Unsupported documentation framework (#{documentation_framework})"
|
70
|
+
end
|
71
|
+
|
59
72
|
|
60
73
|
self.target_dir = options[:directory] || self.project_name
|
61
74
|
|
@@ -65,8 +78,11 @@ class Jeweler
|
|
65
78
|
self.should_use_cucumber = options[:use_cucumber]
|
66
79
|
self.should_use_reek = options[:use_reek]
|
67
80
|
self.should_use_roodi = options[:use_roodi]
|
81
|
+
self.should_setup_gemcutter = options[:gemcutter]
|
68
82
|
self.should_setup_rubyforge = options[:rubyforge]
|
69
83
|
|
84
|
+
development_dependencies << "cucumber" if should_use_cucumber
|
85
|
+
|
70
86
|
use_user_git_config
|
71
87
|
|
72
88
|
end
|
@@ -131,14 +147,6 @@ class Jeweler
|
|
131
147
|
File.join(features_dir, 'step_definitions')
|
132
148
|
end
|
133
149
|
|
134
|
-
def doc_task
|
135
|
-
case documentation_framework
|
136
|
-
when :yard then "yardoc"
|
137
|
-
else
|
138
|
-
documentation_framework.to_s
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
150
|
protected
|
143
151
|
|
144
152
|
# This is in a separate method so we can stub it out during testing
|
@@ -214,7 +222,7 @@ class Jeweler
|
|
214
222
|
template_contents = File.read(File.join(template_dir, source))
|
215
223
|
template = ERB.new(template_contents, nil, '<>')
|
216
224
|
|
217
|
-
template_result = template.result(binding)
|
225
|
+
template_result = template.result(binding).gsub(/\n\n\n+/, "\n\n")
|
218
226
|
|
219
227
|
File.open(final_destination, 'w') {|file| file.write(template_result)}
|
220
228
|
|
@@ -274,11 +282,11 @@ class Jeweler
|
|
274
282
|
end
|
275
283
|
|
276
284
|
def create_and_push_repo
|
277
|
-
Net::HTTP.post_form URI.parse('http://github.com/
|
285
|
+
Net::HTTP.post_form URI.parse('http://github.com/api/v2/yaml/repos/create'),
|
278
286
|
'login' => github_username,
|
279
287
|
'token' => github_token,
|
280
|
-
'
|
281
|
-
'
|
288
|
+
'description' => summary,
|
289
|
+
'name' => project_name
|
282
290
|
# TODO do a HEAD request to see when it's ready
|
283
291
|
@repo.push('origin')
|
284
292
|
end
|
data/lib/jeweler/tasks.rb
CHANGED
@@ -111,6 +111,24 @@ class Jeweler
|
|
111
111
|
task :release do
|
112
112
|
jeweler.release
|
113
113
|
end
|
114
|
+
|
115
|
+
desc "Check that runtime and development dependencies are installed"
|
116
|
+
task :check_dependencies do
|
117
|
+
jeweler.check_dependencies
|
118
|
+
end
|
119
|
+
|
120
|
+
namespace :check_dependencies do
|
121
|
+
desc "Check that runtime dependencies are installed"
|
122
|
+
task :runtime do
|
123
|
+
jeweler.check_dependencies(:runtime)
|
124
|
+
end
|
125
|
+
|
126
|
+
desc"Check that development dependencies are installed"
|
127
|
+
task :development do
|
128
|
+
jeweler.check_dependencies(:development)
|
129
|
+
end
|
130
|
+
|
131
|
+
end
|
114
132
|
|
115
133
|
end
|
116
134
|
end
|
@@ -12,10 +12,15 @@ begin
|
|
12
12
|
gem.authors = ["<%= user_name %>"]
|
13
13
|
<% if should_setup_rubyforge %>
|
14
14
|
gem.rubyforge_project = "<%= project_name %>"
|
15
|
+
<% end %>
|
16
|
+
<% development_dependencies.each do |dependency| %>
|
17
|
+
gem.add_development_dependency "<%= dependency %>"
|
15
18
|
<% end %>
|
16
19
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
17
20
|
end
|
18
|
-
|
21
|
+
<% if should_setup_gemcutter %>
|
22
|
+
Jeweler::GemcutterTasks.new
|
23
|
+
<% end %>
|
19
24
|
<% if should_setup_rubyforge %>
|
20
25
|
Jeweler::RubyforgeTasks.new do |rubyforge|
|
21
26
|
rubyforge.doc_task = "<%= doc_task %>"
|
@@ -75,10 +80,14 @@ rescue LoadError
|
|
75
80
|
end
|
76
81
|
<% end %>
|
77
82
|
|
83
|
+
task :<%= test_task %> => :check_dependencies
|
84
|
+
|
78
85
|
<% if should_use_cucumber %>
|
79
86
|
begin
|
80
87
|
require 'cucumber/rake/task'
|
81
88
|
Cucumber::Rake::Task.new(:features)
|
89
|
+
|
90
|
+
task :features => :check_dependencies
|
82
91
|
rescue LoadError
|
83
92
|
task :features do
|
84
93
|
abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
|
@@ -138,7 +147,7 @@ begin
|
|
138
147
|
YARD::Rake::YardocTask.new
|
139
148
|
rescue LoadError
|
140
149
|
task :yardoc do
|
141
|
-
abort "
|
150
|
+
abort "YARD is not available. In order to run yardoc, you must: sudo gem install yard"
|
142
151
|
end
|
143
152
|
end
|
144
153
|
<% end %>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class Jeweler
|
4
|
+
module Commands
|
5
|
+
class TestReleaseToGemcutter < Test::Unit::TestCase
|
6
|
+
def self.subject
|
7
|
+
Jeweler::Commands::ReleaseToGemcutter.new
|
8
|
+
end
|
9
|
+
|
10
|
+
gemcutter_command_context "rubyforge_project is defined in gemspec and package exists on rubyforge" do
|
11
|
+
setup do
|
12
|
+
stub(@gemspec_helper).gem_path {'pkg/zomg-1.2.3.gem'}
|
13
|
+
stub(@command).sh
|
14
|
+
@command.run
|
15
|
+
end
|
16
|
+
|
17
|
+
should "push to gemcutter" do
|
18
|
+
push_command = "gem push #{@gemspec_helper.gem_path}"
|
19
|
+
assert_received(@command) { |command| command.sh(push_command) }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
build_command_context "build for jeweler" do
|
24
|
+
setup do
|
25
|
+
@command = Jeweler::Commands::ReleaseToGemcutter.build_for(@jeweler)
|
26
|
+
end
|
27
|
+
|
28
|
+
should "assign gemspec helper" do
|
29
|
+
assert_equal @gemspec_helper, @command.gemspec_helper
|
30
|
+
end
|
31
|
+
|
32
|
+
should "assign output" do
|
33
|
+
assert_equal @output, @command.output
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -70,6 +70,26 @@ class Test::Unit::TestCase
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
+
def self.gemcutter_command_context(description, &block)
|
74
|
+
context description do
|
75
|
+
setup do
|
76
|
+
@command = eval(self.class.name.gsub(/::Test/, '::')).new
|
77
|
+
|
78
|
+
if @command.respond_to? :gemspec_helper=
|
79
|
+
@gemspec_helper = Object.new
|
80
|
+
@command.gemspec_helper = @gemspec_helper
|
81
|
+
end
|
82
|
+
|
83
|
+
if @command.respond_to? :output
|
84
|
+
@output = StringIO.new
|
85
|
+
@command.output = @output
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
context "", &block
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
73
93
|
def self.rubyforge_command_context(description, &block)
|
74
94
|
context description do
|
75
95
|
setup do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: technicalpickles-jeweler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Nichols
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-08-
|
12
|
+
date: 2009-08-18 00:00:00 -07:00
|
13
13
|
default_executable: jeweler
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -124,8 +124,10 @@ files:
|
|
124
124
|
- lib/jeweler.rb
|
125
125
|
- lib/jeweler/commands.rb
|
126
126
|
- lib/jeweler/commands/build_gem.rb
|
127
|
+
- lib/jeweler/commands/check_dependencies.rb
|
127
128
|
- lib/jeweler/commands/install_gem.rb
|
128
129
|
- lib/jeweler/commands/release.rb
|
130
|
+
- lib/jeweler/commands/release_to_gemcutter.rb
|
129
131
|
- lib/jeweler/commands/release_to_rubyforge.rb
|
130
132
|
- lib/jeweler/commands/setup_rubyforge.rb
|
131
133
|
- lib/jeweler/commands/validate_gemspec.rb
|
@@ -136,6 +138,7 @@ files:
|
|
136
138
|
- lib/jeweler/commands/version/write.rb
|
137
139
|
- lib/jeweler/commands/write_gemspec.rb
|
138
140
|
- lib/jeweler/errors.rb
|
141
|
+
- lib/jeweler/gemcutter_tasks.rb
|
139
142
|
- lib/jeweler/gemspec_helper.rb
|
140
143
|
- lib/jeweler/generator.rb
|
141
144
|
- lib/jeweler/generator/application.rb
|
@@ -143,9 +146,11 @@ files:
|
|
143
146
|
- lib/jeweler/generator/micronaut_mixin.rb
|
144
147
|
- lib/jeweler/generator/minitest_mixin.rb
|
145
148
|
- lib/jeweler/generator/options.rb
|
149
|
+
- lib/jeweler/generator/rdoc_mixin.rb
|
146
150
|
- lib/jeweler/generator/rspec_mixin.rb
|
147
151
|
- lib/jeweler/generator/shoulda_mixin.rb
|
148
152
|
- lib/jeweler/generator/testunit_mixin.rb
|
153
|
+
- lib/jeweler/generator/yard_mixin.rb
|
149
154
|
- lib/jeweler/rubyforge_tasks.rb
|
150
155
|
- lib/jeweler/specification.rb
|
151
156
|
- lib/jeweler/tasks.rb
|
@@ -198,6 +203,7 @@ files:
|
|
198
203
|
- test/jeweler/commands/test_build_gem.rb
|
199
204
|
- test/jeweler/commands/test_install_gem.rb
|
200
205
|
- test/jeweler/commands/test_release.rb
|
206
|
+
- test/jeweler/commands/test_release_to_gemcutter.rb
|
201
207
|
- test/jeweler/commands/test_release_to_rubyforge.rb
|
202
208
|
- test/jeweler/commands/test_setup_rubyforge.rb
|
203
209
|
- test/jeweler/commands/test_validate_gemspec.rb
|
@@ -257,6 +263,7 @@ test_files:
|
|
257
263
|
- test/jeweler/commands/test_build_gem.rb
|
258
264
|
- test/jeweler/commands/test_install_gem.rb
|
259
265
|
- test/jeweler/commands/test_release.rb
|
266
|
+
- test/jeweler/commands/test_release_to_gemcutter.rb
|
260
267
|
- test/jeweler/commands/test_release_to_rubyforge.rb
|
261
268
|
- test/jeweler/commands/test_setup_rubyforge.rb
|
262
269
|
- test/jeweler/commands/test_validate_gemspec.rb
|