mercurial-ruby 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/mercurial-ruby.rb +4 -1
- data/lib/mercurial-ruby/blame.rb +29 -0
- data/lib/mercurial-ruby/blame_line.rb +19 -0
- data/lib/mercurial-ruby/factories/blame_factory.rb +28 -0
- data/lib/mercurial-ruby/repository.rb +4 -0
- data/mercurial-ruby.gemspec +8 -117
- data/test/fixtures/test-repo.zip +0 -0
- data/test/helper.rb +13 -1
- data/test/test_blame.rb +28 -0
- data/test/test_blame_factory.rb +43 -0
- metadata +10 -119
- data/test/fixtures/test-repo/.DotFile +0 -1
- data/test/fixtures/test-repo/.hg/00changelog.i +0 -0
- data/test/fixtures/test-repo/.hg/branch +0 -1
- data/test/fixtures/test-repo/.hg/cache/branchheads +0 -6
- data/test/fixtures/test-repo/.hg/cache/tags +0 -7
- data/test/fixtures/test-repo/.hg/dirstate +0 -0
- data/test/fixtures/test-repo/.hg/hgrc +0 -3
- data/test/fixtures/test-repo/.hg/last-message.txt +0 -1
- data/test/fixtures/test-repo/.hg/requires +0 -4
- data/test/fixtures/test-repo/.hg/store/00changelog.i +0 -0
- data/test/fixtures/test-repo/.hg/store/00manifest.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/_file _with _whitespace.pdf.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/_l_i_c_e_n_s_e.txt.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/_l_i_c_e_n_s_e2.txt.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/_l_i_c_e_n_s_e3.txt.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/_l_i_c_e_n_s_e4.txt.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/_r_e_a_d_m_e.markdown.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/_r_e_a_d_m_e.markup.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/_rakefile.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/_rakefile2.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/_rakefile3.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/check ~5c this ~5c out ~22 now.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/minitest__mixin.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/options.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/rdoc__mixin.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/rspec__mixin.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/shindo__mixin.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/shoulda__mixin.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/_gemfile.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/_l_i_c_e_n_s_e.txt.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/_r_e_a_d_m_e.rdoc.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/_rakefile.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/bacon/flunking.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/bacon/helper.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/bundler__setup.erb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/features/default.feature.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/features/support/env.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/jeweler__tasks.erb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/micronaut/flunking.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/micronaut/helper.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/minitest/flunking.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/minitest/helper.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/other__tasks.erb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/riot/flunking.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/riot/helper.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/rspec/flunking.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/rspec/helper.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/rspec/~2erspec.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/shindo/flunking.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/shindo/helper.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/shoulda/flunking.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/shoulda/helper.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/testspec/flunking.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/testspec/helper.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/testunit/flunking.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/testunit/helper.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/~2edocument.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/templates/~2egitignore.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory two/~2e_d_s___store.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory__1/rubygems__dot__org__tasks.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory__1/rubygems__tasks.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory__1/specification.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory__1/tasks.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/directory__1/~2e_d_s___store.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/empty-file.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/goose.png.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/goose/pretty-thing.txt.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/new-directory/another-boring-file.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/new-directory/something.csv.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/new-directory/subdirectory/_e_u_l_a5seat___chin___sim02.03.04.pdf.d +0 -0
- data/test/fixtures/test-repo/.hg/store/data/new-directory/subdirectory/_e_u_l_a5seat___chin___sim02.03.04.pdf.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/new-directory/subdirectory/_file _with _whitespace.pdf.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/new-directory/subdirectory/beansprout.png.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/new-file.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/old-directory/minitest__mixin.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/old-directory/options.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/old-directory/rspec__mixin.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/old-directory/shindo__mixin.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/old-directory/testunit__mixin.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/old-directory/yard__mixin.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/riot__mixin.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/riot__mixin__copy.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/style.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/super-cow.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/superman.txt.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/testspec__mixin.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/testspec__mixin__new.rb.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/~2e_dot_file.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/~2ehgignore.i +0 -0
- data/test/fixtures/test-repo/.hg/store/data/~2ehgtags.i +0 -0
- data/test/fixtures/test-repo/.hg/store/fncache +0 -79
- data/test/fixtures/test-repo/.hg/store/undo +0 -0
- data/test/fixtures/test-repo/.hg/undo.bookmarks +0 -0
- data/test/fixtures/test-repo/.hg/undo.branch +0 -1
- data/test/fixtures/test-repo/.hg/undo.desc +0 -2
- data/test/fixtures/test-repo/.hg/undo.dirstate +0 -0
- data/test/fixtures/test-repo/.hgignore +0 -1
- data/test/fixtures/test-repo/.hgtags +0 -1
- data/test/fixtures/test-repo/LICENSE3.txt +0 -15
- data/test/fixtures/test-repo/LICENSE4.txt +0 -17
- data/test/fixtures/test-repo/README.markup +0 -218
- data/test/fixtures/test-repo/Rakefile3 +0 -83
- data/test/fixtures/test-repo/check // this // out /" now" "b/data/test/fixtures/test-repo/check // this // out / → now +0 -0
- data/test/fixtures/test-repo/empty-file +0 -0
- data/test/fixtures/test-repo/goose.png +0 -0
- data/test/fixtures/test-repo/goose/pretty-thing.txt +0 -0
- data/test/fixtures/test-repo/new-directory/another-boring-file +0 -78
- data/test/fixtures/test-repo/new-directory/something.csv +0 -1
- data/test/fixtures/test-repo/new-directory/subdirectory/EULA5seat_Chin_Sim02.03.04.pdf +0 -0
- data/test/fixtures/test-repo/new-directory/subdirectory/File With Whitespace.pdf b/data/test/fixtures/test-repo/new-directory/subdirectory/File With → Whitespace.pdf +0 -0
- data/test/fixtures/test-repo/new-directory/subdirectory/beansprout.png +0 -0
- data/test/fixtures/test-repo/riot_mixin.rb +0 -45
- data/test/fixtures/test-repo/style +0 -4
- data/test/fixtures/test-repo/superman.txt +0 -1
- data/test/fixtures/test-repo/testspec_mixin_new.rb +0 -44
@@ -1 +0,0 @@
|
|
1
|
-
Hey, I'm a file with dot in it's name and I'll break you.
|
Binary file
|
@@ -1 +0,0 @@
|
|
1
|
-
default
|
@@ -1,6 +0,0 @@
|
|
1
|
-
2d32410d9629075b0bb4aba48f6fd2f283ef8ffe 35
|
2
|
-
2d32410d9629075b0bb4aba48f6fd2f283ef8ffe default
|
3
|
-
63e18640e83af60196334f16cc31f4f99c419918 new-branch
|
4
|
-
3cdad3d3ca0054ebfcd2652cc83442bd0d272bbb old-branch
|
5
|
-
16fac694db0a52edfd266576acafb475f7f8420f branch-from-remote
|
6
|
-
3e1ea66bdd04dbfb8d91e4f2de3baca218cd4cca another-branch
|
@@ -1,7 +0,0 @@
|
|
1
|
-
35 2d32410d9629075b0bb4aba48f6fd2f283ef8ffe 6c81f549f60e460380bbc055b3ce4dede0d754a1
|
2
|
-
16 3e1ea66bdd04dbfb8d91e4f2de3baca218cd4cca 874075ae897fb53a3e706386330db170be5d8bf2
|
3
|
-
10 16fac694db0a52edfd266576acafb475f7f8420f 6c81f549f60e460380bbc055b3ce4dede0d754a1
|
4
|
-
5 3cdad3d3ca0054ebfcd2652cc83442bd0d272bbb
|
5
|
-
|
6
|
-
bf6386c0a0ccd1282dbbe51888f52fe82b1806e3 new-tag
|
7
|
-
63f70b2314ede1e12813cae87f6f303ee8d5c09a new-branch-tag
|
Binary file
|
@@ -1 +0,0 @@
|
|
1
|
-
Added file with weird characters in it's name
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/test/fixtures/test-repo/.hg/store/data/directory two/templates/features/default.feature.i
DELETED
Binary file
|
data/test/fixtures/test-repo/.hg/store/data/directory two/templates/features/support/env.rb.i
DELETED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/test/fixtures/test-repo/.hg/store/data/new-directory/subdirectory/_file _with _whitespace.pdf.i
DELETED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,79 +0,0 @@
|
|
1
|
-
data/directory two/templates/LICENSE.txt.i
|
2
|
-
data/directory two/templates/.gitignore.i
|
3
|
-
data/testspec_mixin_new.rb.i
|
4
|
-
data/directory two/templates/Gemfile.i
|
5
|
-
data/directory two/templates/testspec/helper.rb.i
|
6
|
-
data/directory two/templates/testunit/flunking.rb.i
|
7
|
-
data/old-directory/minitest_mixin.rb.i
|
8
|
-
data/directory two/shindo_mixin.rb.i
|
9
|
-
data/directory two/templates/shoulda/flunking.rb.i
|
10
|
-
data/old-directory/options.rb.i
|
11
|
-
data/goose/pretty-thing.txt.i
|
12
|
-
data/directory two/templates/rspec/helper.rb.i
|
13
|
-
data/directory two/templates/rspec/.rspec.i
|
14
|
-
data/directory two/templates/testunit/helper.rb.i
|
15
|
-
data/directory two/templates/shindo/flunking.rb.i
|
16
|
-
data/old-directory/yard_mixin.rb.i
|
17
|
-
data/directory two/templates/jeweler_tasks.erb.i
|
18
|
-
data/riot_mixin.rb.i
|
19
|
-
data/style.i
|
20
|
-
data/directory two/templates/bundler_setup.erb.i
|
21
|
-
data/check \ this \ out " now.i
|
22
|
-
data/directory two/templates/.document.i
|
23
|
-
data/directory two/templates/features/support/env.rb.i
|
24
|
-
data/directory two/rspec_mixin.rb.i
|
25
|
-
data/riot_mixin_copy.rb.i
|
26
|
-
data/directory two/minitest_mixin.rb.i
|
27
|
-
data/directory two/templates/riot/helper.rb.i
|
28
|
-
data/old-directory/shindo_mixin.rb.i
|
29
|
-
data/directory two/templates/other_tasks.erb.i
|
30
|
-
data/File With Whitespace.pdf.i
|
31
|
-
data/LICENSE.txt.i
|
32
|
-
data/directory_1/rubygems_dot_org_tasks.rb.i
|
33
|
-
data/new-file.i
|
34
|
-
data/directory_1/specification.rb.i
|
35
|
-
data/directory two/templates/riot/flunking.rb.i
|
36
|
-
data/Rakefile3.i
|
37
|
-
data/directory two/templates/README.rdoc.i
|
38
|
-
data/Rakefile2.i
|
39
|
-
data/goose.png.i
|
40
|
-
data/super-cow.i
|
41
|
-
data/directory_1/rubygems_tasks.rb.i
|
42
|
-
data/README.markup.i
|
43
|
-
data/new-directory/something.csv.i
|
44
|
-
data/directory two/templates/micronaut/flunking.rb.i
|
45
|
-
data/directory two/templates/rspec/flunking.rb.i
|
46
|
-
data/new-directory/another-boring-file.i
|
47
|
-
data/directory two/templates/bacon/helper.rb.i
|
48
|
-
data/testspec_mixin.rb.i
|
49
|
-
data/superman.txt.i
|
50
|
-
data/old-directory/testunit_mixin.rb.i
|
51
|
-
data/Rakefile.i
|
52
|
-
data/README.markdown.i
|
53
|
-
data/directory_1/.DS_Store.i
|
54
|
-
data/directory two/templates/shoulda/helper.rb.i
|
55
|
-
data/.DotFile.i
|
56
|
-
data/directory_1/tasks.rb.i
|
57
|
-
data/directory two/options.rb.i
|
58
|
-
data/new-directory/subdirectory/beansprout.png.i
|
59
|
-
data/directory two/templates/features/default.feature.i
|
60
|
-
data/directory two/templates/bacon/flunking.rb.i
|
61
|
-
data/LICENSE4.txt.i
|
62
|
-
data/LICENSE2.txt.i
|
63
|
-
data/directory two/.DS_Store.i
|
64
|
-
data/old-directory/rspec_mixin.rb.i
|
65
|
-
data/.hgignore.i
|
66
|
-
data/directory two/shoulda_mixin.rb.i
|
67
|
-
data/.hgtags.i
|
68
|
-
data/directory two/templates/Rakefile.i
|
69
|
-
data/directory two/templates/minitest/flunking.rb.i
|
70
|
-
data/directory two/templates/shindo/helper.rb.i
|
71
|
-
data/new-directory/subdirectory/EULA5seat_Chin_Sim02.03.04.pdf.d
|
72
|
-
data/directory two/templates/testspec/flunking.rb.i
|
73
|
-
data/new-directory/subdirectory/EULA5seat_Chin_Sim02.03.04.pdf.i
|
74
|
-
data/directory two/templates/minitest/helper.rb.i
|
75
|
-
data/new-directory/subdirectory/File With Whitespace.pdf.i
|
76
|
-
data/empty-file.i
|
77
|
-
data/LICENSE3.txt.i
|
78
|
-
data/directory two/rdoc_mixin.rb.i
|
79
|
-
data/directory two/templates/micronaut/helper.rb.i
|
Binary file
|
File without changes
|
@@ -1 +0,0 @@
|
|
1
|
-
default
|
Binary file
|
@@ -1 +0,0 @@
|
|
1
|
-
.DS_Store
|
@@ -1 +0,0 @@
|
|
1
|
-
bf6386c0a0ccd1282dbbe51888f52fe82b1806e3 new-tag
|
@@ -1,15 +0,0 @@
|
|
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", WITHOUROM, OUT OF OR IN CONNECTION
|
15
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,17 +0,0 @@
|
|
1
|
-
Copyright (c) 2008 Josh Nichols
|
2
|
-
|
3
|
-
Changed!
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUROM, OUT OF OR IN CONNECTION
|
17
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,218 +0,0 @@
|
|
1
|
-
# Jeweler: Craft the perfect RubyGem
|
2
|
-
|
3
|
-
Changed README file.
|
4
|
-
|
5
|
-
Jeweler provides the noble ruby developer with two primary features:
|
6
|
-
|
7
|
-
* a library for managing and releasing RubyGem projects
|
8
|
-
* a scaffold generator for starting new RubyGem projects
|
9
|
-
|
10
|
-
## Hello, world
|
11
|
-
|
12
|
-
Use RubyGems to install the heck out of jeweler to get started:
|
13
|
-
|
14
|
-
$ gem install jeweler
|
15
|
-
|
16
|
-
With jeweler installed, you can use the `jeweler` command to generate a new project. For the most basic use, just give it a name:
|
17
|
-
|
18
|
-
$ jeweler hello-gem
|
19
|
-
|
20
|
-
This requires some Git configuration (like name, email, GitHub account, etc), but `jeweler` will prompt along the way.
|
21
|
-
|
22
|
-
Your new `hello-gem` gem is ready in the `hello-gem` directory. Take a peek, and you'll see several files and directories
|
23
|
-
|
24
|
-
* `Rakefile` setup for jeweler, running tests, generating documentation, and releasing to [rubygems.org](http://rubygems.org/)
|
25
|
-
* `README.rdoc` with contribution guidelines and copyright info crediting you
|
26
|
-
* `LICENSE` with the MIT licensed crediting you
|
27
|
-
* `Gemfile` with development dependencies filled in
|
28
|
-
* `lib/hello-gem.rb` waiting for you to code
|
29
|
-
* `test/` containing a (failing) shoulda test suite [shoulda](http://github.com/thoughtbot/shoulda)
|
30
|
-
|
31
|
-
|
32
|
-
### More `jeweler` options
|
33
|
-
|
34
|
-
The `jeweler` command supports a lot of options. Mostly, they are for generating baked in support for this test framework, or that.
|
35
|
-
|
36
|
-
Check out `jeweler --help` for the most up to date options.
|
37
|
-
|
38
|
-
## Hello, rake tasks
|
39
|
-
|
40
|
-
Beyond just editing source code, you'll be interacting with your gem using `rake` a lot. To see all the tasks available with a brief description, you can run:
|
41
|
-
|
42
|
-
$ rake -T
|
43
|
-
|
44
|
-
You'll need a version before you can start installing your gem locally. The easiest way is with the `version:write` Rake task. Let's imagine you start with 0.1.0
|
45
|
-
|
46
|
-
$ rake version:write MAJOR=0 MINOR=1 PATCH=0
|
47
|
-
|
48
|
-
You can now go forth and develop, now that there's an initial version defined. Eventually, you should install and test the gem:
|
49
|
-
|
50
|
-
$ rake install
|
51
|
-
|
52
|
-
The `install` rake task builds the gem and `gem install`s it. You're all set if you're using [RVM](http://rvm.beginrescueend.com/), but you may need to run it with sudo if you have a system-installed ruby:
|
53
|
-
|
54
|
-
$ sudo rake install
|
55
|
-
|
56
|
-
### Releasing
|
57
|
-
|
58
|
-
At last, it's time to [ship it](http://img.skitch.com/20100310-nrgxbwqm58tibiq2un6mujqmm5.png)! Make sure you have everything committed and pushed, then go wild:
|
59
|
-
|
60
|
-
$ rake release
|
61
|
-
|
62
|
-
This will automatically:
|
63
|
-
|
64
|
-
* Generate `hello-gem.gemspec` and commit it
|
65
|
-
* Use `git` to tag `v0.1.0` and push it
|
66
|
-
* Build `hello-gem-0.1.0.gem` and push it to [rubygems.org](http://rubygems.org/gems/)
|
67
|
-
|
68
|
-
### Version bumping
|
69
|
-
|
70
|
-
It feels good to release code. Do it, do it often. But before that, bump the version. Then release it. There's a few ways to update the version:
|
71
|
-
|
72
|
-
# version:write like before
|
73
|
-
$ rake version:write MAJOR=0 MINOR=3 PATCH=0
|
74
|
-
|
75
|
-
# bump just major, ie 0.1.0 -> 1.0.0
|
76
|
-
$ rake version:bump:major
|
77
|
-
|
78
|
-
# bump just minor, ie 0.1.0 -> 0.2.0
|
79
|
-
$ rake version:bump:minor
|
80
|
-
|
81
|
-
# bump just patch, ie 0.1.0 -> 0.1.1
|
82
|
-
$ rake version:bump:patch
|
83
|
-
|
84
|
-
Then it's the same `release` we used before:
|
85
|
-
|
86
|
-
$ rake release
|
87
|
-
|
88
|
-
## Customizing your gem
|
89
|
-
|
90
|
-
If you've been following along so far, your gem is just a blank slate. You're going to need to make it colorful and full of metadata.
|
91
|
-
|
92
|
-
You can customize your gem by updating your `Rakefile`. With a newly generated project, it will look something like this:
|
93
|
-
|
94
|
-
require 'jeweler'
|
95
|
-
Jeweler::Tasks.new do |gem|
|
96
|
-
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
97
|
-
gem.name = "whatwhatwhat"
|
98
|
-
gem.summary = %Q{TODO: one-line summary of your gem}
|
99
|
-
gem.description = %Q{TODO: longer description of your gem}
|
100
|
-
gem.email = "josh@technicalpickles.com"
|
101
|
-
gem.homepage = "http://github.com/technicalpickles/whatwhatwhat"
|
102
|
-
gem.authors = ["Joshua Nichols"]
|
103
|
-
end
|
104
|
-
Jeweler::RubygemsDotOrgTasks.new
|
105
|
-
|
106
|
-
It's crucial to understand the `gem` object is just a Gem::Specification. You can read up about it at [docs.rubygems.org/read/chapter/20](http://docs.rubygems.org/read/chapter/20). This is the most basic way of specifying a gem, Jeweler-managed or not. Jeweler just exposes this to you, in addition to providing some reasonable defaults, which we'll explore now.
|
107
|
-
|
108
|
-
### Project information
|
109
|
-
|
110
|
-
gem.name = "whatwhatwhat"
|
111
|
-
|
112
|
-
Every gem has a name. Among other things, the gem name is how you are able to `gem install` it. [Reference](http://docs.rubygems.org/read/chapter/20#name)
|
113
|
-
|
114
|
-
gem.summary = %Q{TODO: one-line summary of your gem}
|
115
|
-
|
116
|
-
This is a one line summary of your gem. This is displayed, for example, when you use `gem list --details` or view it on [rubygems.org](http://rubygems.org/gems/).
|
117
|
-
|
118
|
-
gem.description = %Q{TODO: longer description of your gem}
|
119
|
-
|
120
|
-
Description is a longer description. Scholars ascertain that knowledge of where the description is used was lost centuries ago.
|
121
|
-
|
122
|
-
gem.email = "josh@technicalpickles.com"
|
123
|
-
|
124
|
-
This should be a way to get a hold of you regarding the gem.
|
125
|
-
|
126
|
-
gem.homepage = "http://github.com/technicalpickles/whatwhatwhat"
|
127
|
-
|
128
|
-
The homepage should have more information about your gem. The jeweler generator guesses this based on the assumption your code lives on [GitHub](http://github.com/), using your Git configuration to find your GitHub username. This is displayed by `gem list --details` and on rubygems.org.
|
129
|
-
|
130
|
-
gem.authors = ["Joshua Nichols"]
|
131
|
-
|
132
|
-
Hey, this is you, the author (or me in this case). The `jeweler` generator also guesses this from your Git configuration. This is displayed by `gem list --details` and on rubygems.org.
|
133
|
-
|
134
|
-
### Files
|
135
|
-
|
136
|
-
The quickest way to add more files is to `git add` them. Jeweler uses your Git repository to populate your gem's files by including added and committed and excluding `.gitignore`d. In most cases, this is reasonable enough.
|
137
|
-
|
138
|
-
If you need to tweak the files, that's cool. Jeweler populates `gem.files` as a `Rake::FileList`. It's like a normal array, except you can `include` and `exclude` file globs:
|
139
|
-
|
140
|
-
gem.files.exclude 'tmp' # exclude temporary directory
|
141
|
-
gem.files.include 'lib/foo/bar.rb' # explicitly include lib/foo/bar.rb
|
142
|
-
|
143
|
-
If that's not enough, you can just set `gem.files` outright
|
144
|
-
|
145
|
-
gem.files = Dir.glob('lib/**/*.rb')
|
146
|
-
|
147
|
-
### Dependencies
|
148
|
-
|
149
|
-
Dependencies let you define other gems that your gem needs to function. `gem install your-gem` will install your-gem's dependencies along with it, and when you use your-gem in an application, the dependencies will be made available. Use `gem.add_dependency` to register them. [Reference](http://docs.rubygems.org/read/chapter/20#dependencies)
|
150
|
-
|
151
|
-
gem.add_dependency 'nokogiri'
|
152
|
-
|
153
|
-
This will ensure a version of `nokogiri` is installed, but it doesn't require anything more than that. You can provide extra args to be more specific:
|
154
|
-
|
155
|
-
gem.add_dependency 'nokogiri', '= 1.2.1' # exactly version 1.2.1
|
156
|
-
gem.add_dependency 'nokogiri', '>= 1.2.1' # greater than or equal to 1.2.1, ie, 1.2.1, 1.2.2, 1.3.0, 2.0.0, etc
|
157
|
-
gem.add_dependency 'nokogiri', '>= 1.2.1', '< 1.3.0' # greater than or equal to 1.2.1, but less than 1.3.0
|
158
|
-
gem.add_dependency 'nokogiri', '~> 1.2.1' # same thing, but more concise
|
159
|
-
|
160
|
-
When specifying which version is required, there's a bit of the condunrum. You want to allow the most versions possible, but you want to be sure they are compatible. Using `>= 1.2.1` is fine most of the time, except until the point that 2.0.0 comes out and totally breaks backwards the API. That's when it's good to use `~> 1.2.1`, which requires any version in the `1.2` family, starting with `1.2.1`.
|
161
|
-
|
162
|
-
### Executables
|
163
|
-
|
164
|
-
Executables let your gem install shell commands. Just put any executable scripts in the `bin/` directory, make sure they are added using `git`, and Jeweler will take care of the rest.
|
165
|
-
|
166
|
-
When you need more finely grained control over it, you can set it yourself:
|
167
|
-
|
168
|
-
gem.executables = ['foo'] # note, it's the file name relative to `bin/`, not the project root
|
169
|
-
|
170
|
-
### Versioning
|
171
|
-
|
172
|
-
We discussed earlier how to bump the version. The rake tasks are really just convience methods for manipulating the `VERSION` file. It just contains a version string, like `1.2.3`.
|
173
|
-
|
174
|
-
`VERSION` is a convention used by Jeweler, and is used to populate `gem.version`. You can actually set this yourself, and Jeweler won't try to override it:
|
175
|
-
|
176
|
-
gem.version = '1.2.3'
|
177
|
-
|
178
|
-
A common pattern is to have this in a version constant in your library. This is convenient, because users of the library can query the version they are using at runtime.
|
179
|
-
|
180
|
-
# in lib/foo/version.rb
|
181
|
-
class Foo
|
182
|
-
module Version
|
183
|
-
MAJOR = 1
|
184
|
-
MINOR = 2
|
185
|
-
PATCH = 3
|
186
|
-
BUILD = 'pre3'
|
187
|
-
|
188
|
-
STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
|
189
|
-
end
|
190
|
-
end
|
191
|
-
|
192
|
-
# in Rakefile
|
193
|
-
require 'jeweler'
|
194
|
-
require './lib/foo/version.rb'
|
195
|
-
Jeweler::Tasks.new do |gem|
|
196
|
-
# snip
|
197
|
-
gem.version = Foo::Version::STRING
|
198
|
-
end
|
199
|
-
|
200
|
-
### Rake tasks
|
201
|
-
|
202
|
-
Jeweler lives inside of Rake. As a result, they are dear friends. But, that friendship doesn't interfere with typical Rake operations.
|
203
|
-
|
204
|
-
That means you can define your own namespaces, tasks, or use third party Rake libraries without cause for concern.
|
205
|
-
|
206
|
-
## Contributing to Jeweler
|
207
|
-
|
208
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
209
|
-
* Check out the [issue tracker](http://github.com/technicalpickles/jeweler/issues) to make sure someone already hasn't requested it and/or contributed it
|
210
|
-
* Fork the project
|
211
|
-
* Start a feature/bugfix branch
|
212
|
-
* Commit and push until you are happy with your contribution
|
213
|
-
* Make sure to add tests for the feature/bugfix. This is important so I don't break it in a future version unintentionally.
|
214
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate it to its own commit so I can cherry-pick around it.
|
215
|
-
|
216
|
-
## Copyright
|
217
|
-
|
218
|
-
Copyright (c) 2008-2010 Josh Nichols. See LICENSE for details.
|