namelessjon-jeweler 0.6.5 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog.markdown +16 -0
- data/LICENSE +20 -0
- data/README.markdown +8 -1
- data/Rakefile +2 -11
- data/TODO +0 -5
- data/VERSION.yml +2 -2
- data/bin/jeweler +24 -2
- data/lib/jeweler.rb +6 -0
- data/lib/jeweler/generator.rb +9 -6
- data/lib/jeweler/tasks.rb +3 -0
- data/lib/jeweler/templates/Rakefile +10 -7
- data/lib/jeweler/templates/bacon/spec_helper.rb +3 -0
- data/lib/jeweler/templates/shoulda/test_helper.rb +4 -1
- data/lib/jeweler/version.rb +2 -0
- data/test/{gemspec_test.rb → test_gemspec.rb} +1 -1
- data/test/{jeweler_generator_test.rb → test_generator.rb} +6 -3
- data/test/{jeweler_test.rb → test_jeweler.rb} +1 -1
- data/test/{tasks_test.rb → test_tasks.rb} +2 -1
- data/test/{version_test.rb → test_version.rb} +1 -2
- metadata +9 -7
data/ChangeLog.markdown
CHANGED
@@ -1,3 +1,19 @@
|
|
1
|
+
# jeweler 0.7.2
|
2
|
+
|
3
|
+
* Added rake task 'version:bump' which is shorthand for 'version:bump:patch'
|
4
|
+
* Generated projects no longer assume RCov is installed.
|
5
|
+
|
6
|
+
# jeweler 0.7.1
|
7
|
+
|
8
|
+
* Fixed yaml not being required
|
9
|
+
|
10
|
+
# jeweler 0.7.0
|
11
|
+
|
12
|
+
* Added support to generator for specifying a description
|
13
|
+
* Condensed README.markdown to be less novel-like
|
14
|
+
* RDoc is now included in your gemspec
|
15
|
+
* Rescue errors that raise in the generator, and display better error message, and exit with a non-zero exit status
|
16
|
+
|
1
17
|
# jeweler 0.6.5
|
2
18
|
|
3
19
|
* `jeweler --create-repo foo` now enables gem creation in addition to creating the repository
|
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
CHANGED
@@ -28,7 +28,7 @@ In this example, `s` is a Gem::Specification object. See the documentation for w
|
|
28
28
|
|
29
29
|
## Kicking off a new project
|
30
30
|
|
31
|
-
Jeweler provides a generator
|
31
|
+
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
32
|
|
33
33
|
jeweler the-perfect-gem
|
34
34
|
|
@@ -77,6 +77,13 @@ It does the following for you:
|
|
77
77
|
* Push to GitHub (which results in a gem being build)
|
78
78
|
* Tag the version and push to GitHub
|
79
79
|
|
80
|
+
## Workflow
|
81
|
+
|
82
|
+
* Hack, commit, hack, commit, etc, etc
|
83
|
+
* `rake version:bump:patch release` to do the actual version bump and release
|
84
|
+
* Have a delicious scotch
|
85
|
+
* Go to [Has My Gem Built Yet](http://hasmygembuiltyet.org) and wait for your gem to be built
|
86
|
+
|
80
87
|
## Links
|
81
88
|
|
82
89
|
* [Bugs](http://technicalpickles.lighthouseapp.com/projects/23560-jeweler/overview)
|
data/Rakefile
CHANGED
@@ -14,7 +14,6 @@ begin
|
|
14
14
|
require 'jeweler'
|
15
15
|
Jeweler::Tasks.new do |s|
|
16
16
|
s.name = "jeweler"
|
17
|
-
s.executables = "jeweler"
|
18
17
|
s.summary = "Simple and opinionated helper for creating Rubygem projects on GitHub"
|
19
18
|
s.email = "josh@technicalpickles.com"
|
20
19
|
s.homepage = "http://github.com/technicalpickles/jeweler"
|
@@ -28,11 +27,7 @@ rescue LoadError
|
|
28
27
|
end
|
29
28
|
|
30
29
|
|
31
|
-
Rake::TestTask.new
|
32
|
-
t.libs << 'lib'
|
33
|
-
t.pattern = 'test/*_test.rb'
|
34
|
-
t.verbose = false
|
35
|
-
end
|
30
|
+
Rake::TestTask.new
|
36
31
|
|
37
32
|
Rake::RDocTask.new do |rdoc|
|
38
33
|
rdoc.rdoc_dir = 'rdoc'
|
@@ -42,10 +37,6 @@ Rake::RDocTask.new do |rdoc|
|
|
42
37
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
43
38
|
end
|
44
39
|
|
45
|
-
Rcov::RcovTask.new
|
46
|
-
t.libs << "test"
|
47
|
-
t.test_files = FileList['test/**/*_test.rb']
|
48
|
-
t.verbose = true
|
49
|
-
end
|
40
|
+
Rcov::RcovTask.new
|
50
41
|
|
51
42
|
task :default => :rcov
|
data/TODO
CHANGED
@@ -8,11 +8,6 @@
|
|
8
8
|
* Support rspec?
|
9
9
|
* Support test/unit
|
10
10
|
* Change generated test filename (test_foo not foo_test)
|
11
|
-
* better error handling during generation
|
12
|
-
* directory existing
|
13
|
-
* no github.token configured
|
14
|
-
* no github.username configured
|
15
11
|
* Releasing
|
16
12
|
* Open hasmygembuiltyet.org
|
17
13
|
* enable runcoderun by default
|
18
|
-
* Add --summary option to generator
|
data/VERSION.yml
CHANGED
data/bin/jeweler
CHANGED
@@ -27,6 +27,10 @@ class JewelerOpts < Hash
|
|
27
27
|
o.on('--create-repo', 'create the repository on GitHub') do
|
28
28
|
self[:create_repo] = true
|
29
29
|
end
|
30
|
+
|
31
|
+
o.on('--summary [SUMMARY]', 'specify the summary of the project') do |summary|
|
32
|
+
self[:summary] = summary
|
33
|
+
end
|
30
34
|
|
31
35
|
o.on_tail('-h', '--help', 'display this help and exit') do
|
32
36
|
puts o
|
@@ -46,5 +50,23 @@ unless ARGV.size == 1
|
|
46
50
|
end
|
47
51
|
|
48
52
|
github_repo_name = ARGV.first
|
49
|
-
|
50
|
-
|
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
|
data/lib/jeweler.rb
CHANGED
@@ -23,6 +23,12 @@ class Jeweler
|
|
23
23
|
@gemspec.files = FileList["[A-Z]*.*", "{bin,generators,lib,test,spec}/**/*"]
|
24
24
|
end
|
25
25
|
|
26
|
+
if @gemspec.executables.nil? || @gemspec.executables.empty?
|
27
|
+
@gemspec.executables = Dir["#{@base_dir}/bin/*"].map do |f|
|
28
|
+
File.basename(f)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
26
32
|
@gemspec.has_rdoc = true
|
27
33
|
@gemspec.rdoc_options << '--inline-source' << '--charset=UTF-8'
|
28
34
|
@gemspec.extra_rdoc_files ||= FileList["[A-Z]*.*"]
|
data/lib/jeweler/generator.rb
CHANGED
@@ -21,8 +21,9 @@ class Jeweler
|
|
21
21
|
end
|
22
22
|
|
23
23
|
class Generator
|
24
|
-
attr_accessor :target_dir, :user_name, :user_email,
|
25
|
-
:github_repo_name, :github_remote, :github_url,
|
24
|
+
attr_accessor :target_dir, :user_name, :user_email, :summary,
|
25
|
+
:github_repo_name, :github_remote, :github_url,
|
26
|
+
:github_username, :github_token,
|
26
27
|
:lib_dir, :constant_name, :file_name_prefix, :config, :test_style,
|
27
28
|
:repo, :should_create_repo
|
28
29
|
|
@@ -43,6 +44,7 @@ class Jeweler
|
|
43
44
|
self.constant_name = self.github_repo_name.split(/[-_]/).collect{|each| each.capitalize }.join
|
44
45
|
self.file_name_prefix = self.github_repo_name.gsub('-', '_')
|
45
46
|
self.should_create_repo = options[:create_repo]
|
47
|
+
self.summary = options[:summary] || 'TODO'
|
46
48
|
end
|
47
49
|
|
48
50
|
def run
|
@@ -96,19 +98,19 @@ class Jeweler
|
|
96
98
|
self.config = read_git_config
|
97
99
|
|
98
100
|
unless config.has_key? 'user.name'
|
99
|
-
raise NoGitUserName
|
101
|
+
raise NoGitUserName
|
100
102
|
end
|
101
103
|
|
102
104
|
unless config.has_key? 'user.email'
|
103
|
-
raise NoGitUserEmail
|
105
|
+
raise NoGitUserEmail
|
104
106
|
end
|
105
107
|
|
106
108
|
unless config.has_key? 'github.user'
|
107
|
-
raise NoGitHubUser
|
109
|
+
raise NoGitHubUser
|
108
110
|
end
|
109
111
|
|
110
112
|
unless config.has_key? 'github.token'
|
111
|
-
raise NoGitHubToken
|
113
|
+
raise NoGitHubToken
|
112
114
|
end
|
113
115
|
|
114
116
|
self.user_name = config['user.name']
|
@@ -161,6 +163,7 @@ class Jeweler
|
|
161
163
|
Net::HTTP.post_form URI.parse('http://github.com/repositories'),
|
162
164
|
'login' => github_username,
|
163
165
|
'token' => github_token,
|
166
|
+
'repository[description]' => summary,
|
164
167
|
'repository[name]' => github_repo_name
|
165
168
|
sleep 2
|
166
169
|
@repo.push('origin')
|
data/lib/jeweler/tasks.rb
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
require 'rake'
|
2
2
|
require 'rake/testtask'
|
3
3
|
require 'rake/rdoctask'
|
4
|
-
require 'rcov/rcovtask'
|
5
4
|
|
6
5
|
begin
|
7
6
|
require 'jeweler'
|
8
7
|
Jeweler::Tasks.new do |s|
|
9
8
|
s.name = "<%= github_repo_name %>"
|
10
|
-
s.summary =
|
9
|
+
s.summary = %Q{<%= summary %>}
|
11
10
|
s.email = "<%= user_email %>"
|
12
11
|
s.homepage = "<%= github_url %>"
|
13
12
|
s.description = "TODO"
|
@@ -31,10 +30,14 @@ Rake::RDocTask.new do |rdoc|
|
|
31
30
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
32
31
|
end
|
33
32
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
begin
|
34
|
+
require 'rcov/rcovtask'
|
35
|
+
Rcov::RcovTask.new do |t|
|
36
|
+
t.libs << '<%= testspec %>'
|
37
|
+
t.test_files = FileList['<%= testspec %>/**/*_<%= testspec %>.rb']
|
38
|
+
t.verbose = true
|
39
|
+
end
|
40
|
+
rescue LoadError
|
38
41
|
end
|
39
42
|
|
40
|
-
task :default => :
|
43
|
+
task :default => :test
|
data/lib/jeweler/version.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/test_helper'
|
2
2
|
|
3
|
-
class
|
4
|
-
|
3
|
+
class TestGenerator < Test::Unit::TestCase
|
5
4
|
def self.should_create_directory(directory)
|
6
5
|
should "create #{directory} directory" do
|
7
6
|
assert File.exists?(File.join(@tmp_dir, directory))
|
@@ -75,6 +74,10 @@ class JewelerTest < Test::Unit::TestCase
|
|
75
74
|
assert_match 's.email = "bar@example.com"', @content
|
76
75
|
end
|
77
76
|
|
77
|
+
should "include the summary in the gem" do
|
78
|
+
assert_match %Q{s.summary = %Q{zomg, so good}}, @content
|
79
|
+
end
|
80
|
+
|
78
81
|
should "include the github repo's url as the gem's url" do
|
79
82
|
assert_match 's.homepage = "http://github.com/technicalpickles/the-perfect-gem"', @content
|
80
83
|
end
|
@@ -122,7 +125,7 @@ class JewelerTest < Test::Unit::TestCase
|
|
122
125
|
|
123
126
|
context "for generating technicalpickles's the-perfect-gem repo in 'tmp'" do
|
124
127
|
setup do
|
125
|
-
@generator = Jeweler::Generator.new('the-perfect-gem', :directory => @tmp_dir)
|
128
|
+
@generator = Jeweler::Generator.new('the-perfect-gem', :directory => @tmp_dir, :summary => 'zomg, so good')
|
126
129
|
end
|
127
130
|
|
128
131
|
should "use tmp for target directory" do
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/test_helper'
|
2
2
|
|
3
3
|
require 'rake'
|
4
|
-
class
|
4
|
+
class TestTasks < Test::Unit::TestCase
|
5
5
|
include Rake
|
6
6
|
|
7
7
|
context 'instantiating Jeweler::Tasks' do
|
@@ -30,6 +30,7 @@ class TasksTest < Test::Unit::TestCase
|
|
30
30
|
assert Task.task_defined?(:version)
|
31
31
|
assert Task.task_defined?(:'version:write')
|
32
32
|
assert Task.task_defined?(:'version:display')
|
33
|
+
assert Task.task_defined?(:'version:bump')
|
33
34
|
assert Task.task_defined?(:'version:bump:major')
|
34
35
|
assert Task.task_defined?(:'version:bump:minor')
|
35
36
|
assert Task.task_defined?(:'version:bump:patch')
|
@@ -1,10 +1,9 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/test_helper'
|
2
2
|
|
3
|
-
class
|
3
|
+
class TestVersion < Test::Unit::TestCase
|
4
4
|
|
5
5
|
VERSION_TMP_DIR = File.dirname(__FILE__) + '/version_tmp'
|
6
6
|
|
7
|
-
|
8
7
|
def self.should_have_version(major, minor, patch)
|
9
8
|
should "have major version #{major}" do
|
10
9
|
assert_equal major, @version.major
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: namelessjon-jeweler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.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-01-
|
12
|
+
date: 2009-01-29 00:00:00 -08:00
|
13
13
|
default_executable: jeweler
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -31,6 +31,7 @@ extra_rdoc_files: []
|
|
31
31
|
|
32
32
|
files:
|
33
33
|
- ChangeLog.markdown
|
34
|
+
- LICENSE
|
34
35
|
- Rakefile
|
35
36
|
- README.markdown
|
36
37
|
- TODO
|
@@ -56,16 +57,17 @@ files:
|
|
56
57
|
- test/fixtures
|
57
58
|
- test/fixtures/bar
|
58
59
|
- test/fixtures/bar/VERSION.yml
|
59
|
-
- test/gemspec_test.rb
|
60
60
|
- test/generators
|
61
61
|
- test/generators/initialization_test.rb
|
62
|
-
- test/
|
63
|
-
- test/jeweler_test.rb
|
62
|
+
- test/jeweler
|
64
63
|
- test/shoulda_macros
|
65
64
|
- test/shoulda_macros/jeweler_macros.rb
|
66
|
-
- test/
|
65
|
+
- test/test_gemspec.rb
|
66
|
+
- test/test_generator.rb
|
67
67
|
- test/test_helper.rb
|
68
|
-
- test/
|
68
|
+
- test/test_jeweler.rb
|
69
|
+
- test/test_tasks.rb
|
70
|
+
- test/test_version.rb
|
69
71
|
- test/version_tmp
|
70
72
|
- test/version_tmp/VERSION.yml
|
71
73
|
- lib/jeweler/templates/.gitignore
|