namelessjon-jeweler 0.7.2 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. data/.gitignore +7 -0
  2. data/ChangeLog.markdown +65 -5
  3. data/README.markdown +99 -19
  4. data/ROADMAP +12 -0
  5. data/Rakefile +87 -23
  6. data/VERSION.yml +3 -3
  7. data/bin/jeweler +1 -65
  8. data/features/generator/cucumber.feature +83 -0
  9. data/features/generator/directory_layout.feature +76 -0
  10. data/features/generator/dotdocument.feature +14 -0
  11. data/features/generator/env_options.feature +9 -0
  12. data/features/generator/git.feature +94 -0
  13. data/features/generator/license.feature +11 -0
  14. data/features/generator/rakefile.feature +110 -0
  15. data/features/generator/readme.feature +12 -0
  16. data/features/generator/test.feature +41 -0
  17. data/features/generator/test_helper.feature +49 -0
  18. data/features/placeholder.feature +5 -0
  19. data/features/step_definitions/debug_steps.rb +6 -0
  20. data/features/step_definitions/filesystem_steps.rb +65 -0
  21. data/features/step_definitions/generator_steps.rb +251 -0
  22. data/features/step_definitions/task_steps.rb +6 -0
  23. data/features/support/env.rb +19 -0
  24. data/features/tasks/build_gem.feature +9 -0
  25. data/features/tasks/version.feature +24 -0
  26. data/features/tasks/version_bumping.feature +33 -0
  27. data/jeweler.gemspec +204 -0
  28. data/lib/jeweler.rb +52 -147
  29. data/lib/jeweler/commands.rb +12 -0
  30. data/lib/jeweler/commands/build_gem.rb +31 -0
  31. data/lib/jeweler/commands/install_gem.rb +26 -0
  32. data/lib/jeweler/commands/release.rb +83 -0
  33. data/lib/jeweler/commands/release_to_rubyforge.rb +51 -0
  34. data/lib/jeweler/commands/setup_rubyforge.rb +38 -0
  35. data/lib/jeweler/commands/validate_gemspec.rb +30 -0
  36. data/lib/jeweler/commands/version/base.rb +41 -0
  37. data/lib/jeweler/commands/version/bump_major.rb +13 -0
  38. data/lib/jeweler/commands/version/bump_minor.rb +12 -0
  39. data/lib/jeweler/commands/version/bump_patch.rb +14 -0
  40. data/lib/jeweler/commands/version/write.rb +12 -0
  41. data/lib/jeweler/commands/write_gemspec.rb +39 -0
  42. data/lib/jeweler/errors.rb +13 -1
  43. data/lib/jeweler/gemspec_helper.rb +76 -0
  44. data/lib/jeweler/generator.rb +160 -66
  45. data/lib/jeweler/generator/application.rb +54 -0
  46. data/lib/jeweler/generator/bacon_mixin.rb +39 -0
  47. data/lib/jeweler/generator/micronaut_mixin.rb +38 -0
  48. data/lib/jeweler/generator/minitest_mixin.rb +39 -0
  49. data/lib/jeweler/generator/options.rb +77 -0
  50. data/lib/jeweler/generator/rspec_mixin.rb +39 -0
  51. data/lib/jeweler/generator/shoulda_mixin.rb +39 -0
  52. data/lib/jeweler/generator/testunit_mixin.rb +39 -0
  53. data/lib/jeweler/rubyforge_tasks.rb +46 -0
  54. data/lib/jeweler/specification.rb +65 -0
  55. data/lib/jeweler/tasks.rb +64 -51
  56. data/lib/jeweler/templates/.document +5 -0
  57. data/lib/jeweler/templates/.gitignore +3 -1
  58. data/lib/jeweler/templates/LICENSE +1 -1
  59. data/lib/jeweler/templates/README.rdoc +7 -0
  60. data/lib/jeweler/templates/Rakefile +85 -26
  61. data/lib/jeweler/templates/bacon/{flunking_spec.rb → flunking.rb} +1 -1
  62. data/lib/jeweler/templates/bacon/{spec_helper.rb → helper.rb} +2 -2
  63. data/lib/jeweler/templates/features/default.feature +9 -0
  64. data/lib/jeweler/templates/features/support/env.rb +8 -0
  65. data/lib/jeweler/templates/micronaut/flunking.rb +7 -0
  66. data/lib/jeweler/templates/micronaut/helper.rb +17 -0
  67. data/lib/jeweler/templates/minitest/flunking.rb +7 -0
  68. data/lib/jeweler/templates/minitest/helper.rb +11 -0
  69. data/lib/jeweler/templates/rspec/flunking.rb +7 -0
  70. data/lib/jeweler/templates/rspec/helper.rb +9 -0
  71. data/lib/jeweler/templates/shoulda/{flunking_test.rb → flunking.rb} +2 -2
  72. data/lib/jeweler/templates/shoulda/{test_helper.rb → helper.rb} +2 -2
  73. data/lib/jeweler/templates/testunit/flunking.rb +7 -0
  74. data/lib/jeweler/templates/testunit/helper.rb +9 -0
  75. data/lib/jeweler/version_helper.rb +128 -0
  76. data/test/fixtures/bar/bin/foo_the_ultimate_bin +1 -0
  77. data/test/fixtures/bar/hey_include_me_in_gemspec +0 -0
  78. data/test/fixtures/bar/lib/foo_the_ultimate_lib.rb +1 -0
  79. data/test/fixtures/existing-project-with-version-plaintext/.document +5 -0
  80. data/test/fixtures/existing-project-with-version-plaintext/.gitignore +5 -0
  81. data/test/fixtures/existing-project-with-version-plaintext/LICENSE +20 -0
  82. data/test/fixtures/existing-project-with-version-plaintext/README.rdoc +7 -0
  83. data/test/fixtures/existing-project-with-version-plaintext/Rakefile +82 -0
  84. data/test/fixtures/existing-project-with-version-plaintext/VERSION +1 -0
  85. data/test/fixtures/existing-project-with-version-plaintext/existing-project-with-version.gemspec +29 -0
  86. data/test/fixtures/existing-project-with-version-plaintext/lib/existing_project_with_version.rb +0 -0
  87. data/test/fixtures/existing-project-with-version-plaintext/test/existing_project_with_version_test.rb +7 -0
  88. data/test/fixtures/existing-project-with-version-plaintext/test/test_helper.rb +10 -0
  89. data/test/fixtures/existing-project-with-version-yaml/.document +5 -0
  90. data/test/fixtures/existing-project-with-version-yaml/.gitignore +5 -0
  91. data/test/fixtures/existing-project-with-version-yaml/LICENSE +20 -0
  92. data/test/fixtures/existing-project-with-version-yaml/README.rdoc +7 -0
  93. data/test/fixtures/existing-project-with-version-yaml/Rakefile +82 -0
  94. data/test/fixtures/existing-project-with-version-yaml/VERSION.yml +4 -0
  95. data/test/fixtures/existing-project-with-version-yaml/existing-project-with-version.gemspec +29 -0
  96. data/test/fixtures/existing-project-with-version-yaml/lib/existing_project_with_version.rb +0 -0
  97. data/test/fixtures/existing-project-with-version-yaml/test/existing_project_with_version_test.rb +7 -0
  98. data/test/fixtures/existing-project-with-version-yaml/test/test_helper.rb +10 -0
  99. data/test/geminstaller.yml +12 -0
  100. data/test/jeweler/commands/test_build_gem.rb +72 -0
  101. data/test/jeweler/commands/test_install_gem.rb +21 -0
  102. data/test/jeweler/commands/test_release.rb +405 -0
  103. data/test/jeweler/commands/test_release_to_rubyforge.rb +157 -0
  104. data/test/jeweler/commands/test_setup_rubyforge.rb +88 -0
  105. data/test/jeweler/commands/test_validate_gemspec.rb +27 -0
  106. data/test/jeweler/commands/test_write_gemspec.rb +92 -0
  107. data/test/jeweler/commands/version/test_base.rb +32 -0
  108. data/test/jeweler/commands/version/test_bump_major.rb +22 -0
  109. data/test/jeweler/commands/version/test_bump_minor.rb +19 -0
  110. data/test/jeweler/commands/version/test_bump_patch.rb +20 -0
  111. data/test/jeweler/commands/version/test_write.rb +23 -0
  112. data/test/test_application.rb +139 -0
  113. data/test/{test_gemspec.rb → test_gemspec_helper.rb} +13 -5
  114. data/test/test_generator.rb +118 -233
  115. data/test/test_generator_initialization.rb +113 -0
  116. data/test/test_generator_mixins.rb +18 -0
  117. data/test/test_helper.rb +98 -28
  118. data/test/test_jeweler.rb +136 -95
  119. data/test/test_options.rb +116 -0
  120. data/test/test_specification.rb +61 -0
  121. data/test/test_tasks.rb +17 -6
  122. data/test/test_version_helper.rb +153 -0
  123. metadata +160 -34
  124. data/TODO +0 -13
  125. data/lib/jeweler/gemspec.rb +0 -41
  126. data/lib/jeweler/templates/README +0 -9
  127. data/lib/jeweler/version.rb +0 -83
  128. data/test/generators/initialization_test.rb +0 -146
  129. data/test/test_version.rb +0 -115
@@ -0,0 +1,7 @@
1
+ coverage
2
+ pkg
3
+ rdoc
4
+ tags
5
+ test/tmp
6
+ test/version_tmp
7
+ tmp
@@ -1,23 +1,83 @@
1
- # jeweler 0.7.2
1
+ # jeweler 0.11.1
2
+
3
+ * Lots of internal refactorings to how project generation happens
4
+ * Fixed missing dependency on rubyforge
5
+ * Depend on a recent version of schacon-git which works on ruby 1.9
6
+ * Updated cucumber support for 0.3.x
7
+ * Tested on Ruby 1.9
8
+
9
+ # jeweler 0.11.0 2009-04-05
10
+
11
+ * generator will respect JEWELER_OPTS, as a way to provide default options
12
+ (pat-maddox)
13
+ * Include 'examples' and 'rails' directories by default in gemspec files
14
+ * generated gemspec now will only include files (not directories). also, they are listed one per line, and sorted.
15
+ * Jeweler::Tasks's intializer has been improved:
16
+ * You can now pass it an existing gemspec (othewise a new one will be created)
17
+ * Jeweler sets its defaults before yielding the gemspec to you. This allows you to append to its defaults, so you aren't forced to entirely overwrite them just to add one value.
18
+ * Managing a gemspec's files, test_files, and extra_rdoc_files is now more flexible. They are now wrapped in a FileList, so you can easily 'include' or 'exclude' patterns.
19
+
20
+ # jeweler 0.10.2 2009-03-26
21
+
22
+ * 'rake install' now will 'rake build' first
23
+ * Support for releasing to RubyForge, thanks to jtrupiano
24
+ * Steps towards Ruby 1.9 support, thanks to rsanheim
25
+
26
+ # jeweler 0.9.1 2009-03-05
27
+
28
+ * Tasks:
29
+ * Fixed populating default spec's extra_rdoc_files
30
+ * Removed redudant gem building/installing tasks. Use rake build and rake install
31
+ * Generator:
32
+ * Added support for micronaut
33
+ * Generate nicer block variable names in Rakefile
34
+ * Cucumber generation now places steps in features/step_features, to follow cucumber standards
35
+
36
+ * shoulda and test/unit test_helpers no longers require mocha
37
+ * Rakefile uses more readable block variable names
38
+ * .gitignore now includes pkg and coverage directories
39
+ * Avoid puts'ing in Rakefile when LoadError occurs. Instead, define a task that aborts with instructions to install.
40
+ * Cucumber is now optional. Generate stories using --cucumber
41
+ * Bacon's 'test' task is now 'spec'
42
+ * Generate README.rdoc instead of just a plain text README
43
+ * Updated year in README.rdoc and COPYRIGHT to be based on the current year instead of hardcoded
44
+
45
+ # jeweler 0.8.1 2009-02-03
46
+
47
+ * Fixed minitest generator
48
+
49
+ # jeweler 0.8.0 2009-02-03
50
+
51
+ * Generator:
52
+ * Supports these new testing frameworks:
53
+ * test/unit
54
+ * minitest
55
+ * rspec
56
+ * Added support for cucumber
57
+ * Creating a new gem is now more verbose, and will show files/directories created
58
+ * Binaries will now be automatically detected in 'bin'
59
+
60
+ # jeweler 0.7.2 2009-01-29
2
61
 
3
62
  * Added rake task 'version:bump' which is shorthand for 'version:bump:patch'
4
63
  * Generated projects no longer assume RCov is installed.
5
64
 
6
- # jeweler 0.7.1
65
+ # jeweler 0.7.1 2009-01-26
7
66
 
8
67
  * Fixed yaml not being required
68
+ * Automatically add files in bin as executables in gemspec
9
69
 
10
- # jeweler 0.7.0
70
+ # jeweler 0.7.0 2009-01-19
11
71
 
12
72
  * Added support to generator for specifying a description
13
73
  * Condensed README.markdown to be less novel-like
14
74
  * RDoc is now included in your gemspec
15
75
  * Rescue errors that raise in the generator, and display better error message, and exit with a non-zero exit status
16
76
 
17
- # jeweler 0.6.5
77
+ # jeweler 0.6.5 2009-01-14
18
78
 
19
79
  * `jeweler --create-repo foo` now enables gem creation in addition to creating the repository
20
80
 
21
- # jeweler 0.6.4
81
+ # jeweler 0.6.4 2009-01-13
22
82
 
23
83
  * Added tasks `build` and `install` as shortcuts for `gem:build` and `gem:install`
@@ -5,28 +5,38 @@ Jeweler provides two things:
5
5
  * Rake tasks for managing gems and versioning of a <a href="http://github.com">GitHub</a> project
6
6
  * A generator for creating kickstarting a new project
7
7
 
8
- ## Setting up in an existing project
8
+ ## Quick Links
9
9
 
10
- It's easy to get up and running. Update your instantiate a `Jeweler::Tasks`, and give it a block with details about your project.
10
+ * [Wiki](http://wiki.github.com/technicalpickles/jeweler)
11
+ * [Bugs](http://github.com/technicalpickles/jeweler/issues)
12
+ * [Donate](http://pledgie.org/campaigns/2604)
13
+
14
+ ## Installing
15
+
16
+ # Install the gem:
17
+ sudo gem install jeweler
18
+
19
+ ## Using in an existing project
11
20
 
21
+ It's easy to get up and running. Update your Rakefile to instantiate a `Jeweler::Tasks`, and give it a block with details about your project.
12
22
 
13
23
  begin
14
24
  require 'jeweler'
15
- Jeweler::Tasks.new do |s|
16
- s.name = "the-perfect-gem"
17
- s.summary = "TODO"
18
- s.email = "josh@technicalpickles.com"
19
- s.homepage = "http://github.com/technicalpickles/the-perfect-gem"
20
- s.description = "TODO"
21
- s.authors = ["Josh Nichols"]
25
+ Jeweler::Tasks.new do |gemspec|
26
+ gemspec.name = "the-perfect-gem"
27
+ gemspec.summary = "TODO"
28
+ gemspec.email = "josh@technicalpickles.com"
29
+ gemspec.homepage = "http://github.com/technicalpickles/the-perfect-gem"
30
+ gemspec.description = "TODO"
31
+ gemspec.authors = ["Josh Nichols"]
22
32
  end
23
33
  rescue LoadError
24
34
  puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
25
35
  end
26
36
 
27
- In this example, `s` is a Gem::Specification object. See the documentation for what possible values you can set on it.
37
+ The yield object here, `gemspec`, is a `Gem::Specification` object. See the [Customizing your project's gem specification](http://wiki.github.com/technicalpickles/jeweler/customizing-your-projects-gem-specification) for more details about how you can customize your gemspec.
28
38
 
29
- ## Kicking off a new project
39
+ ## Using to start a new project
30
40
 
31
41
  Jeweler provides a generator. It requires you to [setup your name and email for git](http://github.com/guides/tell-git-your-user-name-and-email-address) and [your username and token for GitHub](http://github.com/guides/local-github-config).
32
42
 
@@ -37,8 +47,18 @@ This will prepare a project in the 'the-perfect-gem' directory, setup to use Jew
37
47
  It supports a number of options:
38
48
 
39
49
  * --create-repo: in addition to preparing a project, it create an repo up on GitHub and enable RubyGem generation
40
- * --shoulda: generate test_helper.rb and empty test ready for shoulda (this is the default)
41
- * --bacon: generate spec_helper.rb and empty spec ready for bacon
50
+ * --testunit: generate test_helper.rb and test ready for test/unit
51
+ * --minitest: generate test_helper.rb and test ready for minitest
52
+ * --shoulda: generate test_helper.rb and test ready for shoulda (this is the default)
53
+ * --rspec: generate spec_helper.rb and spec ready for rspec
54
+ * --bacon: generate spec_helper.rb and spec ready for bacon
55
+ * --rubyforge: setup releasing to rubyforge
56
+
57
+ ### Default options
58
+
59
+ Jeweler respects the JEWELER_OPTS environment variable. Want to always use RSpec, and you're using bash? Add this to ~/.bashrc:
60
+
61
+ export JEWELER_OPTS="--rspec"
42
62
 
43
63
  ## Gemspec
44
64
 
@@ -65,7 +85,7 @@ Initially, your project starts out at 0.0.0. Jeweler provides Rake tasks for bum
65
85
  rake version:bump:minor
66
86
  rake version:bump:patch
67
87
 
68
- ## Releasing
88
+ ## Releasing to GitHub
69
89
 
70
90
  Jeweler handles releasing your gem into the wild:
71
91
 
@@ -77,14 +97,74 @@ It does the following for you:
77
97
  * Push to GitHub (which results in a gem being build)
78
98
  * Tag the version and push to GitHub
79
99
 
100
+ ## Releasing to RubyForge
101
+
102
+ Jeweler can also handle releasing to [RubyForge](http://rubyforge.org). There are a few steps you need to do before doing any RubyForge releases with Jeweler:
103
+
104
+ * [Create an account on RubyForge](http://rubyforge.org/account/register.php)
105
+ * Request a project on RubyForge. This involves waiting for a project approval, which can take any amount of time from a few hours to a week
106
+ * You might want to create an umbrella project where you can publish your gems, instead of one project per gem
107
+ * Install the RubyForge gem: sudo gem install rubyforge
108
+ * Run 'rubyforge setup' and fill in your username and password for RubyForge
109
+ * Run 'rubyforge config' to pull down information about your projects
110
+ * Run 'rubyforge login' to make sure you are able to login
111
+
112
+ With this in place, you now update your Jeweler::Tasks to setup `rubyforge_project` with the RubyForge project you've just created. (Note, using `jeweler --rubyforge` when generating the project does this for you automatically.)
113
+
114
+ begin
115
+ require 'jeweler'
116
+ Jeweler::Tasks.new do |s|
117
+ s.name = "the-perfect-gem"
118
+ s.summary = "TODO"
119
+ s.email = "josh@technicalpickles.com"
120
+ s.homepage = "http://github.com/technicalpickles/the-perfect-gem"
121
+ s.description = "TODO"
122
+ s.authors = ["Josh Nichols"]
123
+ s.rubyforge_project = 'the-perfect-gem' # This line would be new
124
+ end
125
+ rescue LoadError
126
+ puts "Jeweler not available. Install it with: sudo gem install jeweler"
127
+ end
128
+
129
+ # These are new tasks
130
+ begin
131
+ require 'rake/contrib/sshpublisher'
132
+ namespace :rubyforge do
133
+
134
+ desc "Release gem and RDoc documentation to RubyForge"
135
+ task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
136
+
137
+ namespace :release do
138
+ desc "Publish RDoc to RubyForge."
139
+ task :docs => [:rdoc] do
140
+ config = YAML.load(
141
+ File.read(File.expand_path('~/.rubyforge/user-config.yml'))
142
+ )
143
+
144
+ host = "#{config['username']}@rubyforge.org"
145
+ remote_dir = "/var/www/gforge-projects/the-perfect-gem/"
146
+ local_dir = 'rdoc'
147
+
148
+ Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
149
+ end
150
+ end
151
+ end
152
+ rescue LoadError
153
+ puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
154
+ end
155
+
156
+ Now you must initially create a 'package' for your gem in your 'project':
157
+
158
+ $ rake rubyforge:setup
159
+
160
+ With all that setup out of the way, you can now release to RubyForge with impunity. This would release the current version of your gem, and upload the rdoc as your project's webpage.
161
+
162
+ $ rake rubyforge:release
163
+
80
164
  ## Workflow
81
165
 
82
166
  * Hack, commit, hack, commit, etc, etc
83
167
  * `rake version:bump:patch release` to do the actual version bump and release
84
168
  * Have a delicious scotch
85
- * Go to [Has My Gem Built Yet](http://hasmygembuiltyet.org) and wait for your gem to be built
169
+ * Install [gemstalker](http://github.com/technicalpickles/gemstalker), and use it to know when gem is built. It typically builds in a few minutes, but won't be installable for another 15 minutes.
86
170
 
87
- ## Links
88
-
89
- * [Bugs](http://technicalpickles.lighthouseapp.com/projects/23560-jeweler/overview)
90
- * [Donate](http://pledgie.org/campaigns/2604)
data/ROADMAP ADDED
@@ -0,0 +1,12 @@
1
+ = 1.0
2
+
3
+ * Improve documentation on wiki/readme
4
+
5
+ = Unscheduled, or waiting for contributions
6
+
7
+ * Add command to output the Jeweler::Tasks to help with upgrading/migrating
8
+ * Support github user/token on generator command line
9
+ * Support C extensions
10
+ * Support JRuby gems
11
+ * Support thor
12
+ * Dealing with version bumps in other remotes
data/Rakefile CHANGED
@@ -1,42 +1,106 @@
1
1
  require 'rake'
2
- require 'rake/testtask'
3
- begin
4
- require 'hanna/rdoctask'
5
- rescue LoadError
6
- require 'rake/rdoctask'
7
- end
8
2
 
9
- require 'rcov/rcovtask'
3
+ $LOAD_PATH.unshift('lib')
10
4
 
11
- $:.unshift('lib')
5
+ gem 'git'
6
+ require 'git'
12
7
 
13
8
  begin
14
9
  require 'jeweler'
15
- Jeweler::Tasks.new do |s|
16
- s.name = "jeweler"
17
- s.summary = "Simple and opinionated helper for creating Rubygem projects on GitHub"
18
- s.email = "josh@technicalpickles.com"
19
- s.homepage = "http://github.com/technicalpickles/jeweler"
20
- s.description = "Simple and opinionated helper for creating Rubygem projects on GitHub"
21
- s.authors = ["Josh Nichols"]
22
- s.files = FileList["[A-Z]*", "{bin,generators,lib,test}/**/*", 'lib/jeweler/templates/.gitignore']
23
- s.add_dependency 'schacon-git'
10
+ Jeweler::Tasks.new do |gem|
11
+ gem.name = "jeweler"
12
+ gem.summary = "Simple and opinionated helper for creating Rubygem projects on GitHub"
13
+ gem.email = "josh@technicalpickles.com"
14
+ gem.homepage = "http://github.com/technicalpickles/jeweler"
15
+ gem.description = "Simple and opinionated helper for creating Rubygem projects on GitHub"
16
+ gem.authors = ["Josh Nichols"]
17
+ gem.files.include %w(lib/jeweler/templates/.document lib/jeweler/templates/.gitignore)
18
+ gem.add_dependency "git", ">= 1.1.1"
19
+ gem.add_dependency "rubyforge"
20
+ gem.rubyforge_project = "pickles"
24
21
  end
25
22
  rescue LoadError
26
- puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
23
+ puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install jeweler"
27
24
  end
28
25
 
26
+ require 'rake/testtask'
27
+ Rake::TestTask.new(:test) do |test|
28
+ test.test_files = FileList.new('test/**/test_*.rb') do |list|
29
+ list.exclude 'test/test_helper.rb'
30
+ end
31
+ test.libs << 'test'
32
+ test.verbose = true
33
+ end
29
34
 
30
- Rake::TestTask.new
31
-
35
+ require 'rake/rdoctask'
32
36
  Rake::RDocTask.new do |rdoc|
33
37
  rdoc.rdoc_dir = 'rdoc'
34
38
  rdoc.title = 'jeweler'
35
- rdoc.options << '--line-numbers' << '--inline-source'
36
39
  rdoc.rdoc_files.include('README.markdown')
37
40
  rdoc.rdoc_files.include('lib/**/*.rb')
38
41
  end
39
42
 
40
- Rcov::RcovTask.new
43
+ begin
44
+ require 'rcov/rcovtask'
45
+ Rcov::RcovTask.new(:rcov) do |rcov|
46
+ rcov.libs << 'test'
47
+ rcov.pattern = 'test/**/test_*.rb'
48
+ end
49
+ rescue LoadError
50
+ task :rcov do
51
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
52
+ end
53
+ end
41
54
 
42
- task :default => :rcov
55
+ begin
56
+ require 'cucumber/rake/task'
57
+ Cucumber::Rake::Task.new(:features) do |features|
58
+ features.cucumber_opts = "features --format progress"
59
+ end
60
+ namespace :features do
61
+ Cucumber::Rake::Task.new(:pretty) do |features|
62
+ features.cucumber_opts = "features --format progress"
63
+ end
64
+ end
65
+ rescue LoadError
66
+ task :features do
67
+ abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
68
+ end
69
+ namespace :features do
70
+ task :pretty do
71
+ abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
72
+ end
73
+ end
74
+ end
75
+
76
+ begin
77
+ require 'rake/contrib/sshpublisher'
78
+ namespace :rubyforge do
79
+
80
+ desc "Release gem and RDoc documentation to RubyForge"
81
+ task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
82
+
83
+ namespace :release do
84
+ desc "Publish RDoc to RubyForge."
85
+ task :docs => [:rdoc] do
86
+ config = YAML.load(
87
+ File.read(File.expand_path('~/.rubyforge/user-config.yml'))
88
+ )
89
+
90
+ host = "#{config['username']}@rubyforge.org"
91
+ remote_dir = "/var/www/gforge-projects/pickles"
92
+ local_dir = 'rdoc'
93
+
94
+ Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
95
+ end
96
+ end
97
+ end
98
+ rescue LoadError
99
+ puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
100
+ end
101
+
102
+ if ENV["RUN_CODE_RUN"] == "true"
103
+ task :default => [:test, :features]
104
+ else
105
+ task :default => :test
106
+ end
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 2
3
- :major: 0
4
- :minor: 7
2
+ :minor: 0
3
+ :patch: 1
4
+ :major: 1
@@ -5,68 +5,4 @@ require 'optparse'
5
5
  $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
6
6
  require 'jeweler'
7
7
 
8
- class JewelerOpts < Hash
9
- attr_reader :opts
10
-
11
- def initialize(args)
12
- super()
13
-
14
- self[:test_style] = :shoulda
15
-
16
- @opts = OptionParser.new do |o|
17
- o.banner = "Usage: #{File.basename($0)} [options] reponame\ne.g. #{File.basename($0)} the-perfect-gem"
18
-
19
- o.on('--bacon', 'generate bacon specs') do
20
- self[:test_style] = :bacon
21
- end
22
-
23
- o.on('--shoulda', 'generate shoulda tests') do
24
- self[:test_style] = :shoulda
25
- end
26
-
27
- o.on('--create-repo', 'create the repository on GitHub') do
28
- self[:create_repo] = true
29
- end
30
-
31
- o.on('--summary [SUMMARY]', 'specify the summary of the project') do |summary|
32
- self[:summary] = summary
33
- end
34
-
35
- o.on_tail('-h', '--help', 'display this help and exit') do
36
- puts o
37
- exit
38
- end
39
- end
40
-
41
- @opts.parse!(args)
42
- end
43
- end
44
-
45
- options = JewelerOpts.new(ARGV)
46
-
47
- unless ARGV.size == 1
48
- puts options.opts
49
- exit 1
50
- end
51
-
52
- github_repo_name = ARGV.first
53
-
54
- begin
55
- generator = Jeweler::Generator.new github_repo_name, options
56
- generator.run
57
- rescue Jeweler::NoGitUserName
58
- $stderr.puts %Q{No user.name found in ~/.gitconfig. Please tell git about yourself (see http://github.com/guides/tell-git-your-user-name-and-email-address for details). For example: git config --global user.name "mad voo"}
59
- exit 1
60
- rescue Jeweler::NoGitUserEmail
61
- $stderr.puts %Q{No user.email found in ~/.gitconfig. Please tell git about yourself (see http://github.com/guides/tell-git-your-user-name-and-email-address for details). For example: git config --global user.email mad.vooo@gmail.com}
62
- exit 1
63
- rescue Jeweler::NoGitHubUser
64
- $stderr.puts %Q{No github.user found in ~/.gitconfig. Please tell git about your GitHub account (see http://github.com/blog/180-local-github-config for details). For example: git config --global github.user defunkt}
65
- exit 1
66
- rescue Jeweler::NoGitHubToken
67
- $stderr.puts %Q{No github.token found in ~/.gitconfig. Please tell git about your GitHub account (see http://github.com/blog/180-local-github-config for details). For example: git config --global github.token 6ef8395fecf207165f1a82178ae1b984}
68
- exit 1
69
- rescue Jeweler::FileInTheWay
70
- $stderr.puts "The directory #{github_repo_name} already exists. Maybe move it out of the way before continuing?"
71
- exit 1
72
- end
8
+ Jeweler::Generator::Application.run!(*ARGV)