bundlegem 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +35 -3
- data/bin/bundlegem +1 -0
- data/changelog +48 -24
- data/config/config +4 -0
- data/lib/bundlegem/cli/gem.rb +156 -154
- data/lib/bundlegem/configurator.rb +21 -4
- data/lib/bundlegem/template_manager.rb +59 -0
- data/{tmp_gem/tmp_gem.gemspec → lib/bundlegem/templates/c_extension_gem/#{name}.gemspec.tt} +15 -7
- data/lib/bundlegem/templates/c_extension_gem/.travis.yml.tt +3 -0
- data/lib/bundlegem/templates/c_extension_gem/CODE_OF_CONDUCT.md.tt +13 -0
- data/lib/bundlegem/templates/c_extension_gem/Gemfile.tt +4 -0
- data/lib/bundlegem/templates/c_extension_gem/LICENSE.txt.tt +21 -0
- data/{tmp_gem/README.md → lib/bundlegem/templates/c_extension_gem/README.md.tt} +6 -6
- data/lib/bundlegem/templates/c_extension_gem/Rakefile.tt +25 -0
- data/lib/bundlegem/templates/c_extension_gem/bin/#{name}.tt +3 -0
- data/{tmp_gem/bin/console → lib/bundlegem/templates/c_extension_gem/bin/console.tt} +1 -1
- data/{tmp_gem/changelog → lib/bundlegem/templates/c_extension_gem/changelog.tt} +0 -0
- data/lib/bundlegem/templates/{newgem → c_extension_gem}/ext/#{name}/#{newgem}.c.tt +0 -0
- data/lib/bundlegem/templates/{newgem → c_extension_gem}/ext/#{name}/#{newgem}.h.tt +0 -0
- data/lib/bundlegem/templates/{newgem → c_extension_gem}/ext/#{name}/extconf.rb.tt +0 -0
- data/lib/bundlegem/templates/{newgem → c_extension_gem}/gitignore.tt +0 -0
- data/lib/bundlegem/templates/c_extension_gem/lib/#{name}/version.rb.tt +7 -0
- data/lib/bundlegem/templates/c_extension_gem/lib/#{name}.rb.tt +12 -0
- data/{tmp_gem/.rspec → lib/bundlegem/templates/c_extension_gem/rspec.tt} +0 -0
- data/{tmp_gem/spec/tmp_gem_spec.rb → lib/bundlegem/templates/c_extension_gem/spec/#{name}_spec.rb.tt} +2 -2
- data/{tmp_gem/spec/spec_helper.rb → lib/bundlegem/templates/c_extension_gem/spec/spec_helper.rb.tt} +1 -1
- data/lib/bundlegem/templates/cli_gem/#{name}.gemspec.tt +35 -0
- data/lib/bundlegem/templates/cli_gem/.travis.yml.tt +3 -0
- data/lib/bundlegem/templates/cli_gem/CODE_OF_CONDUCT.md.tt +13 -0
- data/lib/bundlegem/templates/cli_gem/Gemfile.tt +4 -0
- data/lib/bundlegem/templates/cli_gem/LICENSE.txt.tt +21 -0
- data/lib/bundlegem/templates/cli_gem/README.md.tt +39 -0
- data/lib/bundlegem/templates/cli_gem/Rakefile.tt +25 -0
- data/lib/bundlegem/templates/cli_gem/bin/#{name}.tt +3 -0
- data/lib/bundlegem/templates/cli_gem/bin/console.tt +14 -0
- data/lib/bundlegem/templates/cli_gem/changelog.tt +7 -0
- data/lib/bundlegem/templates/cli_gem/exe/#{name}.tt +5 -0
- data/lib/bundlegem/templates/cli_gem/ext/#{name}/#{newgem}.c.tt +9 -0
- data/lib/bundlegem/templates/cli_gem/ext/#{name}/#{newgem}.h.tt +6 -0
- data/lib/bundlegem/templates/cli_gem/ext/#{name}/extconf.rb.tt +3 -0
- data/{tmp_gem/.gitignore → lib/bundlegem/templates/cli_gem/gitignore.tt} +7 -0
- data/lib/bundlegem/templates/cli_gem/lib/#{name}/version.rb.tt +7 -0
- data/lib/bundlegem/templates/cli_gem/lib/#{name}.rb.tt +9 -0
- data/lib/bundlegem/templates/cli_gem/rspec.tt +2 -0
- data/lib/bundlegem/templates/cli_gem/spec/#{name}_spec.rb.tt +11 -0
- data/lib/bundlegem/templates/cli_gem/spec/spec_helper.rb.tt +2 -0
- data/lib/bundlegem/templates/newgem/#{name}.gemspec.tt +2 -6
- data/lib/bundlegem/templates/newgem/.gitignore.tt +16 -0
- data/lib/bundlegem/templates/newgem/Rakefile.tt +32 -17
- data/lib/bundlegem/templates/service/lib/#{name}.rb.tt +1 -1
- data/lib/bundlegem/version.rb +1 -1
- data/lib/bundlegem.rb +29 -2
- data/spec/bundlegem_spec.rb +8 -2
- data/spec/spec_helper.rb +18 -8
- metadata +44 -19
- data/tmp_gem/.travis.yml +0 -3
- data/tmp_gem/Gemfile +0 -4
- data/tmp_gem/Rakefile +0 -1
- data/tmp_gem/lib/tmp_gem/version.rb +0 -3
- data/tmp_gem/lib/tmp_gem.rb +0 -5
@@ -1,27 +1,35 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require '
|
4
|
+
require '<%=config[:namespaced_path]%>/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
8
|
-
spec.version =
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
7
|
+
spec.name = <%=config[:name].inspect%>
|
8
|
+
spec.version = <%=config[:constant_name]%>::VERSION
|
9
|
+
spec.authors = [<%=config[:author].inspect%>]
|
10
|
+
spec.email = [<%=config[:email].inspect%>]
|
11
11
|
|
12
12
|
spec.summary = %q{TODO: Write a short summary, because Rubygems requires one.}
|
13
13
|
spec.description = %q{TODO: delete this line since you're in a hurry.}
|
14
|
-
spec.homepage = "https://github.com
|
14
|
+
spec.homepage = "https://github.com/<%=config[:author]%>/<%=config[:name]%>"
|
15
|
+
# spec.license = "MIT" # uncomment this line if MIT is the best license for your situation
|
15
16
|
|
16
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
17
18
|
spec.bindir = "exe"
|
18
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
20
|
spec.require_paths = ["lib"]
|
21
|
+
<%- if config[:ext] -%>
|
22
|
+
spec.extensions = ["ext/<%=config[:underscored_name]%>/extconf.rb"]
|
23
|
+
<%- end -%>
|
20
24
|
|
21
25
|
if spec.respond_to?(:metadata)
|
22
26
|
spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com' to prevent pushes to rubygems.org, or delete to allow pushes to any server."
|
23
27
|
end
|
24
28
|
|
25
|
-
spec.add_development_dependency "bundler", "~>
|
29
|
+
spec.add_development_dependency "bundler", "~> <%= config[:bundler_version] %>"
|
26
30
|
spec.add_development_dependency "rake", "~> 10.0"
|
31
|
+
<%- if config[:ext] -%>
|
32
|
+
spec.add_development_dependency "rake-compiler"
|
33
|
+
<%- end -%>
|
34
|
+
spec.add_development_dependency "rspec"
|
27
35
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) <%=Time.now.year%> <%=config[:author]%>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
@@ -1,6 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# <%=config[:constant_name]%>
|
2
2
|
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/<%=config[:namespaced_path]%>`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
4
|
|
5
5
|
TODO: Delete this and the text above, and describe your gem
|
6
6
|
|
@@ -9,7 +9,7 @@ TODO: Delete this and the text above, and describe your gem
|
|
9
9
|
Add this line to your application's Gemfile:
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem '
|
12
|
+
gem '<%=config[:name]%>'
|
13
13
|
```
|
14
14
|
|
15
15
|
And then execute:
|
@@ -18,7 +18,7 @@ And then execute:
|
|
18
18
|
|
19
19
|
Or install it yourself as:
|
20
20
|
|
21
|
-
$ gem install
|
21
|
+
$ gem install <%=config[:name]%>
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
@@ -26,13 +26,13 @@ TODO: Write usage instructions here
|
|
26
26
|
|
27
27
|
## Development
|
28
28
|
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.<% if config[:bin] %> Run `bundle exec <%= config[:name] %>` to use the code located in this directory, ignoring other installed copies of this gem.<% end %>
|
30
30
|
|
31
31
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
32
|
|
33
33
|
## Contributing
|
34
34
|
|
35
|
-
1. Fork it ( https://github.com/[my-github-username]
|
35
|
+
1. Fork it ( https://github.com/[my-github-username]/<%=config[:name]%>/fork )
|
36
36
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
37
37
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
38
38
|
4. Push to the branch (`git push origin my-new-feature`)
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
<% if config[:test] == 'minitest' -%>
|
3
|
+
require "rake/testtask"
|
4
|
+
|
5
|
+
Rake::TestTask.new(:test) do |t|
|
6
|
+
t.libs << "test"
|
7
|
+
end
|
8
|
+
|
9
|
+
task :default => :test
|
10
|
+
<% elsif config[:test] == 'rspec' -%>
|
11
|
+
require "rspec/core/rake_task"
|
12
|
+
|
13
|
+
RSpec::Core::RakeTask.new(:spec)
|
14
|
+
|
15
|
+
task :default => :spec
|
16
|
+
<% end -%>
|
17
|
+
<% if config[:ext] -%>
|
18
|
+
require "rake/extensiontask"
|
19
|
+
|
20
|
+
task :build => :compile
|
21
|
+
|
22
|
+
Rake::ExtensionTask.new("<%=config[:underscored_name]%>") do |ext|
|
23
|
+
ext.lib_dir = "lib/<%=config[:namespaced_path]%>"
|
24
|
+
end
|
25
|
+
<% end -%>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require "bundler/setup"
|
4
|
-
require "
|
4
|
+
require "<%= config[:namespaced_path] %>"
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require "<%=config[:namespaced_path]%>/version"
|
2
|
+
<%- if config[:ext] -%>
|
3
|
+
require "<%=config[:namespaced_path]%>/<%=config[:underscored_name]%>"
|
4
|
+
<%- end -%>
|
5
|
+
|
6
|
+
<%- config[:constant_array].each_with_index do |c,i| -%>
|
7
|
+
<%= ' '*i %>module <%= c %>
|
8
|
+
<%- end -%>
|
9
|
+
<%= ' '*config[:constant_array].size %># Your code goes here...
|
10
|
+
<%- (config[:constant_array].size-1).downto(0) do |i| -%>
|
11
|
+
<%= ' '*i %>end
|
12
|
+
<%- end -%>
|
File without changes
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe
|
3
|
+
describe <%= config[:constant_name] %> do
|
4
4
|
it 'has a version number' do
|
5
|
-
expect(
|
5
|
+
expect(<%= config[:constant_name] %>::VERSION).not_to be nil
|
6
6
|
end
|
7
7
|
|
8
8
|
it 'does something useful' do
|
data/{tmp_gem/spec/spec_helper.rb → lib/bundlegem/templates/c_extension_gem/spec/spec_helper.rb.tt}
RENAMED
@@ -1,2 +1,2 @@
|
|
1
1
|
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
2
|
-
require '
|
2
|
+
require '<%= config[:namespaced_path] %>'
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require '<%=config[:namespaced_path]%>/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = <%=config[:name].inspect%>
|
8
|
+
spec.version = <%=config[:constant_name]%>::VERSION
|
9
|
+
spec.authors = [<%=config[:author].inspect%>]
|
10
|
+
spec.email = [<%=config[:email].inspect%>]
|
11
|
+
|
12
|
+
spec.summary = %q{TODO: Write a short summary, because Rubygems requires one.}
|
13
|
+
spec.description = %q{TODO: delete this line since you're in a hurry.}
|
14
|
+
spec.homepage = "https://github.com/<%=config[:author]%>/<%=config[:name]%>"
|
15
|
+
# spec.license = "MIT" # uncomment this line if MIT is the best license for your situation
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = "exe"
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
<%- if config[:ext] -%>
|
22
|
+
spec.extensions = ["ext/<%=config[:underscored_name]%>/extconf.rb"]
|
23
|
+
<%- end -%>
|
24
|
+
|
25
|
+
if spec.respond_to?(:metadata)
|
26
|
+
spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com' to prevent pushes to rubygems.org, or delete to allow pushes to any server."
|
27
|
+
end
|
28
|
+
|
29
|
+
spec.add_development_dependency "bundler", "~> <%= config[:bundler_version] %>"
|
30
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
31
|
+
<%- if config[:ext] -%>
|
32
|
+
spec.add_development_dependency "rake-compiler"
|
33
|
+
<%- end -%>
|
34
|
+
spec.add_development_dependency "rspec"
|
35
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) <%=Time.now.year%> <%=config[:author]%>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# <%=config[:constant_name]%>
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/<%=config[:namespaced_path]%>`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem '<%=config[:name]%>'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install <%=config[:name]%>
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.<% if config[:bin] %> Run `bundle exec <%= config[:name] %>` to use the code located in this directory, ignoring other installed copies of this gem.<% end %>
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
1. Fork it ( https://github.com/[my-github-username]/<%=config[:name]%>/fork )
|
36
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
37
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
38
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
39
|
+
5. Create a new Pull Request
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
<% if config[:test] == 'minitest' -%>
|
3
|
+
require "rake/testtask"
|
4
|
+
|
5
|
+
Rake::TestTask.new(:test) do |t|
|
6
|
+
t.libs << "test"
|
7
|
+
end
|
8
|
+
|
9
|
+
task :default => :test
|
10
|
+
<% elsif config[:test] == 'rspec' -%>
|
11
|
+
require "rspec/core/rake_task"
|
12
|
+
|
13
|
+
RSpec::Core::RakeTask.new(:spec)
|
14
|
+
|
15
|
+
task :default => :spec
|
16
|
+
<% end -%>
|
17
|
+
<% if config[:ext] -%>
|
18
|
+
require "rake/extensiontask"
|
19
|
+
|
20
|
+
task :build => :compile
|
21
|
+
|
22
|
+
Rake::ExtensionTask.new("<%=config[:underscored_name]%>") do |ext|
|
23
|
+
ext.lib_dir = "lib/<%=config[:namespaced_path]%>"
|
24
|
+
end
|
25
|
+
<% end -%>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "<%= config[:namespaced_path] %>"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require "<%=config[:namespaced_path]%>/version"
|
2
|
+
|
3
|
+
<%- config[:constant_array].each_with_index do |c,i| -%>
|
4
|
+
<%= ' '*i %>module <%= c %>
|
5
|
+
<%- end -%>
|
6
|
+
<%= ' '*config[:constant_array].size %># Your code goes here...
|
7
|
+
<%- (config[:constant_array].size-1).downto(0) do |i| -%>
|
8
|
+
<%= ' '*i %>end
|
9
|
+
<%- end -%>
|
@@ -12,9 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.summary = %q{TODO: Write a short summary, because Rubygems requires one.}
|
13
13
|
spec.description = %q{TODO: delete this line since you're in a hurry.}
|
14
14
|
spec.homepage = "https://github.com/<%=config[:author]%>/<%=config[:name]%>"
|
15
|
-
|
16
|
-
spec.license = "MIT"
|
17
|
-
<%- end -%>
|
15
|
+
# spec.license = "MIT" # uncomment this line if MIT is the best license for your situation
|
18
16
|
|
19
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
18
|
spec.bindir = "exe"
|
@@ -33,7 +31,5 @@ Gem::Specification.new do |spec|
|
|
33
31
|
<%- if config[:ext] -%>
|
34
32
|
spec.add_development_dependency "rake-compiler"
|
35
33
|
<%- end -%>
|
36
|
-
|
37
|
-
spec.add_development_dependency "<%=config[:test]%>"
|
38
|
-
<%- end -%>
|
34
|
+
spec.add_development_dependency "rspec"
|
39
35
|
end
|
@@ -1,25 +1,40 @@
|
|
1
|
-
require
|
2
|
-
<% if config[:test] == 'minitest' -%>
|
3
|
-
require "rake/testtask"
|
1
|
+
require 'rake'
|
4
2
|
|
5
|
-
|
6
|
-
|
3
|
+
require 'bundler'
|
4
|
+
Bundler::GemHelper.install_tasks
|
5
|
+
|
6
|
+
require 'rspec/core/rake_task'
|
7
|
+
|
8
|
+
desc "Run unit specs"
|
9
|
+
RSpec::Core::RakeTask.new(:unit) do |t|
|
10
|
+
t.rspec_opts = %w(-fd -c)
|
11
|
+
t.pattern = "./spec/unit/**/*_spec.rb"
|
7
12
|
end
|
8
13
|
|
9
|
-
|
10
|
-
|
11
|
-
|
14
|
+
desc "Run integration specs that are very high level"
|
15
|
+
RSpec::Core::RakeTask.new(:integration) do |t|
|
16
|
+
t.rspec_opts = %w(-fd -c)
|
17
|
+
t.pattern = "./spec/integration/**/*_spec.rb"
|
18
|
+
end
|
12
19
|
|
13
|
-
|
20
|
+
desc "Run all specs"
|
21
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
22
|
+
t.rspec_opts = %w(-fd -c)
|
23
|
+
end
|
24
|
+
|
25
|
+
# this is for running tests that you've marked current... eg: it 'should work', :current => true do
|
26
|
+
RSpec::Core::RakeTask.new(:current) do |spec|
|
27
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
28
|
+
spec.rspec_opts = ['--tag current']
|
29
|
+
end
|
30
|
+
|
31
|
+
# alias for current
|
32
|
+
RSpec::Core::RakeTask.new(:c) do |spec|
|
33
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
34
|
+
spec.rspec_opts = ['--tag current']
|
35
|
+
end
|
14
36
|
|
15
37
|
task :default => :spec
|
16
|
-
|
17
|
-
<% if config[:ext] -%>
|
18
|
-
require "rake/extensiontask"
|
38
|
+
task :test => :spec
|
19
39
|
|
20
|
-
task :build => :compile
|
21
40
|
|
22
|
-
Rake::ExtensionTask.new("<%=config[:underscored_name]%>") do |ext|
|
23
|
-
ext.lib_dir = "lib/<%=config[:namespaced_path]%>"
|
24
|
-
end
|
25
|
-
<% end -%>
|
@@ -6,7 +6,7 @@ require "<%=config[:namespaced_path]%>/version"
|
|
6
6
|
<%= ' '*i %>module <%= c %>
|
7
7
|
<%- end -%>
|
8
8
|
|
9
|
-
<%= ' '*config[:constant_array].size %># Your code goes here...
|
9
|
+
<%= ' '*config[:constant_array].size %># Your code goes here...
|
10
10
|
|
11
11
|
<%= ' '*config[:constant_array].size %>def self.About
|
12
12
|
<%= ' '*config[:constant_array].size %>end
|
data/lib/bundlegem/version.rb
CHANGED