ggem 1.1.4 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -1
- data/Gemfile.lock +11 -5
- data/LICENSE +22 -0
- data/README.md +51 -0
- data/bin/ggem +2 -8
- data/ggem.gemspec +3 -1
- data/lib/ggem/cli.rb +48 -0
- data/lib/ggem/gem.rb +31 -9
- data/lib/ggem/template.rb +15 -12
- data/lib/ggem/template_file/Gemfile.erb +3 -2
- data/lib/ggem/template_file/LICENSE.erb +22 -0
- data/lib/ggem/template_file/README.md.erb +29 -0
- data/lib/ggem/template_file/Rakefile.erb +3 -2
- data/lib/ggem/template_file/gemspec.erb +17 -18
- data/lib/ggem/template_file/gitignore.erb +16 -2
- data/lib/ggem/version.rb +1 -1
- data/test/gem_test.rb +13 -3
- data/test/helper.rb +23 -11
- data/test/name_set.rb +7 -6
- metadata +17 -14
- data/README.rdoc +0 -60
- data/lib/ggem/template_file/README.rdoc.erb +0 -38
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,21 +1,27 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ggem (1.
|
5
|
-
|
4
|
+
ggem (1.2.0)
|
5
|
+
quickl
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://rubygems.org/
|
9
9
|
specs:
|
10
|
-
ansi (1.
|
11
|
-
assert (0.3
|
10
|
+
ansi (1.4.2)
|
11
|
+
assert (0.7.3)
|
12
|
+
assert-view (~> 0.5)
|
13
|
+
assert-view (0.5.0)
|
12
14
|
ansi (~> 1.3)
|
13
|
-
|
15
|
+
undies (~> 2.0)
|
16
|
+
quickl (0.4.2)
|
17
|
+
rake (0.9.2.2)
|
18
|
+
undies (2.2.1)
|
14
19
|
|
15
20
|
PLATFORMS
|
16
21
|
ruby
|
17
22
|
|
18
23
|
DEPENDENCIES
|
19
24
|
assert
|
25
|
+
bundler (~> 1.1)
|
20
26
|
ggem!
|
21
27
|
rake (~> 0.9.2)
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2008-Present Kelly D. Redding
|
2
|
+
|
3
|
+
MIT License
|
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", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# GGem
|
2
|
+
|
3
|
+
Quickly, easily, consistantly generate a ruby gem project ready to build, test, and deploy. Uses and emulates Bundler's gem building features.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
```bash
|
8
|
+
$ gem install ggem
|
9
|
+
```
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
```bash
|
14
|
+
$ ggem my-gem
|
15
|
+
```
|
16
|
+
|
17
|
+
This creates a folder and some files for developing, testing, and building a gem. The command is pretty forgiving with the name you supply, it will automatically transform anything that is CamelCased into something more rubyish. If you have existing folders/files it will just add/overwrite where necessary and not remove anything.
|
18
|
+
|
19
|
+
GGem assumes you are using git for version control. It uses information in you git config and git commands to generate some default information and to build the gem. When creating new gems, GGem will also initialize a git repo and add the newly created files for committing.
|
20
|
+
|
21
|
+
The gem will generate with bundler (http://github.com/carlhuda/bundler/) and assert (http://github.com/teaminsight/assert) gems as development dependencies. They are brought in automatically to make unit testing and releasing your new gem easy. Remove their calls from the generated Rakefile and test helper if you don't want to use them.
|
22
|
+
|
23
|
+
After generating your gem, add information about your gem to both the gemspec and README files. The default version number is "0.0.1", but if you want to change that, take a look at `lib/my_gem/version.rb` to make the change - this will automatically be picked up when you rebuild your gem.
|
24
|
+
|
25
|
+
Your new gem provides some Rake tasks for convenience:
|
26
|
+
|
27
|
+
* all the bundler gem rake tasks (http://github.com/carlhuda/bundler/)
|
28
|
+
* all the testing rake task stuff from assert (http://github.com/teaminsight/assert)
|
29
|
+
|
30
|
+
That's it. Enjoy.
|
31
|
+
|
32
|
+
## Acceptance Testing
|
33
|
+
|
34
|
+
```bash
|
35
|
+
# clone this repo
|
36
|
+
$ bundle install
|
37
|
+
$ rake test
|
38
|
+
```
|
39
|
+
|
40
|
+
## Contributing
|
41
|
+
|
42
|
+
1. Fork it
|
43
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
44
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
45
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
46
|
+
5. Create new Pull Request
|
47
|
+
|
48
|
+
## Credit
|
49
|
+
|
50
|
+
This gem came about from work I did on a fork of Patrick Reagan's (https://github.com/reagent) simple-gem. The original source can be found here: https://github.com/kellyredding/simple-gem.
|
51
|
+
|
data/bin/ggem
CHANGED
data/ggem.gemspec
CHANGED
@@ -17,6 +17,8 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
|
20
|
-
s.add_dependency("bundler")
|
21
20
|
s.add_development_dependency("assert")
|
21
|
+
|
22
|
+
s.add_dependency("quickl")
|
23
|
+
|
22
24
|
end
|
data/lib/ggem/cli.rb
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'quickl'
|
2
|
+
require 'ggem'
|
3
|
+
require "ggem/version"
|
4
|
+
|
5
|
+
module GGemCLI
|
6
|
+
|
7
|
+
#
|
8
|
+
# ggem command line tool
|
9
|
+
#
|
10
|
+
# SYNOPSIS
|
11
|
+
# #{command_name} [options] GEM_NAME
|
12
|
+
#
|
13
|
+
# OPTIONS
|
14
|
+
# #{summarized_options}
|
15
|
+
#
|
16
|
+
# DESCRIPTION
|
17
|
+
# This is a command line tool for using ggem
|
18
|
+
#
|
19
|
+
class Ggem < Quickl::Command(__FILE__, __LINE__)
|
20
|
+
|
21
|
+
VERSION = GGem::VERSION
|
22
|
+
|
23
|
+
# Install options
|
24
|
+
options do |opt|
|
25
|
+
|
26
|
+
@ggem_cli_opts = {}
|
27
|
+
|
28
|
+
opt.on_tail('-h', '--help', "Show this help message") do
|
29
|
+
raise Quickl::Help
|
30
|
+
end
|
31
|
+
|
32
|
+
opt.on_tail('-v', '--version', 'Show version and exit') do
|
33
|
+
raise Quickl::Exit, "#{Quickl.program_name} #{VERSION}"
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
# Run the command
|
39
|
+
def execute(args)
|
40
|
+
raise Quickl::Help if args.size < 1
|
41
|
+
g = GGem::Gem.new(`pwd`.strip, *args)
|
42
|
+
g.save
|
43
|
+
puts "created gem and initialized git repo in #{g.path}"
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|
data/lib/ggem/gem.rb
CHANGED
@@ -11,28 +11,50 @@ module GGem
|
|
11
11
|
self.name = name
|
12
12
|
end
|
13
13
|
|
14
|
+
def path
|
15
|
+
File.join(root_path, name)
|
16
|
+
end
|
17
|
+
|
14
18
|
def name=(name)
|
15
|
-
@name = name.
|
19
|
+
@name = name.
|
20
|
+
gsub(/([A-Z])([a-z])/, '_\1\2').
|
21
|
+
gsub(/_+/, '_').
|
22
|
+
sub(/^_/, '').
|
23
|
+
downcase
|
16
24
|
end
|
17
25
|
|
18
26
|
def module_name
|
19
|
-
@module_name ||= transform_name
|
27
|
+
@module_name ||= transform_name({
|
28
|
+
'_' => '',
|
29
|
+
'-' => '::'
|
30
|
+
}) {|part| part.capitalize }
|
20
31
|
end
|
21
32
|
def ruby_name
|
22
|
-
@ruby_name ||= transform_name(
|
33
|
+
@ruby_name ||= transform_name({
|
34
|
+
'-' => '/'
|
35
|
+
}) {|part| part.downcase }
|
23
36
|
end
|
24
37
|
|
25
38
|
def save
|
26
|
-
Template.new(self).
|
39
|
+
Template.new(self).tap do |t|
|
40
|
+
t.save
|
41
|
+
t.init
|
42
|
+
end
|
27
43
|
end
|
28
44
|
|
29
45
|
private
|
30
46
|
|
31
|
-
def transform_name(
|
32
|
-
self.name
|
33
|
-
|
34
|
-
|
47
|
+
def transform_name(conditions, &block)
|
48
|
+
n = (block ? block.call(self.name) : self.name)
|
49
|
+
conditions.each do |on, glue|
|
50
|
+
if (a = n.split(on)).size > 1
|
51
|
+
n = a.collect do |part|
|
52
|
+
block.call(part) if block
|
53
|
+
end.join(glue)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
n
|
35
57
|
end
|
36
58
|
|
37
59
|
end
|
38
|
-
end
|
60
|
+
end
|
data/lib/ggem/template.rb
CHANGED
@@ -3,7 +3,7 @@ require 'fileutils'
|
|
3
3
|
|
4
4
|
module GGem
|
5
5
|
class Template
|
6
|
-
|
6
|
+
|
7
7
|
def initialize(ggem)
|
8
8
|
@gem = ggem
|
9
9
|
end
|
@@ -14,27 +14,30 @@ module GGem
|
|
14
14
|
save_folder "test"
|
15
15
|
|
16
16
|
save_file('gitignore.erb', '.gitignore')
|
17
|
-
save_file('Gemfile.erb',
|
18
|
-
save_file('gemspec.erb',
|
19
|
-
save_file('Rakefile.erb',
|
20
|
-
save_file('README.
|
17
|
+
save_file('Gemfile.erb', 'Gemfile')
|
18
|
+
save_file('gemspec.erb', "#{@gem.name}.gemspec")
|
19
|
+
save_file('Rakefile.erb', 'Rakefile')
|
20
|
+
save_file('README.md.erb', 'README.md')
|
21
|
+
save_file('LICENSE.erb', 'LICENSE')
|
21
22
|
|
22
|
-
save_file('lib.rb.erb',
|
23
|
+
save_file('lib.rb.erb', "lib/#{@gem.ruby_name}.rb")
|
23
24
|
save_file('lib_version.rb.erb', "lib/#{@gem.ruby_name}/version.rb")
|
24
25
|
|
25
|
-
save_file('test_irb.rb.erb',
|
26
|
+
save_file('test_irb.rb.erb', 'test/irb.rb')
|
26
27
|
save_file('test_helper.rb.erb', 'test/helper.rb')
|
27
|
-
save_file('test.rb.erb',
|
28
|
+
save_file('test.rb.erb', "test/#{@gem.ruby_name}_test.rb")
|
29
|
+
end
|
30
|
+
|
31
|
+
def init
|
32
|
+
`cd #{@gem.path} && git init && git add --all`
|
28
33
|
end
|
29
34
|
|
30
35
|
private
|
31
36
|
|
32
37
|
def save_folder(relative_path=nil)
|
33
38
|
FileUtils.mkdir_p(File.join([
|
34
|
-
@gem.
|
39
|
+
@gem.path, relative_path
|
35
40
|
].compact))
|
36
|
-
["lib/#{@gem.ruby_name}", 'test'].each do |dir|
|
37
|
-
end
|
38
41
|
end
|
39
42
|
|
40
43
|
def save_file(source, output)
|
@@ -50,4 +53,4 @@ module GGem
|
|
50
53
|
end
|
51
54
|
|
52
55
|
end
|
53
|
-
end
|
56
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) <%= Time.now.year %> <TODO: copyright holders>
|
2
|
+
|
3
|
+
MIT License
|
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", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# <%= @gem.module_name %>
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem '<%= @gem.name %>'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install <%= @gem.name %>
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
@@ -1,23 +1,22 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
require "<%= @gem.ruby_name %>/version"
|
2
|
+
require File.expand_path('../lib/<%= @gem.ruby_name %>/version', __FILE__)
|
4
3
|
|
5
|
-
Gem::Specification.new do |
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
s.email = ["TODO: Write your email address"]
|
11
|
-
s.homepage = "http://github.com/__/<%= @gem.name %>"
|
12
|
-
s.summary = %q{TODO: Write a gem summary}
|
13
|
-
s.description = %q{TODO: Write a gem description}
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.name = "<%= @gem.name %>"
|
6
|
+
gem.version = <%= @gem.module_name %>::VERSION
|
7
|
+
gem.description = %q{TODO: Write a gem description}
|
8
|
+
gem.summary = %q{TODO: Write a gem summary}
|
14
9
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
s.require_paths = ["lib"]
|
10
|
+
gem.authors = ["TODO: authors"]
|
11
|
+
gem.email = ["TODO: emails"]
|
12
|
+
gem.homepage = "http://github.com/__/<%= @gem.name %>"
|
19
13
|
|
20
|
-
|
21
|
-
|
22
|
-
|
14
|
+
gem.files = `git ls-files`.split("\n")
|
15
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
|
+
gem.require_paths = ["lib"]
|
18
|
+
|
19
|
+
gem.add_development_dependency("assert")
|
20
|
+
|
21
|
+
# gem.add_dependency("gem-name", ["~> 0.0"])
|
23
22
|
end
|
@@ -1,6 +1,20 @@
|
|
1
|
-
pkg/*
|
2
|
-
.bundle
|
3
1
|
*.gem
|
4
2
|
*.log
|
3
|
+
*.rbc
|
4
|
+
.bundle
|
5
|
+
.config
|
6
|
+
.yardoc
|
5
7
|
.rvmrc
|
6
8
|
.rbenv-version
|
9
|
+
Gemfile.lock
|
10
|
+
InstalledFiles
|
11
|
+
_yardoc
|
12
|
+
coverage
|
13
|
+
doc/
|
14
|
+
lib/bundler/man
|
15
|
+
pkg
|
16
|
+
rdoc
|
17
|
+
spec/reports
|
18
|
+
test/tmp
|
19
|
+
test/version_tmp
|
20
|
+
tmp
|
data/lib/ggem/version.rb
CHANGED
data/test/gem_test.rb
CHANGED
@@ -9,8 +9,14 @@ module GGem
|
|
9
9
|
end
|
10
10
|
|
11
11
|
class RootPathTest < GGemTest
|
12
|
+
before { @gem = Gem.new(TMP_PATH, 'a-gem') }
|
13
|
+
|
12
14
|
should "know its root path" do
|
13
|
-
assert_equal TMP_PATH,
|
15
|
+
assert_equal TMP_PATH, @gem.root_path
|
16
|
+
end
|
17
|
+
|
18
|
+
should "know its path" do
|
19
|
+
assert_equal File.join(TMP_PATH, 'a-gem'), @gem.path
|
14
20
|
end
|
15
21
|
end
|
16
22
|
|
@@ -19,7 +25,7 @@ module GGem
|
|
19
25
|
GGem::NameSet::Underscored,
|
20
26
|
GGem::NameSet::HyphenatedOther
|
21
27
|
].each do |ns|
|
22
|
-
|
28
|
+
should generate_name_set(ns.new)
|
23
29
|
end
|
24
30
|
end
|
25
31
|
|
@@ -35,9 +41,13 @@ module GGem
|
|
35
41
|
FileUtils.rm_rf(TMP_PATH)
|
36
42
|
end
|
37
43
|
|
38
|
-
|
44
|
+
should create_paths((NS.expected_folders + NS.expected_files).collect do |p|
|
39
45
|
File.join(TMP_PATH, NS.name, p)
|
40
46
|
end)
|
47
|
+
|
48
|
+
should "init a git repo in the gem path" do
|
49
|
+
assert File.exists?(File.join(TMP_PATH, NS.name, '.git')), ".git repo config doesn't exist"
|
50
|
+
end
|
41
51
|
end
|
42
52
|
|
43
53
|
end
|
data/test/helper.rb
CHANGED
@@ -5,30 +5,42 @@
|
|
5
5
|
$LOAD_PATH.unshift(File.expand_path("..", __FILE__))
|
6
6
|
|
7
7
|
class Assert::Context
|
8
|
+
|
8
9
|
TMP_PATH = File.expand_path("#{File.dirname(__FILE__)}/../tmp")
|
9
10
|
|
10
|
-
|
11
|
+
def self.create_paths(*paths)
|
12
|
+
called_from = caller.first
|
13
|
+
macro_name = "create the paths: #{paths.join(', ')}"
|
14
|
+
|
15
|
+
Assert::Macro.new(macro_name) do
|
16
|
+
paths.flatten.each do |path|
|
17
|
+
|
18
|
+
should "create the path '#{path}'", called_from do
|
19
|
+
assert File.exists?(path), "'#{path}' does not exist"
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
11
25
|
|
12
|
-
|
26
|
+
def self.generate_name_set(name_set)
|
27
|
+
called_from = caller.first
|
28
|
+
macro_name = "generate the name_set: #{name_set.inspect}"
|
29
|
+
|
30
|
+
Assert::Macro.new(macro_name) do
|
13
31
|
name_set.variations.each do |variation|
|
14
32
|
[:name, :module_name, :ruby_name].each do |name_type|
|
15
|
-
|
33
|
+
|
34
|
+
should "know its :#{name_type} given '#{variation}'", called_from do
|
16
35
|
the_gem = GGem::Gem.new(TMP_PATH, variation)
|
17
36
|
assert_equal name_set.send(name_type), the_gem.send(name_type)
|
18
37
|
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
38
|
|
23
|
-
def should_create_paths(*paths)
|
24
|
-
paths.flatten.each do |path|
|
25
|
-
should "create the path '#{path}'" do
|
26
|
-
assert File.exists?(path), "'#{path}' does not exist"
|
27
39
|
end
|
28
40
|
end
|
29
41
|
end
|
30
|
-
|
31
42
|
end
|
43
|
+
|
32
44
|
end
|
33
45
|
|
34
46
|
|
data/test/name_set.rb
CHANGED
@@ -18,7 +18,8 @@ module GGem
|
|
18
18
|
"Gemfile",
|
19
19
|
"#{@name}.gemspec",
|
20
20
|
"Rakefile",
|
21
|
-
"README.
|
21
|
+
"README.md",
|
22
|
+
"LICENSE",
|
22
23
|
|
23
24
|
"lib/#{@ruby_name}.rb",
|
24
25
|
"lib/#{@ruby_name}/version.rb",
|
@@ -43,7 +44,7 @@ module GGem
|
|
43
44
|
|
44
45
|
class Underscored < Base
|
45
46
|
def initialize
|
46
|
-
@variations = ['my_gem']
|
47
|
+
@variations = ['my_gem', 'my__gem', 'MyGem', 'myGem', 'My_Gem']
|
47
48
|
@name = 'my_gem'
|
48
49
|
@module_name = 'MyGem'
|
49
50
|
@ruby_name = 'my_gem'
|
@@ -53,13 +54,13 @@ module GGem
|
|
53
54
|
|
54
55
|
class HyphenatedOther < Base
|
55
56
|
def initialize
|
56
|
-
@variations = ['my-gem'
|
57
|
+
@variations = ['my-gem']
|
57
58
|
@name = 'my-gem'
|
58
|
-
@module_name = '
|
59
|
-
@ruby_name = '
|
59
|
+
@module_name = 'My::Gem'
|
60
|
+
@ruby_name = 'my/gem'
|
60
61
|
end
|
61
62
|
end
|
62
63
|
|
63
64
|
|
64
65
|
end
|
65
|
-
end
|
66
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ggem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 1.
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 1.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kelly Redding
|
@@ -15,11 +15,10 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2012-03-19 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
|
-
type: :
|
22
|
-
prerelease: false
|
21
|
+
type: :development
|
23
22
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
23
|
none: false
|
25
24
|
requirements:
|
@@ -29,11 +28,11 @@ dependencies:
|
|
29
28
|
segments:
|
30
29
|
- 0
|
31
30
|
version: "0"
|
31
|
+
name: assert
|
32
32
|
version_requirements: *id001
|
33
|
-
name: bundler
|
34
|
-
- !ruby/object:Gem::Dependency
|
35
|
-
type: :development
|
36
33
|
prerelease: false
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
type: :runtime
|
37
36
|
requirement: &id002 !ruby/object:Gem::Requirement
|
38
37
|
none: false
|
39
38
|
requirements:
|
@@ -43,8 +42,9 @@ dependencies:
|
|
43
42
|
segments:
|
44
43
|
- 0
|
45
44
|
version: "0"
|
45
|
+
name: quickl
|
46
46
|
version_requirements: *id002
|
47
|
-
|
47
|
+
prerelease: false
|
48
48
|
description: Quickly, easily, consistantly generate a ruby gem project ready to build, test, and deploy. Uses Bundler's gem building features.
|
49
49
|
email:
|
50
50
|
- kelly@kelredd.com
|
@@ -58,15 +58,18 @@ files:
|
|
58
58
|
- .gitignore
|
59
59
|
- Gemfile
|
60
60
|
- Gemfile.lock
|
61
|
-
-
|
61
|
+
- LICENSE
|
62
|
+
- README.md
|
62
63
|
- Rakefile
|
63
64
|
- bin/ggem
|
64
65
|
- ggem.gemspec
|
65
66
|
- lib/ggem.rb
|
67
|
+
- lib/ggem/cli.rb
|
66
68
|
- lib/ggem/gem.rb
|
67
69
|
- lib/ggem/template.rb
|
68
70
|
- lib/ggem/template_file/Gemfile.erb
|
69
|
-
- lib/ggem/template_file/
|
71
|
+
- lib/ggem/template_file/LICENSE.erb
|
72
|
+
- lib/ggem/template_file/README.md.erb
|
70
73
|
- lib/ggem/template_file/Rakefile.erb
|
71
74
|
- lib/ggem/template_file/gemspec.erb
|
72
75
|
- lib/ggem/template_file/gitignore.erb
|
@@ -109,7 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
112
|
requirements: []
|
110
113
|
|
111
114
|
rubyforge_project:
|
112
|
-
rubygems_version: 1.8.
|
115
|
+
rubygems_version: 1.8.11
|
113
116
|
signing_key:
|
114
117
|
specification_version: 3
|
115
118
|
summary: "\"Juh Gem\", baby! (this makes gems)"
|
data/README.rdoc
DELETED
@@ -1,60 +0,0 @@
|
|
1
|
-
= ggem
|
2
|
-
|
3
|
-
== Description
|
4
|
-
|
5
|
-
Quickly, easily, consistantly generate a ruby gem project ready to build, test, and deploy. Uses Bundler's gem building features.
|
6
|
-
|
7
|
-
== Installation
|
8
|
-
|
9
|
-
gem install ggem
|
10
|
-
|
11
|
-
== Usage
|
12
|
-
|
13
|
-
$ ggem my-gem
|
14
|
-
|
15
|
-
This creates a folder and some files for developing, testing, and building a gem. The command is pretty forgiving with the name you supply, it will automatically transform anything that is CamelCased into something more ruby-like. If you have existing folders/files it will just add/overwrite where necessary and not remove anything.
|
16
|
-
|
17
|
-
The gem will generate with bundler (http://github.com/carlhuda/bundler/) and test-belt (http://github.com/kelredd/test-belt) gems as development dependencies. They are brought in automatically to make unit testing and releasing your new gem easy. Remove their calls from the generated Rakefile and test helper if you don't want to use them.
|
18
|
-
|
19
|
-
After generating your gem, add information about your gem to both the gemspec and README files. The default version number is "0.0.1", but if you want to change that, take a look at <tt>lib/my_gem/version.rb</tt> to make the change - this will automatically be picked up when you rebuild your gem.
|
20
|
-
|
21
|
-
Your new gem provides some Rake tasks for convenience:
|
22
|
-
|
23
|
-
* all the bundler gem rake tasks (http://github.com/carlhuda/bundler/)
|
24
|
-
* all the testing rake task stuff from test-belt (http://github.com/kelredd/test-belt)
|
25
|
-
|
26
|
-
That's it. Enjoy.
|
27
|
-
|
28
|
-
== Acceptance Testing
|
29
|
-
|
30
|
-
# clone this repo
|
31
|
-
$ bundle install
|
32
|
-
$ rake test
|
33
|
-
|
34
|
-
== Credit
|
35
|
-
This gem came about from work I did on a fork of Patrick Reagan's (https://github.com/reagent) simple-gem. The original source can be found here: https://github.com/kelredd/simple-gem.
|
36
|
-
|
37
|
-
== License
|
38
|
-
|
39
|
-
Copyright (c) 2008-2011 Kelly Redding (mailto:kelly@kelredd.com)
|
40
|
-
|
41
|
-
Permission is hereby granted, free of charge, to any person
|
42
|
-
obtaining a copy of this software and associated documentation
|
43
|
-
files (the "Software"), to deal in the Software without
|
44
|
-
restriction, including without limitation the rights to use,
|
45
|
-
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
46
|
-
copies of the Software, and to permit persons to whom the
|
47
|
-
Software is furnished to do so, subject to the following
|
48
|
-
conditions:
|
49
|
-
|
50
|
-
The above copyright notice and this permission notice shall be
|
51
|
-
included in all copies or substantial portions of the Software.
|
52
|
-
|
53
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
54
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
55
|
-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
56
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
57
|
-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
58
|
-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
59
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
60
|
-
OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,38 +0,0 @@
|
|
1
|
-
= <%= @gem.module_name %>
|
2
|
-
|
3
|
-
== Description
|
4
|
-
|
5
|
-
TODO: Write a description
|
6
|
-
|
7
|
-
== Installation
|
8
|
-
|
9
|
-
gem install <%= @gem.name %>
|
10
|
-
|
11
|
-
== Usage
|
12
|
-
|
13
|
-
require '<%= @gem.ruby_name %>'
|
14
|
-
|
15
|
-
== License
|
16
|
-
|
17
|
-
Copyright (c) <year> <copyright holders>
|
18
|
-
|
19
|
-
Permission is hereby granted, free of charge, to any person
|
20
|
-
obtaining a copy of this software and associated documentation
|
21
|
-
files (the "Software"), to deal in the Software without
|
22
|
-
restriction, including without limitation the rights to use,
|
23
|
-
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
24
|
-
copies of the Software, and to permit persons to whom the
|
25
|
-
Software is furnished to do so, subject to the following
|
26
|
-
conditions:
|
27
|
-
|
28
|
-
The above copyright notice and this permission notice shall be
|
29
|
-
included in all copies or substantial portions of the Software.
|
30
|
-
|
31
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
32
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
33
|
-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
34
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
35
|
-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
36
|
-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
37
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
38
|
-
OTHER DEALINGS IN THE SOFTWARE.
|