jeweler2 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. data/lib/jeweler/version.rb +1 -1
  2. metadata +30 -145
  3. data/.document +0 -8
  4. data/Gemfile +0 -18
  5. data/Gemfile.lock +0 -47
  6. data/Rakefile +0 -80
  7. data/features/generator/cucumber.feature +0 -103
  8. data/features/generator/directory_layout.feature +0 -86
  9. data/features/generator/dotdocument.feature +0 -13
  10. data/features/generator/env_options.feature +0 -9
  11. data/features/generator/gemfile.feature +0 -71
  12. data/features/generator/git.feature +0 -102
  13. data/features/generator/license.feature +0 -20
  14. data/features/generator/rakefile.feature +0 -158
  15. data/features/generator/readme.feature +0 -12
  16. data/features/generator/test.feature +0 -54
  17. data/features/generator/test_helper.feature +0 -149
  18. data/features/placeholder.feature +0 -5
  19. data/features/step_definitions/debug_steps.rb +0 -6
  20. data/features/step_definitions/filesystem_steps.rb +0 -70
  21. data/features/step_definitions/generator_steps.rb +0 -380
  22. data/features/step_definitions/task_steps.rb +0 -6
  23. data/features/support/env.rb +0 -42
  24. data/features/tasks/build_gem.feature +0 -9
  25. data/features/tasks/version.feature +0 -31
  26. data/features/tasks/version_bumping.feature +0 -49
  27. data/jeweler.gemspec +0 -245
  28. data/jeweler2.gemspec +0 -233
  29. data/lib/jeweler/templates/.document +0 -5
  30. data/lib/jeweler/templates/.gitignore +0 -48
  31. data/lib/jeweler/templates/Gemfile +0 -12
  32. data/lib/jeweler/templates/LICENSE.txt +0 -20
  33. data/lib/jeweler/templates/README.rdoc +0 -19
  34. data/lib/jeweler/templates/Rakefile +0 -9
  35. data/lib/jeweler/templates/bacon/flunking.rb +0 -7
  36. data/lib/jeweler/templates/bacon/helper.rb +0 -9
  37. data/lib/jeweler/templates/bundler_setup.erb +0 -10
  38. data/lib/jeweler/templates/features/default.feature +0 -9
  39. data/lib/jeweler/templates/features/support/env.rb +0 -10
  40. data/lib/jeweler/templates/jeweler_tasks.erb +0 -31
  41. data/lib/jeweler/templates/micronaut/flunking.rb +0 -7
  42. data/lib/jeweler/templates/micronaut/helper.rb +0 -18
  43. data/lib/jeweler/templates/minitest/flunking.rb +0 -7
  44. data/lib/jeweler/templates/minitest/helper.rb +0 -12
  45. data/lib/jeweler/templates/other_tasks.erb +0 -86
  46. data/lib/jeweler/templates/riot/flunking.rb +0 -11
  47. data/lib/jeweler/templates/riot/helper.rb +0 -4
  48. data/lib/jeweler/templates/rspec/.rspec +0 -1
  49. data/lib/jeweler/templates/rspec/flunking.rb +0 -7
  50. data/lib/jeweler/templates/rspec/helper.rb +0 -12
  51. data/lib/jeweler/templates/shindo/flunking.rb +0 -8
  52. data/lib/jeweler/templates/shindo/helper.rb +0 -6
  53. data/lib/jeweler/templates/shoulda/flunking.rb +0 -7
  54. data/lib/jeweler/templates/shoulda/helper.rb +0 -11
  55. data/lib/jeweler/templates/testspec/flunking.rb +0 -7
  56. data/lib/jeweler/templates/testspec/helper.rb +0 -7
  57. data/lib/jeweler/templates/testunit/flunking.rb +0 -7
  58. data/lib/jeweler/templates/testunit/helper.rb +0 -10
  59. data/test/fixtures/bar/VERSION.yml +0 -4
  60. data/test/fixtures/bar/bin/foo_the_ultimate_bin +0 -1
  61. data/test/fixtures/bar/hey_include_me_in_gemspec +0 -0
  62. data/test/fixtures/bar/lib/foo_the_ultimate_lib.rb +0 -1
  63. data/test/fixtures/existing-project-with-version-constant/.document +0 -5
  64. data/test/fixtures/existing-project-with-version-constant/.gitignore +0 -5
  65. data/test/fixtures/existing-project-with-version-constant/LICENSE.txt +0 -20
  66. data/test/fixtures/existing-project-with-version-constant/README.rdoc +0 -7
  67. data/test/fixtures/existing-project-with-version-constant/Rakefile +0 -85
  68. data/test/fixtures/existing-project-with-version-constant/existing-project-with-version.gemspec +0 -29
  69. data/test/fixtures/existing-project-with-version-constant/lib/existing_project_with_version.rb +0 -0
  70. data/test/fixtures/existing-project-with-version-constant/test/existing_project_with_version_test.rb +0 -7
  71. data/test/fixtures/existing-project-with-version-constant/test/test_helper.rb +0 -10
  72. data/test/fixtures/existing-project-with-version-plaintext/.document +0 -5
  73. data/test/fixtures/existing-project-with-version-plaintext/.gitignore +0 -5
  74. data/test/fixtures/existing-project-with-version-plaintext/LICENSE.txt +0 -20
  75. data/test/fixtures/existing-project-with-version-plaintext/README.rdoc +0 -7
  76. data/test/fixtures/existing-project-with-version-plaintext/Rakefile +0 -84
  77. data/test/fixtures/existing-project-with-version-plaintext/VERSION +0 -1
  78. data/test/fixtures/existing-project-with-version-plaintext/existing-project-with-version.gemspec +0 -29
  79. data/test/fixtures/existing-project-with-version-plaintext/lib/existing_project_with_version.rb +0 -0
  80. data/test/fixtures/existing-project-with-version-plaintext/test/existing_project_with_version_test.rb +0 -7
  81. data/test/fixtures/existing-project-with-version-plaintext/test/test_helper.rb +0 -10
  82. data/test/fixtures/existing-project-with-version-yaml/.document +0 -5
  83. data/test/fixtures/existing-project-with-version-yaml/.gitignore +0 -5
  84. data/test/fixtures/existing-project-with-version-yaml/LICENSE.txt +0 -20
  85. data/test/fixtures/existing-project-with-version-yaml/README.rdoc +0 -7
  86. data/test/fixtures/existing-project-with-version-yaml/Rakefile +0 -84
  87. data/test/fixtures/existing-project-with-version-yaml/VERSION.yml +0 -4
  88. data/test/fixtures/existing-project-with-version-yaml/bin/foo_the_ultimate_bin +0 -0
  89. data/test/fixtures/existing-project-with-version-yaml/existing-project-with-version.gemspec +0 -29
  90. data/test/fixtures/existing-project-with-version-yaml/lib/existing_project_with_version.rb +0 -0
  91. data/test/fixtures/existing-project-with-version-yaml/test/existing_project_with_version_test.rb +0 -7
  92. data/test/fixtures/existing-project-with-version-yaml/test/test_helper.rb +0 -10
  93. data/test/geminstaller.yml +0 -12
  94. data/test/jeweler/commands/test_build_gem.rb +0 -103
  95. data/test/jeweler/commands/test_install_gem.rb +0 -35
  96. data/test/jeweler/commands/test_release_to_gemcutter.rb +0 -39
  97. data/test/jeweler/commands/test_release_to_git.rb +0 -198
  98. data/test/jeweler/commands/test_release_to_github.rb +0 -390
  99. data/test/jeweler/commands/test_validate_gemspec.rb +0 -27
  100. data/test/jeweler/commands/test_write_gemspec.rb +0 -101
  101. data/test/jeweler/commands/version/test_base.rb +0 -32
  102. data/test/jeweler/commands/version/test_bump_major.rb +0 -22
  103. data/test/jeweler/commands/version/test_bump_minor.rb +0 -19
  104. data/test/jeweler/commands/version/test_bump_patch.rb +0 -20
  105. data/test/jeweler/commands/version/test_write.rb +0 -22
  106. data/test/jeweler/generator/test_application.rb +0 -120
  107. data/test/jeweler/generator/test_options.rb +0 -225
  108. data/test/jeweler/test_gemspec_helper.rb +0 -44
  109. data/test/jeweler/test_generator.rb +0 -141
  110. data/test/jeweler/test_generator_initialization.rb +0 -164
  111. data/test/jeweler/test_generator_mixins.rb +0 -23
  112. data/test/jeweler/test_specification.rb +0 -237
  113. data/test/jeweler/test_tasks.rb +0 -50
  114. data/test/jeweler/test_version_helper.rb +0 -214
  115. data/test/shoulda_macros/jeweler_macros.rb +0 -35
  116. data/test/test_helper.rb +0 -178
  117. data/test/test_jeweler.rb +0 -175
@@ -1,50 +0,0 @@
1
- require 'test_helper'
2
-
3
- require 'rake'
4
- class TestTasks < Test::Unit::TestCase
5
- include Rake
6
-
7
- context 'instantiating Jeweler::Tasks' do
8
- setup do
9
- @gemspec_building_block = lambda {|gemspec|}
10
- @tasks = Jeweler::Tasks.new &@gemspec_building_block
11
- end
12
-
13
- teardown do
14
- Task.clear
15
- end
16
-
17
- should 'assign @gemspec' do
18
- assert_not_nil @tasks.gemspec
19
- end
20
-
21
- should 'not eagerly initialize Jeweler' do
22
- assert ! @tasks.instance_variable_defined?(:@jeweler)
23
- end
24
-
25
- should 'set self as the application-wide jeweler tasks' do
26
- assert_same @tasks, Rake.application.jeweler_tasks
27
- end
28
-
29
- should 'save gemspec building block for later' do
30
- assert_same @gemspec_building_block, @tasks.gemspec_building_block
31
- end
32
-
33
- context 'Jeweler instance' do
34
- setup do
35
- @tasks.jeweler
36
- end
37
-
38
- should 'initailize Jeweler' do
39
- assert @tasks.instance_variable_defined?(:@jeweler)
40
- end
41
- end
42
-
43
- should 'yield the gemspec instance' do
44
- spec = nil
45
- @tasks = Jeweler::Tasks.new { |s| spec = s }
46
- assert_not_nil @tasks.jeweler.gemspec
47
- end
48
-
49
- end
50
- end
@@ -1,214 +0,0 @@
1
- require 'test_helper'
2
-
3
- class TestVersionHelper < Test::Unit::TestCase
4
-
5
- VERSION_TMP_DIR = File.dirname(__FILE__) + '/version_tmp'
6
-
7
- def self.should_have_version(major, minor, patch, build=nil)
8
- should "have major version #{major}" do
9
- assert_equal major, @version_helper.major
10
- end
11
-
12
- should "have minor version #{minor}" do
13
- assert_equal minor, @version_helper.minor
14
- end
15
-
16
- should "have patch version #{patch}" do
17
- assert_equal patch, @version_helper.patch
18
- end
19
-
20
- should "have build version #{build}" do
21
- assert_equal build, @version_helper.build
22
- end
23
-
24
- version_s = [major, minor, patch, build].compact.join('.')
25
- should "render string as #{version_s.inspect}" do
26
- assert_equal version_s, @version_helper.to_s
27
- end
28
-
29
- #version_hash = {:major => major, :minor => minor, :patch => patch}
30
- #should "render hash as #{version_hash.inspect}" do
31
- #assert_equal version_hash, @version_helper.to_hash
32
- #end
33
-
34
- end
35
-
36
- context "VERSION.yml with 3.5.4" do
37
- setup do
38
- FileUtils.rm_rf VERSION_TMP_DIR
39
- FileUtils.mkdir_p VERSION_TMP_DIR
40
-
41
- build_version_yml VERSION_TMP_DIR, 3, 5, 4
42
-
43
- @version_helper = Jeweler::VersionHelper.new VERSION_TMP_DIR
44
- end
45
-
46
- should_have_version 3, 5, 4
47
-
48
- context "bumping major version" do
49
- setup { @version_helper.bump_major }
50
- should_have_version 4, 0, 0
51
- end
52
-
53
- context "bumping the minor version" do
54
- setup { @version_helper.bump_minor }
55
- should_have_version 3, 6, 0
56
- end
57
-
58
- context "bumping the patch version" do
59
- setup { @version_helper.bump_patch }
60
- should_have_version 3, 5, 5
61
- end
62
- end
63
-
64
- context "VERSION.yml with 3.5.4.a1" do
65
- setup do
66
- FileUtils.rm_rf VERSION_TMP_DIR
67
- FileUtils.mkdir_p VERSION_TMP_DIR
68
-
69
- build_version_yml VERSION_TMP_DIR, 3, 5, 4, 'a1'
70
-
71
- @version_helper = Jeweler::VersionHelper.new VERSION_TMP_DIR
72
- end
73
-
74
- should_have_version 3, 5, 4, 'a1'
75
-
76
- context "bumping major version" do
77
- setup { @version_helper.bump_major }
78
- should_have_version 4, 0, 0, nil
79
- end
80
-
81
- context "bumping the minor version" do
82
- setup { @version_helper.bump_minor }
83
- should_have_version 3, 6, 0, nil
84
- end
85
-
86
- context "bumping the patch version" do
87
- setup { @version_helper.bump_patch }
88
- should_have_version 3, 5, 5, nil
89
- end
90
- end
91
-
92
- context "VERSION with 3.5.4" do
93
- setup do
94
- FileUtils.rm_rf VERSION_TMP_DIR
95
- FileUtils.mkdir_p VERSION_TMP_DIR
96
-
97
- build_version_plaintext VERSION_TMP_DIR, 3, 5, 4
98
-
99
- @version_helper = Jeweler::VersionHelper.new VERSION_TMP_DIR
100
- end
101
-
102
- should_have_version 3, 5, 4
103
-
104
- context "bumping major version" do
105
- setup { @version_helper.bump_major }
106
- should_have_version 4, 0, 0
107
- end
108
-
109
- context "bumping the minor version" do
110
- setup { @version_helper.bump_minor }
111
- should_have_version 3, 6, 0
112
- end
113
-
114
- context "bumping the patch version" do
115
- setup { @version_helper.bump_patch }
116
- should_have_version 3, 5, 5
117
- end
118
- end
119
-
120
- context "VERSION with 3.5.4.a1" do
121
- setup do
122
- FileUtils.rm_rf VERSION_TMP_DIR
123
- FileUtils.mkdir_p VERSION_TMP_DIR
124
-
125
- build_version_plaintext VERSION_TMP_DIR, 3, 5, 4, 'a1'
126
-
127
- @version_helper = Jeweler::VersionHelper.new VERSION_TMP_DIR
128
- end
129
-
130
- should_have_version 3, 5, 4, 'a1'
131
-
132
- context "bumping major version" do
133
- setup { @version_helper.bump_major }
134
- should_have_version 4, 0, 0, nil
135
- end
136
-
137
- context "bumping the minor version" do
138
- setup { @version_helper.bump_minor }
139
- should_have_version 3, 6, 0, nil
140
- end
141
-
142
- context "bumping the patch version" do
143
- setup { @version_helper.bump_patch }
144
- should_have_version 3, 5, 5, nil
145
- end
146
- end
147
-
148
- context "Non-existant VERSION.yml" do
149
- setup do
150
- FileUtils.rm_rf VERSION_TMP_DIR
151
- FileUtils.mkdir_p VERSION_TMP_DIR
152
- end
153
-
154
- should "not raise error if the VERSION.yml doesn't exist" do
155
- assert_nothing_raised Jeweler::VersionYmlError do
156
- Jeweler::VersionHelper.new(VERSION_TMP_DIR)
157
- end
158
- end
159
-
160
- context "setting an initial version" do
161
- setup do
162
- @version_helper = Jeweler::VersionHelper.new(VERSION_TMP_DIR)
163
- @version_helper.update_to 0, 0, 1
164
- end
165
-
166
- should_have_version 0, 0, 1
167
- should "not create VERSION.yml" do
168
- assert ! File.exists?(File.join(VERSION_TMP_DIR, 'VERSION.yml'))
169
- end
170
- should "not create VERSION" do
171
- assert ! File.exists?(File.join(VERSION_TMP_DIR, 'VERSION'))
172
- end
173
-
174
- context "outputting" do
175
- setup do
176
- @version_helper.write
177
- end
178
-
179
- should "create VERSION" do
180
- assert File.exists?(File.join(VERSION_TMP_DIR, 'VERSION'))
181
- end
182
-
183
- context "re-reading VERSION" do
184
- setup do
185
- @version_helper = Jeweler::VersionHelper.new(VERSION_TMP_DIR)
186
- end
187
-
188
- should_have_version 0, 0, 1
189
- end
190
- end
191
- end
192
- end
193
-
194
- def build_version_yml(base_dir, major, minor, patch, build=nil)
195
- version_path = File.join(base_dir, 'VERSION.yml')
196
-
197
- File.open(version_path, 'w+') do |f|
198
- version_hash = {
199
- 'major' => major.to_i,
200
- 'minor' => minor.to_i,
201
- 'patch' => patch.to_i
202
- }
203
- version_hash['build'] = build if build
204
- YAML.dump(version_hash, f)
205
- end
206
- end
207
-
208
- def build_version_plaintext(base_dir, major, minor, patch, build=nil)
209
- version_path = File.join(base_dir, 'VERSION')
210
- File.open(version_path, 'w+') do |f|
211
- f.puts [major, minor, patch, build].compact.join('.')
212
- end
213
- end
214
- end
@@ -1,35 +0,0 @@
1
- class Test::Unit::TestCase
2
- class << self
3
- def should_have_major_version(version)
4
- should "have major version of #{version}" do
5
- assert_equal version, @jeweler.major_version
6
- end
7
- end
8
-
9
- def should_have_minor_version(version)
10
- should "have minor version of #{version}" do
11
- assert_equal version, @jeweler.minor_version
12
- end
13
- end
14
-
15
- def should_have_patch_version(version)
16
- should "have patch version of #{version}" do
17
- assert_equal version, @jeweler.patch_version
18
- end
19
- end
20
-
21
- def should_be_version(version)
22
- should "be version #{version}" do
23
- assert_equal version, @jeweler.version
24
- end
25
- end
26
-
27
- def should_bump_version(major, minor, patch)
28
- version = "#{major}.#{minor}.#{patch}"
29
- should_have_major_version major
30
- should_have_minor_version minor
31
- should_have_patch_version patch
32
- should_be_version version
33
- end
34
- end
35
- end
@@ -1,178 +0,0 @@
1
- require 'test/unit'
2
- require 'rubygems'
3
-
4
- begin
5
- require 'ruby-debug'
6
- rescue LoadError
7
- end
8
-
9
- require 'bundler'
10
- begin
11
- Bundler.setup(:default, :development)
12
- rescue Bundler::BundlerError => e
13
- $stderr.puts e.message
14
- $stderr.puts "Run `bundle install` to install missing gems"
15
- exit e.status_code
16
- end
17
-
18
- require 'rake'
19
- require 'shoulda'
20
- require 'rr'
21
- #require 'redgreen'
22
- require 'construct'
23
- require 'git'
24
- require 'time'
25
-
26
- $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib')
27
- require 'jeweler'
28
-
29
- $LOAD_PATH.unshift(File.dirname(__FILE__))
30
- require 'shoulda_macros/jeweler_macros'
31
-
32
- TMP_DIR = '/tmp/jeweler_test'
33
- FIXTURE_DIR = File.expand_path('../fixtures', __FILE__)
34
-
35
- class RubyForgeStub
36
- attr_accessor :userconfig, :autoconfig
37
- def initialize
38
- @userconfig = {}
39
- @autoconfig = {}
40
- end
41
- end
42
-
43
- class Test::Unit::TestCase
44
- include RR::Adapters::TestUnit unless include?(RR::Adapters::TestUnit)
45
- include Construct::Helpers
46
-
47
- def tmp_dir
48
- TMP_DIR
49
- end
50
-
51
- def fixture_dir
52
- File.join(FIXTURE_DIR, 'bar')
53
- end
54
-
55
- def remove_tmpdir!
56
- FileUtils.rm_rf(tmp_dir)
57
- end
58
-
59
- def create_tmpdir!
60
- FileUtils.mkdir_p(tmp_dir)
61
- end
62
-
63
- def build_spec(*files)
64
- Gem::Specification.new do |s|
65
- s.name = "bar"
66
- s.summary = "Simple and opinionated helper for creating Rubygem projects on GitHub"
67
- s.email = "josh@technicalpickles.com"
68
- s.homepage = "http://github.com/technicalpickles/jeweler"
69
- s.description = "Simple and opinionated helper for creating Rubygem projects on GitHub"
70
- s.authors = ["Josh Nichols"]
71
- s.files = FileList[*files] unless files.empty?
72
- s.version = '0.1.1'
73
- end
74
- end
75
-
76
- def self.gemcutter_command_context(description, &block)
77
- context description do
78
- setup do
79
- @command = eval(self.class.name.gsub(/::Test/, '::')).new
80
-
81
- if @command.respond_to? :gemspec_helper=
82
- @gemspec_helper = Object.new
83
- @command.gemspec_helper = @gemspec_helper
84
- end
85
-
86
- if @command.respond_to? :output
87
- @output = StringIO.new
88
- @command.output = @output
89
- end
90
- end
91
-
92
- context "", &block
93
- end
94
- end
95
-
96
- def self.rubyforge_command_context(description, &block)
97
- context description do
98
- setup do
99
- @command = eval(self.class.name.gsub(/::Test/, '::')).new
100
-
101
- if @command.respond_to? :gemspec=
102
- @gemspec = Object.new
103
- @command.gemspec = @gemspec
104
- end
105
-
106
- if @command.respond_to? :gemspec_helper=
107
- @gemspec_helper = Object.new
108
- @command.gemspec_helper = @gemspec_helper
109
- end
110
-
111
- if @command.respond_to? :rubyforge=
112
- @rubyforge = RubyForgeStub.new
113
- @command.rubyforge = @rubyforge
114
- end
115
-
116
- if @command.respond_to? :output
117
- @output = StringIO.new
118
- @command.output = @output
119
- end
120
-
121
- if @command.respond_to? :repo
122
- @repo = Object.new
123
- @command.repo = @repo
124
- end
125
- end
126
-
127
- context "", &block
128
- end
129
- end
130
-
131
- def self.build_command_context(description, &block)
132
- context description do
133
- setup do
134
-
135
- @repo = Object.new
136
- @version_helper = Object.new
137
- @gemspec = Object.new
138
- @commit = Object.new
139
- @version = Object.new
140
- @output = Object.new
141
- @base_dir = Object.new
142
- @gemspec_helper = Object.new
143
- @rubyforge = Object.new
144
-
145
- @jeweler = Object.new
146
-
147
- stub(@jeweler).repo { @repo }
148
- stub(@jeweler).version_helper { @version_helper }
149
- stub(@jeweler).gemspec { @gemspec }
150
- stub(@jeweler).commit { @commit }
151
- stub(@jeweler).version { @version }
152
- stub(@jeweler).output { @output }
153
- stub(@jeweler).gemspec_helper { @gemspec_helper }
154
- stub(@jeweler).base_dir { @base_dir }
155
- stub(@jeweler).rubyforge { @rubyforge }
156
- end
157
-
158
- context "", &block
159
- end
160
-
161
- end
162
-
163
- def stub_git_config(options = {})
164
- stub(Git).global_config() { options }
165
- end
166
-
167
- def set_default_git_config
168
- @project_name = 'the-perfect-gem'
169
- @git_name = 'foo'
170
- @git_email = 'bar@example.com'
171
- @github_user = 'technicalpickles'
172
- @github_token = 'zomgtoken'
173
- end
174
-
175
- def valid_git_config
176
- { 'user.name' => @git_name, 'user.email' => @git_email, 'github.user' => @github_user, 'github.token' => @github_token }
177
- end
178
- end