gemsmith 1.0.0 → 1.1.0
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/.rspec +2 -0
- data/CHANGELOG.rdoc +10 -0
- data/README.rdoc +15 -6
- data/gemsmith.gemspec +10 -8
- data/lib/gemsmith/cli.rb +27 -1
- data/lib/gemsmith/templates/README.rdoc.tmp +12 -4
- data/lib/gemsmith/templates/lib/gem/cli.rb.tmp +1 -1
- data/lib/gemsmith/templates/rspec.tmp +1 -0
- data/lib/gemsmith/templates/spec/spec_helper.rb.tmp +0 -1
- data/lib/gemsmith/version.rb +1 -1
- data/spec/spec_helper.rb +0 -1
- metadata +6 -5
data/.rspec
ADDED
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
= v1.1.0
|
2
|
+
|
3
|
+
* Fixed bug where args, options, and config were not being passed to super for CLI initialize for gem and gem template generation.
|
4
|
+
* Updated gemspec settings and removed rubygem requirements from spec helper.
|
5
|
+
* Defaulted RSpec output to documentation format for project and template generation.
|
6
|
+
* Added Ruby on Rails Gem Packaging to Best Practices section of README.
|
7
|
+
* Added the -o option for opening a gem in the default editor.
|
8
|
+
* Added RSpec documentation to README and README template.
|
9
|
+
* Added Tests, Contributions, and Credits section to README and README template.
|
10
|
+
|
1
11
|
= v1.0.0
|
2
12
|
|
3
13
|
* Upgraded to Ruby 1.9 and added Ruby 1.9 requirements.
|
data/README.rdoc
CHANGED
@@ -7,11 +7,12 @@ gem. Gemsmith is essentially an enhanced version of Bundler's gem building capab
|
|
7
7
|
= Features
|
8
8
|
|
9
9
|
* Builds a gem skeleton with Bundler functionality in mind.
|
10
|
-
* Allows for common settings that
|
10
|
+
* Allows for common settings that can be applied to new gem creations.
|
11
11
|
* Supports binary skeletons with Thor[https://github.com/wycats/thor] command line functionality.
|
12
12
|
* Supports {Ruby on Rails}[http://rubyonrails.org] skeletons.
|
13
13
|
* Supports RSpec[http://rspec.info] test skeletons.
|
14
14
|
* Adds commonly needed README, CHANGELOG, LICENSE, etc. template files.
|
15
|
+
* Provides the ability to open any installed gem within your favorite editor.
|
15
16
|
|
16
17
|
= Requirements
|
17
18
|
|
@@ -59,6 +60,7 @@ From the command line, type: gemsmith help
|
|
59
60
|
gemsmith -c, [create=GEM_NAME] # Create new gem.
|
60
61
|
gemsmith -e, [edit] # Edit gem settings in default editor (assumes $EDITOR environment variable).
|
61
62
|
gemsmith -h, [help] # Show this message.
|
63
|
+
gemsmith -o, [open=NAME] # Opens gem in default editor (assumes $EDITOR environment variable).
|
62
64
|
gemsmith -v, [version] # Show version.
|
63
65
|
|
64
66
|
For more gem creation options, type: gemsmith help create
|
@@ -75,17 +77,24 @@ available to you via Bundler (i.e. rake -T):
|
|
75
77
|
rake install # Build and install <gem>-<version>.gem into system gems
|
76
78
|
rake release # Create tag v0.1.1 and build and push <gem>-<version>.gem to Rubygems
|
77
79
|
|
80
|
+
= Tests
|
81
|
+
|
82
|
+
To test, change directory to the gem root and run:
|
83
|
+
|
84
|
+
bundle exec rspec spec
|
85
|
+
|
78
86
|
= Best Practices
|
79
87
|
|
80
|
-
1.
|
88
|
+
1. {Ruby on Rails Gem Packaging}[http://weblog.rubyonrails.org/2009/9/1/gem-packaging-best-practices]
|
89
|
+
2. Ensure the RUBYOPT env variable includes the -w option. {Details}[http://avdi.org/devblog/2011/06/23/how-ruby-helps-you-fix-your-broken-code/].
|
81
90
|
|
82
|
-
=
|
91
|
+
= Contributions
|
83
92
|
|
84
|
-
{
|
93
|
+
Please log all feedback/issues via {GitHub Issues}[https://github.com/bkuhlmann/gemsmith/issues] for the project. Thanks.
|
85
94
|
|
86
|
-
=
|
95
|
+
= Credits
|
87
96
|
|
88
|
-
{Brooke Kuhlmann}[http://www.redalchemist.com]
|
97
|
+
Developed by {Brooke Kuhlmann}[http://www.redalchemist.com] at {Red Alchemist}[http://www.redalchemist.com]
|
89
98
|
|
90
99
|
= License
|
91
100
|
|
data/gemsmith.gemspec
CHANGED
@@ -3,14 +3,16 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
require "gemsmith/version"
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
|
-
s.name
|
7
|
-
s.version
|
8
|
-
s.platform
|
9
|
-
s.author
|
10
|
-
s.email
|
11
|
-
s.homepage
|
12
|
-
s.summary
|
13
|
-
s.description
|
6
|
+
s.name = "gemsmith"
|
7
|
+
s.version = Gemsmith::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.author = "Brooke Kuhlmann"
|
10
|
+
s.email = "brooke@redalchemist.com"
|
11
|
+
s.homepage = "http://www.redalchemist.com"
|
12
|
+
s.summary = "Ruby gem skeleton generation for the professional gemsmith."
|
13
|
+
s.description = "Ruby gem skeleton generation for the professional gemsmith. Includes custom settings, binary, Ruby on Rails, and RSpec support. "
|
14
|
+
s.license = "MIT"
|
15
|
+
s.post_install_message = "(W): www.redalchemist.com. (T): @ralchemist."
|
14
16
|
|
15
17
|
s.rdoc_options << "CHANGELOG.rdoc"
|
16
18
|
s.required_ruby_version = "~> 1.9.0"
|
data/lib/gemsmith/cli.rb
CHANGED
@@ -15,7 +15,7 @@ module Gemsmith
|
|
15
15
|
|
16
16
|
# Initialize.
|
17
17
|
def initialize args = [], options = {}, config = {}
|
18
|
-
super
|
18
|
+
super args, options, config
|
19
19
|
load_settings settings_file
|
20
20
|
end
|
21
21
|
|
@@ -88,6 +88,32 @@ module Gemsmith
|
|
88
88
|
say
|
89
89
|
end
|
90
90
|
|
91
|
+
desc "-o, [open=NAME]", "Opens gem in default editor (assumes $EDITOR environment variable)."
|
92
|
+
map "-o" => :open
|
93
|
+
def open name
|
94
|
+
specs = Gem::Specification.find_all_by_name name
|
95
|
+
case
|
96
|
+
when specs.size == 1
|
97
|
+
`$EDITOR #{specs.first.full_gem_path}`
|
98
|
+
when specs.size > 1
|
99
|
+
say "Multiple versions found:"
|
100
|
+
specs.each_with_index do |spec, index|
|
101
|
+
say "#{index + 1}. #{spec.name} #{spec.version.version}"
|
102
|
+
end
|
103
|
+
result = ask "Please pick one (or type 'q' to quit):"
|
104
|
+
unless result == 'q'
|
105
|
+
if (1..specs.size).include?(result.to_i)
|
106
|
+
spec = Gem::Specification.find_by_name(name, specs[result.to_i - 1].version.version)
|
107
|
+
`$EDITOR #{spec.full_gem_path}`
|
108
|
+
else
|
109
|
+
error "Invalid option: #{result}"
|
110
|
+
end
|
111
|
+
end
|
112
|
+
else
|
113
|
+
say "Unable to find gem: #{name}"
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
91
117
|
desc "-e, [edit]", "Edit gem settings in default editor (assumes $EDITOR environment variable)."
|
92
118
|
map "-e" => :edit
|
93
119
|
def edit
|
@@ -22,13 +22,21 @@ Add the following to your Gemfile:
|
|
22
22
|
|
23
23
|
= Usage
|
24
24
|
|
25
|
-
|
25
|
+
<%- if config[:rspec] -%>
|
26
|
+
= Tests
|
26
27
|
|
27
|
-
|
28
|
+
To test, change directory to the gem root and run:
|
28
29
|
|
29
|
-
|
30
|
+
bundle exec rspec spec
|
31
|
+
<%- end -%>
|
32
|
+
|
33
|
+
= Contributions
|
34
|
+
|
35
|
+
Please log all feedback/issues via GitHub Issues for the project. Thanks.
|
36
|
+
|
37
|
+
= Credits
|
30
38
|
|
31
|
-
{<%= config[:author_name] %>}[<%= config[:author_url] %>]
|
39
|
+
Developed by {<%= config[:author_name] %>}[<%= config[:author_url] %>] at {<%= config[:company_name] %>}[<%= config[:company_url] %>]
|
32
40
|
|
33
41
|
= License
|
34
42
|
|
data/lib/gemsmith/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: gemsmith
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.
|
5
|
+
version: 1.1.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Brooke Kuhlmann
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-11-20 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: thor
|
@@ -66,6 +66,7 @@ extra_rdoc_files: []
|
|
66
66
|
|
67
67
|
files:
|
68
68
|
- .gitignore
|
69
|
+
- .rspec
|
69
70
|
- CHANGELOG.rdoc
|
70
71
|
- Gemfile
|
71
72
|
- LICENSE.rdoc
|
@@ -103,9 +104,9 @@ files:
|
|
103
104
|
- spec/spec_helper.rb
|
104
105
|
- spec/support/settings.yml
|
105
106
|
homepage: http://www.redalchemist.com
|
106
|
-
licenses:
|
107
|
-
|
108
|
-
post_install_message:
|
107
|
+
licenses:
|
108
|
+
- MIT
|
109
|
+
post_install_message: "(W): www.redalchemist.com. (T): @ralchemist."
|
109
110
|
rdoc_options:
|
110
111
|
- CHANGELOG.rdoc
|
111
112
|
require_paths:
|