technicalpickles-jeweler 0.11.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +7 -0
- data/ChangeLog.markdown +8 -0
- data/README.markdown +9 -9
- data/ROADMAP +12 -0
- data/Rakefile +22 -5
- data/VERSION.yml +2 -2
- 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 +110 -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 +65 -0
- data/features/step_definitions/generator_steps.rb +251 -0
- data/features/step_definitions/task_steps.rb +6 -0
- data/features/support/env.rb +19 -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 +204 -0
- data/lib/jeweler/commands/release.rb +35 -11
- data/lib/jeweler/commands/version/base.rb +1 -1
- data/lib/jeweler/gemspec_helper.rb +4 -6
- data/lib/jeweler/generator/application.rb +8 -3
- data/lib/jeweler/generator/bacon_mixin.rb +39 -0
- data/lib/jeweler/generator/micronaut_mixin.rb +38 -0
- data/lib/jeweler/generator/minitest_mixin.rb +39 -0
- data/lib/jeweler/generator/options.rb +5 -1
- data/lib/jeweler/generator/rspec_mixin.rb +39 -0
- data/lib/jeweler/generator/shoulda_mixin.rb +39 -0
- data/lib/jeweler/generator/testunit_mixin.rb +39 -0
- data/lib/jeweler/generator.rb +48 -111
- data/lib/jeweler/rubyforge_tasks.rb +46 -0
- data/lib/jeweler/specification.rb +3 -2
- data/lib/jeweler/tasks.rb +32 -26
- data/lib/jeweler/templates/README.rdoc +1 -1
- data/lib/jeweler/templates/Rakefile +29 -52
- data/lib/jeweler/templates/bacon/helper.rb +1 -1
- data/lib/jeweler/templates/features/support/env.rb +4 -7
- data/lib/jeweler/templates/micronaut/helper.rb +1 -1
- data/lib/jeweler/templates/minitest/helper.rb +1 -1
- data/lib/jeweler/templates/rspec/flunking.rb +1 -1
- data/lib/jeweler/templates/rspec/helper.rb +1 -1
- data/lib/jeweler/templates/shoulda/helper.rb +1 -1
- data/lib/jeweler/templates/testunit/helper.rb +1 -1
- data/lib/jeweler/version_helper.rb +78 -33
- data/lib/jeweler.rb +5 -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 → existing-project-with-version-plaintext}/LICENSE +0 -0
- data/test/fixtures/{existing-project-with-version → existing-project-with-version-plaintext}/README.rdoc +0 -0
- data/test/fixtures/{existing-project-with-version → existing-project-with-version-plaintext}/Rakefile +0 -0
- data/test/fixtures/existing-project-with-version-plaintext/VERSION +1 -0
- data/test/fixtures/{existing-project-with-version → existing-project-with-version-plaintext}/existing-project-with-version.gemspec +0 -0
- data/test/fixtures/{existing-project-with-version → existing-project-with-version-plaintext}/lib/existing_project_with_version.rb +0 -0
- data/test/fixtures/{existing-project-with-version → existing-project-with-version-plaintext}/test/existing_project_with_version_test.rb +0 -0
- data/test/fixtures/{existing-project-with-version → existing-project-with-version-plaintext}/test/test_helper.rb +0 -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 → existing-project-with-version-yaml}/VERSION.yml +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/jeweler/commands/test_release.rb +304 -79
- data/test/test_application.rb +26 -0
- data/test/test_gemspec_helper.rb +4 -0
- data/test/test_generator.rb +83 -112
- data/test/test_generator_initialization.rb +113 -0
- data/test/test_generator_mixins.rb +18 -0
- data/test/test_helper.rb +3 -0
- data/test/test_options.rb +6 -0
- data/test/test_specification.rb +6 -2
- data/test/test_version_helper.rb +47 -9
- metadata +72 -17
- data/test/generators/initialization_test.rb +0 -146
data/test/test_generator.rb
CHANGED
@@ -50,134 +50,105 @@ class TestGenerator < Test::Unit::TestCase
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
-
|
54
|
-
|
55
|
-
assert_equal 'test', build_generator(:shoulda).test_or_spec
|
56
|
-
end
|
57
|
-
|
58
|
-
should "be test for testunit" do
|
59
|
-
assert_equal 'test', build_generator(:testunit).test_or_spec
|
60
|
-
end
|
61
|
-
|
62
|
-
should "be test for minitest" do
|
63
|
-
assert_equal 'test', build_generator(:minitest).test_or_spec
|
64
|
-
end
|
65
|
-
|
66
|
-
should "be spec for bacon" do
|
67
|
-
assert_equal 'spec', build_generator(:bacon).test_or_spec
|
68
|
-
end
|
69
|
-
|
70
|
-
should "be spec for rspec" do
|
71
|
-
assert_equal 'spec', build_generator(:rspec).test_or_spec
|
72
|
-
end
|
73
|
-
|
74
|
-
should "be example for micronaut" do
|
75
|
-
assert_equal 'example', build_generator(:micronaut).test_or_spec
|
76
|
-
end
|
53
|
+
should "have the correct git remote" do
|
54
|
+
assert_equal 'git@github.com:johndoe/the-perfect-gem.git', build_generator.git_remote
|
77
55
|
end
|
78
56
|
|
79
|
-
|
80
|
-
|
81
|
-
assert_equal 'test', build_generator(:shoulda).test_dir
|
82
|
-
end
|
83
|
-
|
84
|
-
should "be test for testunit" do
|
85
|
-
assert_equal 'test', build_generator(:testunit).test_dir
|
86
|
-
end
|
87
|
-
|
88
|
-
should "be test for minitest" do
|
89
|
-
assert_equal 'test', build_generator(:minitest).test_dir
|
90
|
-
end
|
91
|
-
|
92
|
-
should "be spec for bacon" do
|
93
|
-
assert_equal 'spec', build_generator(:bacon).test_dir
|
94
|
-
end
|
95
|
-
|
96
|
-
should "be spec for rspec" do
|
97
|
-
assert_equal 'spec', build_generator(:rspec).test_dir
|
98
|
-
end
|
99
|
-
|
100
|
-
should "be examples for micronaut" do
|
101
|
-
assert_equal 'examples', build_generator(:micronaut).test_dir
|
102
|
-
end
|
57
|
+
should "have the correct project homepage" do
|
58
|
+
assert_equal 'http://github.com/johndoe/the-perfect-gem', build_generator.project_homepage
|
103
59
|
end
|
104
60
|
|
105
|
-
|
106
|
-
|
107
|
-
assert_equal 'test', build_generator(:shoulda).default_task
|
108
|
-
end
|
109
|
-
|
110
|
-
should "be test for testunit" do
|
111
|
-
assert_equal 'test', build_generator(:testunit).default_task
|
112
|
-
end
|
113
|
-
|
114
|
-
should "be test for minitest" do
|
115
|
-
assert_equal 'test', build_generator(:minitest).default_task
|
116
|
-
end
|
117
|
-
|
118
|
-
should "be spec for bacon" do
|
119
|
-
assert_equal 'spec', build_generator(:bacon).default_task
|
120
|
-
end
|
121
|
-
|
122
|
-
should "be spec for rspec" do
|
123
|
-
assert_equal 'spec', build_generator(:rspec).default_task
|
124
|
-
end
|
125
|
-
|
126
|
-
should "be examples for micronaut" do
|
127
|
-
assert_equal 'examples', build_generator(:micronaut).default_task
|
128
|
-
end
|
61
|
+
should "have the correct constant name" do
|
62
|
+
assert_equal "ThePerfectGem", build_generator.constant_name
|
129
63
|
end
|
130
64
|
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
end
|
135
|
-
|
136
|
-
should "be test/unit/assertions for testunit" do
|
137
|
-
assert_equal 'test/unit/assertions', build_generator(:testunit).feature_support_require
|
138
|
-
end
|
139
|
-
|
140
|
-
should "be mini/test for minitest" do
|
141
|
-
assert_equal 'mini/test', build_generator(:minitest).feature_support_require
|
142
|
-
end
|
143
|
-
|
144
|
-
should "be test/unit/assertions for bacon" do
|
145
|
-
assert_equal 'test/unit/assertions', build_generator(:bacon).feature_support_require
|
146
|
-
end
|
65
|
+
should "have the correct file name prefix" do
|
66
|
+
assert_equal "the_perfect_gem", build_generator.file_name_prefix
|
67
|
+
end
|
147
68
|
|
148
|
-
|
149
|
-
|
150
|
-
|
69
|
+
should "have the correct require name" do
|
70
|
+
assert_equal "the-perfect-gem", build_generator.require_name
|
71
|
+
end
|
151
72
|
|
152
|
-
|
153
|
-
|
154
|
-
end
|
73
|
+
should "have the correct lib file name" do
|
74
|
+
assert_equal "the-perfect-gem.rb", build_generator.lib_filename
|
155
75
|
end
|
156
76
|
|
157
|
-
|
158
|
-
should "
|
159
|
-
assert_equal
|
77
|
+
def self.should_have_generator_attribute(attribute, value)
|
78
|
+
should "have #{value} for #{attribute}" do
|
79
|
+
assert_equal value, build_generator(@framework).send(attribute)
|
160
80
|
end
|
81
|
+
end
|
161
82
|
|
162
|
-
|
163
|
-
|
164
|
-
|
83
|
+
context "shoulda" do
|
84
|
+
setup { @framework = :shoulda }
|
85
|
+
should_have_generator_attribute :test_task, 'test'
|
86
|
+
should_have_generator_attribute :test_dir, 'test'
|
87
|
+
should_have_generator_attribute :default_task, 'test'
|
88
|
+
should_have_generator_attribute :feature_support_require, 'test/unit/assertions'
|
89
|
+
should_have_generator_attribute :feature_support_extend, 'Test::Unit::Assertions'
|
90
|
+
should_have_generator_attribute :test_pattern, 'test/**/*_test.rb'
|
91
|
+
should_have_generator_attribute :test_filename, 'the-perfect-gem_test.rb'
|
92
|
+
should_have_generator_attribute :test_helper_filename, 'test_helper.rb'
|
93
|
+
end
|
165
94
|
|
166
|
-
|
167
|
-
|
168
|
-
|
95
|
+
context "testunit" do
|
96
|
+
setup { @framework = :testunit }
|
97
|
+
should_have_generator_attribute :test_task, 'test'
|
98
|
+
should_have_generator_attribute :test_dir, 'test'
|
99
|
+
should_have_generator_attribute :default_task, 'test'
|
100
|
+
should_have_generator_attribute :feature_support_require, 'test/unit/assertions'
|
101
|
+
should_have_generator_attribute :feature_support_extend, 'Test::Unit::Assertions'
|
102
|
+
should_have_generator_attribute :test_pattern, 'test/**/*_test.rb'
|
103
|
+
should_have_generator_attribute :test_filename, 'the-perfect-gem_test.rb'
|
104
|
+
should_have_generator_attribute :test_helper_filename, 'test_helper.rb'
|
105
|
+
end
|
169
106
|
|
170
|
-
|
171
|
-
|
172
|
-
|
107
|
+
context "minitest" do
|
108
|
+
setup { @framework = :minitest }
|
109
|
+
should_have_generator_attribute :test_task, 'test'
|
110
|
+
should_have_generator_attribute :test_dir, 'test'
|
111
|
+
should_have_generator_attribute :default_task, 'test'
|
112
|
+
should_have_generator_attribute :feature_support_require, 'mini/test'
|
113
|
+
should_have_generator_attribute :feature_support_extend, 'Mini::Test::Assertions'
|
114
|
+
should_have_generator_attribute :test_pattern, 'test/**/*_test.rb'
|
115
|
+
should_have_generator_attribute :test_filename, 'the-perfect-gem_test.rb'
|
116
|
+
should_have_generator_attribute :test_helper_filename, 'test_helper.rb'
|
117
|
+
end
|
173
118
|
|
174
|
-
|
175
|
-
|
176
|
-
|
119
|
+
context "bacon" do
|
120
|
+
setup { @framework = :bacon }
|
121
|
+
should_have_generator_attribute :test_task, 'spec'
|
122
|
+
should_have_generator_attribute :test_dir, 'spec'
|
123
|
+
should_have_generator_attribute :default_task, 'spec'
|
124
|
+
should_have_generator_attribute :feature_support_require, 'test/unit/assertions'
|
125
|
+
should_have_generator_attribute :feature_support_extend, 'Test::Unit::Assertions'
|
126
|
+
should_have_generator_attribute :test_pattern, 'spec/**/*_spec.rb'
|
127
|
+
should_have_generator_attribute :test_filename, 'the-perfect-gem_spec.rb'
|
128
|
+
should_have_generator_attribute :test_helper_filename, 'spec_helper.rb'
|
129
|
+
end
|
177
130
|
|
178
|
-
|
179
|
-
|
180
|
-
|
131
|
+
context "rspec" do
|
132
|
+
setup { @framework = :rspec }
|
133
|
+
should_have_generator_attribute :test_task, 'spec'
|
134
|
+
should_have_generator_attribute :test_dir, 'spec'
|
135
|
+
should_have_generator_attribute :default_task, 'spec'
|
136
|
+
should_have_generator_attribute :feature_support_require, 'spec/expectations'
|
137
|
+
should_have_generator_attribute :feature_support_extend, nil
|
138
|
+
should_have_generator_attribute :test_pattern, 'spec/**/*_spec.rb'
|
139
|
+
should_have_generator_attribute :test_filename, 'the-perfect-gem_spec.rb'
|
140
|
+
should_have_generator_attribute :test_helper_filename, 'spec_helper.rb'
|
181
141
|
end
|
182
142
|
|
143
|
+
context "micronaut" do
|
144
|
+
setup { @framework = :micronaut }
|
145
|
+
should_have_generator_attribute :test_task, 'examples'
|
146
|
+
should_have_generator_attribute :test_dir, 'examples'
|
147
|
+
should_have_generator_attribute :default_task, 'examples'
|
148
|
+
should_have_generator_attribute :feature_support_require, 'micronaut/expectations'
|
149
|
+
should_have_generator_attribute :feature_support_extend, 'Micronaut::Matchers'
|
150
|
+
should_have_generator_attribute :test_pattern, 'examples/**/*_example.rb'
|
151
|
+
should_have_generator_attribute :test_filename, 'the-perfect-gem_example.rb'
|
152
|
+
should_have_generator_attribute :test_helper_filename, 'example_helper.rb'
|
153
|
+
end
|
183
154
|
end
|
@@ -0,0 +1,113 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class TestGeneratorInitialization < Test::Unit::TestCase
|
4
|
+
def setup
|
5
|
+
@project_name = 'the-perfect-gem'
|
6
|
+
@git_name = 'foo'
|
7
|
+
@git_email = 'bar@example.com'
|
8
|
+
@github_user = 'technicalpickles'
|
9
|
+
@github_token = 'zomgtoken'
|
10
|
+
end
|
11
|
+
|
12
|
+
def stub_git_config(options = {})
|
13
|
+
stub.instance_of(Git::Lib).parse_config('~/.gitconfig') { options }
|
14
|
+
end
|
15
|
+
|
16
|
+
context "given a nil github repo name" do
|
17
|
+
setup do
|
18
|
+
stub_git_config
|
19
|
+
|
20
|
+
@block = lambda { }
|
21
|
+
end
|
22
|
+
|
23
|
+
should 'raise NoGithubRepoNameGiven' do
|
24
|
+
assert_raise Jeweler::NoGitHubRepoNameGiven do
|
25
|
+
Jeweler::Generator.new(nil)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
context "without git user's name set" do
|
31
|
+
setup do
|
32
|
+
stub_git_config 'user.email' => @git_email
|
33
|
+
end
|
34
|
+
|
35
|
+
should 'raise an NoGitUserName' do
|
36
|
+
assert_raise Jeweler::NoGitUserName do
|
37
|
+
Jeweler::Generator.new(@project_name)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
context "without git user's email set" do
|
43
|
+
setup do
|
44
|
+
stub_git_config 'user.name' => @git_name
|
45
|
+
end
|
46
|
+
|
47
|
+
should 'raise NoGitUserName' do
|
48
|
+
assert_raise Jeweler::NoGitUserEmail do
|
49
|
+
Jeweler::Generator.new(@project_name)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
context "without github username set" do
|
55
|
+
setup do
|
56
|
+
stub_git_config 'user.email' => @git_email, 'user.name' => @git_name
|
57
|
+
end
|
58
|
+
|
59
|
+
should 'raise NotGitHubUser' do
|
60
|
+
assert_raise Jeweler::NoGitHubUser do
|
61
|
+
Jeweler::Generator.new(@project_name)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
context "without github token set" do
|
67
|
+
setup do
|
68
|
+
stub_git_config 'user.name' => @git_name, 'user.email' => @git_email, 'github.user' => @github_user
|
69
|
+
end
|
70
|
+
|
71
|
+
should 'raise NoGitHubToken if creating repo' do
|
72
|
+
assert_raise Jeweler::NoGitHubToken do
|
73
|
+
Jeweler::Generator.new(@project_name, :create_repo => true)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
context "with valid git user configuration" do
|
79
|
+
setup do
|
80
|
+
stub_git_config 'user.name' => @git_name, 'user.email' => @git_email, 'github.user' => @github_user, 'github.token' => @github_token
|
81
|
+
end
|
82
|
+
|
83
|
+
context "for technicalpickle's the-perfect-gem repository" do
|
84
|
+
setup do
|
85
|
+
@generator = Jeweler::Generator.new(@project_name)
|
86
|
+
end
|
87
|
+
|
88
|
+
should "assign user's name from git config" do
|
89
|
+
assert_equal @git_name, @generator.user_name
|
90
|
+
end
|
91
|
+
|
92
|
+
should "assign email from git config" do
|
93
|
+
assert_equal @git_email, @generator.user_email
|
94
|
+
end
|
95
|
+
|
96
|
+
should "assign github remote" do
|
97
|
+
assert_equal 'git@github.com:technicalpickles/the-perfect-gem.git', @generator.git_remote
|
98
|
+
end
|
99
|
+
|
100
|
+
should "assign github username from git config" do
|
101
|
+
assert_equal @github_user, @generator.github_username
|
102
|
+
end
|
103
|
+
|
104
|
+
should "determine project name as the-perfect-gem" do
|
105
|
+
assert_equal @project_name, @generator.project_name
|
106
|
+
end
|
107
|
+
|
108
|
+
should "determine target directory as the same as the github repository name" do
|
109
|
+
assert_equal @generator.project_name, @generator.target_dir
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class TestGeneratorMixins < Test::Unit::TestCase
|
4
|
+
|
5
|
+
[Jeweler::Generator::BaconMixin, Jeweler::Generator::MicronautMixin,
|
6
|
+
Jeweler::Generator::RspecMixin, Jeweler::Generator::ShouldaMixin,
|
7
|
+
Jeweler::Generator::TestunitMixin, Jeweler::Generator::MinitestMixin].each do |mixin|
|
8
|
+
context "#{mixin}" do
|
9
|
+
%w(default_task feature_support_require feature_support_extend
|
10
|
+
test_dir test_task test_pattern test_filename
|
11
|
+
test_helper_filename).each do |method|
|
12
|
+
should "define #{method}" do
|
13
|
+
assert mixin.method_defined?(method)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -13,7 +13,9 @@ begin
|
|
13
13
|
require 'ruby-debug'
|
14
14
|
rescue LoadError
|
15
15
|
end
|
16
|
+
|
16
17
|
require 'rr'
|
18
|
+
require 'redgreen'
|
17
19
|
require 'time'
|
18
20
|
|
19
21
|
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib')
|
@@ -63,6 +65,7 @@ class Test::Unit::TestCase
|
|
63
65
|
s.description = "Simple and opinionated helper for creating Rubygem projects on GitHub"
|
64
66
|
s.authors = ["Josh Nichols"]
|
65
67
|
s.files = FileList[*files] unless files.empty?
|
68
|
+
s.version = '0.1.1'
|
66
69
|
end
|
67
70
|
end
|
68
71
|
|
data/test/test_options.rb
CHANGED
@@ -93,6 +93,12 @@ class TestOptions < Test::Unit::TestCase
|
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
|
+
for_options '--zomg-invalid' do
|
97
|
+
should 'be an invalid argument' do
|
98
|
+
assert @options[:invalid_argument]
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
96
102
|
context "merging options" do
|
97
103
|
should "take options from each" do
|
98
104
|
options = Jeweler::Generator::Options.new(["--rspec"]).
|
data/test/test_specification.rb
CHANGED
@@ -3,7 +3,10 @@ require 'test_helper'
|
|
3
3
|
class TestSpecification < Test::Unit::TestCase
|
4
4
|
def setup
|
5
5
|
remove_tmpdir!
|
6
|
-
|
6
|
+
path = File.join(FIXTURE_DIR, "existing-project-with-version-yaml")
|
7
|
+
Git.init(path)
|
8
|
+
FileUtils.cp_r path, tmp_dir
|
9
|
+
#breakpoint
|
7
10
|
|
8
11
|
|
9
12
|
@spec = Gem::Specification.new
|
@@ -17,7 +20,8 @@ class TestSpecification < Test::Unit::TestCase
|
|
17
20
|
|
18
21
|
context "Gem::Specification with Jeweler monkey-patches" do
|
19
22
|
context "when setting defaults" do
|
20
|
-
|
23
|
+
should_eventually "should populate `files'" do
|
24
|
+
# this implementation changed to use ruby-git
|
21
25
|
assert_equal %w{Rakefile VERSION.yml bin/foo_the_ultimate_bin lib/foo_the_ultimate_lib.rb }, @spec.files.sort
|
22
26
|
end
|
23
27
|
|
data/test/test_version_helper.rb
CHANGED
@@ -22,10 +22,10 @@ class TestVersionHelper < Test::Unit::TestCase
|
|
22
22
|
assert_equal version_s, @version_helper.to_s
|
23
23
|
end
|
24
24
|
|
25
|
-
version_hash = {:major => major, :minor => minor, :patch => patch}
|
26
|
-
should "render hash as #{version_hash.inspect}" do
|
27
|
-
assert_equal version_hash, @version_helper.to_hash
|
28
|
-
end
|
25
|
+
#version_hash = {:major => major, :minor => minor, :patch => patch}
|
26
|
+
#should "render hash as #{version_hash.inspect}" do
|
27
|
+
#assert_equal version_hash, @version_helper.to_hash
|
28
|
+
#end
|
29
29
|
|
30
30
|
end
|
31
31
|
|
@@ -57,6 +57,34 @@ class TestVersionHelper < Test::Unit::TestCase
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
+
context "VERSION with 3.5.4" do
|
61
|
+
setup do
|
62
|
+
FileUtils.rm_rf VERSION_TMP_DIR
|
63
|
+
FileUtils.mkdir_p VERSION_TMP_DIR
|
64
|
+
|
65
|
+
build_version_plaintext VERSION_TMP_DIR, 3, 5, 4
|
66
|
+
|
67
|
+
@version_helper = Jeweler::VersionHelper.new VERSION_TMP_DIR
|
68
|
+
end
|
69
|
+
|
70
|
+
should_have_version 3, 5, 4
|
71
|
+
|
72
|
+
context "bumping major version" do
|
73
|
+
setup { @version_helper.bump_major }
|
74
|
+
should_have_version 4, 0, 0
|
75
|
+
end
|
76
|
+
|
77
|
+
context "bumping the minor version" do
|
78
|
+
setup { @version_helper.bump_minor }
|
79
|
+
should_have_version 3, 6, 0
|
80
|
+
end
|
81
|
+
|
82
|
+
context "bumping the patch version" do
|
83
|
+
setup { @version_helper.bump_patch }
|
84
|
+
should_have_version 3, 5, 5
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
60
88
|
context "Non-existant VERSION.yml" do
|
61
89
|
setup do
|
62
90
|
FileUtils.rm_rf VERSION_TMP_DIR
|
@@ -79,17 +107,20 @@ class TestVersionHelper < Test::Unit::TestCase
|
|
79
107
|
should "not create VERSION.yml" do
|
80
108
|
assert ! File.exists?(File.join(VERSION_TMP_DIR, 'VERSION.yml'))
|
81
109
|
end
|
110
|
+
should "not create VERSION" do
|
111
|
+
assert ! File.exists?(File.join(VERSION_TMP_DIR, 'VERSION'))
|
112
|
+
end
|
82
113
|
|
83
114
|
context "outputting" do
|
84
115
|
setup do
|
85
116
|
@version_helper.write
|
86
117
|
end
|
87
118
|
|
88
|
-
should "create VERSION
|
89
|
-
assert File.exists?(File.join(VERSION_TMP_DIR, 'VERSION
|
119
|
+
should "create VERSION" do
|
120
|
+
assert File.exists?(File.join(VERSION_TMP_DIR, 'VERSION'))
|
90
121
|
end
|
91
122
|
|
92
|
-
context "re-reading VERSION
|
123
|
+
context "re-reading VERSION" do
|
93
124
|
setup do
|
94
125
|
@version_helper = Jeweler::VersionHelper.new(VERSION_TMP_DIR)
|
95
126
|
end
|
@@ -101,9 +132,9 @@ class TestVersionHelper < Test::Unit::TestCase
|
|
101
132
|
end
|
102
133
|
|
103
134
|
def build_version_yml(base_dir, major, minor, patch)
|
104
|
-
|
135
|
+
version_path = File.join(base_dir, 'VERSION.yml')
|
105
136
|
|
106
|
-
File.open(
|
137
|
+
File.open(version_path, 'w+') do |f|
|
107
138
|
version_hash = {
|
108
139
|
'major' => major.to_i,
|
109
140
|
'minor' => minor.to_i,
|
@@ -112,4 +143,11 @@ class TestVersionHelper < Test::Unit::TestCase
|
|
112
143
|
YAML.dump(version_hash, f)
|
113
144
|
end
|
114
145
|
end
|
146
|
+
|
147
|
+
def build_version_plaintext(base_dir, major, minor, patch)
|
148
|
+
version_path = File.join(base_dir, 'VERSION')
|
149
|
+
File.open(version_path, 'w+') do |f|
|
150
|
+
f.puts "#{major}.#{minor}.#{patch}"
|
151
|
+
end
|
152
|
+
end
|
115
153
|
end
|
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: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Nichols
|
@@ -9,11 +9,21 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-05-15 00:00:00 -07:00
|
13
13
|
default_executable: jeweler
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
16
|
+
name: git
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.1.1
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rubyforge
|
17
27
|
type: :runtime
|
18
28
|
version_requirement:
|
19
29
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -33,12 +43,34 @@ extra_rdoc_files:
|
|
33
43
|
- LICENSE
|
34
44
|
- README.markdown
|
35
45
|
files:
|
46
|
+
- .gitignore
|
36
47
|
- ChangeLog.markdown
|
37
48
|
- LICENSE
|
38
49
|
- README.markdown
|
50
|
+
- ROADMAP
|
39
51
|
- Rakefile
|
40
52
|
- VERSION.yml
|
41
53
|
- bin/jeweler
|
54
|
+
- features/generator/cucumber.feature
|
55
|
+
- features/generator/directory_layout.feature
|
56
|
+
- features/generator/dotdocument.feature
|
57
|
+
- features/generator/env_options.feature
|
58
|
+
- features/generator/git.feature
|
59
|
+
- features/generator/license.feature
|
60
|
+
- features/generator/rakefile.feature
|
61
|
+
- features/generator/readme.feature
|
62
|
+
- features/generator/test.feature
|
63
|
+
- features/generator/test_helper.feature
|
64
|
+
- features/placeholder.feature
|
65
|
+
- features/step_definitions/debug_steps.rb
|
66
|
+
- features/step_definitions/filesystem_steps.rb
|
67
|
+
- features/step_definitions/generator_steps.rb
|
68
|
+
- features/step_definitions/task_steps.rb
|
69
|
+
- features/support/env.rb
|
70
|
+
- features/tasks/build_gem.feature
|
71
|
+
- features/tasks/version.feature
|
72
|
+
- features/tasks/version_bumping.feature
|
73
|
+
- jeweler.gemspec
|
42
74
|
- lib/jeweler.rb
|
43
75
|
- lib/jeweler/commands.rb
|
44
76
|
- lib/jeweler/commands/build_gem.rb
|
@@ -57,7 +89,14 @@ files:
|
|
57
89
|
- lib/jeweler/gemspec_helper.rb
|
58
90
|
- lib/jeweler/generator.rb
|
59
91
|
- lib/jeweler/generator/application.rb
|
92
|
+
- lib/jeweler/generator/bacon_mixin.rb
|
93
|
+
- lib/jeweler/generator/micronaut_mixin.rb
|
94
|
+
- lib/jeweler/generator/minitest_mixin.rb
|
60
95
|
- lib/jeweler/generator/options.rb
|
96
|
+
- lib/jeweler/generator/rspec_mixin.rb
|
97
|
+
- lib/jeweler/generator/shoulda_mixin.rb
|
98
|
+
- lib/jeweler/generator/testunit_mixin.rb
|
99
|
+
- lib/jeweler/rubyforge_tasks.rb
|
61
100
|
- lib/jeweler/specification.rb
|
62
101
|
- lib/jeweler/tasks.rb
|
63
102
|
- lib/jeweler/templates/.document
|
@@ -84,16 +123,27 @@ files:
|
|
84
123
|
- test/fixtures/bar/bin/foo_the_ultimate_bin
|
85
124
|
- test/fixtures/bar/hey_include_me_in_gemspec
|
86
125
|
- test/fixtures/bar/lib/foo_the_ultimate_lib.rb
|
87
|
-
- test/fixtures/existing-project-with-version
|
88
|
-
- test/fixtures/existing-project-with-version
|
89
|
-
- test/fixtures/existing-project-with-version/
|
90
|
-
- test/fixtures/existing-project-with-version/
|
91
|
-
- test/fixtures/existing-project-with-version/
|
92
|
-
- test/fixtures/existing-project-with-version/
|
93
|
-
- test/fixtures/existing-project-with-version/
|
94
|
-
- test/fixtures/existing-project-with-version/
|
126
|
+
- test/fixtures/existing-project-with-version-plaintext/.document
|
127
|
+
- test/fixtures/existing-project-with-version-plaintext/.gitignore
|
128
|
+
- test/fixtures/existing-project-with-version-plaintext/LICENSE
|
129
|
+
- test/fixtures/existing-project-with-version-plaintext/README.rdoc
|
130
|
+
- test/fixtures/existing-project-with-version-plaintext/Rakefile
|
131
|
+
- test/fixtures/existing-project-with-version-plaintext/VERSION
|
132
|
+
- test/fixtures/existing-project-with-version-plaintext/existing-project-with-version.gemspec
|
133
|
+
- test/fixtures/existing-project-with-version-plaintext/lib/existing_project_with_version.rb
|
134
|
+
- test/fixtures/existing-project-with-version-plaintext/test/existing_project_with_version_test.rb
|
135
|
+
- test/fixtures/existing-project-with-version-plaintext/test/test_helper.rb
|
136
|
+
- test/fixtures/existing-project-with-version-yaml/.document
|
137
|
+
- test/fixtures/existing-project-with-version-yaml/.gitignore
|
138
|
+
- test/fixtures/existing-project-with-version-yaml/LICENSE
|
139
|
+
- test/fixtures/existing-project-with-version-yaml/README.rdoc
|
140
|
+
- test/fixtures/existing-project-with-version-yaml/Rakefile
|
141
|
+
- test/fixtures/existing-project-with-version-yaml/VERSION.yml
|
142
|
+
- test/fixtures/existing-project-with-version-yaml/existing-project-with-version.gemspec
|
143
|
+
- test/fixtures/existing-project-with-version-yaml/lib/existing_project_with_version.rb
|
144
|
+
- test/fixtures/existing-project-with-version-yaml/test/existing_project_with_version_test.rb
|
145
|
+
- test/fixtures/existing-project-with-version-yaml/test/test_helper.rb
|
95
146
|
- test/geminstaller.yml
|
96
|
-
- test/generators/initialization_test.rb
|
97
147
|
- test/jeweler/commands/test_build_gem.rb
|
98
148
|
- test/jeweler/commands/test_install_gem.rb
|
99
149
|
- test/jeweler/commands/test_release.rb
|
@@ -110,13 +160,14 @@ files:
|
|
110
160
|
- test/test_application.rb
|
111
161
|
- test/test_gemspec_helper.rb
|
112
162
|
- test/test_generator.rb
|
163
|
+
- test/test_generator_initialization.rb
|
164
|
+
- test/test_generator_mixins.rb
|
113
165
|
- test/test_helper.rb
|
114
166
|
- test/test_jeweler.rb
|
115
167
|
- test/test_options.rb
|
116
168
|
- test/test_specification.rb
|
117
169
|
- test/test_tasks.rb
|
118
170
|
- test/test_version_helper.rb
|
119
|
-
- test/version_tmp/VERSION.yml
|
120
171
|
has_rdoc: true
|
121
172
|
homepage: http://github.com/technicalpickles/jeweler
|
122
173
|
post_install_message:
|
@@ -145,10 +196,12 @@ specification_version: 2
|
|
145
196
|
summary: Simple and opinionated helper for creating Rubygem projects on GitHub
|
146
197
|
test_files:
|
147
198
|
- test/fixtures/bar/lib/foo_the_ultimate_lib.rb
|
148
|
-
- test/fixtures/existing-project-with-version/lib/existing_project_with_version.rb
|
149
|
-
- test/fixtures/existing-project-with-version/test/existing_project_with_version_test.rb
|
150
|
-
- test/fixtures/existing-project-with-version/test/test_helper.rb
|
151
|
-
- test/
|
199
|
+
- test/fixtures/existing-project-with-version-plaintext/lib/existing_project_with_version.rb
|
200
|
+
- test/fixtures/existing-project-with-version-plaintext/test/existing_project_with_version_test.rb
|
201
|
+
- test/fixtures/existing-project-with-version-plaintext/test/test_helper.rb
|
202
|
+
- test/fixtures/existing-project-with-version-yaml/lib/existing_project_with_version.rb
|
203
|
+
- test/fixtures/existing-project-with-version-yaml/test/existing_project_with_version_test.rb
|
204
|
+
- test/fixtures/existing-project-with-version-yaml/test/test_helper.rb
|
152
205
|
- test/jeweler/commands/test_build_gem.rb
|
153
206
|
- test/jeweler/commands/test_install_gem.rb
|
154
207
|
- test/jeweler/commands/test_release.rb
|
@@ -165,6 +218,8 @@ test_files:
|
|
165
218
|
- test/test_application.rb
|
166
219
|
- test/test_gemspec_helper.rb
|
167
220
|
- test/test_generator.rb
|
221
|
+
- test/test_generator_initialization.rb
|
222
|
+
- test/test_generator_mixins.rb
|
168
223
|
- test/test_helper.rb
|
169
224
|
- test/test_jeweler.rb
|
170
225
|
- test/test_options.rb
|