jeweler 1.8.2 → 2.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +7 -0
  2. data/.coveralls.yml +2 -0
  3. data/.semver +5 -0
  4. data/.travis.yml +5 -3
  5. data/ChangeLog.markdown +30 -0
  6. data/Gemfile +32 -25
  7. data/Gemfile.lock +117 -46
  8. data/README.markdown +36 -10
  9. data/README.org +374 -0
  10. data/Rakefile +23 -28
  11. data/bin/jeweler +1 -0
  12. data/features/generator/gemfile.feature +1 -0
  13. data/features/generator/test.feature +2 -2
  14. data/features/step_definitions/debug_steps.rb +0 -1
  15. data/features/step_definitions/filesystem_steps.rb +2 -3
  16. data/features/step_definitions/generator_steps.rb +44 -66
  17. data/features/step_definitions/task_steps.rb +1 -2
  18. data/features/support/env.rb +22 -9
  19. data/jeweler.gemspec +64 -45
  20. data/lib/jeweler/commands/build_gem.rb +6 -2
  21. data/lib/jeweler/commands/check_dependencies.rb +3 -3
  22. data/lib/jeweler/commands/install_gem.rb +1 -1
  23. data/lib/jeweler/commands/release_gemspec.rb +17 -14
  24. data/lib/jeweler/commands/release_to_git.rb +20 -11
  25. data/lib/jeweler/commands/validate_gemspec.rb +5 -7
  26. data/lib/jeweler/commands/version/base.rb +8 -13
  27. data/lib/jeweler/commands/version/bump_major.rb +1 -3
  28. data/lib/jeweler/commands/version/bump_minor.rb +1 -2
  29. data/lib/jeweler/commands/version/bump_patch.rb +1 -4
  30. data/lib/jeweler/commands/write_gemspec.rb +4 -3
  31. data/lib/jeweler/commands.rb +6 -6
  32. data/lib/jeweler/gemspec_helper.rb +15 -15
  33. data/lib/jeweler/generator/application.rb +5 -10
  34. data/lib/jeweler/generator/bacon_mixin.rb +2 -4
  35. data/lib/jeweler/generator/github_mixin.rb +1 -10
  36. data/lib/jeweler/generator/micronaut_mixin.rb +3 -3
  37. data/lib/jeweler/generator/minitest_mixin.rb +2 -3
  38. data/lib/jeweler/generator/options.rb +16 -25
  39. data/lib/jeweler/generator/rdoc_mixin.rb +1 -1
  40. data/lib/jeweler/generator/riot_mixin.rb +2 -3
  41. data/lib/jeweler/generator/rspec_mixin.rb +2 -3
  42. data/lib/jeweler/generator/shindo_mixin.rb +2 -3
  43. data/lib/jeweler/generator/shoulda_mixin.rb +2 -3
  44. data/lib/jeweler/generator/testspec_mixin.rb +2 -3
  45. data/lib/jeweler/generator/testunit_mixin.rb +1 -3
  46. data/lib/jeweler/generator/yard_mixin.rb +3 -4
  47. data/lib/jeweler/generator.rb +52 -45
  48. data/lib/jeweler/rubyforge_tasks.rb +13 -13
  49. data/lib/jeweler/rubygems_dot_org_tasks.rb +3 -3
  50. data/lib/jeweler/rubygems_tasks.rb +3 -3
  51. data/lib/jeweler/specification.rb +22 -11
  52. data/lib/jeweler/tasks.rb +68 -59
  53. data/lib/jeweler/templates/Gemfile +1 -1
  54. data/lib/jeweler/templates/bacon/flunking.rb +3 -3
  55. data/lib/jeweler/templates/bacon/helper.rb +1 -0
  56. data/lib/jeweler/templates/features/support/env.rb +1 -0
  57. data/lib/jeweler/templates/jeweler_tasks.erb +1 -1
  58. data/lib/jeweler/templates/micronaut/flunking.rb +3 -3
  59. data/lib/jeweler/templates/micronaut/helper.rb +1 -0
  60. data/lib/jeweler/templates/minitest/flunking.rb +1 -1
  61. data/lib/jeweler/templates/minitest/helper.rb +4 -3
  62. data/lib/jeweler/templates/other_tasks.erb +4 -20
  63. data/lib/jeweler/templates/riot/flunking.rb +1 -1
  64. data/lib/jeweler/templates/riot/helper.rb +1 -0
  65. data/lib/jeweler/templates/rspec/flunking.rb +3 -3
  66. data/lib/jeweler/templates/rspec/helper.rb +3 -1
  67. data/lib/jeweler/templates/shindo/flunking.rb +3 -3
  68. data/lib/jeweler/templates/shindo/helper.rb +1 -0
  69. data/lib/jeweler/templates/shoulda/helper.rb +1 -0
  70. data/lib/jeweler/templates/simplecov.erb +16 -0
  71. data/lib/jeweler/templates/testspec/flunking.rb +3 -3
  72. data/lib/jeweler/templates/testspec/helper.rb +1 -1
  73. data/lib/jeweler/templates/testunit/helper.rb +1 -0
  74. data/lib/jeweler/version.rb +3 -3
  75. data/lib/jeweler/version_helper.rb +18 -15
  76. data/lib/jeweler.rb +23 -23
  77. data/test/fixtures/bar/lib/foo_the_ultimate_lib.rb +1 -1
  78. data/test/fixtures/existing-project-with-version-constant/Rakefile +18 -20
  79. data/test/fixtures/existing-project-with-version-constant/existing-project-with-version.gemspec +15 -17
  80. data/test/fixtures/existing-project-with-version-constant/test/existing_project_with_version_test.rb +2 -2
  81. data/test/fixtures/existing-project-with-version-plaintext/Rakefile +17 -19
  82. data/test/fixtures/existing-project-with-version-plaintext/existing-project-with-version.gemspec +15 -17
  83. data/test/fixtures/existing-project-with-version-plaintext/test/existing_project_with_version_test.rb +2 -2
  84. data/test/fixtures/existing-project-with-version-yaml/Rakefile +17 -19
  85. data/test/fixtures/existing-project-with-version-yaml/existing-project-with-version.gemspec +15 -17
  86. data/test/fixtures/existing-project-with-version-yaml/test/existing_project_with_version_test.rb +2 -2
  87. data/test/jeweler/commands/test_build_gem.rb +33 -27
  88. data/test/jeweler/commands/test_install_gem.rb +7 -7
  89. data/test/jeweler/commands/test_release_to_gemcutter.rb +6 -7
  90. data/test/jeweler/commands/test_release_to_git.rb +95 -37
  91. data/test/jeweler/commands/test_release_to_github.rb +161 -97
  92. data/test/jeweler/commands/test_validate_gemspec.rb +4 -6
  93. data/test/jeweler/commands/test_write_gemspec.rb +21 -24
  94. data/test/jeweler/commands/version/test_base.rb +26 -6
  95. data/test/jeweler/commands/version/test_bump_major.rb +1 -5
  96. data/test/jeweler/commands/version/test_bump_minor.rb +1 -2
  97. data/test/jeweler/commands/version/test_bump_patch.rb +1 -3
  98. data/test/jeweler/commands/version/test_write.rb +1 -3
  99. data/test/jeweler/generator/test_application.rb +22 -26
  100. data/test/jeweler/generator/test_options.rb +26 -38
  101. data/test/jeweler/test_gemspec_helper.rb +7 -7
  102. data/test/jeweler/test_generator.rb +31 -33
  103. data/test/jeweler/test_generator_initialization.rb +40 -57
  104. data/test/jeweler/test_generator_mixins.rb +6 -7
  105. data/test/jeweler/test_specification.rb +44 -43
  106. data/test/jeweler/test_tasks.rb +2 -3
  107. data/test/jeweler/test_version_helper.rb +33 -35
  108. data/test/shoulda_macros/jeweler_macros.rb +5 -5
  109. data/test/test_helper.rb +25 -31
  110. data/test/test_jeweler.rb +28 -29
  111. metadata +206 -165
data/lib/jeweler/tasks.rb CHANGED
@@ -33,11 +33,12 @@ class Jeweler
33
33
  # The block variable gem is actually a Gem::Specification, so you can
34
34
  # do anything you would normally do with a Gem::Specification.
35
35
  # For more details, see the official gemspec reference:
36
- # http://docs.rubygems.org/read/chapter/20
36
+ # http://guides.rubygems.org/specification-reference
37
37
  #
38
38
  # In addition, it provides reasonable defaults for several values. See Jeweler::Specification for more details.
39
39
  class Tasks < ::Rake::TaskLib
40
- attr_accessor :gemspec, :jeweler, :gemspec_building_block
40
+ attr_accessor :gemspec, :gemspec_building_block
41
+ attr_writer :jeweler
41
42
 
42
43
  def initialize(gemspec = nil, &gemspec_building_block)
43
44
  @gemspec = gemspec || Gem::Specification.new
@@ -48,14 +49,16 @@ class Jeweler
48
49
  end
49
50
 
50
51
  def jeweler
51
- if @jeweler.nil?
52
- @jeweler = Jeweler.new(gemspec)
53
- gemspec_building_block.call gemspec if gemspec_building_block
54
- end
55
- @jeweler
52
+ @jeweler ||= jeweler!
56
53
  end
57
54
 
58
- private
55
+ private
56
+
57
+ def jeweler!
58
+ j = Jeweler.new(gemspec)
59
+ gemspec_building_block.call gemspec if gemspec_building_block
60
+ j
61
+ end
59
62
 
60
63
  def yield_gemspec_set_version?
61
64
  yielded_gemspec = @gemspec.dup
@@ -65,61 +68,67 @@ class Jeweler
65
68
 
66
69
  gemspec_building_block.call(yielded_gemspec) if gemspec_building_block
67
70
 
68
- ! yielded_gemspec.version.nil?
71
+ !yielded_gemspec.version.nil?
72
+ end
73
+
74
+ def release_args
75
+ args = {}
76
+ args[:remote] = ENV['REMOTE']
77
+ args[:branch] = ENV['BRANCH']
78
+ args[:local_branch] = ENV['LOCAL_BRANCH']
79
+ args[:remote_branch] = ENV['REMOTE_BRANCH']
80
+ args
69
81
  end
70
82
 
71
83
  def define
72
84
  task :version_required do
73
- if jeweler.expects_version_file? && !jeweler.version_file_exists?
85
+ if jeweler.expects_version_file? && !jeweler.version_file_exist?
74
86
  abort "Expected VERSION or VERSION.yml to exist. Use 'rake version:write' to create an initial one."
75
87
  end
76
88
  end
77
89
 
78
90
  task :gemspec_required do
79
- if ! File.exist?(jeweler.gemspec_helper.path)
91
+ unless File.exist?(jeweler.gemspec_helper.path)
80
92
  abort "Expected #{jeweler.gemspec_helper.path} to exist. See 'rake gemspec:write' to create it"
81
93
  end
82
94
  end
83
95
 
84
-
85
- desc "Build gem into pkg/"
96
+ desc 'Build gem into pkg/'
86
97
  task :build do
87
98
  jeweler.build_gem
88
99
  end
89
100
 
90
-
91
-
92
- desc "Build and install gem using `gem install`"
93
- task :install => [:build] do
101
+ desc 'Build and install gem using `gem install`'
102
+ task install: [:build] do
94
103
  jeweler.install_gem
95
104
  end
96
105
 
97
- desc "Displays the current version"
98
- task :version => :version_required do
106
+ desc 'Displays the current version'
107
+ task version: :version_required do
99
108
  $stdout.puts "Current version: #{jeweler.version}"
100
109
  end
101
110
 
102
- desc "Release gem"
103
- task :release => :clean do
111
+ desc 'Release gem'
112
+ task release: :clean do
104
113
  end
105
114
 
106
- desc "Generate and validate gemspec"
107
- task :gemspec => ['gemspec:generate', 'gemspec:validate']
115
+ desc 'Generate and validate gemspec'
116
+ task gemspec: ['gemspec:generate', 'gemspec:validate']
108
117
 
109
118
  namespace :gemspec do
110
- desc "Validates the gemspec on the filesystem"
111
- task :validate => :gemspec_required do
119
+ desc 'Validates the gemspec on the filesystem'
120
+ task validate: :gemspec_required do
112
121
  jeweler.validate_gemspec
113
122
  end
114
123
 
115
- desc "Regenerate the gemspec on the filesystem"
116
- task :generate => :version_required do
124
+ desc 'Regenerate the gemspec on the filesystem'
125
+ task generate: :version_required do
117
126
  jeweler.write_gemspec
118
127
  end
119
128
 
120
- desc "Display the gemspec for debugging purposes, as jeweler knows it (not from the filesystem)"
129
+ desc 'Display the gemspec for debugging purposes, as jeweler knows it (not from the filesystem)'
121
130
  task :debug do
122
- # TODO move to a command
131
+ # TODO: move to a command
123
132
  jeweler.gemspec_helper.spec.version ||= begin
124
133
  jeweler.version_helper.refresh
125
134
  jeweler.version_helper.to_s
@@ -128,39 +137,41 @@ class Jeweler
128
137
  puts jeweler.gemspec_helper.to_ruby
129
138
  end
130
139
 
131
- desc "Regenerate and validate gemspec, and then commits and pushes to git"
140
+ desc 'Regenerate and validate gemspec, and then commits and pushes to git'
132
141
  task :release do
133
- jeweler.release_gemspec
142
+ jeweler.release_gemspec(release_args)
134
143
  end
135
144
  end
136
145
 
137
- task :release => 'gemspec:release'
138
-
146
+ task release: 'gemspec:release'
139
147
 
140
148
  unless yield_gemspec_set_version?
141
149
  namespace :version do
142
- desc "Writes out an explicit version. Respects the following environment variables, or defaults to 0: MAJOR, MINOR, PATCH. Also recognizes BUILD, which defaults to nil"
150
+ desc 'Writes out an explicit version. Respects the following environment variables, or defaults to 0: MAJOR, MINOR, PATCH. Also recognizes BUILD, which defaults to nil'
143
151
  task :write do
144
- major, minor, patch, build = ENV['MAJOR'].to_i, ENV['MINOR'].to_i, ENV['PATCH'].to_i, (ENV['BUILD'] || nil )
145
- jeweler.write_version(major, minor, patch, build, :announce => false, :commit => false)
152
+ major = ENV['MAJOR'].to_i
153
+ minor = ENV['MINOR'].to_i
154
+ patch = ENV['PATCH'].to_i
155
+ build = (ENV['BUILD'] || nil)
156
+ jeweler.write_version(major, minor, patch, build, announce: false, commit: false)
146
157
  $stdout.puts "Updated version: #{jeweler.version}"
147
158
  end
148
159
 
149
160
  namespace :bump do
150
- desc "Bump the major version by 1"
151
- task :major => [:version_required, :version] do
161
+ desc 'Bump the major version by 1'
162
+ task major: [:version_required, :version] do
152
163
  jeweler.bump_major_version
153
164
  $stdout.puts "Updated version: #{jeweler.version}"
154
165
  end
155
166
 
156
- desc "Bump the a minor version by 1"
157
- task :minor => [:version_required, :version] do
167
+ desc 'Bump the a minor version by 1'
168
+ task minor: [:version_required, :version] do
158
169
  jeweler.bump_minor_version
159
170
  $stdout.puts "Updated version: #{jeweler.version}"
160
171
  end
161
172
 
162
- desc "Bump the patch version by 1"
163
- task :patch => [:version_required, :version] do
173
+ desc 'Bump the patch version by 1'
174
+ task patch: [:version_required, :version] do
164
175
  jeweler.bump_patch_version
165
176
  $stdout.puts "Updated version: #{jeweler.version}"
166
177
  end
@@ -168,45 +179,44 @@ class Jeweler
168
179
  end
169
180
  end
170
181
 
171
-
172
182
  namespace :git do
173
- desc "Tag and push release to git. (happens by default with `rake release`)"
183
+ desc 'Tag and push release to git. (happens by default with `rake release`)'
174
184
  task :release do
175
- jeweler.release_to_git
185
+ jeweler.release_to_git(release_args)
176
186
  end
177
187
  end
178
188
 
179
- task :release => 'git:release'
189
+ task release: 'git:release'
180
190
 
181
191
  unless File.exist?('Gemfile')
182
- desc "Check that runtime and development dependencies are installed"
192
+ desc 'Check that runtime and development dependencies are installed'
183
193
  task :check_dependencies do
184
194
  jeweler.check_dependencies
185
195
  end
186
196
 
187
197
  namespace :check_dependencies do
188
- desc "Check that runtime dependencies are installed"
189
- task :runtime do
198
+ desc 'Check that runtime dependencies are installed'
199
+ task :runtime do
190
200
  jeweler.check_dependencies(:runtime)
191
201
  end
192
202
 
193
- desc"Check that development dependencies are installed"
203
+ desc'Check that development dependencies are installed'
194
204
  task :development do
195
205
  jeweler.check_dependencies(:development)
196
206
  end
197
207
  end
198
208
  end
199
209
 
200
- desc "Start IRB with all runtime dependencies loaded"
201
- task :console, [:script] do |t,args|
202
- # TODO move to a command
203
- dirs = ['ext', 'lib'].select { |dir| File.directory?(dir) }
210
+ desc 'Start IRB with all runtime dependencies loaded'
211
+ task :console, [:script] do |_t, args|
212
+ # TODO: move to a command
213
+ dirs = %w(ext lib).select { |dir| File.directory?(dir) }
204
214
 
205
215
  original_load_path = $LOAD_PATH
206
216
 
207
- cmd = if File.exist?('Gemfile')
208
- require 'bundler'
209
- Bundler.setup(:default)
217
+ _cmd = if File.exist?('Gemfile')
218
+ require 'bundler'
219
+ Bundler.setup(:default)
210
220
  end
211
221
 
212
222
  # add the project code directories
@@ -222,9 +232,8 @@ class Jeweler
222
232
  IRB.start
223
233
 
224
234
  # return the $LOAD_PATH to it's original state
225
- $LOAD_PATH.reject! { |path| !(original_load_path.include?(path)) }
235
+ $LOAD_PATH.reject! { |path| !original_load_path.include?(path) }
226
236
  end
227
-
228
237
  end
229
238
  end
230
239
  end
@@ -1,4 +1,4 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
  # Add dependencies required to use your gem here.
3
3
  # Example:
4
4
  # gem "activesupport", ">= 2.3.5"
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe "<%= constant_name %>" do
4
- it "fails" do
5
- should.flunk "hey buddy, you should probably rename this file and start specing for real"
3
+ describe '<%= constant_name %>' do
4
+ it 'fails' do
5
+ should.flunk 'hey buddy, you should probably rename this file and start specing for real'
6
6
  end
7
7
  end
@@ -1,3 +1,4 @@
1
+ <%= render_template 'simplecov.erb' %>
1
2
  require 'rubygems'
2
3
  <%= render_template 'bundler_setup.erb' %>
3
4
  require 'bacon'
@@ -1,3 +1,4 @@
1
+ <%= render_template 'simplecov.erb' %>
1
2
  <%= render_template 'bundler_setup.erb' %>
2
3
 
3
4
  $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
@@ -1,6 +1,6 @@
1
1
  require 'jeweler'
2
2
  Jeweler::Tasks.new do |gem|
3
- # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
3
+ # gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
4
4
  gem.name = "<%= project_name %>"
5
5
  gem.homepage = "<%= homepage %>"
6
6
  gem.license = "MIT"
@@ -1,7 +1,7 @@
1
1
  require 'example_helper'
2
2
 
3
- describe "<%= constant_name %>" do
4
- it "fails" do
5
- fail "hey buddy, you should probably rename this file and start specing for real"
3
+ describe '<%= constant_name %>' do
4
+ it 'fails' do
5
+ fail 'hey buddy, you should probably rename this file and start specing for real'
6
6
  end
7
7
  end
@@ -1,3 +1,4 @@
1
+ <%= render_template 'simplecov.erb' %>
1
2
  require 'rubygems'
2
3
  <%= render_template 'bundler_setup.erb' %>
3
4
  require 'micronaut'
@@ -1,6 +1,6 @@
1
1
  require 'helper'
2
2
 
3
- class Test<%= constant_name %> < MiniTest::Unit::TestCase
3
+ class Test<%= constant_name %> < MiniTest::Test
4
4
  def test_something_for_real
5
5
  flunk "hey buddy, you should probably rename this file and start testing for real"
6
6
  end
@@ -1,12 +1,13 @@
1
+ <%= render_template 'simplecov.erb' %>
1
2
  require 'rubygems'
2
3
  <%= render_template 'bundler_setup.erb' %>
3
- require 'minitest/unit'
4
+ require 'minitest/test'
4
5
 
5
6
  $LOAD_PATH.unshift(File.dirname(__FILE__))
6
7
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
7
8
  require '<%= require_name %>'
8
9
 
9
- class MiniTest::Unit::TestCase
10
+ class MiniTest::Test
10
11
  end
11
12
 
12
- MiniTest::Unit.autorun
13
+ require 'minitest/autorun'
@@ -23,27 +23,11 @@ Rake::TestTask.new(:<%= test_task %>) do |<%= test_task %>|
23
23
  end
24
24
  <% end %>
25
25
 
26
- <% case testing_framework %>
27
- <% when :rspec %>
28
- RSpec::Core::RakeTask.new(:rcov) do |spec|
29
- spec.pattern = '<%= test_pattern %>'
30
- spec.rcov = true
26
+ desc "Code coverage detail"
27
+ task :simplecov do
28
+ ENV['COVERAGE'] = "true"
29
+ Rake::Task['<%= test_task %>'].execute
31
30
  end
32
- <% when :micronaut %>
33
- Micronaut::RakeTask.new(:rcov) do |examples|
34
- examples.pattern = '<%= test_pattern %>'
35
- examples.rcov_opts = '-Ilib -I<%= test_dir %>'
36
- examples.rcov = true
37
- end
38
- <% else %>
39
- require 'rcov/rcovtask'
40
- Rcov::RcovTask.new do |<%= test_task %>|
41
- <%= test_task %>.libs << '<%= test_dir %>'
42
- <%= test_task %>.pattern = '<%= test_pattern %>'
43
- <%= test_task %>.verbose = true
44
- <%= test_task %>.rcov_opts << '--exclude "gems/*"'
45
- end
46
- <% end %>
47
31
 
48
32
  <% if should_use_cucumber %>
49
33
  require 'cucumber/rake/task'
@@ -1,6 +1,6 @@
1
1
  require 'teststrap'
2
2
 
3
- context "<%= require_name %>" do
3
+ context '<%= require_name %>' do
4
4
  setup do
5
5
  false
6
6
  end
@@ -1,3 +1,4 @@
1
+ <%= render_template 'simplecov.erb' %>
1
2
  require 'rubygems'
2
3
  <%= render_template 'bundler_setup.erb' %>
3
4
  require 'riot'
@@ -1,7 +1,7 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
2
 
3
- describe "<%= constant_name %>" do
4
- it "fails" do
5
- fail "hey buddy, you should probably rename this file and start specing for real"
3
+ describe '<%= constant_name %>' do
4
+ it 'fails' do
5
+ fail 'hey buddy, you should probably rename this file and start specing for real'
6
6
  end
7
7
  end
@@ -1,5 +1,7 @@
1
+ <%= render_template 'simplecov.erb' %>
1
2
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
3
  $LOAD_PATH.unshift(File.dirname(__FILE__))
4
+
3
5
  require 'rspec'
4
6
  require '<%= require_name %>'
5
7
 
@@ -8,5 +10,5 @@ require '<%= require_name %>'
8
10
  Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
9
11
 
10
12
  RSpec.configure do |config|
11
-
13
+
12
14
  end
@@ -1,8 +1,8 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/tests_helper')
2
2
 
3
- Shindo.tests("<%= constant_name %>") do
4
- test("fails") do
5
- "hey buddy, you should probably rename this file and start specing for real"
3
+ Shindo.tests('<%= constant_name %>') do
4
+ test('fails') do
5
+ 'hey buddy, you should probably rename this file and start specing for real'
6
6
  false
7
7
  end
8
8
  end
@@ -1,3 +1,4 @@
1
+ <%= render_template 'simplecov.erb' %>
1
2
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
3
  $LOAD_PATH.unshift(File.dirname(__FILE__))
3
4
  require '<%= require_name %>'
@@ -1,3 +1,4 @@
1
+ <%= render_template 'simplecov.erb' %>
1
2
  require 'rubygems'
2
3
  <%= render_template 'bundler_setup.erb' %>
3
4
  require 'test/unit'
@@ -0,0 +1,16 @@
1
+ require 'simplecov'
2
+
3
+ module SimpleCov::Configuration
4
+ def clean_filters
5
+ @filters = []
6
+ end
7
+ end
8
+
9
+ SimpleCov.configure do
10
+ clean_filters
11
+ load_adapter 'test_frameworks'
12
+ end
13
+
14
+ ENV["COVERAGE"] && SimpleCov.start do
15
+ add_filter "/.rvm/"
16
+ end
@@ -1,7 +1,7 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/test_helper')
2
2
 
3
- describe "<%= constant_name %>" do
4
- it "fails" do
5
- fail "hey buddy, you should probably rename this file and start specing for real"
3
+ describe '<%= constant_name %>' do
4
+ it 'fails' do
5
+ fail 'hey buddy, you should probably rename this file and start specing for real'
6
6
  end
7
7
  end
@@ -1,4 +1,4 @@
1
-
1
+ <%= render_template 'simplecov.erb' %>
2
2
  require 'rubygems'
3
3
  require 'test/spec'
4
4
 
@@ -1,3 +1,4 @@
1
+ <%= render_template 'simplecov.erb' %>
1
2
  require 'rubygems'
2
3
  <%= render_template 'bundler_setup.erb' %>
3
4
  require 'test/unit'
@@ -1,8 +1,8 @@
1
1
  class Jeweler
2
2
  module Version
3
- MAJOR = 1
4
- MINOR = 8
5
- PATCH = 2
3
+ MAJOR = 2
4
+ MINOR = 0
5
+ PATCH = 1
6
6
  BUILD = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
@@ -13,16 +13,16 @@ class Jeweler
13
13
  module YamlExtension
14
14
  def write
15
15
  File.open(yaml_path, 'w+') do |f|
16
- YAML.dump(self.to_hash, f)
16
+ YAML.dump(to_hash, f)
17
17
  end
18
18
  end
19
19
 
20
20
  def to_hash
21
21
  {
22
- :major => major,
23
- :minor => minor,
24
- :patch => patch,
25
- :build => build
22
+ major: major,
23
+ minor: minor,
24
+ patch: patch,
25
+ build: build
26
26
  }
27
27
  end
28
28
 
@@ -39,7 +39,7 @@ class Jeweler
39
39
  end
40
40
 
41
41
  def read_yaml
42
- if File.exists?(yaml_path)
42
+ if File.exist?(yaml_path)
43
43
  YAML.load_file(yaml_path)
44
44
  else
45
45
  raise VersionYmlError, "#{yaml_path} does not exist!"
@@ -86,14 +86,12 @@ class Jeweler
86
86
  def initialize(base_dir)
87
87
  self.base_dir = base_dir
88
88
 
89
- if File.exists?(yaml_path)
89
+ if File.exist?(yaml_path)
90
90
  extend YamlExtension
91
91
  parse_yaml
92
92
  else
93
93
  extend PlaintextExtension
94
- if File.exists?(plaintext_path)
95
- parse_plaintext
96
- end
94
+ parse_plaintext if File.exist?(plaintext_path)
97
95
  end
98
96
  end
99
97
 
@@ -115,7 +113,7 @@ class Jeweler
115
113
  @build = nil
116
114
  end
117
115
 
118
- def update_to(major, minor, patch, build=nil)
116
+ def update_to(major, minor, patch, build = nil)
119
117
  @major = major
120
118
  @minor = minor
121
119
  @patch = patch
@@ -127,15 +125,20 @@ class Jeweler
127
125
  end
128
126
 
129
127
  def yaml_path
130
- denormalized_path = File.join(@base_dir, 'VERSION.yml')
131
- absolute_path = File.expand_path(denormalized_path)
132
- absolute_path.gsub(Dir.getwd + File::SEPARATOR, '')
128
+ path_to_version_file('VERSION.yml')
133
129
  end
134
130
 
135
131
  def plaintext_path
136
- denormalized_path = File.join(@base_dir, 'VERSION')
132
+ path_to_version_file('VERSION')
133
+ end
134
+
135
+ private
136
+
137
+ def path_to_version_file(filename)
138
+ denormalized_path = File.join(@base_dir, filename)
137
139
  absolute_path = File.expand_path(denormalized_path)
138
140
  absolute_path.gsub(Dir.getwd + File::SEPARATOR, '')
139
141
  end
142
+
140
143
  end
141
144
  end