ggem 1.2.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +16 -2
- data/Gemfile +0 -1
- data/README.md +3 -16
- data/Rakefile +4 -3
- data/ggem.gemspec +15 -18
- data/lib/ggem/gem.rb +4 -8
- data/lib/ggem/template.rb +0 -1
- data/lib/ggem/template_file/Gemfile.erb +0 -1
- data/lib/ggem/template_file/Rakefile.erb +1 -1
- data/lib/ggem/template_file/gemspec.erb +0 -1
- data/lib/ggem/version.rb +1 -1
- data/test/{gem_test.rb → gem_tests.rb} +7 -15
- data/test/helper.rb +7 -1
- data/test/name_set.rb +2 -3
- metadata +19 -21
- data/Gemfile.lock +0 -27
- data/lib/ggem/template_file/test.rb.erb +0 -9
data/.gitignore
CHANGED
@@ -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/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
# GGem
|
2
2
|
|
3
|
-
Quickly, easily, consistantly generate a ruby gem project ready to build, test, and deploy. Uses and emulates Bundler's gem building features.
|
3
|
+
Quickly, easily, consistantly generate a ruby gem project ready to build, test, and deploy. Uses and emulates most of Bundler's gem building features.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
```
|
7
|
+
```
|
8
8
|
$ gem install ggem
|
9
9
|
```
|
10
10
|
|
11
11
|
## Usage
|
12
12
|
|
13
|
-
```
|
13
|
+
```
|
14
14
|
$ ggem my-gem
|
15
15
|
```
|
16
16
|
|
@@ -29,14 +29,6 @@ Your new gem provides some Rake tasks for convenience:
|
|
29
29
|
|
30
30
|
That's it. Enjoy.
|
31
31
|
|
32
|
-
## Acceptance Testing
|
33
|
-
|
34
|
-
```bash
|
35
|
-
# clone this repo
|
36
|
-
$ bundle install
|
37
|
-
$ rake test
|
38
|
-
```
|
39
|
-
|
40
32
|
## Contributing
|
41
33
|
|
42
34
|
1. Fork it
|
@@ -44,8 +36,3 @@ $ rake test
|
|
44
36
|
3. Commit your changes (`git commit -am 'Added some feature'`)
|
45
37
|
4. Push to the branch (`git push origin my-new-feature`)
|
46
38
|
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/Rakefile
CHANGED
data/ggem.gemspec
CHANGED
@@ -1,24 +1,21 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
|
3
|
-
require "ggem/version"
|
2
|
+
require File.expand_path('../lib/ggem/version', __FILE__)
|
4
3
|
|
5
|
-
Gem::Specification.new do |
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
s.email = ["kelly@kelredd.com"]
|
11
|
-
s.homepage = "http://github.com/kelredd/ggem"
|
12
|
-
s.summary = %q{"Juh Gem", baby! (this makes gems)}
|
13
|
-
s.description = %q{Quickly, easily, consistantly generate a ruby gem project ready to build, test, and deploy. Uses Bundler's gem building features.}
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.name = "ggem"
|
6
|
+
gem.version = GGem::VERSION
|
7
|
+
gem.summary = %q{"Juh Gem", baby! (this makes gems)}
|
8
|
+
gem.description = %q{"Juh Gem", baby! (this makes gems)}
|
14
9
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
s.require_paths = ["lib"]
|
10
|
+
gem.authors = ["Kelly Redding"]
|
11
|
+
gem.email = ["kelly@kellyredding.com"]
|
12
|
+
gem.homepage = "http://github.com/kellyredding/ggem"
|
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"]
|
23
18
|
|
19
|
+
gem.add_development_dependency("assert")
|
20
|
+
gem.add_dependency("quickl")
|
24
21
|
end
|
data/lib/ggem/gem.rb
CHANGED
@@ -24,15 +24,11 @@ module GGem
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def module_name
|
27
|
-
@module_name ||= transform_name({
|
28
|
-
'_' => '',
|
29
|
-
'-' => '::'
|
30
|
-
}) {|part| part.capitalize }
|
27
|
+
@module_name ||= transform_name('_' => '', '-' => '') {|part| part.capitalize }
|
31
28
|
end
|
29
|
+
|
32
30
|
def ruby_name
|
33
|
-
@ruby_name ||= transform_name
|
34
|
-
'-' => '/'
|
35
|
-
}) {|part| part.downcase }
|
31
|
+
@ruby_name ||= transform_name{|part| part.downcase }
|
36
32
|
end
|
37
33
|
|
38
34
|
def save
|
@@ -44,7 +40,7 @@ module GGem
|
|
44
40
|
|
45
41
|
private
|
46
42
|
|
47
|
-
def transform_name(conditions, &block)
|
43
|
+
def transform_name(conditions={}, &block)
|
48
44
|
n = (block ? block.call(self.name) : self.name)
|
49
45
|
conditions.each do |on, glue|
|
50
46
|
if (a = n.split(on)).size > 1
|
data/lib/ggem/template.rb
CHANGED
data/lib/ggem/version.rb
CHANGED
@@ -4,11 +4,11 @@ require "name_set"
|
|
4
4
|
require "ggem/gem"
|
5
5
|
|
6
6
|
module GGem
|
7
|
-
class
|
7
|
+
class GGemTests < Assert::Context
|
8
8
|
desc "GGem::Gem"
|
9
9
|
end
|
10
10
|
|
11
|
-
class
|
11
|
+
class RootPathTests < GGemTests
|
12
12
|
before { @gem = Gem.new(TMP_PATH, 'a-gem') }
|
13
13
|
|
14
14
|
should "know its root path" do
|
@@ -20,7 +20,7 @@ module GGem
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
class
|
23
|
+
class NameTests < GGemTests
|
24
24
|
[ GGem::NameSet::Simple,
|
25
25
|
GGem::NameSet::Underscored,
|
26
26
|
GGem::NameSet::HyphenatedOther
|
@@ -29,7 +29,7 @@ module GGem
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
class
|
32
|
+
class SaveTests < GGemTests
|
33
33
|
NS_SIMPLE = GGem::NameSet::Simple.new
|
34
34
|
NS_UNDER = GGem::NameSet::Underscored.new
|
35
35
|
NS_HYPHEN = GGem::NameSet::HyphenatedOther.new
|
@@ -45,17 +45,9 @@ module GGem
|
|
45
45
|
FileUtils.rm_rf(TMP_PATH)
|
46
46
|
end
|
47
47
|
|
48
|
-
should create_paths(
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
should create_paths((NS_UNDER.expected_folders + NS_UNDER.expected_files).collect do |p|
|
53
|
-
File.join(TMP_PATH, NS_UNDER.name, p)
|
54
|
-
end)
|
55
|
-
|
56
|
-
should create_paths((NS_HYPHEN.expected_folders + NS_HYPHEN.expected_files).collect do |p|
|
57
|
-
File.join(TMP_PATH, NS_HYPHEN.name, p)
|
58
|
-
end)
|
48
|
+
should create_paths(NS_SIMPLE)
|
49
|
+
should create_paths(NS_UNDER)
|
50
|
+
should create_paths(NS_HYPHEN)
|
59
51
|
|
60
52
|
should "init a git repo in the gem path" do
|
61
53
|
assert File.exists?(File.join(TMP_PATH, NS_SIMPLE.name, '.git')), ".git repo config doesn't exist"
|
data/test/helper.rb
CHANGED
@@ -8,8 +8,14 @@ class Assert::Context
|
|
8
8
|
|
9
9
|
TMP_PATH = File.expand_path("#{File.dirname(__FILE__)}/../tmp")
|
10
10
|
|
11
|
-
|
11
|
+
|
12
|
+
|
13
|
+
def self.create_paths(name_set)
|
12
14
|
called_from = caller.first
|
15
|
+
folders = name_set.expected_folders
|
16
|
+
files = name_set.expected_files
|
17
|
+
|
18
|
+
paths = (folders + files).collect{|p| File.join(TMP_PATH, name_set.name, p)}
|
13
19
|
macro_name = "create the paths: #{paths.join(', ')}"
|
14
20
|
|
15
21
|
Assert::Macro.new(macro_name) do
|
data/test/name_set.rb
CHANGED
@@ -26,7 +26,6 @@ module GGem
|
|
26
26
|
|
27
27
|
"test/helper.rb",
|
28
28
|
"test/irb.rb",
|
29
|
-
"test/#{@ruby_name}_test.rb"
|
30
29
|
]
|
31
30
|
end
|
32
31
|
end
|
@@ -56,8 +55,8 @@ module GGem
|
|
56
55
|
def initialize
|
57
56
|
@variations = ['my-gem']
|
58
57
|
@name = 'my-gem'
|
59
|
-
@module_name = '
|
60
|
-
@ruby_name = 'my
|
58
|
+
@module_name = 'MyGem'
|
59
|
+
@ruby_name = 'my-gem'
|
61
60
|
end
|
62
61
|
end
|
63
62
|
|
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: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 1.
|
8
|
+
- 3
|
9
|
+
- 0
|
10
|
+
version: 1.3.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kelly Redding
|
@@ -15,11 +15,11 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-10-15 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
|
-
|
22
|
-
|
21
|
+
name: assert
|
22
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
23
23
|
none: false
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
@@ -28,12 +28,12 @@ dependencies:
|
|
28
28
|
segments:
|
29
29
|
- 0
|
30
30
|
version: "0"
|
31
|
-
|
32
|
-
|
31
|
+
type: :development
|
32
|
+
requirement: *id001
|
33
33
|
prerelease: false
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
|
-
|
36
|
-
|
35
|
+
name: quickl
|
36
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
37
37
|
none: false
|
38
38
|
requirements:
|
39
39
|
- - ">="
|
@@ -42,12 +42,12 @@ dependencies:
|
|
42
42
|
segments:
|
43
43
|
- 0
|
44
44
|
version: "0"
|
45
|
-
|
46
|
-
|
45
|
+
type: :runtime
|
46
|
+
requirement: *id002
|
47
47
|
prerelease: false
|
48
|
-
description:
|
48
|
+
description: "\"Juh Gem\", baby! (this makes gems)"
|
49
49
|
email:
|
50
|
-
- kelly@
|
50
|
+
- kelly@kellyredding.com
|
51
51
|
executables:
|
52
52
|
- ggem
|
53
53
|
extensions: []
|
@@ -57,7 +57,6 @@ extra_rdoc_files: []
|
|
57
57
|
files:
|
58
58
|
- .gitignore
|
59
59
|
- Gemfile
|
60
|
-
- Gemfile.lock
|
61
60
|
- LICENSE
|
62
61
|
- README.md
|
63
62
|
- Rakefile
|
@@ -75,15 +74,14 @@ files:
|
|
75
74
|
- lib/ggem/template_file/gitignore.erb
|
76
75
|
- lib/ggem/template_file/lib.rb.erb
|
77
76
|
- lib/ggem/template_file/lib_version.rb.erb
|
78
|
-
- lib/ggem/template_file/test.rb.erb
|
79
77
|
- lib/ggem/template_file/test_helper.rb.erb
|
80
78
|
- lib/ggem/template_file/test_irb.rb.erb
|
81
79
|
- lib/ggem/version.rb
|
82
|
-
- test/
|
80
|
+
- test/gem_tests.rb
|
83
81
|
- test/helper.rb
|
84
82
|
- test/irb.rb
|
85
83
|
- test/name_set.rb
|
86
|
-
homepage: http://github.com/
|
84
|
+
homepage: http://github.com/kellyredding/ggem
|
87
85
|
licenses: []
|
88
86
|
|
89
87
|
post_install_message:
|
@@ -112,12 +110,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
110
|
requirements: []
|
113
111
|
|
114
112
|
rubyforge_project:
|
115
|
-
rubygems_version: 1.8.
|
113
|
+
rubygems_version: 1.8.24
|
116
114
|
signing_key:
|
117
115
|
specification_version: 3
|
118
116
|
summary: "\"Juh Gem\", baby! (this makes gems)"
|
119
117
|
test_files:
|
120
|
-
- test/
|
118
|
+
- test/gem_tests.rb
|
121
119
|
- test/helper.rb
|
122
120
|
- test/irb.rb
|
123
121
|
- test/name_set.rb
|
data/Gemfile.lock
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
ggem (1.2.1)
|
5
|
-
quickl
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: http://rubygems.org/
|
9
|
-
specs:
|
10
|
-
ansi (1.4.2)
|
11
|
-
assert (0.7.3)
|
12
|
-
assert-view (~> 0.5)
|
13
|
-
assert-view (0.5.0)
|
14
|
-
ansi (~> 1.3)
|
15
|
-
undies (~> 2.0)
|
16
|
-
quickl (0.4.2)
|
17
|
-
rake (0.9.2.2)
|
18
|
-
undies (2.2.1)
|
19
|
-
|
20
|
-
PLATFORMS
|
21
|
-
ruby
|
22
|
-
|
23
|
-
DEPENDENCIES
|
24
|
-
assert
|
25
|
-
bundler (~> 1.1)
|
26
|
-
ggem!
|
27
|
-
rake (~> 0.9.2)
|