nugem 0.8.0 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -3
  3. data/CHANGELOG.md +31 -9
  4. data/Gemfile +26 -0
  5. data/README.md +29 -12
  6. data/exe/nugem +5 -0
  7. data/lib/nugem/cli/cli_gem.rb +6 -7
  8. data/lib/nugem/cli/cli_jekyll.rb +15 -15
  9. data/lib/nugem/cli/cli_rails.rb +3 -4
  10. data/lib/nugem/cli.rb +53 -39
  11. data/lib/nugem/git.rb +61 -59
  12. data/lib/nugem/version.rb +1 -1
  13. data/lib/nugem.rb +7 -22
  14. data/lib/util.rb +27 -0
  15. data/nugem.gemspec +23 -12
  16. data/templates/common/LICENCE.txt.tt +21 -0
  17. data/templates/common/executable_scaffold/exe/%gem_name%.tt +5 -0
  18. data/templates/common/executable_scaffold/lib/%gem_name%/cli.rb.tt +13 -0
  19. data/templates/common/gem_scaffold/%gem_name%.gemspec.tt +57 -0
  20. data/templates/common/gem_scaffold/.bundle/config +2 -0
  21. data/templates/common/gem_scaffold/.gitignore.tt +27 -0
  22. data/templates/common/gem_scaffold/.markdownlint.json +8 -0
  23. data/templates/common/gem_scaffold/.rspec +4 -0
  24. data/templates/common/gem_scaffold/.rubocop.yml.tt +80 -0
  25. data/templates/common/gem_scaffold/.shellcheckrc +5 -0
  26. data/templates/common/gem_scaffold/.vscode/%gem_name%.json.code-snippets.tt +19 -0
  27. data/templates/common/gem_scaffold/.vscode/extensions.json +22 -0
  28. data/templates/common/gem_scaffold/.vscode/launch.json +31 -0
  29. data/templates/common/gem_scaffold/.vscode/settings.json +5 -0
  30. data/templates/common/gem_scaffold/CHANGELOG.md.tt +5 -0
  31. data/templates/common/gem_scaffold/Gemfile.tt +44 -0
  32. data/templates/common/gem_scaffold/README.md.tt +102 -0
  33. data/templates/common/gem_scaffold/Rakefile.tt +51 -0
  34. data/templates/common/gem_scaffold/bin/attach +35 -0
  35. data/templates/common/gem_scaffold/bin/build +7 -0
  36. data/templates/common/gem_scaffold/bin/console.tt +10 -0
  37. data/templates/common/gem_scaffold/bin/rake +13 -0
  38. data/templates/common/gem_scaffold/bin/reset +4 -0
  39. data/templates/common/gem_scaffold/bin/setup.tt +27 -0
  40. data/templates/common/gem_scaffold/lib/%gem_name%/version.rb.tt +3 -0
  41. data/templates/common/gem_scaffold/lib/%gem_name%.rb.tt +14 -0
  42. data/templates/common/gem_scaffold/test/%gem_name%_test.rb.tt +11 -0
  43. data/templates/common/gem_scaffold/test/test_helper.rb.tt +96 -0
  44. data/templates/jekyll/block_no_arg_scaffold/lib/%block_name%.rb.tt +23 -0
  45. data/templates/jekyll/block_scaffold/lib/%block_name%.rb.tt +50 -0
  46. data/templates/jekyll/common_scaffold/spec/%gem_name%_spec.rb.tt +13 -0
  47. data/templates/jekyll/common_scaffold/spec/spec_helper.rb +79 -0
  48. data/templates/jekyll/demo/demo/Gemfile.tt +22 -0
  49. data/templates/jekyll/demo/demo/_bin/debug +71 -0
  50. data/templates/jekyll/demo/demo/_config.yml.tt +48 -0
  51. data/templates/jekyll/demo/demo/_drafts/2022/2022-05-01-test2.html +15 -0
  52. data/templates/jekyll/demo/demo/_includes/block_tag_template_wrapper +9 -0
  53. data/templates/jekyll/demo/demo/_layouts/default.html.tt +67 -0
  54. data/templates/jekyll/demo/demo/_posts/2022/2022-01-02-redact-test.html +12 -0
  55. data/templates/jekyll/demo/demo/assets/css/style.css +218 -0
  56. data/templates/jekyll/demo/demo/assets/images/404-error.png +0 -0
  57. data/templates/jekyll/demo/demo/assets/images/404-error.webp +0 -0
  58. data/templates/jekyll/demo/demo/assets/images/favicon.png +0 -0
  59. data/templates/jekyll/demo/demo/assets/images/jekyll.png +0 -0
  60. data/templates/jekyll/demo/demo/assets/images/jekyll.webp +0 -0
  61. data/templates/jekyll/demo/demo/assets/js/clipboard.min.js +7 -0
  62. data/templates/jekyll/demo/demo/assets/js/jquery-3.4.1.min.js +2 -0
  63. data/templates/jekyll/demo/demo/blog/blogsByDate.html +22 -0
  64. data/templates/jekyll/demo/demo/blog/index.html +36 -0
  65. data/templates/jekyll/demo/demo/index.html.tt +5 -0
  66. data/templates/jekyll/filter_scaffold/lib/%filter_name%.rb.tt +30 -0
  67. data/templates/jekyll/generator_scaffold/lib/%generator_name%.rb.tt +34 -0
  68. data/templates/jekyll/hooks_scaffold/lib/dumpers.rb +172 -0
  69. data/templates/jekyll/hooks_scaffold/lib/hooks.rb.tt +238 -0
  70. data/templates/jekyll/tag_no_arg_scaffold/lib/%tag_name%.rb.tt +18 -0
  71. data/templates/jekyll/tag_scaffold/lib/%tag_name%.rb.tt +43 -0
  72. data/templates/rails/engine_scaffold/app/assets/images/%gem_name%/.keep +0 -0
  73. data/templates/rails/engine_scaffold/app/assets/javascripts/%gem_name%/.keep +0 -0
  74. data/templates/rails/engine_scaffold/app/assets/stylesheets/%gem_name%/.keep +0 -0
  75. data/templates/rails/engine_scaffold/app/controllers/.keep +0 -0
  76. data/templates/rails/engine_scaffold/app/helpers/.keep +0 -0
  77. data/templates/rails/engine_scaffold/app/mailers/.keep +0 -0
  78. data/templates/rails/engine_scaffold/app/models/.keep +0 -0
  79. data/templates/rails/engine_scaffold/app/views/.keep +0 -0
  80. data/templates/rails/engine_scaffold/bin/rails.tt +15 -0
  81. data/templates/rails/engine_scaffold/config/routes.rb.tt +6 -0
  82. data/templates/rails/engine_scaffold/lib/%gem_name%/engine.rb.tt +7 -0
  83. data/templates/rails/engine_scaffold/test/integration/navigation_test.rb +7 -0
  84. data/templates/rails/mountable_scaffold/app/assets/javascripts/%gem_name%/application.js +13 -0
  85. data/templates/rails/mountable_scaffold/app/assets/stylesheets/%gem_name%/application.css +15 -0
  86. data/templates/rails/mountable_scaffold/app/controllers/%gem_name%/application_controller.rb.tt +5 -0
  87. data/templates/rails/mountable_scaffold/app/helpers/%gem_name%/application_helper.rb.tt +4 -0
  88. data/templates/rails/mountable_scaffold/app/views/layouts/%gem_name%/application.html.erb.tt +14 -0
  89. data/templates/rails/plugin_scaffold/.envrc +1 -0
  90. data/templates/rails/plugin_scaffold/.simplecov.tt +18 -0
  91. data/templates/rails/plugin_scaffold/.travis.yml +4 -0
  92. data/templates/rails/plugin_scaffold/test/dummy/.envrc +1 -0
  93. data/templates/rails/plugin_scaffold/test/dummy/README.rdoc +28 -0
  94. data/templates/rails/plugin_scaffold/test/dummy/Rakefile +6 -0
  95. data/templates/rails/plugin_scaffold/test/dummy/app/assets/images/.keep +0 -0
  96. data/templates/rails/plugin_scaffold/test/dummy/app/assets/javascripts/application.js +13 -0
  97. data/templates/rails/plugin_scaffold/test/dummy/app/assets/stylesheets/application.sass +0 -0
  98. data/templates/rails/plugin_scaffold/test/dummy/app/controllers/application_controller.rb +7 -0
  99. data/templates/rails/plugin_scaffold/test/dummy/app/controllers/concerns/.keep +0 -0
  100. data/templates/rails/plugin_scaffold/test/dummy/app/helpers/application_helper.rb +2 -0
  101. data/templates/rails/plugin_scaffold/test/dummy/app/mailers/application_mailer.rb +4 -0
  102. data/templates/rails/plugin_scaffold/test/dummy/app/models/.keep +0 -0
  103. data/templates/rails/plugin_scaffold/test/dummy/app/models/concerns/.keep +0 -0
  104. data/templates/rails/plugin_scaffold/test/dummy/app/views/layouts/application.html.erb +14 -0
  105. data/templates/rails/plugin_scaffold/test/dummy/app/views/layouts/mailer.html.erb +9 -0
  106. data/templates/rails/plugin_scaffold/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  107. data/templates/rails/plugin_scaffold/test/dummy/bin/bundle +4 -0
  108. data/templates/rails/plugin_scaffold/test/dummy/bin/rails +5 -0
  109. data/templates/rails/plugin_scaffold/test/dummy/bin/rake +6 -0
  110. data/templates/rails/plugin_scaffold/test/dummy/bin/setup +30 -0
  111. data/templates/rails/plugin_scaffold/test/dummy/config/application.rb.tt +26 -0
  112. data/templates/rails/plugin_scaffold/test/dummy/config/boot.rb +5 -0
  113. data/templates/rails/plugin_scaffold/test/dummy/config/database.yml +25 -0
  114. data/templates/rails/plugin_scaffold/test/dummy/config/environment.rb +5 -0
  115. data/templates/rails/plugin_scaffold/test/dummy/config/environments/development.rb +41 -0
  116. data/templates/rails/plugin_scaffold/test/dummy/config/environments/production.rb +79 -0
  117. data/templates/rails/plugin_scaffold/test/dummy/config/environments/test.rb +42 -0
  118. data/templates/rails/plugin_scaffold/test/dummy/config/initializers/assets.rb +11 -0
  119. data/templates/rails/plugin_scaffold/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  120. data/templates/rails/plugin_scaffold/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  121. data/templates/rails/plugin_scaffold/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  122. data/templates/rails/plugin_scaffold/test/dummy/config/initializers/inflections.rb +16 -0
  123. data/templates/rails/plugin_scaffold/test/dummy/config/initializers/mime_types.rb +4 -0
  124. data/templates/rails/plugin_scaffold/test/dummy/config/initializers/session_store.rb +3 -0
  125. data/templates/rails/plugin_scaffold/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  126. data/templates/rails/plugin_scaffold/test/dummy/config/locales/en.yml +23 -0
  127. data/templates/rails/plugin_scaffold/test/dummy/config/routes.rb.tt +5 -0
  128. data/templates/rails/plugin_scaffold/test/dummy/config/secrets.yml +22 -0
  129. data/templates/rails/plugin_scaffold/test/dummy/config.ru +4 -0
  130. data/templates/rails/plugin_scaffold/test/dummy/db/seeds.rb +7 -0
  131. data/templates/rails/plugin_scaffold/test/dummy/lib/assets/.keep +0 -0
  132. data/templates/rails/plugin_scaffold/test/dummy/log/.keep +0 -0
  133. data/templates/rails/plugin_scaffold/test/dummy/public/404.html +67 -0
  134. data/templates/rails/plugin_scaffold/test/dummy/public/422.html +67 -0
  135. data/templates/rails/plugin_scaffold/test/dummy/public/500.html +66 -0
  136. data/templates/rails/plugin_scaffold/test/dummy/public/favicon.ico +0 -0
  137. data/templates/rails/rails_scaffold/lib/tasks/%gem_name%_tasks.rake.tt +4 -0
  138. data/templates/rails/rails_scaffold/test/dummy/.envrc +1 -0
  139. data/templates/rails/rails_scaffold/test/dummy/README.rdoc +28 -0
  140. data/templates/rails/rails_scaffold/test/dummy/Rakefile +6 -0
  141. data/templates/rails/rails_scaffold/test/dummy/app/assets/images/.keep +0 -0
  142. data/templates/rails/rails_scaffold/test/dummy/app/assets/javascripts/application.js +13 -0
  143. data/templates/rails/rails_scaffold/test/dummy/app/assets/stylesheets/application.sass +0 -0
  144. data/templates/rails/rails_scaffold/test/dummy/app/controllers/application_controller.rb +7 -0
  145. data/templates/rails/rails_scaffold/test/dummy/app/controllers/concerns/.keep +0 -0
  146. data/templates/rails/rails_scaffold/test/dummy/app/helpers/application_helper.rb +2 -0
  147. data/templates/rails/rails_scaffold/test/dummy/app/mailers/application_mailer.rb +4 -0
  148. data/templates/rails/rails_scaffold/test/dummy/app/models/.keep +0 -0
  149. data/templates/rails/rails_scaffold/test/dummy/app/models/concerns/.keep +0 -0
  150. data/templates/rails/rails_scaffold/test/dummy/app/views/layouts/application.html.erb +14 -0
  151. data/templates/rails/rails_scaffold/test/dummy/app/views/layouts/mailer.html.erb +9 -0
  152. data/templates/rails/rails_scaffold/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  153. data/templates/rails/rails_scaffold/test/dummy/bin/bundle +4 -0
  154. data/templates/rails/rails_scaffold/test/dummy/bin/rails +5 -0
  155. data/templates/rails/rails_scaffold/test/dummy/bin/rake +6 -0
  156. data/templates/rails/rails_scaffold/test/dummy/bin/setup +30 -0
  157. data/templates/rails/rails_scaffold/test/dummy/config/application.rb.tt +26 -0
  158. data/templates/rails/rails_scaffold/test/dummy/config/boot.rb +5 -0
  159. data/templates/rails/rails_scaffold/test/dummy/config/database.yml +25 -0
  160. data/templates/rails/rails_scaffold/test/dummy/config/environment.rb +5 -0
  161. data/templates/rails/rails_scaffold/test/dummy/config/environments/development.rb +41 -0
  162. data/templates/rails/rails_scaffold/test/dummy/config/environments/production.rb +79 -0
  163. data/templates/rails/rails_scaffold/test/dummy/config/environments/test.rb +42 -0
  164. data/templates/rails/rails_scaffold/test/dummy/config/initializers/assets.rb +11 -0
  165. data/templates/rails/rails_scaffold/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  166. data/templates/rails/rails_scaffold/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  167. data/templates/rails/rails_scaffold/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  168. data/templates/rails/rails_scaffold/test/dummy/config/initializers/inflections.rb +16 -0
  169. data/templates/rails/rails_scaffold/test/dummy/config/initializers/mime_types.rb +4 -0
  170. data/templates/rails/rails_scaffold/test/dummy/config/initializers/session_store.rb +3 -0
  171. data/templates/rails/rails_scaffold/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  172. data/templates/rails/rails_scaffold/test/dummy/config/locales/en.yml +23 -0
  173. data/templates/rails/rails_scaffold/test/dummy/config/routes.rb.tt +5 -0
  174. data/templates/rails/rails_scaffold/test/dummy/config/secrets.yml +22 -0
  175. data/templates/rails/rails_scaffold/test/dummy/config.ru +4 -0
  176. data/templates/rails/rails_scaffold/test/dummy/db/seeds.rb +7 -0
  177. data/templates/rails/rails_scaffold/test/dummy/lib/assets/.keep +0 -0
  178. data/templates/rails/rails_scaffold/test/dummy/log/.keep +0 -0
  179. data/templates/rails/rails_scaffold/test/dummy/public/404.html +67 -0
  180. data/templates/rails/rails_scaffold/test/dummy/public/422.html +67 -0
  181. data/templates/rails/rails_scaffold/test/dummy/public/500.html +66 -0
  182. data/templates/rails/rails_scaffold/test/dummy/public/favicon.ico +0 -0
  183. metadata +187 -3
data/lib/nugem/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Nugem
2
- VERSION = '0.8.0'.freeze
2
+ VERSION = '0.8.3'.freeze
3
3
  end
data/lib/nugem.rb CHANGED
@@ -1,31 +1,16 @@
1
1
  require 'thor'
2
- require_relative 'nugem/git'
3
- require_relative 'nugem/repository'
4
- require_relative 'nugem/version'
5
2
  require_relative 'util'
6
3
 
4
+ Signal.trap('INT') { exit }
5
+
7
6
  module Nugem
8
7
  # @return Path to the generated gem
9
8
  def self.dest_root(gem_name)
10
9
  File.expand_path "generated/#{gem_name}"
11
10
  end
12
-
13
- class Cli < Thor
14
- include Thor::Actions
15
-
16
- package_name 'Nugem'
17
-
18
- # These declarations make the class instance variable values available as an accessor,
19
- # which is necessary to name template files that are named '%variable_name%.extension'.
20
- # See https://www.rubydoc.info/gems/thor/Thor/Actions#directory-instance_method
21
- attr_reader :block_name, :filter_name, :generator_name, :tag_name, :test_framework
22
-
23
- class << self
24
- def test_option(default_value)
25
- method_option :test_framework, type: :string, default: default_value,
26
- enum: %w[minitest rspec],
27
- desc: "Use rspec or minitest for the test framework (default is #{default_value})."
28
- end
29
- end
30
- end
31
11
  end
12
+
13
+ require_relative 'nugem/git'
14
+ require_relative 'nugem/cli'
15
+ require_relative 'nugem/repository'
16
+ require_relative 'nugem/version'
data/lib/util.rb CHANGED
@@ -8,4 +8,31 @@ module Nugem
8
8
  ENV.fetch(Regexp.last_match(1), nil)
9
9
  end
10
10
  end
11
+
12
+ # The following methods are not required at present ... but they might be needed one day, so not deleting yet
13
+
14
+ # @param file must be a fully qualified file name
15
+ # @return Gem::Specification of gem that file points into, or nil if not called from a gem
16
+ def self.current_spec(file)
17
+ return nil unless File.file?(file)
18
+
19
+ searcher = if Gem::Specification.respond_to?(:find)
20
+ Gem::Specification
21
+ elsif Gem.respond_to?(:searcher)
22
+ Gem.searcher.init_gemspecs
23
+ end
24
+
25
+ searcher&.find do |spec|
26
+ file.start_with? spec.full_gem_path
27
+ end
28
+ end
29
+
30
+ def self.gem_path(file)
31
+ spec = self.current_spec(file)
32
+ spec&.full_gem_path
33
+ end
34
+
35
+ def self.template_directory
36
+ File.join gem_path(__FILE__), 'templates'
37
+ end
11
38
  end
data/nugem.gemspec CHANGED
@@ -1,23 +1,34 @@
1
1
  require_relative 'lib/nugem/version'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
- spec.authors = ['Igor Jancev', 'Mike Slinn']
5
- spec.bindir = 'exe'
6
- spec.email = ['igor@masterybits.com', 'mslinn@mslinn.com']
7
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
8
- spec.files = Dir['.rubocop.yml', 'LICENSE.*', 'Rakefile', '{lib,spec}/**/*', '*.gemspec', '*.md']
9
- spec.description = <<~END_DESC
4
+ spec.description = <<~END_DESC
10
5
  Nugem creates a scaffold project for new gems. You can choose between Github and Bitbucket,
11
6
  Rubygems or Geminabox, with or without an executable, etc.
12
7
  END_DESC
13
- spec.homepage = 'https://github.com/mslinn/nugem'
14
- spec.license = 'MIT'
15
- spec.name = 'nugem'
16
- spec.require_paths = ['lib']
8
+ spec.authors = ['Igor Jancev', 'Mike Slinn']
9
+ spec.bindir = 'exe'
10
+ spec.email = ['igor@masterybits.com', 'mslinn@mslinn.com']
11
+ spec.executables = %w[nugem]
12
+ spec.files = Dir[
13
+ '.rubocop.yml',
14
+ 'Gemfile',
15
+ 'LICENSE.*',
16
+ 'Rakefile',
17
+ '{lib,spec,templates}/**/*',
18
+ 'templates/**/.*',
19
+ 'templates/**/.*/*',
20
+ '*.gemspec',
21
+ '*.md'
22
+ ]
23
+ spec.homepage = 'https://github.com/mslinn/nugem'
24
+ spec.license = 'MIT'
25
+ spec.name = 'nugem'
26
+ spec.require_paths = ['lib']
17
27
  spec.required_ruby_version = '>= 3.1.0'
18
- spec.summary = 'Nugem creates a scaffold project for new gems.'
19
- spec.version = Nugem::VERSION
28
+ spec.summary = 'Nugem creates a scaffold project for new gems.'
29
+ spec.version = Nugem::VERSION
20
30
 
31
+ spec.add_dependency 'jekyll'
21
32
  spec.add_dependency 'rugged'
22
33
  spec.add_dependency 'thor'
23
34
  end
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) <%= Time.new.year %> <%= @repository.user_name %>
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,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require '<%= @gem_name %>/cli'
4
+
5
+ <%= @class_name %>::Cli.start
@@ -0,0 +1,13 @@
1
+ require 'thor'
2
+ require '<%= @gem_name %>'
3
+
4
+ module <%= @class_name %>
5
+ class Cli < Thor
6
+ include Thor::Actions
7
+
8
+ desc "do_something NAME", "<%= @todo %>task description"
9
+ def do_something(name)
10
+ puts "<%= @todo %>do something with: #{name}"
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,57 @@
1
+ require_relative 'lib/<%= @gem_name %>/version'
2
+
3
+ Gem::Specification.new do |spec|
4
+ <%- if @repository.github? -%>
5
+ host = 'https://github.com/<%= @repository.user %>/<%= @gem_name %>'
6
+ <%- else -%>
7
+ host = 'https://bitbucket.com/<%= @repository.user %>/<%= @gem_name %>'
8
+ <%- end -%>
9
+
10
+ spec.authors = ['<%= @repository.user_name %>']
11
+ <%- if @executable -%>
12
+ spec.bindir = 'binstub'
13
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
14
+ <%- end -%>
15
+ spec.description = <<~END_DESC
16
+ <%= @todo %>Write a longer description of the gem.
17
+ Use as many lines as you like.
18
+ END_DESC
19
+ spec.email = ['<%= @repository.user_email %>']
20
+ spec.files = Dir['.rubocop.yml', 'LICENSE.*', 'Rakefile', '{lib,spec}/**/*', '*.gemspec', '*.md']
21
+ spec.homepage = '<%= @repository.url %>'
22
+ <%- if @repository.public? -%>
23
+ spec.license = 'MIT'
24
+ <%- end -%>
25
+ spec.metadata = {
26
+ 'allowed_push_host' => '<%= @repository.gem_server_url %>',
27
+ <%- unless @repository.private? -%>
28
+ 'bug_tracker_uri' => "#{host}/issues",
29
+ 'changelog_uri' => "#{host}/CHANGELOG.md",
30
+ 'homepage_uri' => spec.homepage,
31
+ 'source_code_uri' => host,
32
+ <%- end -%>
33
+ }
34
+ spec.name = '<%= @gem_name %>'
35
+ spec.post_install_message = <<~END_MESSAGE
36
+
37
+ Thanks for installing #{spec.name}!
38
+
39
+ END_MESSAGE
40
+ spec.require_paths = ['lib']
41
+ spec.required_ruby_version = '>= 3.1.0'
42
+ spec.summary = '<%= @todo %>Write summary of what the gem is for'
43
+ spec.version = <%= @class_name %>::VERSION
44
+ <%- if @geminabox -%>
45
+ spec.add_dependency 'geminabox', '>= 2.2.1'
46
+ <%- end -%>
47
+ <%- if @jekyll -%>
48
+ spec.add_dependency 'jekyll', '>= 3.5.0'
49
+ spec.add_dependency 'jekyll_plugin_support', '>= 0.7.0'
50
+ <%- end -%>
51
+ <%- if @rails -%>
52
+ spec.add_dependency 'rails', '~> 7.0.5'
53
+ <%- end -%>
54
+ <%- if @executable -%>
55
+ spec.add_dependency 'thor', '~> 1.2.2'
56
+ <%- end -%>
57
+ end
@@ -0,0 +1,2 @@
1
+ ---
2
+ BUNDLE_BIN: "binstub"
@@ -0,0 +1,27 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /binstub/
4
+ /Gemfile.lock
5
+ /_yardoc/
6
+ /coverage/
7
+ /test/coverage/
8
+ /test/reports/
9
+ /doc/
10
+ /pkg/
11
+ /tmp/
12
+ <%- if @rails -%>
13
+ test/dummy/db/*.sqlite3
14
+ test/dummy/db/*.sqlite3-journal
15
+ test/dummy/log/*.log
16
+ test/dummy/tmp/
17
+ test/dummy/.sass-cache
18
+ <%- end -%>
19
+ <%- if @jekyll -%>
20
+ spec/status_persistence.txt
21
+ .jekyll-cache/
22
+ .jekyll-metadata
23
+ _site/
24
+ demo/_site/
25
+ demo/.jekyll-cache/
26
+ demo/.jekyll-metadata
27
+ <%- end -%>
@@ -0,0 +1,8 @@
1
+ {
2
+ "MD012": false,
3
+ "MD014": false,
4
+ "MD013": { "line_length": 120 },
5
+ "MD024": false,
6
+ "MD033": false,
7
+ "MD034": false
8
+ }
@@ -0,0 +1,4 @@
1
+ --color
2
+ --format documentation
3
+ --order defined
4
+ --require spec_helper
@@ -0,0 +1,80 @@
1
+ require:
2
+ <%- if @jekyll -%>
3
+ # - rubocop-jekyll
4
+ <%- end -%>
5
+ - rubocop-md
6
+ - rubocop-performance
7
+ <%- if @test_framework == 'minitest' -%>
8
+ - rubocop-minitest
9
+ <%- end -%>
10
+ - rubocop-rake
11
+ <%- if @test_framework == 'rspec' -%>
12
+ - rubocop-rspec
13
+ <%- end -%>
14
+
15
+ AllCops:
16
+ Exclude:
17
+ - binstub/**/*
18
+ - exe/**/*
19
+ - vendor/**/*
20
+ - Gemfile*
21
+ NewCops: enable
22
+ TargetRubyVersion: 3.1.3
23
+
24
+ Gemspec/DeprecatedAttributeAssignment:
25
+ Enabled: false
26
+
27
+ Gemspec/RequireMFA:
28
+ Enabled: false
29
+
30
+ Layout/HashAlignment:
31
+ EnforcedColonStyle: table
32
+ EnforcedHashRocketStyle: table
33
+
34
+ Layout/LineLength:
35
+ Max: 150
36
+
37
+ Metrics/AbcSize:
38
+ Max: 35
39
+
40
+ Metrics/BlockLength:
41
+ Exclude:
42
+ - <%= @gem_name %>.gemspec
43
+ Max: 30
44
+
45
+ Metrics/CyclomaticComplexity:
46
+ Max: 15
47
+
48
+ Metrics/MethodLength:
49
+ Max: 40
50
+
51
+ Metrics/ModuleLength:
52
+ Enabled: false
53
+
54
+ Metrics/PerceivedComplexity:
55
+ Max: 15
56
+
57
+ Naming/FileName:
58
+ Exclude:
59
+ - Rakefile
60
+
61
+ Style/Documentation:
62
+ Enabled: false
63
+
64
+ Style/FrozenStringLiteralComment:
65
+ Enabled: false
66
+
67
+ Style/TrailingCommaInHashLiteral:
68
+ EnforcedStyleForMultiline: comma
69
+ <%- if @test_framework == 'rspec' -%>
70
+
71
+ RSpec/FilePath:
72
+ IgnoreMethods: true
73
+ SpecSuffixOnly: true
74
+
75
+ RSpec/ExampleLength:
76
+ Max: 30
77
+
78
+ RSpec/MultipleExpectations:
79
+ Max: 15
80
+ <%- end -%>
@@ -0,0 +1,5 @@
1
+ disable=SC1091
2
+ disable=SC2059
3
+ disable=SC2086
4
+ disable=SC2155
5
+ disable=SC2181
@@ -0,0 +1,19 @@
1
+ {
2
+ // Place your workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
3
+ // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
4
+ // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
5
+ // used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
6
+ // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
7
+ // Placeholders with the same ids are connected.
8
+ // Example:
9
+ // "Print to console": {
10
+ // "scope": "javascript,typescript",
11
+ // "prefix": "log",
12
+ // "body": [
13
+ // "console.log('$1');",
14
+ // "$2"
15
+ // ],
16
+ // "description": "Log output to console"
17
+ // }
18
+ //
19
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3
+ // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4
+
5
+ // List of extensions which should be recommended for users of this workspace.
6
+ "recommendations": [
7
+ "DavidAnson.vscode-markdownlint",
8
+ "devonray.snippet",
9
+ "KoichiSasada.vscode-rdbg",
10
+ "misogi.ruby-rubocop",
11
+ "redhat.vscode-yaml",
12
+ "shd101wyy.markdown-preview-enhanced",
13
+ "Shopify.ruby-lsp",
14
+ "timonwong.shellcheck",
15
+ ],
16
+ // List of extensions recommended by VS Code that should not be recommended for users of this workspace.
17
+ "unwantedRecommendations": [
18
+ "castwide.solargraph",
19
+ "rebornix.Ruby",
20
+ "wingrunr21.vscode-ruby",
21
+ ]
22
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "name": "Run selected Ruby file",
9
+ "program": "ruby ${file}",
10
+ "request": "launch",
11
+ "type": "ruby_lsp"
12
+ },
13
+ {
14
+ "name": "Attach rdebug-ide",
15
+ "request": "attach",
16
+ "type": "ruby_lsp",
17
+ },
18
+ {
19
+ "name": "RSpec - active spec file only",
20
+ "program": "binstub/rspec -I ${workspaceRoot} ${file}",
21
+ "request": "launch",
22
+ "type": "ruby_lsp",
23
+ },
24
+ {
25
+ "name": "RSpec - all",
26
+ "program": "${workspaceRoot}/binstub/rspec -I ${workspaceRoot}",
27
+ "request": "launch",
28
+ "type": "ruby_lsp",
29
+ }
30
+ ]
31
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "ruby.rubocop.configFilePath": ".rubocop.yml",
3
+ "ruby.rubocop.useBundler": true,
4
+ "ruby.rubocop.executePath": "./binstub/"
5
+ }
@@ -0,0 +1,5 @@
1
+ # Change Log
2
+
3
+ ## 0.1.0
4
+
5
+ * Initial release.
@@ -0,0 +1,44 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # The <%= @gem_name %> gem dependencies are defined in <%= @gem_name %>.gemspec
4
+ gemspec
5
+
6
+ group :test, :development do
7
+ gem 'debug', '>= 1.0.0', require: false
8
+ gem 'gem-release', '>= 2.2.2', require: false
9
+ <%- if @jekyll -%>
10
+ gem 'rake', require: false
11
+ <%- end -%>
12
+ gem 'rubocop', require: false
13
+ gem 'rubocop-md', require: false
14
+ <%- if @minitest -%>
15
+ gem 'rubocop-minitest', require: false
16
+ <%- end -%>
17
+ gem 'rubocop-performance', require: false
18
+ gem 'rubocop-rake', require: false
19
+ <%- if @rspec -%>
20
+ gem 'rubocop-rspec', require: false
21
+ <%- end -%>
22
+ <%- if @rails -%>
23
+ gem 'capybara', '~> 3.39.1', require: false
24
+ gem 'capybara_minitest_spec', '~> 1.0.7', require: false
25
+ <%- if @repository.public? -%>
26
+ gem 'coveralls', require: false
27
+ <%- end -%>
28
+ gem 'database_cleaner', '~> 2.0.2', require: false
29
+ gem 'erb_lint', require: false
30
+ <%- if @minitest -%>
31
+ gem 'minitest', '>= 5.18.0', require: false
32
+ gem 'minitest-reporters', '>= 1.6.0', require: false
33
+ gem 'minitest-screenshot-reporter', '~> 0.0.6', require: false
34
+ <%- end -%>
35
+ gem 'poltergeist', '~> 1.10.1', require: false
36
+ gem 'quiet_assets'
37
+ gem 'selenium-webdriver', '~> 4.9.1', require: false
38
+ gem 'sqlite3'
39
+ <%- end -%>
40
+ end
41
+
42
+ group :test do
43
+ gem 'rspec-match_ignoring_whitespace'
44
+ end
@@ -0,0 +1,102 @@
1
+ <%- if @repository.public? -%>
2
+ # `<%= gem_name.capitalize %>` [![Gem Version](https://badge.fury.io/rb/<%= gem_name %>.svg)](https://badge.fury.io/rb/<%= gem_name %>)
3
+ <%- else -%>
4
+ # `<%= gem_name.capitalize %>`
5
+ <%- end -%>
6
+
7
+ <%= @todo %>Description of <%= @class_name %>
8
+
9
+
10
+ ## Installation
11
+
12
+ <%- if @jekyll -%>
13
+ Add the following to your Jekyll website's `Gemfile`:
14
+
15
+ ```ruby
16
+ group :jekyll_plugins do
17
+ gem '<%= @gem_name %>'
18
+ end
19
+ ```
20
+ <%- end -%>
21
+ <%- unless @jekyll -%>
22
+ Either add this line to your application&rsquo;s `Gemfile`:
23
+
24
+ ```ruby
25
+ gem '<%= @gem_name %>'
26
+ ```
27
+
28
+ ... or add the following to your application&rsquo;s `.gemspec`:
29
+
30
+ ```ruby
31
+ spec.add_dependency '<%= @gem_name %>'
32
+ ```
33
+ <%- end -%>
34
+
35
+ And then execute:
36
+
37
+ ```shell
38
+ $ bundle
39
+ ```
40
+
41
+
42
+ ## Usage
43
+
44
+ <%= @todo %>Describe how to use this gem
45
+
46
+
47
+ ## Development
48
+
49
+ After checking out this git repository, install dependencies by typing:
50
+
51
+ ```shell
52
+ $ bin/setup
53
+ ```
54
+
55
+ You should do the above before running Visual Studio Code.
56
+
57
+
58
+ ### Run the Tests
59
+
60
+ ```shell
61
+ $ bundle exec rake test
62
+ ```
63
+
64
+
65
+ ### Interactive Session
66
+
67
+ The following will allow you to experiment:
68
+
69
+ ```shell
70
+ $ bin/console
71
+ ```
72
+
73
+
74
+ ### Local Installation
75
+
76
+ To install this gem onto your local machine, type:
77
+
78
+ ```shell
79
+ $ bundle exec rake install
80
+ ```
81
+
82
+
83
+ ### To Release A New Version
84
+
85
+ To create a git tag for the new version, push git commits and tags,
86
+ and push the new version of the gem to <%= @repository.gem_server_url -%>, type:
87
+
88
+ ```shell
89
+ $ bundle exec rake release
90
+ ```
91
+
92
+
93
+ ## Contributing
94
+
95
+ Bug reports and pull requests are welcome at <%= @repository.url %>.
96
+
97
+
98
+ <%- if @repository.public? -%>
99
+ ## License
100
+
101
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
102
+ <%- end -%>
@@ -0,0 +1,51 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << 'test'
6
+ t.libs << 'lib'
7
+ t.test_files = FileList['test/**/*_test.rb']
8
+ end
9
+
10
+ <%- if @engine -%>
11
+ APP_RAKEFILE = File.expand_path('../test/dummy/Rakefile', __FILE__)
12
+ load 'rails/tasks/engine.rake'
13
+
14
+ load 'rails/tasks/statistics.rake'
15
+
16
+ <%- end -%>
17
+ desc 'Bump patch version'
18
+ task :patch do
19
+ system 'gem bump --tag'
20
+ end
21
+
22
+ desc 'Bump minor version'
23
+ task :minor do
24
+ system 'gem bump --version minor --tag'
25
+ end
26
+
27
+ desc 'Bump major version'
28
+ task :major do
29
+ system 'gem bump --version major --tag'
30
+ end
31
+
32
+ task publish: [:build] do
33
+ $VERBOSE = nil
34
+ load '<%= @gem_name %>/version.rb'
35
+ <%- if @repository.private? -%>
36
+ system "gem inabox pkg/<%= @gem_name %>-#{<%= @class_name %>::VERSION}.gem"
37
+ <%- else -%>
38
+ system "gem push pkg/<%= @gem_name %>-#{<%= @class_name %>::VERSION}.gem"
39
+ <%- end -%>
40
+ end
41
+
42
+ desc 'Bump patch version, create git tag, build the gem and release to geminabox (default)'
43
+ task release_patch: %i[test patch publish]
44
+
45
+ desc 'Bump minor version, create git tag, build the gem and release to geminabox'
46
+ task release_minor: %i[test minor publish]
47
+
48
+ desc 'Bump major version, create git tag, build the gem and release to geminabox'
49
+ task release_major: %i[test major publish]
50
+
51
+ task default: :test