bundlegem 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +35 -3
  3. data/bin/bundlegem +1 -0
  4. data/changelog +48 -24
  5. data/config/config +4 -0
  6. data/lib/bundlegem/cli/gem.rb +156 -154
  7. data/lib/bundlegem/configurator.rb +21 -4
  8. data/lib/bundlegem/template_manager.rb +59 -0
  9. data/{tmp_gem/tmp_gem.gemspec → lib/bundlegem/templates/c_extension_gem/#{name}.gemspec.tt} +15 -7
  10. data/lib/bundlegem/templates/c_extension_gem/.travis.yml.tt +3 -0
  11. data/lib/bundlegem/templates/c_extension_gem/CODE_OF_CONDUCT.md.tt +13 -0
  12. data/lib/bundlegem/templates/c_extension_gem/Gemfile.tt +4 -0
  13. data/lib/bundlegem/templates/c_extension_gem/LICENSE.txt.tt +21 -0
  14. data/{tmp_gem/README.md → lib/bundlegem/templates/c_extension_gem/README.md.tt} +6 -6
  15. data/lib/bundlegem/templates/c_extension_gem/Rakefile.tt +25 -0
  16. data/lib/bundlegem/templates/c_extension_gem/bin/#{name}.tt +3 -0
  17. data/{tmp_gem/bin/console → lib/bundlegem/templates/c_extension_gem/bin/console.tt} +1 -1
  18. data/{tmp_gem/changelog → lib/bundlegem/templates/c_extension_gem/changelog.tt} +0 -0
  19. data/lib/bundlegem/templates/{newgem → c_extension_gem}/ext/#{name}/#{newgem}.c.tt +0 -0
  20. data/lib/bundlegem/templates/{newgem → c_extension_gem}/ext/#{name}/#{newgem}.h.tt +0 -0
  21. data/lib/bundlegem/templates/{newgem → c_extension_gem}/ext/#{name}/extconf.rb.tt +0 -0
  22. data/lib/bundlegem/templates/{newgem → c_extension_gem}/gitignore.tt +0 -0
  23. data/lib/bundlegem/templates/c_extension_gem/lib/#{name}/version.rb.tt +7 -0
  24. data/lib/bundlegem/templates/c_extension_gem/lib/#{name}.rb.tt +12 -0
  25. data/{tmp_gem/.rspec → lib/bundlegem/templates/c_extension_gem/rspec.tt} +0 -0
  26. data/{tmp_gem/spec/tmp_gem_spec.rb → lib/bundlegem/templates/c_extension_gem/spec/#{name}_spec.rb.tt} +2 -2
  27. data/{tmp_gem/spec/spec_helper.rb → lib/bundlegem/templates/c_extension_gem/spec/spec_helper.rb.tt} +1 -1
  28. data/lib/bundlegem/templates/cli_gem/#{name}.gemspec.tt +35 -0
  29. data/lib/bundlegem/templates/cli_gem/.travis.yml.tt +3 -0
  30. data/lib/bundlegem/templates/cli_gem/CODE_OF_CONDUCT.md.tt +13 -0
  31. data/lib/bundlegem/templates/cli_gem/Gemfile.tt +4 -0
  32. data/lib/bundlegem/templates/cli_gem/LICENSE.txt.tt +21 -0
  33. data/lib/bundlegem/templates/cli_gem/README.md.tt +39 -0
  34. data/lib/bundlegem/templates/cli_gem/Rakefile.tt +25 -0
  35. data/lib/bundlegem/templates/cli_gem/bin/#{name}.tt +3 -0
  36. data/lib/bundlegem/templates/cli_gem/bin/console.tt +14 -0
  37. data/lib/bundlegem/templates/cli_gem/changelog.tt +7 -0
  38. data/lib/bundlegem/templates/cli_gem/exe/#{name}.tt +5 -0
  39. data/lib/bundlegem/templates/cli_gem/ext/#{name}/#{newgem}.c.tt +9 -0
  40. data/lib/bundlegem/templates/cli_gem/ext/#{name}/#{newgem}.h.tt +6 -0
  41. data/lib/bundlegem/templates/cli_gem/ext/#{name}/extconf.rb.tt +3 -0
  42. data/{tmp_gem/.gitignore → lib/bundlegem/templates/cli_gem/gitignore.tt} +7 -0
  43. data/lib/bundlegem/templates/cli_gem/lib/#{name}/version.rb.tt +7 -0
  44. data/lib/bundlegem/templates/cli_gem/lib/#{name}.rb.tt +9 -0
  45. data/lib/bundlegem/templates/cli_gem/rspec.tt +2 -0
  46. data/lib/bundlegem/templates/cli_gem/spec/#{name}_spec.rb.tt +11 -0
  47. data/lib/bundlegem/templates/cli_gem/spec/spec_helper.rb.tt +2 -0
  48. data/lib/bundlegem/templates/newgem/#{name}.gemspec.tt +2 -6
  49. data/lib/bundlegem/templates/newgem/.gitignore.tt +16 -0
  50. data/lib/bundlegem/templates/newgem/Rakefile.tt +32 -17
  51. data/lib/bundlegem/templates/service/lib/#{name}.rb.tt +1 -1
  52. data/lib/bundlegem/version.rb +1 -1
  53. data/lib/bundlegem.rb +29 -2
  54. data/spec/bundlegem_spec.rb +8 -2
  55. data/spec/spec_helper.rb +18 -8
  56. metadata +44 -19
  57. data/tmp_gem/.travis.yml +0 -3
  58. data/tmp_gem/Gemfile +0 -4
  59. data/tmp_gem/Rakefile +0 -1
  60. data/tmp_gem/lib/tmp_gem/version.rb +0 -3
  61. 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 'tmp_gem/version'
4
+ require '<%=config[:namespaced_path]%>/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "tmp_gem"
8
- spec.version = TmpGem::VERSION
9
- spec.authors = ["TODO: Write your name"]
10
- spec.email = ["TODO: Write your email address"]
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/TODO: Write your name/tmp_gem"
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", "~> 1.7"
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,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - <%= RUBY_VERSION %>
@@ -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,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in <%=config[:name]%>.gemspec
4
+ gemspec
@@ -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
- # TmpGem
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/tmp_gem`. To experiment with that code, run `bin/console` for an interactive prompt.
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 'tmp_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 tmp_gem
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]/tmp_gem/fork )
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 -%>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "<%= config[:namespaced_path] %>"
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "tmp_gem"
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.
@@ -0,0 +1,7 @@
1
+ <%- config[:constant_array].each_with_index do |c,i| -%>
2
+ <%= ' '*i %>module <%= c %>
3
+ <%- end -%>
4
+ <%= ' '*config[:constant_array].size %>VERSION = "0.1.0"
5
+ <%- (config[:constant_array].size-1).downto(0) do |i| -%>
6
+ <%= ' '*i %>end
7
+ <%- end -%>
@@ -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 -%>
@@ -1,8 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe TmpGem do
3
+ describe <%= config[:constant_name] %> do
4
4
  it 'has a version number' do
5
- expect(TmpGem::VERSION).not_to be nil
5
+ expect(<%= config[:constant_name] %>::VERSION).not_to be nil
6
6
  end
7
7
 
8
8
  it 'does something useful' do
@@ -1,2 +1,2 @@
1
1
  $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
- require 'tmp_gem'
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,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - <%= RUBY_VERSION %>
@@ -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,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in <%=config[:name]%>.gemspec
4
+ gemspec
@@ -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,3 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "<%= config[:namespaced_path] %>"
@@ -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,7 @@
1
+ ** 0.0.x **
2
+ TODO: List off what features you'll be including at some point in the
3
+ future.
4
+
5
+ ** 0.0.1 **
6
+ TODO: List off what features you'll be including in the first release
7
+
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "<%= config[:namespaced_path] %>"
4
+
5
+ puts "I'm still just a stub cli ruby app"
@@ -0,0 +1,9 @@
1
+ #include "<%=config[:underscored_name]%>.h"
2
+
3
+ VALUE rb_m<%=config[:constant_array].join%>;
4
+
5
+ void
6
+ Init_<%=config[:underscored_name]%>(void)
7
+ {
8
+ rb_m<%=config[:constant_array].join%> = rb_define_module(<%=config[:constant_name].inspect%>);
9
+ }
@@ -0,0 +1,6 @@
1
+ #ifndef <%=config[:underscored_name].upcase%>_H
2
+ #define <%=config[:underscored_name].upcase%>_H 1
3
+
4
+ #include "ruby.h"
5
+
6
+ #endif /* <%=config[:underscored_name].upcase%>_H */
@@ -0,0 +1,3 @@
1
+ require "mkmf"
2
+
3
+ create_makefile(<%= config[:makefile_path].inspect %>)
@@ -7,3 +7,10 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ <%- if config[:ext] -%>
11
+ *.bundle
12
+ *.so
13
+ *.o
14
+ *.a
15
+ mkmf.log
16
+ <%- end -%>
@@ -0,0 +1,7 @@
1
+ <%- config[:constant_array].each_with_index do |c,i| -%>
2
+ <%= ' '*i %>module <%= c %>
3
+ <%- end -%>
4
+ <%= ' '*config[:constant_array].size %>VERSION = "0.1.0"
5
+ <%- (config[:constant_array].size-1).downto(0) do |i| -%>
6
+ <%= ' '*i %>end
7
+ <%- end -%>
@@ -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 -%>
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,11 @@
1
+ require 'spec_helper'
2
+
3
+ describe <%= config[:constant_name] %> do
4
+ it 'has a version number' do
5
+ expect(<%= config[:constant_name] %>::VERSION).not_to be nil
6
+ end
7
+
8
+ it 'does something useful' do
9
+ expect(false).to eq(true)
10
+ end
11
+ end
@@ -0,0 +1,2 @@
1
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
+ require '<%= config[:namespaced_path] %>'
@@ -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
- <%- if config[:mit] -%>
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
- <%- if config[:test] && config[:test] != "false" -%>
37
- spec.add_development_dependency "<%=config[:test]%>"
38
- <%- end -%>
34
+ spec.add_development_dependency "rspec"
39
35
  end
@@ -0,0 +1,16 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ <%- if config[:ext] -%>
11
+ *.bundle
12
+ *.so
13
+ *.o
14
+ *.a
15
+ mkmf.log
16
+ <%- end -%>
@@ -1,25 +1,40 @@
1
- require "bundler/gem_tasks"
2
- <% if config[:test] == 'minitest' -%>
3
- require "rake/testtask"
1
+ require 'rake'
4
2
 
5
- Rake::TestTask.new(:test) do |t|
6
- t.libs << "test"
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
- task :default => :test
10
- <% elsif config[:test] == 'rspec' -%>
11
- require "rspec/core/rake_task"
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
- RSpec::Core::RakeTask.new(:spec)
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
- <% end -%>
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...k
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
@@ -1,3 +1,3 @@
1
1
  module Bundlegem
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end