mcornick-jeweler 1.2.0
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/.gitignore +9 -0
- data/ChangeLog.markdown +111 -0
- data/LICENSE +20 -0
- data/README.markdown +185 -0
- data/ROADMAP +12 -0
- data/Rakefile +103 -0
- data/VERSION.yml +4 -0
- data/bin/jeweler +8 -0
- data/features/generator/cucumber.feature +83 -0
- data/features/generator/directory_layout.feature +76 -0
- data/features/generator/dotdocument.feature +14 -0
- data/features/generator/env_options.feature +9 -0
- data/features/generator/git.feature +94 -0
- data/features/generator/license.feature +11 -0
- data/features/generator/rakefile.feature +151 -0
- data/features/generator/readme.feature +12 -0
- data/features/generator/test.feature +41 -0
- data/features/generator/test_helper.feature +49 -0
- data/features/placeholder.feature +5 -0
- data/features/step_definitions/debug_steps.rb +6 -0
- data/features/step_definitions/filesystem_steps.rb +68 -0
- data/features/step_definitions/generator_steps.rb +284 -0
- data/features/step_definitions/task_steps.rb +6 -0
- data/features/support/env.rb +29 -0
- data/features/tasks/build_gem.feature +9 -0
- data/features/tasks/version.feature +24 -0
- data/features/tasks/version_bumping.feature +33 -0
- data/jeweler.gemspec +225 -0
- data/lib/jeweler.rb +153 -0
- data/lib/jeweler/commands.rb +14 -0
- data/lib/jeweler/commands/build_gem.rb +31 -0
- data/lib/jeweler/commands/check_dependencies.rb +52 -0
- data/lib/jeweler/commands/install_gem.rb +40 -0
- data/lib/jeweler/commands/release.rb +86 -0
- data/lib/jeweler/commands/release_to_rubyforge.rb +51 -0
- data/lib/jeweler/commands/setup_rubyforge.rb +57 -0
- data/lib/jeweler/commands/validate_gemspec.rb +30 -0
- data/lib/jeweler/commands/version/base.rb +41 -0
- data/lib/jeweler/commands/version/bump_major.rb +13 -0
- data/lib/jeweler/commands/version/bump_minor.rb +12 -0
- data/lib/jeweler/commands/version/bump_patch.rb +14 -0
- data/lib/jeweler/commands/version/write.rb +12 -0
- data/lib/jeweler/commands/write_gemspec.rb +39 -0
- data/lib/jeweler/errors.rb +20 -0
- data/lib/jeweler/gemspec_helper.rb +79 -0
- data/lib/jeweler/generator.rb +306 -0
- data/lib/jeweler/generator/application.rb +54 -0
- data/lib/jeweler/generator/bacon_mixin.rb +43 -0
- data/lib/jeweler/generator/micronaut_mixin.rb +41 -0
- data/lib/jeweler/generator/minitest_mixin.rb +42 -0
- data/lib/jeweler/generator/options.rb +102 -0
- data/lib/jeweler/generator/rdoc_mixin.rb +9 -0
- data/lib/jeweler/generator/rspec_mixin.rb +42 -0
- data/lib/jeweler/generator/shoulda_mixin.rb +42 -0
- data/lib/jeweler/generator/testunit_mixin.rb +39 -0
- data/lib/jeweler/generator/yard_mixin.rb +14 -0
- data/lib/jeweler/rubyforge_tasks.rb +98 -0
- data/lib/jeweler/specification.rb +66 -0
- data/lib/jeweler/tasks.rb +135 -0
- data/lib/jeweler/templates/.document +5 -0
- data/lib/jeweler/templates/.gitignore +5 -0
- data/lib/jeweler/templates/LICENSE +20 -0
- data/lib/jeweler/templates/README.rdoc +18 -0
- data/lib/jeweler/templates/Rakefile +153 -0
- data/lib/jeweler/templates/bacon/flunking.rb +7 -0
- data/lib/jeweler/templates/bacon/helper.rb +8 -0
- data/lib/jeweler/templates/features/default.feature +9 -0
- data/lib/jeweler/templates/features/support/env.rb +8 -0
- data/lib/jeweler/templates/micronaut/flunking.rb +7 -0
- data/lib/jeweler/templates/micronaut/helper.rb +17 -0
- data/lib/jeweler/templates/minitest/flunking.rb +7 -0
- data/lib/jeweler/templates/minitest/helper.rb +11 -0
- data/lib/jeweler/templates/rspec/flunking.rb +7 -0
- data/lib/jeweler/templates/rspec/helper.rb +10 -0
- data/lib/jeweler/templates/shoulda/flunking.rb +7 -0
- data/lib/jeweler/templates/shoulda/helper.rb +10 -0
- data/lib/jeweler/templates/testunit/flunking.rb +7 -0
- data/lib/jeweler/templates/testunit/helper.rb +9 -0
- data/lib/jeweler/version_helper.rb +128 -0
- data/test/fixtures/bar/VERSION.yml +4 -0
- data/test/fixtures/bar/bin/foo_the_ultimate_bin +1 -0
- data/test/fixtures/bar/hey_include_me_in_gemspec +0 -0
- data/test/fixtures/bar/lib/foo_the_ultimate_lib.rb +1 -0
- data/test/fixtures/existing-project-with-version-plaintext/.document +5 -0
- data/test/fixtures/existing-project-with-version-plaintext/.gitignore +5 -0
- data/test/fixtures/existing-project-with-version-plaintext/LICENSE +20 -0
- data/test/fixtures/existing-project-with-version-plaintext/README.rdoc +7 -0
- data/test/fixtures/existing-project-with-version-plaintext/Rakefile +82 -0
- data/test/fixtures/existing-project-with-version-plaintext/VERSION +1 -0
- data/test/fixtures/existing-project-with-version-plaintext/existing-project-with-version.gemspec +29 -0
- data/test/fixtures/existing-project-with-version-plaintext/lib/existing_project_with_version.rb +0 -0
- data/test/fixtures/existing-project-with-version-plaintext/test/existing_project_with_version_test.rb +7 -0
- data/test/fixtures/existing-project-with-version-plaintext/test/test_helper.rb +10 -0
- data/test/fixtures/existing-project-with-version-yaml/.document +5 -0
- data/test/fixtures/existing-project-with-version-yaml/.gitignore +5 -0
- data/test/fixtures/existing-project-with-version-yaml/LICENSE +20 -0
- data/test/fixtures/existing-project-with-version-yaml/README.rdoc +7 -0
- data/test/fixtures/existing-project-with-version-yaml/Rakefile +82 -0
- data/test/fixtures/existing-project-with-version-yaml/VERSION.yml +4 -0
- data/test/fixtures/existing-project-with-version-yaml/bin/foo_the_ultimate_bin +0 -0
- data/test/fixtures/existing-project-with-version-yaml/existing-project-with-version.gemspec +29 -0
- data/test/fixtures/existing-project-with-version-yaml/lib/existing_project_with_version.rb +0 -0
- data/test/fixtures/existing-project-with-version-yaml/test/existing_project_with_version_test.rb +7 -0
- data/test/fixtures/existing-project-with-version-yaml/test/test_helper.rb +10 -0
- data/test/geminstaller.yml +12 -0
- data/test/jeweler/commands/test_build_gem.rb +72 -0
- data/test/jeweler/commands/test_install_gem.rb +74 -0
- data/test/jeweler/commands/test_release.rb +362 -0
- data/test/jeweler/commands/test_release_to_rubyforge.rb +157 -0
- data/test/jeweler/commands/test_setup_rubyforge.rb +182 -0
- data/test/jeweler/commands/test_validate_gemspec.rb +27 -0
- data/test/jeweler/commands/test_write_gemspec.rb +92 -0
- data/test/jeweler/commands/version/test_base.rb +32 -0
- data/test/jeweler/commands/version/test_bump_major.rb +22 -0
- data/test/jeweler/commands/version/test_bump_minor.rb +19 -0
- data/test/jeweler/commands/version/test_bump_patch.rb +20 -0
- data/test/jeweler/commands/version/test_write.rb +23 -0
- data/test/shoulda_macros/jeweler_macros.rb +35 -0
- data/test/test_application.rb +139 -0
- data/test/test_gemspec_helper.rb +40 -0
- data/test/test_generator.rb +166 -0
- data/test/test_generator_initialization.rb +156 -0
- data/test/test_generator_mixins.rb +18 -0
- data/test/test_helper.rb +159 -0
- data/test/test_jeweler.rb +174 -0
- data/test/test_options.rb +149 -0
- data/test/test_specification.rb +61 -0
- data/test/test_tasks.rb +35 -0
- data/test/test_version_helper.rb +153 -0
- metadata +283 -0
@@ -0,0 +1,29 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
|
2
|
+
require 'jeweler'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'mocha'
|
6
|
+
require 'output_catcher'
|
7
|
+
rescue LoadError => e
|
8
|
+
puts "*" * 80
|
9
|
+
puts "Some dependencies needed to run tests were missing. Run the following command to find them:"
|
10
|
+
puts
|
11
|
+
puts "\trake development_dependencies:check"
|
12
|
+
puts "*" * 80
|
13
|
+
exit 1
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
require 'test/unit/assertions'
|
18
|
+
|
19
|
+
World(Test::Unit::Assertions)
|
20
|
+
|
21
|
+
def yank_task_info(content, task)
|
22
|
+
if content =~ /#{Regexp.escape(task)}.new(\(.*\))? do \|(.*?)\|(.*?)end/m
|
23
|
+
[$2, $3]
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def fixture_dir
|
28
|
+
File.expand_path File.join(File.dirname(__FILE__), '..', '..', 'test', 'fixtures')
|
29
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Feature: building gems
|
2
|
+
|
3
|
+
Scenario: default
|
4
|
+
Given a working directory
|
5
|
+
And I use the existing project "existing-project-with-version-yaml" as a template
|
6
|
+
And "VERSION.yml" contains hash "{ :major => 1, :minor => 5, :patch => 3}"
|
7
|
+
And "existing-project-with-version/pkg/existing-project-with-version-1.5.3.gem" does not exist
|
8
|
+
When I run "rake build" in "existing-project-with-version-yaml"
|
9
|
+
Then I can gem install "existing-project-with-version-yaml/pkg/existing-project-with-version-1.5.3.gem"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
Feature: version rake task
|
2
|
+
|
3
|
+
#Scenario: a newly created project without a version
|
4
|
+
# Given a working directory
|
5
|
+
# And I use the jeweler command to generate the "the-perfect-gem" project in the working directory
|
6
|
+
# And "the-perfect-gem/VERSION" does not exist
|
7
|
+
# When I run "rake version" in "the-perfect-gem"
|
8
|
+
# Then the process should not exit cleanly
|
9
|
+
|
10
|
+
Scenario: an existing project with version yaml
|
11
|
+
Given a working directory
|
12
|
+
And I use the existing project "existing-project-with-version-yaml" as a template
|
13
|
+
And "VERSION.yml" contains hash "{ :major => 1, :minor => 5, :patch => 3}"
|
14
|
+
When I run "rake version" in "existing-project-with-version-yaml"
|
15
|
+
Then the process should exit cleanly
|
16
|
+
And the current version, 1.5.3, is displayed
|
17
|
+
|
18
|
+
Scenario: an existing project with version plaintext
|
19
|
+
Given a working directory
|
20
|
+
And I use the existing project "existing-project-with-version-plaintext" as a template
|
21
|
+
And "VERSION" contains "1.5.3"
|
22
|
+
When I run "rake version" in "existing-project-with-version-plaintext"
|
23
|
+
Then the process should exit cleanly
|
24
|
+
And the current version, 1.5.3, is displayed
|
@@ -0,0 +1,33 @@
|
|
1
|
+
Feature: bumping version
|
2
|
+
|
3
|
+
Scenario: major version
|
4
|
+
Given a working directory
|
5
|
+
And I use the existing project "existing-project-with-version-yaml" as a template
|
6
|
+
And "VERSION.yml" contains hash "{ :major => 1, :minor => 5, :patch => 3}"
|
7
|
+
When I run "rake version:bump:major" in "existing-project-with-version-yaml"
|
8
|
+
Then the process should exit cleanly
|
9
|
+
And the updated version, 2.0.0, is displayed
|
10
|
+
|
11
|
+
Scenario: minor version
|
12
|
+
Given a working directory
|
13
|
+
And I use the existing project "existing-project-with-version-yaml" as a template
|
14
|
+
And "VERSION.yml" contains hash "{ :major => 1, :minor => 5, :patch => 3}"
|
15
|
+
When I run "rake version:bump:minor" in "existing-project-with-version-yaml"
|
16
|
+
Then the process should exit cleanly
|
17
|
+
And the updated version, 1.6.0, is displayed
|
18
|
+
|
19
|
+
Scenario: patch version
|
20
|
+
Given a working directory
|
21
|
+
And I use the existing project "existing-project-with-version-yaml" as a template
|
22
|
+
And "VERSION.yml" contains hash "{ :major => 1, :minor => 5, :patch => 3}"
|
23
|
+
When I run "rake version:bump:patch" in "existing-project-with-version-yaml"
|
24
|
+
Then the process should exit cleanly
|
25
|
+
And the updated version, 1.5.4, is displayed
|
26
|
+
|
27
|
+
Scenario: arbitrary version
|
28
|
+
Given a working directory
|
29
|
+
And I use the existing project "existing-project-with-version-yaml" as a template
|
30
|
+
And "VERSION.yml" contains hash "{ :major => 1, :minor => 5, :patch => 3}"
|
31
|
+
When I run "rake version:write MAJOR=3 MINOR=7 PATCH=1" in "existing-project-with-version-yaml"
|
32
|
+
Then the process should exit cleanly
|
33
|
+
And the updated version, 3.7.1, is displayed
|
data/jeweler.gemspec
ADDED
@@ -0,0 +1,225 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{jeweler}
|
8
|
+
s.version = "1.2.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Josh Nichols"]
|
12
|
+
s.date = %q{2009-08-06}
|
13
|
+
s.default_executable = %q{jeweler}
|
14
|
+
s.description = %q{Simple and opinionated helper for creating Rubygem projects on GitHub}
|
15
|
+
s.email = %q{josh@technicalpickles.com}
|
16
|
+
s.executables = ["jeweler"]
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"ChangeLog.markdown",
|
19
|
+
"LICENSE",
|
20
|
+
"README.markdown"
|
21
|
+
]
|
22
|
+
s.files = [
|
23
|
+
".gitignore",
|
24
|
+
"ChangeLog.markdown",
|
25
|
+
"LICENSE",
|
26
|
+
"README.markdown",
|
27
|
+
"ROADMAP",
|
28
|
+
"Rakefile",
|
29
|
+
"VERSION.yml",
|
30
|
+
"bin/jeweler",
|
31
|
+
"features/generator/cucumber.feature",
|
32
|
+
"features/generator/directory_layout.feature",
|
33
|
+
"features/generator/dotdocument.feature",
|
34
|
+
"features/generator/env_options.feature",
|
35
|
+
"features/generator/git.feature",
|
36
|
+
"features/generator/license.feature",
|
37
|
+
"features/generator/rakefile.feature",
|
38
|
+
"features/generator/readme.feature",
|
39
|
+
"features/generator/test.feature",
|
40
|
+
"features/generator/test_helper.feature",
|
41
|
+
"features/placeholder.feature",
|
42
|
+
"features/step_definitions/debug_steps.rb",
|
43
|
+
"features/step_definitions/filesystem_steps.rb",
|
44
|
+
"features/step_definitions/generator_steps.rb",
|
45
|
+
"features/step_definitions/task_steps.rb",
|
46
|
+
"features/support/env.rb",
|
47
|
+
"features/tasks/build_gem.feature",
|
48
|
+
"features/tasks/version.feature",
|
49
|
+
"features/tasks/version_bumping.feature",
|
50
|
+
"jeweler.gemspec",
|
51
|
+
"lib/jeweler.rb",
|
52
|
+
"lib/jeweler/commands.rb",
|
53
|
+
"lib/jeweler/commands/build_gem.rb",
|
54
|
+
"lib/jeweler/commands/check_dependencies.rb",
|
55
|
+
"lib/jeweler/commands/install_gem.rb",
|
56
|
+
"lib/jeweler/commands/release.rb",
|
57
|
+
"lib/jeweler/commands/release_to_rubyforge.rb",
|
58
|
+
"lib/jeweler/commands/setup_rubyforge.rb",
|
59
|
+
"lib/jeweler/commands/validate_gemspec.rb",
|
60
|
+
"lib/jeweler/commands/version/base.rb",
|
61
|
+
"lib/jeweler/commands/version/bump_major.rb",
|
62
|
+
"lib/jeweler/commands/version/bump_minor.rb",
|
63
|
+
"lib/jeweler/commands/version/bump_patch.rb",
|
64
|
+
"lib/jeweler/commands/version/write.rb",
|
65
|
+
"lib/jeweler/commands/write_gemspec.rb",
|
66
|
+
"lib/jeweler/errors.rb",
|
67
|
+
"lib/jeweler/gemspec_helper.rb",
|
68
|
+
"lib/jeweler/generator.rb",
|
69
|
+
"lib/jeweler/generator/application.rb",
|
70
|
+
"lib/jeweler/generator/bacon_mixin.rb",
|
71
|
+
"lib/jeweler/generator/micronaut_mixin.rb",
|
72
|
+
"lib/jeweler/generator/minitest_mixin.rb",
|
73
|
+
"lib/jeweler/generator/options.rb",
|
74
|
+
"lib/jeweler/generator/rdoc_mixin.rb",
|
75
|
+
"lib/jeweler/generator/rspec_mixin.rb",
|
76
|
+
"lib/jeweler/generator/shoulda_mixin.rb",
|
77
|
+
"lib/jeweler/generator/testunit_mixin.rb",
|
78
|
+
"lib/jeweler/generator/yard_mixin.rb",
|
79
|
+
"lib/jeweler/rubyforge_tasks.rb",
|
80
|
+
"lib/jeweler/specification.rb",
|
81
|
+
"lib/jeweler/tasks.rb",
|
82
|
+
"lib/jeweler/templates/.document",
|
83
|
+
"lib/jeweler/templates/.document",
|
84
|
+
"lib/jeweler/templates/.gitignore",
|
85
|
+
"lib/jeweler/templates/.gitignore",
|
86
|
+
"lib/jeweler/templates/LICENSE",
|
87
|
+
"lib/jeweler/templates/README.rdoc",
|
88
|
+
"lib/jeweler/templates/Rakefile",
|
89
|
+
"lib/jeweler/templates/bacon/flunking.rb",
|
90
|
+
"lib/jeweler/templates/bacon/helper.rb",
|
91
|
+
"lib/jeweler/templates/features/default.feature",
|
92
|
+
"lib/jeweler/templates/features/support/env.rb",
|
93
|
+
"lib/jeweler/templates/micronaut/flunking.rb",
|
94
|
+
"lib/jeweler/templates/micronaut/helper.rb",
|
95
|
+
"lib/jeweler/templates/minitest/flunking.rb",
|
96
|
+
"lib/jeweler/templates/minitest/helper.rb",
|
97
|
+
"lib/jeweler/templates/rspec/flunking.rb",
|
98
|
+
"lib/jeweler/templates/rspec/helper.rb",
|
99
|
+
"lib/jeweler/templates/shoulda/flunking.rb",
|
100
|
+
"lib/jeweler/templates/shoulda/helper.rb",
|
101
|
+
"lib/jeweler/templates/testunit/flunking.rb",
|
102
|
+
"lib/jeweler/templates/testunit/helper.rb",
|
103
|
+
"lib/jeweler/version_helper.rb",
|
104
|
+
"test/fixtures/bar/VERSION.yml",
|
105
|
+
"test/fixtures/bar/bin/foo_the_ultimate_bin",
|
106
|
+
"test/fixtures/bar/hey_include_me_in_gemspec",
|
107
|
+
"test/fixtures/bar/lib/foo_the_ultimate_lib.rb",
|
108
|
+
"test/fixtures/existing-project-with-version-plaintext/.document",
|
109
|
+
"test/fixtures/existing-project-with-version-plaintext/.gitignore",
|
110
|
+
"test/fixtures/existing-project-with-version-plaintext/LICENSE",
|
111
|
+
"test/fixtures/existing-project-with-version-plaintext/README.rdoc",
|
112
|
+
"test/fixtures/existing-project-with-version-plaintext/Rakefile",
|
113
|
+
"test/fixtures/existing-project-with-version-plaintext/VERSION",
|
114
|
+
"test/fixtures/existing-project-with-version-plaintext/existing-project-with-version.gemspec",
|
115
|
+
"test/fixtures/existing-project-with-version-plaintext/lib/existing_project_with_version.rb",
|
116
|
+
"test/fixtures/existing-project-with-version-plaintext/test/existing_project_with_version_test.rb",
|
117
|
+
"test/fixtures/existing-project-with-version-plaintext/test/test_helper.rb",
|
118
|
+
"test/fixtures/existing-project-with-version-yaml/.document",
|
119
|
+
"test/fixtures/existing-project-with-version-yaml/.gitignore",
|
120
|
+
"test/fixtures/existing-project-with-version-yaml/LICENSE",
|
121
|
+
"test/fixtures/existing-project-with-version-yaml/README.rdoc",
|
122
|
+
"test/fixtures/existing-project-with-version-yaml/Rakefile",
|
123
|
+
"test/fixtures/existing-project-with-version-yaml/VERSION.yml",
|
124
|
+
"test/fixtures/existing-project-with-version-yaml/bin/foo_the_ultimate_bin",
|
125
|
+
"test/fixtures/existing-project-with-version-yaml/existing-project-with-version.gemspec",
|
126
|
+
"test/fixtures/existing-project-with-version-yaml/lib/existing_project_with_version.rb",
|
127
|
+
"test/fixtures/existing-project-with-version-yaml/test/existing_project_with_version_test.rb",
|
128
|
+
"test/fixtures/existing-project-with-version-yaml/test/test_helper.rb",
|
129
|
+
"test/geminstaller.yml",
|
130
|
+
"test/jeweler/commands/test_build_gem.rb",
|
131
|
+
"test/jeweler/commands/test_install_gem.rb",
|
132
|
+
"test/jeweler/commands/test_release.rb",
|
133
|
+
"test/jeweler/commands/test_release_to_rubyforge.rb",
|
134
|
+
"test/jeweler/commands/test_setup_rubyforge.rb",
|
135
|
+
"test/jeweler/commands/test_validate_gemspec.rb",
|
136
|
+
"test/jeweler/commands/test_write_gemspec.rb",
|
137
|
+
"test/jeweler/commands/version/test_base.rb",
|
138
|
+
"test/jeweler/commands/version/test_bump_major.rb",
|
139
|
+
"test/jeweler/commands/version/test_bump_minor.rb",
|
140
|
+
"test/jeweler/commands/version/test_bump_patch.rb",
|
141
|
+
"test/jeweler/commands/version/test_write.rb",
|
142
|
+
"test/shoulda_macros/jeweler_macros.rb",
|
143
|
+
"test/test_application.rb",
|
144
|
+
"test/test_gemspec_helper.rb",
|
145
|
+
"test/test_generator.rb",
|
146
|
+
"test/test_generator_initialization.rb",
|
147
|
+
"test/test_generator_mixins.rb",
|
148
|
+
"test/test_helper.rb",
|
149
|
+
"test/test_jeweler.rb",
|
150
|
+
"test/test_options.rb",
|
151
|
+
"test/test_specification.rb",
|
152
|
+
"test/test_tasks.rb",
|
153
|
+
"test/test_version_helper.rb"
|
154
|
+
]
|
155
|
+
s.homepage = %q{http://github.com/technicalpickles/jeweler}
|
156
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
157
|
+
s.require_paths = ["lib"]
|
158
|
+
s.rubyforge_project = %q{pickles}
|
159
|
+
s.rubygems_version = %q{1.3.5}
|
160
|
+
s.summary = %q{Simple and opinionated helper for creating Rubygem projects on GitHub}
|
161
|
+
s.test_files = [
|
162
|
+
"test/fixtures/bar/lib/foo_the_ultimate_lib.rb",
|
163
|
+
"test/fixtures/existing-project-with-version-plaintext/lib/existing_project_with_version.rb",
|
164
|
+
"test/fixtures/existing-project-with-version-plaintext/test/existing_project_with_version_test.rb",
|
165
|
+
"test/fixtures/existing-project-with-version-plaintext/test/test_helper.rb",
|
166
|
+
"test/fixtures/existing-project-with-version-yaml/lib/existing_project_with_version.rb",
|
167
|
+
"test/fixtures/existing-project-with-version-yaml/test/existing_project_with_version_test.rb",
|
168
|
+
"test/fixtures/existing-project-with-version-yaml/test/test_helper.rb",
|
169
|
+
"test/jeweler/commands/test_build_gem.rb",
|
170
|
+
"test/jeweler/commands/test_install_gem.rb",
|
171
|
+
"test/jeweler/commands/test_release.rb",
|
172
|
+
"test/jeweler/commands/test_release_to_rubyforge.rb",
|
173
|
+
"test/jeweler/commands/test_setup_rubyforge.rb",
|
174
|
+
"test/jeweler/commands/test_validate_gemspec.rb",
|
175
|
+
"test/jeweler/commands/test_write_gemspec.rb",
|
176
|
+
"test/jeweler/commands/version/test_base.rb",
|
177
|
+
"test/jeweler/commands/version/test_bump_major.rb",
|
178
|
+
"test/jeweler/commands/version/test_bump_minor.rb",
|
179
|
+
"test/jeweler/commands/version/test_bump_patch.rb",
|
180
|
+
"test/jeweler/commands/version/test_write.rb",
|
181
|
+
"test/shoulda_macros/jeweler_macros.rb",
|
182
|
+
"test/test_application.rb",
|
183
|
+
"test/test_gemspec_helper.rb",
|
184
|
+
"test/test_generator.rb",
|
185
|
+
"test/test_generator_initialization.rb",
|
186
|
+
"test/test_generator_mixins.rb",
|
187
|
+
"test/test_helper.rb",
|
188
|
+
"test/test_jeweler.rb",
|
189
|
+
"test/test_options.rb",
|
190
|
+
"test/test_specification.rb",
|
191
|
+
"test/test_tasks.rb",
|
192
|
+
"test/test_version_helper.rb"
|
193
|
+
]
|
194
|
+
|
195
|
+
if s.respond_to? :specification_version then
|
196
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
197
|
+
s.specification_version = 3
|
198
|
+
|
199
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
200
|
+
s.add_runtime_dependency(%q<git>, [">= 1.2.1"])
|
201
|
+
s.add_runtime_dependency(%q<rubyforge>, [">= 0"])
|
202
|
+
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
203
|
+
s.add_development_dependency(%q<mhennemeyer-output_catcher>, [">= 0"])
|
204
|
+
s.add_development_dependency(%q<rr>, [">= 0"])
|
205
|
+
s.add_development_dependency(%q<mocha>, [">= 0"])
|
206
|
+
s.add_development_dependency(%q<redgreen>, [">= 0"])
|
207
|
+
else
|
208
|
+
s.add_dependency(%q<git>, [">= 1.2.1"])
|
209
|
+
s.add_dependency(%q<rubyforge>, [">= 0"])
|
210
|
+
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
211
|
+
s.add_dependency(%q<mhennemeyer-output_catcher>, [">= 0"])
|
212
|
+
s.add_dependency(%q<rr>, [">= 0"])
|
213
|
+
s.add_dependency(%q<mocha>, [">= 0"])
|
214
|
+
s.add_dependency(%q<redgreen>, [">= 0"])
|
215
|
+
end
|
216
|
+
else
|
217
|
+
s.add_dependency(%q<git>, [">= 1.2.1"])
|
218
|
+
s.add_dependency(%q<rubyforge>, [">= 0"])
|
219
|
+
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
220
|
+
s.add_dependency(%q<mhennemeyer-output_catcher>, [">= 0"])
|
221
|
+
s.add_dependency(%q<rr>, [">= 0"])
|
222
|
+
s.add_dependency(%q<mocha>, [">= 0"])
|
223
|
+
s.add_dependency(%q<redgreen>, [">= 0"])
|
224
|
+
end
|
225
|
+
end
|
data/lib/jeweler.rb
ADDED
@@ -0,0 +1,153 @@
|
|
1
|
+
require 'date'
|
2
|
+
require 'rubygems/user_interaction'
|
3
|
+
require 'rubygems/builder'
|
4
|
+
require 'rubyforge'
|
5
|
+
|
6
|
+
require 'jeweler/errors'
|
7
|
+
require 'jeweler/version_helper'
|
8
|
+
require 'jeweler/gemspec_helper'
|
9
|
+
require 'jeweler/generator'
|
10
|
+
require 'jeweler/generator/options'
|
11
|
+
require 'jeweler/generator/application'
|
12
|
+
|
13
|
+
require 'jeweler/commands'
|
14
|
+
|
15
|
+
require 'jeweler/tasks'
|
16
|
+
require 'jeweler/gemcutter_tasks'
|
17
|
+
require 'jeweler/rubyforge_tasks'
|
18
|
+
|
19
|
+
require 'jeweler/specification'
|
20
|
+
|
21
|
+
# A Jeweler helps you craft the perfect Rubygem. Give him a gemspec, and he takes care of the rest.
|
22
|
+
class Jeweler
|
23
|
+
|
24
|
+
attr_reader :gemspec, :gemspec_helper, :version_helper
|
25
|
+
attr_accessor :base_dir, :output, :repo, :commit, :rubyforge
|
26
|
+
|
27
|
+
def initialize(gemspec, base_dir = '.')
|
28
|
+
raise(GemspecError, "Can't create a Jeweler with a nil gemspec") if gemspec.nil?
|
29
|
+
|
30
|
+
@gemspec = gemspec
|
31
|
+
@gemspec.extend(Specification)
|
32
|
+
@gemspec.set_jeweler_defaults(base_dir)
|
33
|
+
|
34
|
+
@base_dir = base_dir
|
35
|
+
@repo = Git.open(base_dir) if in_git_repo?
|
36
|
+
@version_helper = Jeweler::VersionHelper.new(base_dir)
|
37
|
+
@output = $stdout
|
38
|
+
@commit = true
|
39
|
+
@gemspec_helper = GemSpecHelper.new(gemspec, base_dir)
|
40
|
+
@rubyforge = RubyForge.new
|
41
|
+
end
|
42
|
+
|
43
|
+
# Major version, as defined by the gemspec's Version module.
|
44
|
+
# For 1.5.3, this would return 1.
|
45
|
+
def major_version
|
46
|
+
@version_helper.major
|
47
|
+
end
|
48
|
+
|
49
|
+
# Minor version, as defined by the gemspec's Version module.
|
50
|
+
# For 1.5.3, this would return 5.
|
51
|
+
def minor_version
|
52
|
+
@version_helper.minor
|
53
|
+
end
|
54
|
+
|
55
|
+
# Patch version, as defined by the gemspec's Version module.
|
56
|
+
# For 1.5.3, this would return 5.
|
57
|
+
def patch_version
|
58
|
+
@version_helper.patch
|
59
|
+
end
|
60
|
+
|
61
|
+
# Human readable version, which is used in the gemspec.
|
62
|
+
def version
|
63
|
+
@version_helper.to_s
|
64
|
+
end
|
65
|
+
|
66
|
+
# Writes out the gemspec
|
67
|
+
def write_gemspec
|
68
|
+
Jeweler::Commands::WriteGemspec.build_for(self).run
|
69
|
+
end
|
70
|
+
|
71
|
+
# Validates the project's gemspec from disk in an environment similar to how
|
72
|
+
# GitHub would build from it. See http://gist.github.com/16215
|
73
|
+
def validate_gemspec
|
74
|
+
Jeweler::Commands::ValidateGemspec.build_for(self).run
|
75
|
+
end
|
76
|
+
|
77
|
+
# is the project's gemspec from disk valid?
|
78
|
+
def valid_gemspec?
|
79
|
+
gemspec_helper.valid?
|
80
|
+
end
|
81
|
+
|
82
|
+
def build_gem
|
83
|
+
Jeweler::Commands::BuildGem.build_for(self).run
|
84
|
+
end
|
85
|
+
|
86
|
+
def install_gem
|
87
|
+
Jeweler::Commands::InstallGem.build_for(self).run
|
88
|
+
end
|
89
|
+
|
90
|
+
# Bumps the patch version.
|
91
|
+
#
|
92
|
+
# 1.5.1 -> 1.5.2
|
93
|
+
def bump_patch_version()
|
94
|
+
Jeweler::Commands::Version::BumpPatch.build_for(self).run
|
95
|
+
end
|
96
|
+
|
97
|
+
# Bumps the minor version.
|
98
|
+
#
|
99
|
+
# 1.5.1 -> 1.6.0
|
100
|
+
def bump_minor_version()
|
101
|
+
Jeweler::Commands::Version::BumpMinor.build_for(self).run
|
102
|
+
end
|
103
|
+
|
104
|
+
# Bumps the major version.
|
105
|
+
#
|
106
|
+
# 1.5.1 -> 2.0.0
|
107
|
+
def bump_major_version()
|
108
|
+
Jeweler::Commands::Version::BumpMajor.build_for(self).run
|
109
|
+
end
|
110
|
+
|
111
|
+
# Bumps the version, to the specific major/minor/patch version, writing out the appropriate version.rb, and then reloads it.
|
112
|
+
def write_version(major, minor, patch, options = {})
|
113
|
+
command = Jeweler::Commands::Version::Write.build_for(self)
|
114
|
+
command.major = major
|
115
|
+
command.minor = minor
|
116
|
+
command.patch = patch
|
117
|
+
|
118
|
+
command.run
|
119
|
+
end
|
120
|
+
|
121
|
+
def release
|
122
|
+
Jeweler::Commands::Release.build_for(self).run
|
123
|
+
end
|
124
|
+
|
125
|
+
def release_gem_to_gemcutter
|
126
|
+
Jeweler::Commands::ReleaseToGemcutter.build_for(self).run
|
127
|
+
end
|
128
|
+
|
129
|
+
def release_gem_to_rubyforge
|
130
|
+
Jeweler::Commands::ReleaseToRubyforge.build_for(self).run
|
131
|
+
end
|
132
|
+
|
133
|
+
def setup_rubyforge
|
134
|
+
Jeweler::Commands::SetupRubyforge.build_for(self).run
|
135
|
+
end
|
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
|
143
|
+
|
144
|
+
def in_git_repo?
|
145
|
+
File.exists?(File.join(self.base_dir, '.git'))
|
146
|
+
end
|
147
|
+
|
148
|
+
def version_exists?
|
149
|
+
File.exists?(@version_helper.plaintext_path) || File.exists?(@version_helper.yaml_path)
|
150
|
+
end
|
151
|
+
|
152
|
+
end
|
153
|
+
|