jeweler 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -24,7 +24,8 @@ It's easy to get up and running. Update your Rakefile to instantiate a `Jeweler:
24
24
  require 'jeweler'
25
25
  Jeweler::Tasks.new do |gemspec|
26
26
  gemspec.name = "the-perfect-gem"
27
- gemspec.summary = "TODO"
27
+ gemspec.summary = "Summarize your gem"
28
+ gemspec.description = "Describe your gem"
28
29
  gemspec.email = "josh@technicalpickles.com"
29
30
  gemspec.homepage = "http://github.com/technicalpickles/the-perfect-gem"
30
31
  gemspec.description = "TODO"
@@ -116,6 +117,7 @@ With this in place, you now update your Jeweler::Tasks to setup `rubyforge_proje
116
117
  Jeweler::Tasks.new do |s|
117
118
  s.name = "the-perfect-gem"
118
119
  s.summary = "TODO"
120
+ s.description = "TODO"
119
121
  s.email = "josh@technicalpickles.com"
120
122
  s.homepage = "http://github.com/technicalpickles/the-perfect-gem"
121
123
  s.description = "TODO"
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :minor: 0
3
- :patch: 1
4
2
  :major: 1
3
+ :patch: 2
4
+ :minor: 0
@@ -6,7 +6,7 @@ Feature: generated Rakefile
6
6
  Scenario: shared
7
7
  Given a working directory
8
8
  And I have configured git sanely
9
- When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
9
+ When I generate a project named 'the-perfect-gem' that is 'zomg, so good' and described as 'Descriptive'
10
10
 
11
11
  Then 'Rakefile' requires 'rubygems'
12
12
  And 'Rakefile' requires 'rake'
@@ -14,6 +14,7 @@ Feature: generated Rakefile
14
14
  And Rakefile has 'the-perfect-gem' for the Jeweler::Tasks name
15
15
  And Rakefile has 'bar@example.com' for the Jeweler::Tasks email
16
16
  And Rakefile has 'zomg, so good' for the Jeweler::Tasks summary
17
+ And Rakefile has 'Descriptive' for the Jeweler::Tasks description
17
18
  And Rakefile has 'http://github.com/technicalpickles/the-perfect-gem' for the Jeweler::Tasks homepage
18
19
 
19
20
  Scenario: bacon
@@ -95,6 +96,40 @@ Feature: generated Rakefile
95
96
  Then Rakefile requires 'cucumber/rake/task'
96
97
  And Rakefile instantiates a Cucumber::Rake::Task
97
98
 
99
+ Scenario: no reek
100
+ Given a working directory
101
+ And I have configured git sanely
102
+ And I do not want reek
103
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
104
+ Then Rakefile does not require 'reek/rake_task'
105
+ And Rakefile does not instantiate a Reek::RakeTask
106
+
107
+ Scenario: reek
108
+ Given a working directory
109
+ And I have configured git sanely
110
+ And I want reek
111
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
112
+ Then Rakefile requires 'reek/rake_task'
113
+ And Rakefile instantiates a Reek::RakeTask
114
+
115
+ Scenario: no roodi
116
+ Given a working directory
117
+ And I have configured git sanely
118
+ And I do not want roodi
119
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
120
+ Then Rakefile does not require 'roodi'
121
+ And Rakefile does not require 'roodi_task'
122
+ And Rakefile does not instantiate a RoodiTask
123
+
124
+ Scenario: roodi
125
+ Given a working directory
126
+ And I have configured git sanely
127
+ And I want roodi
128
+ When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
129
+ Then Rakefile requires 'roodi'
130
+ And Rakefile requires 'roodi_task'
131
+ And Rakefile instantiates a RoodiTask
132
+
98
133
  Scenario: no rubyforge
99
134
  Given a working directory
100
135
  And I have configured git sanely
@@ -6,6 +6,22 @@ Given /^I want cucumber stories$/ do
6
6
  @use_cucumber = true
7
7
  end
8
8
 
9
+ Given /^I do not want reek$/ do
10
+ @use_reek = false
11
+ end
12
+
13
+ Given /^I want reek$/ do
14
+ @use_reek = true
15
+ end
16
+
17
+ Given /^I do not want roodi$/ do
18
+ @use_roodi = false
19
+ end
20
+
21
+ Given /^I want roodi$/ do
22
+ @use_roodi = true
23
+ end
24
+
9
25
  And /^I do not want rubyforge setup$/ do
10
26
  @use_rubyforge = false
11
27
  end
@@ -37,9 +53,14 @@ Given /^I set JEWELER_OPTS env variable to "(.*)"$/ do |val|
37
53
  ENV['JEWELER_OPTS'] = val
38
54
  end
39
55
 
40
- When /^I generate a (.*)project named '((?:\w|-|_)+)' that is '(.*)'$/ do |testing_framework, name, summary|
56
+ When /^I generate a (.*)project named '((?:\w|-|_)+)' that is '([^']*)'$/ do |testing_framework, name, summary|
57
+ When "I generate a #{testing_framework}project named '#{name}' that is '#{summary}' and described as ''"
58
+ end
59
+
60
+ When /^I generate a (.*)project named '((?:\w|-|_)+)' that is '([^']*)' and described as '([^']*)'$/ do |testing_framework, name, summary, description|
41
61
  @name = name
42
62
  @summary = summary
63
+ @description = description
43
64
 
44
65
  testing_framework = testing_framework.squeeze.strip
45
66
  unless testing_framework.blank?
@@ -50,9 +71,12 @@ When /^I generate a (.*)project named '((?:\w|-|_)+)' that is '(.*)'$/ do |testi
50
71
  arguments = ['--directory',
51
72
  "#{@working_dir}/#{@name}",
52
73
  '--summary', @summary,
74
+ '--description', @description,
53
75
  @use_cucumber ? '--cucumber' : nil,
54
76
  @testing_framework ? "--#{@testing_framework}" : nil,
55
77
  @use_rubyforge ? '--rubyforge' : nil,
78
+ @use_roodi ? '--roodi' : nil,
79
+ @use_reek ? '--reek' : nil,
56
80
  @name].compact
57
81
 
58
82
  @stdout = OutputCatcher.catch_out do
data/jeweler.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{jeweler}
5
- s.version = "1.0.1"
5
+ s.version = "1.0.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Josh Nichols"]
9
- s.date = %q{2009-05-15}
9
+ s.date = %q{2009-07-29}
10
10
  s.default_executable = %q{jeweler}
11
11
  s.description = %q{Simple and opinionated helper for creating Rubygem projects on GitHub}
12
12
  s.email = %q{josh@technicalpickles.com}
@@ -115,6 +115,7 @@ Gem::Specification.new do |s|
115
115
  "test/fixtures/existing-project-with-version-yaml/README.rdoc",
116
116
  "test/fixtures/existing-project-with-version-yaml/Rakefile",
117
117
  "test/fixtures/existing-project-with-version-yaml/VERSION.yml",
118
+ "test/fixtures/existing-project-with-version-yaml/bin/foo_the_ultimate_bin",
118
119
  "test/fixtures/existing-project-with-version-yaml/existing-project-with-version.gemspec",
119
120
  "test/fixtures/existing-project-with-version-yaml/lib/existing_project_with_version.rb",
120
121
  "test/fixtures/existing-project-with-version-yaml/test/existing_project_with_version_test.rb",
@@ -145,12 +146,11 @@ Gem::Specification.new do |s|
145
146
  "test/test_tasks.rb",
146
147
  "test/test_version_helper.rb"
147
148
  ]
148
- s.has_rdoc = true
149
149
  s.homepage = %q{http://github.com/technicalpickles/jeweler}
150
150
  s.rdoc_options = ["--charset=UTF-8"]
151
151
  s.require_paths = ["lib"]
152
152
  s.rubyforge_project = %q{pickles}
153
- s.rubygems_version = %q{1.3.1}
153
+ s.rubygems_version = %q{1.3.4}
154
154
  s.summary = %q{Simple and opinionated helper for creating Rubygem projects on GitHub}
155
155
  s.test_files = [
156
156
  "test/fixtures/bar/lib/foo_the_ultimate_lib.rb",
@@ -188,7 +188,7 @@ Gem::Specification.new do |s|
188
188
 
189
189
  if s.respond_to? :specification_version then
190
190
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
191
- s.specification_version = 2
191
+ s.specification_version = 3
192
192
 
193
193
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
194
194
  s.add_runtime_dependency(%q<git>, [">= 1.1.1"])
@@ -30,7 +30,9 @@ class Jeweler
30
30
  class Generator
31
31
  attr_accessor :target_dir, :user_name, :user_email, :summary, :testing_framework,
32
32
  :project_name, :github_username, :github_token,
33
- :repo, :should_create_repo, :should_use_cucumber, :should_setup_rubyforge
33
+ :repo, :should_create_repo, :should_use_cucumber, :should_setup_rubyforge,
34
+ :should_use_reek, :should_use_roodi,
35
+ :description
34
36
 
35
37
  DEFAULT_TESTING_FRAMEWORK = :shoulda
36
38
 
@@ -54,8 +56,11 @@ class Jeweler
54
56
  self.target_dir = options[:directory] || self.project_name
55
57
 
56
58
  self.should_create_repo = options[:create_repo]
57
- self.summary = options[:summary] || 'TODO'
59
+ self.summary = options[:summary] || 'TODO: one-line summary of your gem'
60
+ self.description = options[:description] || 'TODO: longer description of your gem'
58
61
  self.should_use_cucumber = options[:use_cucumber]
62
+ self.should_use_reek = options[:use_reek]
63
+ self.should_use_roodi = options[:use_roodi]
59
64
  self.should_setup_rubyforge = options[:rubyforge]
60
65
 
61
66
  use_user_git_config
@@ -40,6 +40,14 @@ class Jeweler
40
40
  self[:use_cucumber] = true
41
41
  end
42
42
 
43
+ o.on('--reek', 'generate rake task for reek') do
44
+ self[:use_reek] = true
45
+ end
46
+
47
+ o.on('--roodi', 'generate rake task for roodi') do
48
+ self[:use_roodi] = true
49
+ end
50
+
43
51
  o.on('--create-repo', 'create the repository on GitHub') do
44
52
  self[:create_repo] = true
45
53
  end
@@ -52,6 +60,10 @@ class Jeweler
52
60
  self[:summary] = summary
53
61
  end
54
62
 
63
+ o.on('--description [DESCRIPTION]', 'specify a description of the project') do |description|
64
+ self[:description] = description
65
+ end
66
+
55
67
  o.on('--directory [DIRECTORY]', 'specify the directory to generate into') do |directory|
56
68
  self[:directory] = directory
57
69
  end
@@ -28,11 +28,12 @@ class Jeweler
28
28
  Dir.chdir(base_dir) do
29
29
  if blank?(files) && File.directory?(File.join(base_dir, '.git'))
30
30
  repo = Git.open(base_dir)
31
- self.files = repo.ls_files.keys
31
+ self.files = repo.ls_files.keys - repo.lib.ignored_files
32
32
  end
33
33
 
34
34
  if blank?(test_files)
35
- self.test_files = FileList['{spec,test,examples}/**/*.rb']
35
+ repo = Git.open(base_dir)
36
+ self.test_files = FileList['{spec,test,examples}/**/*.rb'] - repo.lib.ignored_files
36
37
  end
37
38
 
38
39
  if blank?(executable)
data/lib/jeweler/tasks.rb CHANGED
@@ -20,7 +20,6 @@ class Jeweler
20
20
 
21
21
  private
22
22
  def define
23
- desc "Setup initial version of 0.0.0"
24
23
  task :version_required do
25
24
  unless jeweler.version_exists?
26
25
  abort "Expected VERSION or VERSION.yml to exist. See version:write to create an initial one."
@@ -2,6 +2,17 @@
2
2
 
3
3
  Description goes here.
4
4
 
5
+ == Note on Patches/Pull Requests
6
+
7
+ * Fork the project.
8
+ * Make your feature addition or bug fix.
9
+ * Add tests for it. This is important so I don't break it in a
10
+ future version unintentionally.
11
+ * Commit, do not mess with rakefile, version, or history.
12
+ (if you want to have your own version, that is fine but
13
+ bump version in a commit by itself I can ignore when I pull)
14
+ * Send me a pull request. Bonus points for topic branches.
15
+
5
16
  == Copyright
6
17
 
7
18
  Copyright (c) <%= Time.now.year %> <%= user_name %>. See LICENSE for details.
@@ -6,6 +6,7 @@ begin
6
6
  Jeweler::Tasks.new do |gem|
7
7
  gem.name = "<%= project_name %>"
8
8
  gem.summary = %Q{<%= summary %>}
9
+ gem.description = %Q{<%= description %>}
9
10
  gem.email = "<%= user_email %>"
10
11
  gem.homepage = "<%= project_homepage %>"
11
12
  gem.authors = ["<%= user_name %>"]
@@ -83,6 +84,35 @@ rescue LoadError
83
84
  end
84
85
  <% end %>
85
86
 
87
+ <% if should_use_reek %>
88
+ begin
89
+ require 'reek/rake_task'
90
+ Reek::RakeTask.new do |t|
91
+ t.fail_on_error = true
92
+ t.verbose = false
93
+ t.source_files = 'lib/**/*.rb'
94
+ end
95
+ rescue LoadError
96
+ task :reek do
97
+ abort "Reek is not available. In order to run reek, you must: sudo gem install reek"
98
+ end
99
+ end
100
+ <% end %>
101
+
102
+ <% if should_use_roodi %>
103
+ begin
104
+ require 'roodi'
105
+ require 'roodi_task'
106
+ RoodiTask.new do |t|
107
+ t.verbose = false
108
+ end
109
+ rescue LoadError
110
+ task :roodi do
111
+ abort "Roodi is not available. In order to run roodi, you must: sudo gem install roodi"
112
+ end
113
+ end
114
+ <% end %>
115
+
86
116
  task :default => :<%= default_task %>
87
117
 
88
118
  require 'rake/rdoctask'
@@ -1,8 +1,9 @@
1
- require 'spec'
2
-
3
1
  $LOAD_PATH.unshift(File.dirname(__FILE__))
4
2
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
5
3
  require '<%= require_name %>'
4
+ require 'spec'
5
+ require 'spec/autorun'
6
+
6
7
 
7
8
  Spec::Runner.configure do |config|
8
9
 
@@ -5,7 +5,7 @@ begin
5
5
  require 'jeweler'
6
6
  Jeweler::Tasks.new do |gem|
7
7
  gem.name = "existing-project-with-version"
8
- gem.summary = %Q{TODO}
8
+ gem.summary = %Q{Summarize your gem}
9
9
  gem.email = "josh@technicalpickles.com"
10
10
  gem.homepage = "http://github.com/technicalpickles/existing-project-with-version"
11
11
  gem.authors = ["Josh Nichols"]
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.rdoc_options = ["--inline-source", "--charset=UTF-8"]
16
16
  s.require_paths = ["lib"]
17
17
  s.rubygems_version = %q{1.3.1}
18
- s.summary = %q{TODO}
18
+ s.summary = %q{Summarize your gem}
19
19
 
20
20
  if s.respond_to? :specification_version then
21
21
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
@@ -5,7 +5,7 @@ begin
5
5
  require 'jeweler'
6
6
  Jeweler::Tasks.new do |gem|
7
7
  gem.name = "existing-project-with-version"
8
- gem.summary = %Q{TODO}
8
+ gem.summary = %Q{Summarize your gem}
9
9
  gem.email = "josh@technicalpickles.com"
10
10
  gem.homepage = "http://github.com/technicalpickles/existing-project-with-version"
11
11
  gem.authors = ["Josh Nichols"]
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.rdoc_options = ["--inline-source", "--charset=UTF-8"]
16
16
  s.require_paths = ["lib"]
17
17
  s.rubygems_version = %q{1.3.1}
18
- s.summary = %q{TODO}
18
+ s.summary = %q{Summarize your gem}
19
19
 
20
20
  if s.respond_to? :specification_version then
21
21
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
@@ -31,8 +31,12 @@ class TestGenerator < Test::Unit::TestCase
31
31
  assert_equal 'the-perfect-gem', build_generator.target_dir
32
32
  end
33
33
 
34
- should "have TODO as default summary" do
35
- assert_equal "TODO", build_generator.summary
34
+ should "have default summary" do
35
+ assert_equal "TODO: one-line summary of your gem", build_generator.summary
36
+ end
37
+
38
+ should "have default description" do
39
+ assert_equal "TODO: longer description of your gem", build_generator.description
36
40
  end
37
41
 
38
42
  should "not create repo by default" do
@@ -43,6 +47,14 @@ class TestGenerator < Test::Unit::TestCase
43
47
  assert ! build_generator.should_use_cucumber
44
48
  end
45
49
 
50
+ should "not use reek by default" do
51
+ assert ! build_generator.should_use_reek
52
+ end
53
+
54
+ should "not use roodi by default" do
55
+ assert ! build_generator.should_use_roodi
56
+ end
57
+
46
58
  should "raise error for invalid testing frameworks" do
47
59
  assert_raise ArgumentError do
48
60
  build_generator(:zomg_invalid)
data/test/test_options.rb CHANGED
@@ -57,6 +57,18 @@ class TestOptions < Test::Unit::TestCase
57
57
  end
58
58
  end
59
59
 
60
+ for_options '--reek' do
61
+ should 'enable reek' do
62
+ assert_equal true, @options[:use_reek]
63
+ end
64
+ end
65
+
66
+ for_options '--roodi' do
67
+ should 'enable roodi' do
68
+ assert_equal true, @options[:use_roodi]
69
+ end
70
+ end
71
+
60
72
  for_options '--create-repo' do
61
73
  should 'create repository' do
62
74
  assert @options[:create_repo]
@@ -75,6 +87,12 @@ class TestOptions < Test::Unit::TestCase
75
87
  end
76
88
  end
77
89
 
90
+ for_options '--description', 'Descriptive' do
91
+ should 'have description Descriptive' do
92
+ assert_equal 'Descriptive', @options[:description]
93
+ end
94
+ end
95
+
78
96
  for_options '--directory', 'foo' do
79
97
  should 'have directory foo' do
80
98
  assert_equal 'foo', @options[:directory]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jeweler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Nichols
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-05-15 00:00:00 -04:00
12
+ date: 2009-07-29 00:00:00 -04:00
13
13
  default_executable: jeweler
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -139,6 +139,7 @@ files:
139
139
  - test/fixtures/existing-project-with-version-yaml/README.rdoc
140
140
  - test/fixtures/existing-project-with-version-yaml/Rakefile
141
141
  - test/fixtures/existing-project-with-version-yaml/VERSION.yml
142
+ - test/fixtures/existing-project-with-version-yaml/bin/foo_the_ultimate_bin
142
143
  - test/fixtures/existing-project-with-version-yaml/existing-project-with-version.gemspec
143
144
  - test/fixtures/existing-project-with-version-yaml/lib/existing_project_with_version.rb
144
145
  - test/fixtures/existing-project-with-version-yaml/test/existing_project_with_version_test.rb
@@ -170,6 +171,8 @@ files:
170
171
  - test/test_version_helper.rb
171
172
  has_rdoc: true
172
173
  homepage: http://github.com/technicalpickles/jeweler
174
+ licenses: []
175
+
173
176
  post_install_message:
174
177
  rdoc_options:
175
178
  - --charset=UTF-8
@@ -190,9 +193,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
193
  requirements: []
191
194
 
192
195
  rubyforge_project: pickles
193
- rubygems_version: 1.3.1
196
+ rubygems_version: 1.3.4
194
197
  signing_key:
195
- specification_version: 2
198
+ specification_version: 3
196
199
  summary: Simple and opinionated helper for creating Rubygem projects on GitHub
197
200
  test_files:
198
201
  - test/fixtures/bar/lib/foo_the_ultimate_lib.rb