gem-newgem 0.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.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.rspec +4 -0
- data/.travis.yml +6 -0
- data/.yardopts +5 -0
- data/CHANGELOG.md +19 -0
- data/Gemfile +4 -0
- data/LICENSE.md +22 -0
- data/README.md +151 -0
- data/Rakefile +6 -0
- data/gem-newgem.gemspec +38 -0
- data/lib/gem_newgem/newgem.rb +33 -0
- data/lib/gem_newgem/newgem/configuration.rb +37 -0
- data/lib/gem_newgem/newgem/template.rb +73 -0
- data/lib/gem_newgem/newgem/validations.rb +37 -0
- data/lib/gem_newgem/platform.rb +4 -0
- data/lib/rubygems/commands/newgem_command.rb +47 -0
- data/lib/rubygems_plugin.rb +3 -0
- data/spec/newgem_command_spec.rb +1 -0
- data/spec/spec_helper.rb +14 -0
- metadata +192 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bed2c1b5a49108febd12c6c186552a240efbfd09
|
4
|
+
data.tar.gz: efc50ff4566068f77058e3222625766bd90ee0cd
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: de014ea0d552e25f2411e7651695a24258ffa688ba5459b3b65e9b0b8225fabe1db5289c9dfe2ab32affe43e39d73b4368c6610e648bc38598e258f6ee609703
|
7
|
+
data.tar.gz: 7f5947324951919be443d01d68589af0a4c4a1af9658ad0f05a15693086c0a18d45b5954e08bc1a93d73361ce0bf99315f836a32cae48af537d0abe33e6c9d04
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/.yardopts
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
## [In git](https://github.com/elgalu/gem-newgem/compare/v0.1.0...HEAD)
|
2
|
+
|
3
|
+
### New Features
|
4
|
+
* n/a
|
5
|
+
|
6
|
+
### Bugfixes
|
7
|
+
* n/a
|
8
|
+
|
9
|
+
### Chores
|
10
|
+
* n/a
|
11
|
+
|
12
|
+
## [v0.1.0](https://github.com/elgalu/gem-newgem/tree/v0.1.0)
|
13
|
+
|
14
|
+
## First gem release
|
15
|
+
|
16
|
+
### Features:
|
17
|
+
* Generate new gem skeleton based on a default or custom template (Leo Gallucci)
|
18
|
+
* Option: \[--template TEMPLATEDIR] (Leo Gallucci)
|
19
|
+
* Option: \[--summary "This newgem will do some fancy stuff"] (Leo Gallucci)
|
data/Gemfile
ADDED
data/LICENSE.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Leo Gallucci
|
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,151 @@
|
|
1
|
+
# gem-newgem
|
2
|
+
|
3
|
+
## Description
|
4
|
+
|
5
|
+
This a [rubygems plugin][Gem plugins] useful to generate new gem skeleton based on a default or custom template.
|
6
|
+
|
7
|
+
```bash
|
8
|
+
$ gem install gem-newgem
|
9
|
+
$ gem new fancy_stuff --summary "This newgem will do some fancy stuff"
|
10
|
+
```
|
11
|
+
|
12
|
+
## Similar tools
|
13
|
+
|
14
|
+
You can achieve pretty much the same with [bundle gem][] GEMNAME using [bundler predefined][] template.
|
15
|
+
|
16
|
+
Or you can use one of these tools:
|
17
|
+
|
18
|
+
[Ore][] | [RubiGen][] | [gem-init][] | [prigner][] | [gem-new][]
|
19
|
+
|
20
|
+
But i guess i just wanted to write my own ;)
|
21
|
+
|
22
|
+
If you like the idea of creating creating custom generators take a look at [thor][] (used by this gem) and how to [start][] the generator from your ruby script.
|
23
|
+
|
24
|
+
## Installation
|
25
|
+
|
26
|
+
```bash
|
27
|
+
$ gem install gem-newgem
|
28
|
+
```
|
29
|
+
|
30
|
+
## Usage
|
31
|
+
|
32
|
+
Use either the long form `$ gem newgem GEMNAME` or the [short form][] `$ gem new GEMNAME`
|
33
|
+
|
34
|
+
```bash
|
35
|
+
$ gem newgem GEMNAME [--template TEMPLATE_NAME] [--summary "This newgem will do some fancy stuff"]
|
36
|
+
|
37
|
+
$ gem newgem --help
|
38
|
+
Usage: gem newgem GEMNAME [options]
|
39
|
+
|
40
|
+
Options:
|
41
|
+
-t, --template TEMPLATE_NAME Use TEMPLATE instead of `default` template
|
42
|
+
By default, all templates are looked at ~/.newgem-templates/
|
43
|
+
-s, --summary "SUMMARY_TEXT" Set the gem summary text now in case you want to save time.
|
44
|
+
|
45
|
+
Common Options:
|
46
|
+
-h, --help Get help on this command
|
47
|
+
-V, --[no-]verbose Set the verbose level of output
|
48
|
+
-q, --quiet Silence commands
|
49
|
+
--config-file FILE Use this config file instead of default
|
50
|
+
--backtrace Show stack backtrace on errors
|
51
|
+
--debug Turn on Ruby debugging
|
52
|
+
|
53
|
+
Arguments:
|
54
|
+
GEMNAME name of the gem skeleton to generate.
|
55
|
+
|
56
|
+
Summary:
|
57
|
+
Generate new gem skeleton based on a default or custom template.
|
58
|
+
|
59
|
+
Defaults:
|
60
|
+
--template default --summary "TODO: Write a gem summary"
|
61
|
+
```
|
62
|
+
|
63
|
+
You can't use templates absolute paths, so place your templates at `~/.newgem-templates/` and provide just the name of the template.
|
64
|
+
|
65
|
+
Example:
|
66
|
+
|
67
|
+
```bash
|
68
|
+
$ gem new play_piano -t default -s "Gem that plays all day"
|
69
|
+
create play_piano
|
70
|
+
create play_piano/play_piano.gemspec
|
71
|
+
create play_piano/.gitignore
|
72
|
+
create play_piano/.rspec
|
73
|
+
create play_piano/.travis.yml
|
74
|
+
create play_piano/CHANGELOG.md
|
75
|
+
create play_piano/Gemfile
|
76
|
+
create play_piano/LICENSE.md
|
77
|
+
create play_piano/README.md
|
78
|
+
create play_piano/Rakefile
|
79
|
+
create play_piano/lib/play_piano.rb
|
80
|
+
create play_piano/lib/play_piano/version.rb
|
81
|
+
create play_piano/spec/play_piano_spec.rb
|
82
|
+
create play_piano/spec/spec_helper.rb
|
83
|
+
INFO: Initializing git repo at play_piano/
|
84
|
+
git init
|
85
|
+
Initialized empty Git repository in ~/apps/gem-newgem/play_piano/.git/
|
86
|
+
git add .
|
87
|
+
INFO: Will add remote so you get ready to push to github
|
88
|
+
git remote add github git@github.com:elgalu/play_piano.git
|
89
|
+
INFO: Make branch tracking automatic
|
90
|
+
git config --add branch.master.remote github
|
91
|
+
git config --add branch.master.merge refs/heads/master
|
92
|
+
```
|
93
|
+
|
94
|
+
## Contributing
|
95
|
+
|
96
|
+
1. Fork it.
|
97
|
+
2. Make your feature addition or bug fix and create your feature branch.
|
98
|
+
3. Add specs/tests for it. This is important so I don't break it in a future version unintentionally.
|
99
|
+
4. Commit, create a new Pull Request.
|
100
|
+
5. Check that your pull request passes the [build][travis pull requests].
|
101
|
+
|
102
|
+
### TODO
|
103
|
+
+ Add specs so this gem can be published
|
104
|
+
+ Make easier to use the gem as a general bootstrap tool, not just for new gems
|
105
|
+
+ Show configurations found banner, then pause, then continue the bootstrap.
|
106
|
+
+ Add yaml configuration file.
|
107
|
+
+ Add support to install templates from git like [Ore][Ore custom templates] does.
|
108
|
+
+ Add more templates to [templates][] directory.
|
109
|
+
+ Add more integration with Bundler tasks: 'bundler/gem_tasks'
|
110
|
+
+ Then add more integration with [RubyGems API][].
|
111
|
+
|
112
|
+
## License
|
113
|
+
|
114
|
+
Released under the MIT License. See the [LICENSE][] file for further details.
|
115
|
+
|
116
|
+
<!-- ## Links
|
117
|
+
|
118
|
+
[Gem plugins][] | [RubyGems][] | [Documentation][] | [Source][] | [Bugtracker][] | [Build Status][] | [Dependency Status][] | [Code Climate][]
|
119
|
+
-->
|
120
|
+
|
121
|
+
[Gem plugins]: http://guides.rubygems.org/plugins/
|
122
|
+
[short form]: https://github.com/rubygems/rubygems/blob/1894b60ee9b65f768c40a6b834b49f04feac6edd/lib/rubygems/command_manager.rb#L190
|
123
|
+
|
124
|
+
[bundle install]: http://gembundler.com/man/bundle-install.1.html
|
125
|
+
[Gemfile]: http://gembundler.com/man/gemfile.5.html
|
126
|
+
[LICENSE]: LICENSE.md
|
127
|
+
|
128
|
+
[RubyGems]: https://rubygems.org/gems/gem-newgem
|
129
|
+
[Documentation]: http://rubydoc.info/gems/gem-newgem
|
130
|
+
[Source]: https://github.com/elgalu/gem-newgem
|
131
|
+
[Bugtracker]: https://github.com/elgalu/gem-newgem/issues
|
132
|
+
[BS img]: https://travis-ci.org/elgalu/gem-newgem.png
|
133
|
+
[DS img]: https://gemnasium.com/elgalu/gem-newgem.png
|
134
|
+
[CC img]: https://codeclimate.com/github/elgalu/gem-newgem.png
|
135
|
+
[Build Status]: https://travis-ci.org/elgalu/gem-newgem
|
136
|
+
[travis pull requests]: https://travis-ci.org/elgalu/gem-newgem/pull_requests
|
137
|
+
[Dependency Status]: https://gemnasium.com/elgalu/gem-newgem
|
138
|
+
[Code Climate]: https://codeclimate.com/github/elgalu/gem-newgem
|
139
|
+
|
140
|
+
[bundle gem]: http://gembundler.com/v1.2/bundle_gem.html
|
141
|
+
[bundler predefined]: https://github.com/carlhuda/bundler/tree/master/lib/bundler/templates/newgem
|
142
|
+
[Ore]: https://github.com/ruby-ore/ore
|
143
|
+
[Ore custom templates]: https://github.com/ruby-ore/ore/blob/5a2d8f48db63f0a0cfd9c6c1d5d15765b0612b28/README.md#custom-templates
|
144
|
+
[RubiGen]: https://github.com/drnic/rubigen
|
145
|
+
[gem-init]: https://github.com/mwhuss/gem-init
|
146
|
+
[prigner]: https://github.com/codigorama/prigner
|
147
|
+
[gem-new]: https://github.com/apeiros/gem-new
|
148
|
+
[thor]: https://github.com/wycats/thor/wiki/Generators
|
149
|
+
[start]: http://elgalu.github.com/2013/how-to-run-thor-tasks-from-your-ruby-scripts/
|
150
|
+
|
151
|
+
[RubyGems API]: http://guides.rubygems.org/rubygems-org-api/
|
data/Rakefile
ADDED
data/gem-newgem.gemspec
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
lib = File.expand_path('../lib', __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require 'gem_newgem/platform'
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
|
7
|
+
spec.platform = Gem::Platform::RUBY
|
8
|
+
spec.name = "gem-newgem"
|
9
|
+
spec.version = GemNewgem::VERSION
|
10
|
+
spec.summary = GemNewgem::SUMMARY
|
11
|
+
spec.description = spec.summary
|
12
|
+
|
13
|
+
spec.required_ruby_version = '>= 1.9.2'
|
14
|
+
spec.required_rubygems_version = '>= 1.8'
|
15
|
+
|
16
|
+
spec.authors = ["Leo Gallucci"]
|
17
|
+
spec.email = ["elgalu3@gmail.com"]
|
18
|
+
spec.homepage = "https://github.com/elgalu/gem-newgem"
|
19
|
+
|
20
|
+
spec.license = 'MIT'
|
21
|
+
|
22
|
+
spec.executables = spec.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
23
|
+
spec.files = `git ls-files`.split($/)
|
24
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
25
|
+
spec.require_paths = ["lib"]
|
26
|
+
|
27
|
+
spec.add_runtime_dependency "thor-exclude_pattern", "~> 0.18"
|
28
|
+
spec.add_runtime_dependency "activesupport", ">= 3"
|
29
|
+
|
30
|
+
spec.add_development_dependency "bundler", ">= 1.2"
|
31
|
+
spec.add_development_dependency "rake"
|
32
|
+
spec.add_development_dependency "rspec", "~> 2.13"
|
33
|
+
spec.add_development_dependency "redcarpet", ">= 2.2"
|
34
|
+
spec.add_development_dependency "yard", ">= 0.8"
|
35
|
+
spec.add_development_dependency "simplecov", ">= 0.7"
|
36
|
+
spec.add_development_dependency 'coveralls', '>= 0.5.7'
|
37
|
+
|
38
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# External
|
2
|
+
require 'active_support/core_ext/string/inflections'
|
3
|
+
|
4
|
+
# Internal
|
5
|
+
require 'gem_newgem/newgem/validations'
|
6
|
+
require 'gem_newgem/newgem/configuration'
|
7
|
+
require 'gem_newgem/newgem/template'
|
8
|
+
|
9
|
+
module GemNewgem
|
10
|
+
class Newgem
|
11
|
+
include Validations
|
12
|
+
|
13
|
+
attr_reader :gem_name, :gem_summary, :template, :config
|
14
|
+
|
15
|
+
def initialize(gem_name, gem_summary, template)
|
16
|
+
@config = Configuration.instance
|
17
|
+
@gem_name = gem_name || ''
|
18
|
+
@gem_summary = gem_summary || config.default_summary
|
19
|
+
template_name = template || config.default_template
|
20
|
+
@template = Template.new(template_name)
|
21
|
+
end
|
22
|
+
|
23
|
+
def generate!
|
24
|
+
load "#{File.join(template.path, template.name)}.thor"
|
25
|
+
args = [gem_name, template.name]
|
26
|
+
opts = { gem_summary: gem_summary }
|
27
|
+
const_name = "GemNewgem::Templates::#{template.name.capitalize}".constantize
|
28
|
+
script = const_name.new(args, opts)
|
29
|
+
script.invoke_all
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'singleton'
|
2
|
+
|
3
|
+
module GemNewgem
|
4
|
+
class Newgem
|
5
|
+
class Configuration
|
6
|
+
include Singleton
|
7
|
+
|
8
|
+
def templates_base_dir
|
9
|
+
"~/.newgem-templates/"
|
10
|
+
end
|
11
|
+
|
12
|
+
def default_template
|
13
|
+
"default"
|
14
|
+
end
|
15
|
+
|
16
|
+
def default_template_git_url
|
17
|
+
"git://github.com/elgalu/newgem-template.git"
|
18
|
+
end
|
19
|
+
|
20
|
+
def default_summary
|
21
|
+
"TODO: Write a gem summary"
|
22
|
+
end
|
23
|
+
|
24
|
+
def option_summary_desc
|
25
|
+
"Set the gem summary text now in case you want to save time."
|
26
|
+
end
|
27
|
+
|
28
|
+
def option_template_desc
|
29
|
+
<<-DESC.gsub(/^\s*/, '')
|
30
|
+
Use TEMPLATE instead of `default` template
|
31
|
+
By default, all templates are looked at #{templates_base_dir}
|
32
|
+
DESC
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# External
|
2
|
+
require 'fileutils'
|
3
|
+
require 'rubygems/user_interaction'
|
4
|
+
|
5
|
+
# Internal
|
6
|
+
require 'gem_newgem/newgem/configuration'
|
7
|
+
|
8
|
+
module GemNewgem
|
9
|
+
|
10
|
+
class Newgem
|
11
|
+
|
12
|
+
class Template
|
13
|
+
# Class methods
|
14
|
+
class << self
|
15
|
+
include Gem::UserInteraction
|
16
|
+
|
17
|
+
def get_config
|
18
|
+
@config ||= GemNewgem::Newgem::Configuration.instance
|
19
|
+
end
|
20
|
+
|
21
|
+
def ensure_default
|
22
|
+
create_base_dir unless Dir.exists?(get_config.templates_base_dir)
|
23
|
+
create_default_template unless Dir.exists?(default_template_path)
|
24
|
+
end
|
25
|
+
|
26
|
+
def create_base_dir
|
27
|
+
FileUtils.mkdir_p @config.templates_base_dir
|
28
|
+
end
|
29
|
+
|
30
|
+
def default_template_path
|
31
|
+
File.expand_path(File.join(get_config.templates_base_dir, get_config.default_template))
|
32
|
+
end
|
33
|
+
|
34
|
+
def create_default_template
|
35
|
+
alert "Default template doesn't seem to exists yet. Will git clone it now..."
|
36
|
+
command = "git clone -v #{get_config.default_template_git_url} #{default_template_path}"
|
37
|
+
say command
|
38
|
+
result = system(command)
|
39
|
+
alert_error "git not installed or not found in path." if result.nil?
|
40
|
+
alert_error "Cloning default template failed." if $?.exitstatus != 0
|
41
|
+
terminate_interaction(1) if $?.exitstatus != 0
|
42
|
+
validate_exists(default_template_path)
|
43
|
+
end
|
44
|
+
|
45
|
+
def validate_exists(path)
|
46
|
+
unless Dir.exists?(path)
|
47
|
+
alert_error "Templates directory #{path} doesn't exist!"
|
48
|
+
terminate_interaction(1)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
class Template
|
55
|
+
# Instance methods
|
56
|
+
attr_reader :name
|
57
|
+
|
58
|
+
def initialize(name)
|
59
|
+
@name = name
|
60
|
+
@config = Template.get_config
|
61
|
+
end
|
62
|
+
|
63
|
+
def path
|
64
|
+
File.expand_path(File.join(@config.templates_base_dir, name))
|
65
|
+
end
|
66
|
+
|
67
|
+
def validate
|
68
|
+
Template.validate_exists(path)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# External
|
2
|
+
require 'rubygems/user_interaction'
|
3
|
+
|
4
|
+
# Internal
|
5
|
+
require 'gem_newgem/newgem/template'
|
6
|
+
|
7
|
+
module GemNewgem
|
8
|
+
class Newgem
|
9
|
+
module Validations
|
10
|
+
include Gem::UserInteraction # Methods alert, ask, ask_yes_no...
|
11
|
+
|
12
|
+
def validate
|
13
|
+
validate_gem_name
|
14
|
+
validate_target_dir
|
15
|
+
Template.ensure_default
|
16
|
+
template.validate
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def validate_gem_name
|
22
|
+
if gem_name.nil? || gem_name.empty?
|
23
|
+
alert_error "Please specify a gem name on the command line (e.g. gem newgem GEMNAME)"
|
24
|
+
terminate_interaction(1)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def validate_target_dir
|
29
|
+
if Dir.exists?(gem_name)
|
30
|
+
alert_error "Directory #{gem_name} already exists! Remove first."
|
31
|
+
terminate_interaction(1)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# External
|
2
|
+
require 'rubygems/command'
|
3
|
+
|
4
|
+
# Internal
|
5
|
+
require 'gem_newgem/platform'
|
6
|
+
require 'gem_newgem/newgem/configuration'
|
7
|
+
require 'gem_newgem/newgem'
|
8
|
+
|
9
|
+
class Gem::Commands::NewgemCommand < Gem::Command
|
10
|
+
|
11
|
+
def initialize
|
12
|
+
super('newgem', GemNewgem::SUMMARY)
|
13
|
+
|
14
|
+
@config = GemNewgem::Newgem::Configuration.instance
|
15
|
+
|
16
|
+
add_option('-t', '--template TEMPLATE_NAME', @config.option_template_desc) do |template, options|
|
17
|
+
options[:template] = template
|
18
|
+
end
|
19
|
+
|
20
|
+
add_option('-s', '--summary "SUMMARY_TEXT"', @config.option_summary_desc) do |summary, options|
|
21
|
+
options[:summary] = summary
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def arguments
|
26
|
+
%Q|GEMNAME name of the gem skeleton to generate.|
|
27
|
+
end
|
28
|
+
|
29
|
+
def usage
|
30
|
+
%Q|#{program_name} GEMNAME|
|
31
|
+
end
|
32
|
+
|
33
|
+
def defaults_str
|
34
|
+
%Q|--template #{@config.default_template} --summary "#{@config.default_summary}"|
|
35
|
+
end
|
36
|
+
|
37
|
+
def execute
|
38
|
+
@newgem = GemNewgem::Newgem.new(
|
39
|
+
get_one_optional_argument, options[:summary], options[:template]
|
40
|
+
)
|
41
|
+
|
42
|
+
@newgem.validate
|
43
|
+
|
44
|
+
@newgem.generate!
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'spec_helper'
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
|
3
|
+
# Require this file using `require "spec_helper"` within each of your specs
|
4
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
5
|
+
RSpec.configure do |config|
|
6
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
7
|
+
config.run_all_when_everything_filtered = true
|
8
|
+
config.filter_run :focus
|
9
|
+
|
10
|
+
# Run specs in random order to surface order dependencies.
|
11
|
+
config.order = 'random'
|
12
|
+
end
|
13
|
+
|
14
|
+
SimpleCov.start
|
metadata
ADDED
@@ -0,0 +1,192 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gem-newgem
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Leo Gallucci
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-02-28 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor-exclude_pattern
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.18'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.18'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activesupport
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.2'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2.13'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2.13'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: redcarpet
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '2.2'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '2.2'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: yard
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.8'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.8'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: simplecov
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0.7'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0.7'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: coveralls
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 0.5.7
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - '>='
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 0.5.7
|
139
|
+
description: RubyGems plugin to generate a new gem skeleton based customizable templates.
|
140
|
+
email:
|
141
|
+
- elgalu3@gmail.com
|
142
|
+
executables: []
|
143
|
+
extensions: []
|
144
|
+
extra_rdoc_files: []
|
145
|
+
files:
|
146
|
+
- .gitignore
|
147
|
+
- .rspec
|
148
|
+
- .travis.yml
|
149
|
+
- .yardopts
|
150
|
+
- CHANGELOG.md
|
151
|
+
- Gemfile
|
152
|
+
- LICENSE.md
|
153
|
+
- README.md
|
154
|
+
- Rakefile
|
155
|
+
- gem-newgem.gemspec
|
156
|
+
- lib/gem_newgem/newgem.rb
|
157
|
+
- lib/gem_newgem/newgem/configuration.rb
|
158
|
+
- lib/gem_newgem/newgem/template.rb
|
159
|
+
- lib/gem_newgem/newgem/validations.rb
|
160
|
+
- lib/gem_newgem/platform.rb
|
161
|
+
- lib/rubygems/commands/newgem_command.rb
|
162
|
+
- lib/rubygems_plugin.rb
|
163
|
+
- spec/newgem_command_spec.rb
|
164
|
+
- spec/spec_helper.rb
|
165
|
+
homepage: https://github.com/elgalu/gem-newgem
|
166
|
+
licenses:
|
167
|
+
- MIT
|
168
|
+
metadata: {}
|
169
|
+
post_install_message:
|
170
|
+
rdoc_options: []
|
171
|
+
require_paths:
|
172
|
+
- lib
|
173
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
174
|
+
requirements:
|
175
|
+
- - '>='
|
176
|
+
- !ruby/object:Gem::Version
|
177
|
+
version: 1.9.2
|
178
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
|
+
requirements:
|
180
|
+
- - '>='
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
version: '1.8'
|
183
|
+
requirements: []
|
184
|
+
rubyforge_project:
|
185
|
+
rubygems_version: 2.0.0
|
186
|
+
signing_key:
|
187
|
+
specification_version: 4
|
188
|
+
summary: RubyGems plugin to generate a new gem skeleton based customizable templates.
|
189
|
+
test_files:
|
190
|
+
- spec/newgem_command_spec.rb
|
191
|
+
- spec/spec_helper.rb
|
192
|
+
has_rdoc:
|