gohanlonllc-jeweler 0.11.1.20090513153819
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +7 -0
- data/ChangeLog.markdown +83 -0
- data/LICENSE +20 -0
- data/README.markdown +170 -0
- data/ROADMAP +12 -0
- data/Rakefile +106 -0
- data/VERSION.yml +5 -0
- data/bin/jeweler +8 -0
- 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 +205 -0
- data/lib/jeweler/commands/build_gem.rb +31 -0
- data/lib/jeweler/commands/install_gem.rb +26 -0
- data/lib/jeweler/commands/release.rb +83 -0
- data/lib/jeweler/commands/release_to_rubyforge.rb +51 -0
- data/lib/jeweler/commands/setup_rubyforge.rb +38 -0
- data/lib/jeweler/commands/validate_gemspec.rb +30 -0
- data/lib/jeweler/commands/version/base.rb +41 -0
- data/lib/jeweler/commands/version/bump_major.rb +13 -0
- data/lib/jeweler/commands/version/bump_minor.rb +12 -0
- data/lib/jeweler/commands/version/bump_patch.rb +14 -0
- data/lib/jeweler/commands/version/bump_timestamp.rb +14 -0
- data/lib/jeweler/commands/version/write.rb +12 -0
- data/lib/jeweler/commands/write_gemspec.rb +39 -0
- data/lib/jeweler/commands.rb +13 -0
- data/lib/jeweler/errors.rb +20 -0
- data/lib/jeweler/gemspec_helper.rb +76 -0
- data/lib/jeweler/generator/application.rb +54 -0
- 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 +77 -0
- 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 +284 -0
- data/lib/jeweler/rubyforge_tasks.rb +46 -0
- data/lib/jeweler/specification.rb +65 -0
- data/lib/jeweler/tasks.rb +131 -0
- data/lib/jeweler/templates/.document +5 -0
- data/lib/jeweler/templates/.gitignore +5 -0
- data/lib/jeweler/templates/LICENSE +20 -0
- data/lib/jeweler/templates/README.rdoc +7 -0
- data/lib/jeweler/templates/Rakefile +102 -0
- data/lib/jeweler/templates/bacon/flunking.rb +7 -0
- data/lib/jeweler/templates/bacon/helper.rb +8 -0
- data/lib/jeweler/templates/features/default.feature +9 -0
- data/lib/jeweler/templates/features/support/env.rb +8 -0
- data/lib/jeweler/templates/micronaut/flunking.rb +7 -0
- data/lib/jeweler/templates/micronaut/helper.rb +17 -0
- data/lib/jeweler/templates/minitest/flunking.rb +7 -0
- data/lib/jeweler/templates/minitest/helper.rb +11 -0
- data/lib/jeweler/templates/rspec/flunking.rb +7 -0
- data/lib/jeweler/templates/rspec/helper.rb +9 -0
- data/lib/jeweler/templates/shoulda/flunking.rb +7 -0
- data/lib/jeweler/templates/shoulda/helper.rb +10 -0
- data/lib/jeweler/templates/testunit/flunking.rb +7 -0
- data/lib/jeweler/templates/testunit/helper.rb +9 -0
- data/lib/jeweler/version_helper.rb +140 -0
- data/lib/jeweler.rb +155 -0
- data/test/fixtures/bar/VERSION.yml +4 -0
- data/test/fixtures/bar/bin/foo_the_ultimate_bin +1 -0
- data/test/fixtures/bar/hey_include_me_in_gemspec +0 -0
- data/test/fixtures/bar/lib/foo_the_ultimate_lib.rb +1 -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-plaintext/LICENSE +20 -0
- data/test/fixtures/existing-project-with-version-plaintext/README.rdoc +7 -0
- data/test/fixtures/existing-project-with-version-plaintext/Rakefile +82 -0
- data/test/fixtures/existing-project-with-version-plaintext/VERSION +1 -0
- data/test/fixtures/existing-project-with-version-plaintext/existing-project-with-version.gemspec +29 -0
- data/test/fixtures/existing-project-with-version-plaintext/lib/existing_project_with_version.rb +0 -0
- data/test/fixtures/existing-project-with-version-plaintext/test/existing_project_with_version_test.rb +7 -0
- data/test/fixtures/existing-project-with-version-plaintext/test/test_helper.rb +10 -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-yaml/VERSION.yml +4 -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/geminstaller.yml +12 -0
- data/test/jeweler/commands/test_build_gem.rb +72 -0
- data/test/jeweler/commands/test_install_gem.rb +21 -0
- data/test/jeweler/commands/test_release.rb +405 -0
- data/test/jeweler/commands/test_release_to_rubyforge.rb +157 -0
- data/test/jeweler/commands/test_setup_rubyforge.rb +88 -0
- data/test/jeweler/commands/test_validate_gemspec.rb +27 -0
- data/test/jeweler/commands/test_write_gemspec.rb +92 -0
- data/test/jeweler/commands/version/test_base.rb +32 -0
- data/test/jeweler/commands/version/test_bump_major.rb +22 -0
- data/test/jeweler/commands/version/test_bump_minor.rb +19 -0
- data/test/jeweler/commands/version/test_bump_patch.rb +20 -0
- data/test/jeweler/commands/version/test_write.rb +23 -0
- data/test/shoulda_macros/jeweler_macros.rb +35 -0
- data/test/test_application.rb +139 -0
- data/test/test_gemspec_helper.rb +40 -0
- data/test/test_generator.rb +154 -0
- data/test/test_generator_initialization.rb +113 -0
- data/test/test_generator_mixins.rb +18 -0
- data/test/test_helper.rb +133 -0
- data/test/test_jeweler.rb +174 -0
- data/test/test_options.rb +116 -0
- data/test/test_specification.rb +61 -0
- data/test/test_tasks.rb +51 -0
- data/test/test_version_helper.rb +153 -0
- metadata +229 -0
data/.gitignore
ADDED
data/ChangeLog.markdown
ADDED
@@ -0,0 +1,83 @@
|
|
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
|
61
|
+
|
62
|
+
* Added rake task 'version:bump' which is shorthand for 'version:bump:patch'
|
63
|
+
* Generated projects no longer assume RCov is installed.
|
64
|
+
|
65
|
+
# jeweler 0.7.1 2009-01-26
|
66
|
+
|
67
|
+
* Fixed yaml not being required
|
68
|
+
* Automatically add files in bin as executables in gemspec
|
69
|
+
|
70
|
+
# jeweler 0.7.0 2009-01-19
|
71
|
+
|
72
|
+
* Added support to generator for specifying a description
|
73
|
+
* Condensed README.markdown to be less novel-like
|
74
|
+
* RDoc is now included in your gemspec
|
75
|
+
* Rescue errors that raise in the generator, and display better error message, and exit with a non-zero exit status
|
76
|
+
|
77
|
+
# jeweler 0.6.5 2009-01-14
|
78
|
+
|
79
|
+
* `jeweler --create-repo foo` now enables gem creation in addition to creating the repository
|
80
|
+
|
81
|
+
# jeweler 0.6.4 2009-01-13
|
82
|
+
|
83
|
+
* Added tasks `build` and `install` as shortcuts for `gem:build` and `gem:install`
|
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2008 Josh Nichols
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.markdown
ADDED
@@ -0,0 +1,170 @@
|
|
1
|
+
# Jeweler: Craft the perfect RubyGem
|
2
|
+
|
3
|
+
Jeweler provides two things:
|
4
|
+
|
5
|
+
* Rake tasks for managing gems and versioning of a <a href="http://github.com">GitHub</a> project
|
6
|
+
* A generator for creating kickstarting a new project
|
7
|
+
|
8
|
+
## Quick Links
|
9
|
+
|
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
|
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.
|
22
|
+
|
23
|
+
begin
|
24
|
+
require 'jeweler'
|
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"]
|
32
|
+
end
|
33
|
+
rescue LoadError
|
34
|
+
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
35
|
+
end
|
36
|
+
|
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.
|
38
|
+
|
39
|
+
## Using to start a new project
|
40
|
+
|
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).
|
42
|
+
|
43
|
+
jeweler the-perfect-gem
|
44
|
+
|
45
|
+
This will prepare a project in the 'the-perfect-gem' directory, setup to use Jeweler.
|
46
|
+
|
47
|
+
It supports a number of options:
|
48
|
+
|
49
|
+
* --create-repo: in addition to preparing a project, it create an repo up on GitHub and enable RubyGem generation
|
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"
|
62
|
+
|
63
|
+
## Gemspec
|
64
|
+
|
65
|
+
Jeweler handles generating a gemspec file for your project:
|
66
|
+
|
67
|
+
rake gemspec
|
68
|
+
|
69
|
+
This creates a gemspec for your project. It's based on the info you give `Jeweler::Tasks`, the current version of your project, and some defaults that Jeweler provides.
|
70
|
+
|
71
|
+
## Gem
|
72
|
+
|
73
|
+
Jeweler gives you tasks for building and installing your gem:
|
74
|
+
|
75
|
+
rake build
|
76
|
+
rake install
|
77
|
+
|
78
|
+
## Versioning
|
79
|
+
|
80
|
+
Jeweler tracks the version of your project. It assumes you will be using a version in the format `x.y.z`. `x` is the 'major' version, `y` is the 'minor' version, and `z` is the patch version.
|
81
|
+
|
82
|
+
Initially, your project starts out at 0.0.0. Jeweler provides Rake tasks for bumping the version:
|
83
|
+
|
84
|
+
rake version:bump:major
|
85
|
+
rake version:bump:minor
|
86
|
+
rake version:bump:patch
|
87
|
+
|
88
|
+
## Releasing to GitHub
|
89
|
+
|
90
|
+
Jeweler handles releasing your gem into the wild:
|
91
|
+
|
92
|
+
rake release
|
93
|
+
|
94
|
+
It does the following for you:
|
95
|
+
|
96
|
+
* Regenerate the gemspec to the latest version of your project
|
97
|
+
* Push to GitHub (which results in a gem being build)
|
98
|
+
* Tag the version and push to GitHub
|
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
|
+
|
164
|
+
## Workflow
|
165
|
+
|
166
|
+
* Hack, commit, hack, commit, etc, etc
|
167
|
+
* `rake version:bump:patch release` to do the actual version bump and release
|
168
|
+
* Have a delicious scotch
|
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.
|
170
|
+
|
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
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
require 'rake'
|
2
|
+
|
3
|
+
$LOAD_PATH.unshift('lib')
|
4
|
+
|
5
|
+
gem 'git'
|
6
|
+
require 'git'
|
7
|
+
|
8
|
+
begin
|
9
|
+
require 'jeweler'
|
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"
|
21
|
+
end
|
22
|
+
rescue LoadError
|
23
|
+
puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install jeweler"
|
24
|
+
end
|
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
|
34
|
+
|
35
|
+
require 'rake/rdoctask'
|
36
|
+
Rake::RDocTask.new do |rdoc|
|
37
|
+
rdoc.rdoc_dir = 'rdoc'
|
38
|
+
rdoc.title = 'jeweler'
|
39
|
+
rdoc.rdoc_files.include('README.markdown')
|
40
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
41
|
+
end
|
42
|
+
|
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
|
54
|
+
|
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
|
data/VERSION.yml
ADDED
data/bin/jeweler
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
Feature: generating cucumber stories
|
2
|
+
In order to get started using cucumber in a project
|
3
|
+
A user should be able to
|
4
|
+
generate a project setup for their testing framework of choice
|
5
|
+
|
6
|
+
Scenario: sans cucumber setup
|
7
|
+
Given a working directory
|
8
|
+
And I have configured git sanely
|
9
|
+
And I do not want cucumber stories
|
10
|
+
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
|
11
|
+
|
12
|
+
And a file named 'the-perfect-gem/features/the-perfect-gem.feature' is not created
|
13
|
+
And a file named 'the-perfect-gem/features/support/env.rb' is not created
|
14
|
+
And a file named 'the-perfect-gem/features/steps/the-perfect-gem_steps.rb' is not created
|
15
|
+
|
16
|
+
Scenario: basic cucumber setup
|
17
|
+
Given a working directory
|
18
|
+
And I have configured git sanely
|
19
|
+
And I want cucumber stories
|
20
|
+
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
|
21
|
+
|
22
|
+
Then cucumber directories are created
|
23
|
+
|
24
|
+
And a file named 'the-perfect-gem/features/the-perfect-gem.feature' is created
|
25
|
+
And a file named 'the-perfect-gem/features/support/env.rb' is created
|
26
|
+
And a file named 'the-perfect-gem/features/step_definitions/the-perfect-gem_steps.rb' is created
|
27
|
+
|
28
|
+
And 'features/support/env.rb' requires 'the-perfect-gem'
|
29
|
+
|
30
|
+
Scenario: cucumber setup for bacon
|
31
|
+
Given a working directory
|
32
|
+
And I have configured git sanely
|
33
|
+
And I want cucumber stories
|
34
|
+
When I generate a bacon project named 'the-perfect-gem' that is 'zomg, so good'
|
35
|
+
|
36
|
+
Then 'features/support/env.rb' requires 'test/unit/assertions'
|
37
|
+
And cucumber world extends "Test::Unit::Assertions"
|
38
|
+
|
39
|
+
Scenario: cucumber setup for shoulda
|
40
|
+
Given a working directory
|
41
|
+
And I have configured git sanely
|
42
|
+
And I want cucumber stories
|
43
|
+
When I generate a shoulda project named 'the-perfect-gem' that is 'zomg, so good'
|
44
|
+
|
45
|
+
Then 'features/support/env.rb' requires 'test/unit/assertions'
|
46
|
+
And cucumber world extends "Test::Unit::Assertions"
|
47
|
+
|
48
|
+
Scenario: cucumber setup for testunit
|
49
|
+
Given a working directory
|
50
|
+
And I have configured git sanely
|
51
|
+
And I want cucumber stories
|
52
|
+
When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
|
53
|
+
|
54
|
+
Then 'features/support/env.rb' requires 'test/unit/assertions'
|
55
|
+
And cucumber world extends "Test::Unit::Assertions"
|
56
|
+
|
57
|
+
Scenario: cucumber setup for minitest
|
58
|
+
Given a working directory
|
59
|
+
And I have configured git sanely
|
60
|
+
And I want cucumber stories
|
61
|
+
When I generate a minitest project named 'the-perfect-gem' that is 'zomg, so good'
|
62
|
+
|
63
|
+
Then 'features/support/env.rb' requires 'mini/test'
|
64
|
+
And cucumber world extends "Mini::Test::Assertions"
|
65
|
+
|
66
|
+
Scenario: cucumber setup for rspec
|
67
|
+
Given a working directory
|
68
|
+
And I have configured git sanely
|
69
|
+
And I want cucumber stories
|
70
|
+
When I generate a rspec project named 'the-perfect-gem' that is 'zomg, so good'
|
71
|
+
|
72
|
+
Then 'features/support/env.rb' requires 'the-perfect-gem'
|
73
|
+
And 'features/support/env.rb' requires 'spec/expectations'
|
74
|
+
|
75
|
+
Scenario: cucumber setup for mirconaut
|
76
|
+
Given a working directory
|
77
|
+
And I have configured git sanely
|
78
|
+
And I want cucumber stories
|
79
|
+
When I generate a micronaut project named 'the-perfect-gem' that is 'zomg, so good'
|
80
|
+
|
81
|
+
Then 'features/support/env.rb' requires 'the-perfect-gem'
|
82
|
+
And 'features/support/env.rb' requires 'micronaut/expectations'
|
83
|
+
And cucumber world extends "Micronaut::Matchers"
|
@@ -0,0 +1,76 @@
|
|
1
|
+
Feature: generated directory layout
|
2
|
+
In order to start a new gem
|
3
|
+
A user should be able to
|
4
|
+
generate a directory layout
|
5
|
+
|
6
|
+
Scenario: shared
|
7
|
+
Given a working directory
|
8
|
+
And I have configured git sanely
|
9
|
+
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
|
10
|
+
|
11
|
+
Then a directory named 'the-perfect-gem' is created
|
12
|
+
And a directory named 'the-perfect-gem/lib' is created
|
13
|
+
|
14
|
+
And a file named 'the-perfect-gem/README.rdoc' is created
|
15
|
+
And a file named 'the-perfect-gem/.document' is created
|
16
|
+
And a file named 'the-perfect-gem/lib/the-perfect-gem.rb' is created
|
17
|
+
|
18
|
+
Scenario: bacon
|
19
|
+
Given a working directory
|
20
|
+
And I have configured git sanely
|
21
|
+
When I generate a bacon project named 'the-perfect-gem' that is 'zomg, so good'
|
22
|
+
|
23
|
+
Then a directory named 'the-perfect-gem/spec' is created
|
24
|
+
|
25
|
+
And a file named 'the-perfect-gem/spec/spec_helper.rb' is created
|
26
|
+
And a file named 'the-perfect-gem/spec/the-perfect-gem_spec.rb' is created
|
27
|
+
|
28
|
+
Scenario: minitest
|
29
|
+
Given a working directory
|
30
|
+
And I have configured git sanely
|
31
|
+
When I generate a minitest project named 'the-perfect-gem' that is 'zomg, so good'
|
32
|
+
|
33
|
+
Then a directory named 'the-perfect-gem/test' is created
|
34
|
+
|
35
|
+
And a file named 'the-perfect-gem/test/test_helper.rb' is created
|
36
|
+
And a file named 'the-perfect-gem/test/the-perfect-gem_test.rb' is created
|
37
|
+
|
38
|
+
Scenario: rspec
|
39
|
+
Given a working directory
|
40
|
+
And I have configured git sanely
|
41
|
+
When I generate a rspec project named 'the-perfect-gem' that is 'zomg, so good'
|
42
|
+
|
43
|
+
Then a directory named 'the-perfect-gem/spec' is created
|
44
|
+
|
45
|
+
And a file named 'the-perfect-gem/spec/spec_helper.rb' is created
|
46
|
+
And a file named 'the-perfect-gem/spec/the-perfect-gem_spec.rb' is created
|
47
|
+
|
48
|
+
Scenario: shoulda
|
49
|
+
Given a working directory
|
50
|
+
And I have configured git sanely
|
51
|
+
When I generate a shoulda project named 'the-perfect-gem' that is 'zomg, so good'
|
52
|
+
|
53
|
+
Then a directory named 'the-perfect-gem/test' is created
|
54
|
+
|
55
|
+
And a file named 'the-perfect-gem/test/test_helper.rb' is created
|
56
|
+
And a file named 'the-perfect-gem/test/the-perfect-gem_test.rb' is created
|
57
|
+
|
58
|
+
Scenario: testunit
|
59
|
+
Given a working directory
|
60
|
+
And I have configured git sanely
|
61
|
+
When I generate a testunit project named 'the-perfect-gem' that is 'zomg, so good'
|
62
|
+
|
63
|
+
Then a directory named 'the-perfect-gem/test' is created
|
64
|
+
|
65
|
+
And a file named 'the-perfect-gem/test/test_helper.rb' is created
|
66
|
+
And a file named 'the-perfect-gem/test/the-perfect-gem_test.rb' is created
|
67
|
+
|
68
|
+
Scenario: micronaut
|
69
|
+
Given a working directory
|
70
|
+
And I have configured git sanely
|
71
|
+
When I generate a micronaut project named 'the-perfect-gem' that is 'zomg, so good'
|
72
|
+
|
73
|
+
Then a directory named 'the-perfect-gem/examples' is created
|
74
|
+
|
75
|
+
And a file named 'the-perfect-gem/examples/example_helper.rb' is created
|
76
|
+
And a file named 'the-perfect-gem/examples/the-perfect-gem_example.rb' is created
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Feature: generated .document
|
2
|
+
In order to easily generate RDoc
|
3
|
+
A user should be able to
|
4
|
+
generate reasonable .document file
|
5
|
+
|
6
|
+
Scenario: .document
|
7
|
+
Given a working directory
|
8
|
+
And I have configured git sanely
|
9
|
+
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
|
10
|
+
Then '.document' contains 'README.rdoc'
|
11
|
+
And '.document' contains 'lib/**/*.rb'
|
12
|
+
And '.document' contains 'bin/*'
|
13
|
+
And '.document' contains 'features/**/*.feature'
|
14
|
+
And '.document' contains 'LICENSE'
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Feature: Getting options from environment variable
|
2
|
+
In order to avoid having to type --rspec over and over
|
3
|
+
A user will need to set up a JEWELER_OPTS environment variable
|
4
|
+
|
5
|
+
Scenario: Environment variable set
|
6
|
+
Given a working directory
|
7
|
+
And I set JEWELER_OPTS env variable to "--rspec"
|
8
|
+
When I generate a project named 'the-perfect-gem' that is 'zomg, so good'
|
9
|
+
Then 'spec/the-perfect-gem_spec.rb' should describe 'ThePerfectGem'
|