gemsmith 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +10 -0
- data/README.rdoc +3 -1
- data/lib/gemsmith.rb +0 -4
- data/lib/gemsmith/cli.rb +6 -4
- data/lib/gemsmith/templates/gem.gemspec.tmp +6 -2
- data/lib/gemsmith/templates/lib/gem.rb.tmp +6 -6
- data/lib/gemsmith/templates/lib/gem/action_controller/class_methods.rb.tmp +1 -1
- data/lib/gemsmith/templates/lib/gem/action_controller/instance_methods.rb.tmp +1 -1
- data/lib/gemsmith/templates/lib/gem/action_view/instance_methods.rb.tmp +5 -1
- data/lib/gemsmith/templates/lib/gem/active_record/class_methods.rb.tmp +1 -1
- data/lib/gemsmith/templates/lib/gem/active_record/instance_methods.rb.tmp +1 -1
- data/lib/gemsmith/templates/lib/generators/gem/install/install_generator.rb.tmp +2 -2
- data/lib/gemsmith/templates/lib/generators/gem/upgrade/upgrade_generator.rb.tmp +2 -2
- data/lib/gemsmith/version.rb +1 -1
- metadata +5 -5
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
= v0.5.0
|
2
|
+
|
3
|
+
# Fixed bug with wrong definition of ActionView instance method include for main gem template.
|
4
|
+
# Changed the ActionView template behavior so that instance methods are auto-included.
|
5
|
+
# Renamed the execute methods for the install and upgrade generators to install and upgrade respectively.
|
6
|
+
# Added Rails version options. Default: 3.0.0.
|
7
|
+
# Added Ruby version option. Default: 1.9.2.
|
8
|
+
# Made the module namespace optional when building gems specifically for Rails.
|
9
|
+
# Relabeled the TODO helper text for all templates.
|
10
|
+
|
1
11
|
= v0.4.0
|
2
12
|
|
3
13
|
* Fixed bug with options not being supplied as second argument to write_inheritable_attribute for ActionController and ActiveRecord class method templates.
|
data/README.rdoc
CHANGED
@@ -31,7 +31,6 @@ You can also configure common settings for future gem builds by creating the fol
|
|
31
31
|
...with the following settings (for example):
|
32
32
|
|
33
33
|
---
|
34
|
-
:gem_platform: Gem::Platform::RUBY
|
35
34
|
:author_name: Brooke Kuhlmann
|
36
35
|
:author_email: brooke@redalchemist.com
|
37
36
|
:author_url: http://www.redalchemist.com
|
@@ -46,6 +45,9 @@ NOTE: All options above are optional. If no options are configured, then the def
|
|
46
45
|
author_url: nil
|
47
46
|
company_name: <author name>
|
48
47
|
company_url: <author URL>
|
48
|
+
year: <current date of gem creation>
|
49
|
+
ruby_version: 1.9.2
|
50
|
+
rails_version: 3.0.0
|
49
51
|
|
50
52
|
= Usage
|
51
53
|
|
data/lib/gemsmith.rb
CHANGED
data/lib/gemsmith/cli.rb
CHANGED
@@ -31,21 +31,23 @@ module Gemsmith
|
|
31
31
|
# Initialize options.
|
32
32
|
gem_name = Thor::Util.snake_case name
|
33
33
|
gem_class = Thor::Util.camel_case name
|
34
|
-
author_name = @settings[:author_name] || `git config user.name`.chomp || "TODO:
|
35
|
-
author_url = @settings[:author_url] || "TODO:
|
34
|
+
author_name = @settings[:author_name] || `git config user.name`.chomp || "TODO: Add your full name here."
|
35
|
+
author_url = @settings[:author_url] || "TODO: Add your home page URL here."
|
36
36
|
template_options = {
|
37
37
|
:gem_name => gem_name,
|
38
38
|
:gem_class => gem_class,
|
39
39
|
:gem_platform => (@settings[:gem_platform] || "Gem::Platform::RUBY"),
|
40
40
|
:author_name => author_name,
|
41
|
-
:author_email => (@settings[:author_email] || `git config user.email`.chomp || "TODO:
|
41
|
+
:author_email => (@settings[:author_email] || `git config user.email`.chomp || "TODO: Add your email address here."),
|
42
42
|
:author_url => author_url,
|
43
43
|
:company_name => (@settings[:company_name] || author_name),
|
44
44
|
:company_url => (@settings[:company_url] || author_url),
|
45
45
|
:year => Time.now.year,
|
46
46
|
:bin => options[:bin],
|
47
47
|
:rails => options[:rails],
|
48
|
-
:rspec => options[:rspec]
|
48
|
+
:rspec => options[:rspec],
|
49
|
+
:ruby_version => (@settings[:ruby_version] || "1.9.2"),
|
50
|
+
:rails_version => (@settings[:rails_version] || "3.0.0")
|
49
51
|
}
|
50
52
|
|
51
53
|
# Configure templates.
|
@@ -9,13 +9,17 @@ Gem::Specification.new do |s|
|
|
9
9
|
s.authors = ["<%= config[:author_name] %>"]
|
10
10
|
s.email = ["<%= config[:author_email] %>"]
|
11
11
|
s.homepage = "<%= config[:author_url] %>"
|
12
|
-
s.summary = "TODO:
|
13
|
-
s.description = "TODO:
|
12
|
+
s.summary = "TODO: Add your gem summary here."
|
13
|
+
s.description = "TODO: Add your gem description here."
|
14
14
|
|
15
15
|
s.rdoc_options << "CHANGELOG.rdoc"
|
16
|
+
s.required_ruby_version = "~> <%= config[:ruby_version] %>"
|
16
17
|
<%- if config[:bin] -%>
|
17
18
|
s.add_dependency "thor"
|
18
19
|
<%- end -%>
|
20
|
+
<%- if config[:rails] -%>
|
21
|
+
s.add_dependency "rails", "~> <%= config[:rails_version] %>"
|
22
|
+
<%- end -%>
|
19
23
|
<%- if config[:rspec] -%>
|
20
24
|
s.add_development_dependency "rspec"
|
21
25
|
<%- end -%>
|
@@ -8,11 +8,6 @@ require File.join File.dirname(__FILE__), "<%= config[:gem_name] %>", "action_co
|
|
8
8
|
require File.join File.dirname(__FILE__), "<%= config[:gem_name] %>", "action_controller", "instance_methods.rb"
|
9
9
|
<%- end -%>
|
10
10
|
|
11
|
-
# Namespace
|
12
|
-
module <%= config[:gem_class] %>
|
13
|
-
# Placeholder.
|
14
|
-
end
|
15
|
-
|
16
11
|
<%- if config[:rails] -%>
|
17
12
|
# Rails Enhancements
|
18
13
|
if defined? Rails
|
@@ -23,7 +18,7 @@ if defined? Rails
|
|
23
18
|
|
24
19
|
# View
|
25
20
|
if defined? ActionView
|
26
|
-
ActionView::Base.send :include, <%= config[:gem_class] %>::
|
21
|
+
ActionView::Base.send :include, <%= config[:gem_class] %>::ActionView
|
27
22
|
end
|
28
23
|
|
29
24
|
# Controller
|
@@ -31,4 +26,9 @@ if defined? Rails
|
|
31
26
|
ActionController::Base.send :include, <%= config[:gem_class] %>::ActionController
|
32
27
|
end
|
33
28
|
end
|
29
|
+
<%- else -%>
|
30
|
+
# Namespace
|
31
|
+
module <%= config[:gem_class] %>
|
32
|
+
# TODO - Add your custom code here.
|
33
|
+
end
|
34
34
|
<%- end -%>
|
@@ -3,8 +3,8 @@ module <%= config[:gem_class] %>
|
|
3
3
|
source_root File.join(File.dirname(__FILE__), "..", "templates")
|
4
4
|
|
5
5
|
desc "Installs additional <%= config[:gem_class] %> resources."
|
6
|
-
def
|
7
|
-
# TODO - Add your
|
6
|
+
def install
|
7
|
+
# TODO - Add your install code here.
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
@@ -3,8 +3,8 @@ module <%= config[:gem_class] %>
|
|
3
3
|
source_root File.join(File.dirname(__FILE__), "..", "templates")
|
4
4
|
|
5
5
|
desc "Upgrades previously installed <%= config[:gem_class] %> resources."
|
6
|
-
def
|
7
|
-
# TODO - Add your
|
6
|
+
def upgrade
|
7
|
+
# TODO - Add your upgrade code here.
|
8
8
|
end
|
9
9
|
end
|
10
10
|
end
|
data/lib/gemsmith/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gemsmith
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 5
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.5.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Brooke Kuhlmann
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-08-27 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: thor
|
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
requirements: []
|
136
136
|
|
137
137
|
rubyforge_project:
|
138
|
-
rubygems_version: 1.8.
|
138
|
+
rubygems_version: 1.8.8
|
139
139
|
signing_key:
|
140
140
|
specification_version: 3
|
141
141
|
summary: Ruby gem skeleton generation for the professional gemsmith.
|