gemsmith 5.6.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +4 -3
  4. data/README.md +90 -54
  5. data/lib/gemsmith.rb +0 -1
  6. data/lib/gemsmith/aids/gem.rb +24 -0
  7. data/lib/gemsmith/aids/git.rb +10 -0
  8. data/lib/gemsmith/aids/spec.rb +41 -0
  9. data/lib/gemsmith/cli.rb +26 -11
  10. data/lib/gemsmith/cli_helpers.rb +20 -69
  11. data/lib/gemsmith/configuration.rb +189 -0
  12. data/lib/gemsmith/identity.rb +2 -2
  13. data/lib/gemsmith/rake/build.rb +17 -19
  14. data/lib/gemsmith/rake/tasks.rb +11 -9
  15. data/lib/gemsmith/skeletons/base_skeleton.rb +6 -9
  16. data/lib/gemsmith/skeletons/bundler_skeleton.rb +1 -1
  17. data/lib/gemsmith/skeletons/cli_skeleton.rb +3 -7
  18. data/lib/gemsmith/skeletons/documentation_skeleton.rb +17 -5
  19. data/lib/gemsmith/skeletons/gem_skeleton.rb +4 -4
  20. data/lib/gemsmith/skeletons/git_skeleton.rb +2 -2
  21. data/lib/gemsmith/skeletons/guard_skeleton.rb +2 -6
  22. data/lib/gemsmith/skeletons/pry_skeleton.rb +11 -0
  23. data/lib/gemsmith/skeletons/rails_skeleton.rb +21 -19
  24. data/lib/gemsmith/skeletons/rake_skeleton.rb +10 -15
  25. data/lib/gemsmith/skeletons/rspec_skeleton.rb +8 -12
  26. data/lib/gemsmith/skeletons/rubocop_skeleton.rb +3 -7
  27. data/lib/gemsmith/skeletons/ruby_skeleton.rb +1 -1
  28. data/lib/gemsmith/skeletons/travis_skeleton.rb +2 -6
  29. data/lib/gemsmith/templates/%gem_name%/%gem_name%.gemspec.tt +23 -29
  30. data/lib/gemsmith/templates/%gem_name%/.gitignore.tt +0 -1
  31. data/lib/gemsmith/templates/%gem_name%/.rubocop.yml.tt +3 -1
  32. data/lib/gemsmith/templates/%gem_name%/.ruby-version.tt +1 -1
  33. data/lib/gemsmith/templates/%gem_name%/.travis.yml.tt +3 -4
  34. data/lib/gemsmith/templates/%gem_name%/CODE_OF_CONDUCT.md.tt +18 -9
  35. data/lib/gemsmith/templates/%gem_name%/Guardfile.tt +1 -1
  36. data/lib/gemsmith/templates/%gem_name%/LICENSE.md.tt +1 -1
  37. data/lib/gemsmith/templates/%gem_name%/README.md.tt +25 -22
  38. data/lib/gemsmith/templates/%gem_name%/Rakefile.tt +1 -1
  39. data/lib/gemsmith/templates/%gem_name%/bin/%gem_name%.tt +5 -5
  40. data/lib/gemsmith/templates/%gem_name%/gemfiles/rails-%rails_version%.x.gemfile.tt +5 -0
  41. data/lib/gemsmith/templates/%gem_name%/lib/%gem_name%.rb.tt +3 -3
  42. data/lib/gemsmith/templates/%gem_name%/lib/%gem_name%/cli.rb.tt +7 -7
  43. data/lib/gemsmith/templates/%gem_name%/lib/%gem_name%/engine.rb.tt +2 -2
  44. data/lib/gemsmith/templates/%gem_name%/lib/%gem_name%/identity.rb.tt +5 -5
  45. data/lib/gemsmith/templates/%gem_name%/lib/generators/%gem_name%/install/USAGE.tt +2 -2
  46. data/lib/gemsmith/templates/%gem_name%/lib/generators/%gem_name%/install/install_generator.rb.tt +2 -2
  47. data/lib/gemsmith/templates/%gem_name%/lib/generators/%gem_name%/upgrade/USAGE.tt +2 -2
  48. data/lib/gemsmith/templates/%gem_name%/lib/generators/%gem_name%/upgrade/upgrade_generator.rb.tt +2 -2
  49. data/lib/gemsmith/templates/%gem_name%/lib/{%gem_name%/tasks → tasks}/rspec.rake.tt +0 -0
  50. data/lib/gemsmith/templates/%gem_name%/lib/{%gem_name%/tasks → tasks}/rubocop.rake.tt +0 -0
  51. data/lib/gemsmith/templates/%gem_name%/spec/lib/%gem_name%/%gem_name%_spec.rb.tt +1 -1
  52. data/lib/gemsmith/templates/%gem_name%/spec/spec_helper.rb.tt +5 -16
  53. data/lib/gemsmith/templates/%gem_name%/spec/support/extensions/pry.rb.tt +6 -0
  54. data/lib/{gemsmith/tasks → tasks}/rspec.rake +0 -0
  55. data/lib/{gemsmith/tasks → tasks}/rubocop.rake +0 -0
  56. metadata +47 -15
  57. metadata.gz.sig +0 -0
  58. data/lib/gemsmith/cli_options.rb +0 -103
  59. data/lib/gemsmith/kit.rb +0 -12
  60. data/lib/gemsmith/templates/%gem_name%/gemfiles/rails-4.1.x.gemfile.tt +0 -5
@@ -2,42 +2,44 @@ module Gemsmith
2
2
  module Skeletons
3
3
  # Configures Ruby on Rails support.
4
4
  class RailsSkeleton < BaseSkeleton
5
- def enabled?
6
- cli.template_options.key?(:rails) && cli.template_options[:rails]
5
+ def rails?
6
+ cli.run "command -v rails > /dev/null"
7
7
  end
8
8
 
9
- def rails?
10
- system "command -v rails"
9
+ def install_rails
10
+ return if rails?
11
+ return unless cli.yes?("Ruby on Rails is not installed. Would you like to install it (y/n)?")
12
+ cli.run "gem install rails"
11
13
  end
12
14
 
13
15
  def create_engine
14
- cli.template "#{lib_root}/%gem_name%/engine.rb.tt", cli.template_options
15
-
16
- gem_name = cli.template_options.fetch :gem_name
17
- system "rails plugin new --skip #{gem_name} #{engine_options}"
16
+ gem_name = configuration.gem_name
18
17
 
19
- cli.remove_file "#{gem_name}/app/helpers/#{gem_name}/application_helper.rb", cli.template_options
20
- cli.remove_file "#{gem_name}/lib/#{gem_name}/version.rb", cli.template_options
21
- cli.remove_file "#{gem_name}/MIT-LICENSE", cli.template_options
22
- cli.remove_file "#{gem_name}/README.rdoc", cli.template_options
18
+ cli.template "#{lib_root}/%gem_name%/engine.rb.tt", configuration.to_h
19
+ cli.run "rails plugin new --skip #{gem_name} #{engine_options}"
20
+ cli.remove_file "#{gem_name}/app/helpers/#{gem_name}/application_helper.rb", configuration.to_h
21
+ cli.remove_file "#{gem_name}/lib/#{gem_name}/version.rb", configuration.to_h
22
+ cli.remove_file "#{gem_name}/MIT-LICENSE", configuration.to_h
23
+ cli.remove_file "#{gem_name}/README.rdoc", configuration.to_h
23
24
  end
24
25
 
25
26
  def create_generator_files
26
27
  cli.empty_directory "#{generator_root}/templates"
27
- cli.template "#{generator_root}/install/install_generator.rb.tt", cli.template_options
28
- cli.template "#{generator_root}/install/USAGE.tt", cli.template_options
29
- cli.template "#{generator_root}/upgrade/upgrade_generator.rb.tt", cli.template_options
30
- cli.template "#{generator_root}/upgrade/USAGE.tt", cli.template_options
28
+ cli.template "#{generator_root}/install/install_generator.rb.tt", configuration.to_h
29
+ cli.template "#{generator_root}/install/USAGE.tt", configuration.to_h
30
+ cli.template "#{generator_root}/upgrade/upgrade_generator.rb.tt", configuration.to_h
31
+ cli.template "#{generator_root}/upgrade/USAGE.tt", configuration.to_h
31
32
  end
32
33
 
33
34
  def create_travis_gemfiles
34
- return unless cli.template_options[:travis]
35
- cli.template "%gem_name%/gemfiles/rails-4.1.x.gemfile.tt", cli.template_options
35
+ return unless configuration.create_travis?
36
+ cli.template "%gem_name%/gemfiles/rails-%rails_version%.x.gemfile.tt", configuration.to_h
36
37
  end
37
38
 
38
39
  def create
39
- return unless enabled? && rails?
40
+ return unless configuration.create_rails?
40
41
 
42
+ install_rails
41
43
  create_engine
42
44
  create_generator_files
43
45
  create_travis_gemfiles
@@ -2,33 +2,28 @@ module Gemsmith
2
2
  module Skeletons
3
3
  # Configures Rake support.
4
4
  class RakeSkeleton < BaseSkeleton
5
- def self.allowed_options
6
- {
7
- rspec: "spec",
8
- rubocop: "rubocop"
9
- }
10
- end
11
-
12
5
  def create
13
- cli.template "%gem_name%/Rakefile.tt", cli.template_options
6
+ cli.template "%gem_name%/Rakefile.tt", configuration.to_h
14
7
  configure_rakefile
15
8
  end
16
9
 
17
10
  private
18
11
 
19
- def allowed_options?
20
- cli.template_options.keys.any? { |key| self.class.allowed_options.keys.include? key }
12
+ def rspec_task
13
+ "spec" if configuration.create_rspec?
14
+ end
15
+
16
+ def rubocop_task
17
+ "rubocop" if configuration.create_rubocop?
21
18
  end
22
19
 
23
20
  def default_tasks
24
- cli.template_options.each.with_object([]) do |(key, _), tasks|
25
- tasks.push self.class.allowed_options[key]
26
- end
21
+ [rspec_task, rubocop_task].compact
27
22
  end
28
23
 
29
24
  def configure_rakefile
30
- return unless allowed_options?
31
- cli.append_to_file "%gem_name%/Rakefile", "\ntask default: %w(#{default_tasks.compact.join(' ')})\n"
25
+ return if default_tasks.empty?
26
+ cli.append_to_file "%gem_name%/Rakefile", %(\ntask default: %w(#{default_tasks.join(" ")})\n)
32
27
  end
33
28
  end
34
29
  end
@@ -2,20 +2,16 @@ module Gemsmith
2
2
  module Skeletons
3
3
  # Configures RSpec support.
4
4
  class RspecSkeleton < BaseSkeleton
5
- def enabled?
6
- cli.template_options.key?(:rspec) && cli.template_options[:rspec]
7
- end
8
-
9
5
  def create
10
- return unless enabled?
6
+ return unless configuration.create_rspec?
11
7
 
12
- cli.template "%gem_name%/lib/%gem_name%/tasks/rspec.rake.tt", cli.template_options
13
- cli.template "#{rspec_root}/spec_helper.rb.tt", cli.template_options
14
- cli.template "#{rspec_root}/lib/%gem_name%/%gem_name%_spec.rb.tt", cli.template_options
15
- cli.template "#{rspec_root}/support/kit/default_config.rb.tt", cli.template_options
16
- cli.template "#{rspec_root}/support/kit/stderr.rb.tt", cli.template_options
17
- cli.template "#{rspec_root}/support/kit/stdout.rb.tt", cli.template_options
18
- cli.template "#{rspec_root}/support/kit/temp_dir.rb.tt", cli.template_options
8
+ cli.template "%gem_name%/lib/tasks/rspec.rake.tt", configuration.to_h
9
+ cli.template "#{rspec_root}/spec_helper.rb.tt", configuration.to_h
10
+ cli.template "#{rspec_root}/lib/%gem_name%/%gem_name%_spec.rb.tt", configuration.to_h
11
+ cli.template "#{rspec_root}/support/kit/default_config.rb.tt", configuration.to_h
12
+ cli.template "#{rspec_root}/support/kit/stderr.rb.tt", configuration.to_h
13
+ cli.template "#{rspec_root}/support/kit/stdout.rb.tt", configuration.to_h
14
+ cli.template "#{rspec_root}/support/kit/temp_dir.rb.tt", configuration.to_h
19
15
  end
20
16
 
21
17
  private
@@ -2,15 +2,11 @@ module Gemsmith
2
2
  module Skeletons
3
3
  # Configures Rubocop support.
4
4
  class RubocopSkeleton < BaseSkeleton
5
- def enabled?
6
- cli.template_options.key?(:rubocop) && cli.template_options[:rubocop]
7
- end
8
-
9
5
  def create
10
- return unless enabled?
6
+ return unless configuration.create_rubocop?
11
7
 
12
- cli.template "%gem_name%/.rubocop.yml.tt", cli.template_options
13
- cli.template "%gem_name%/lib/%gem_name%/tasks/rubocop.rake.tt", cli.template_options
8
+ cli.template "%gem_name%/.rubocop.yml.tt", configuration.to_h
9
+ cli.template "%gem_name%/lib/tasks/rubocop.rake.tt", configuration.to_h
14
10
  end
15
11
  end
16
12
  end
@@ -3,7 +3,7 @@ module Gemsmith
3
3
  # Configures Ruby support.
4
4
  class RubySkeleton < BaseSkeleton
5
5
  def create
6
- cli.template "%gem_name%/.ruby-version.tt", cli.template_options
6
+ cli.template "%gem_name%/.ruby-version.tt", configuration.to_h
7
7
  end
8
8
  end
9
9
  end
@@ -2,13 +2,9 @@ module Gemsmith
2
2
  module Skeletons
3
3
  # Configures Travis CI support.
4
4
  class TravisSkeleton < BaseSkeleton
5
- def enabled?
6
- cli.template_options.key?(:travis) && cli.template_options[:travis]
7
- end
8
-
9
5
  def create
10
- return unless enabled?
11
- cli.template "%gem_name%/.travis.yml.tt", cli.template_options
6
+ return unless configuration.create_travis?
7
+ cli.template "%gem_name%/.travis.yml.tt", configuration.to_h
12
8
  end
13
9
  end
14
10
  end
@@ -1,67 +1,61 @@
1
1
  $LOAD_PATH.push File.expand_path("../lib", __FILE__)
2
- require "<%=config[:gem_name]%>/identity"
2
+ require "<%= config.fetch(:gem).fetch(:name) %>/identity"
3
3
 
4
4
  Gem::Specification.new do |spec|
5
- spec.name = <%= config[:gem_class] %>::Identity.name
6
- spec.version = <%= config[:gem_class] %>::Identity.version
7
- spec.platform = <%= config[:gem_platform] %>
8
- spec.authors = ["<%= config[:author_name] %>"]
9
- spec.email = ["<%= config[:author_email] %>"]
10
- spec.homepage = "<%= config[:gem_url] %>"
5
+ spec.name = <%= config.fetch(:gem).fetch(:class) %>::Identity.name
6
+ spec.version = <%= config.fetch(:gem).fetch(:class) %>::Identity.version
7
+ spec.platform = <%= config.fetch(:gem).fetch(:platform) %>
8
+ spec.authors = ["<%= config.fetch(:author).fetch(:name) %>"]
9
+ spec.email = ["<%= config.fetch(:author).fetch(:email) %>"]
10
+ spec.homepage = "<%= config.fetch(:gem).fetch(:home_url) %>"
11
11
  spec.summary = "TODO: Add gem summary here."
12
12
  spec.description = "TODO: Add gem description here."
13
13
  spec.license = "MIT"
14
- <%- if config[:post_install_message] -%>
15
- spec.post_install_message = "<%= config[:post_install_message] %>"
16
- <%- end -%>
17
14
 
18
- <%- if config[:security] -%>
15
+ <%- if config.fetch(:create).fetch(:security) -%>
19
16
  if ENV["RUBY_GEM_SECURITY"] == "enabled"
20
- spec.signing_key = File.expand_path("<%= config[:gem_private_key] %>")
21
- spec.cert_chain = [File.expand_path("<%= config[:gem_public_key] %>")]
17
+ spec.signing_key = File.expand_path("<%= config.fetch(:gem).fetch(:private_key) %>")
18
+ spec.cert_chain = [File.expand_path("<%= config.fetch(:gem).fetch(:public_key) %>")]
22
19
  end
23
20
  <%- end -%>
24
21
 
25
- <%- if config[:bin] -%>
22
+ <%- if config.fetch(:create).fetch(:cli) -%>
26
23
  spec.add_dependency "thor"
27
24
  spec.add_dependency "thor_plus"
28
25
  <%- end -%>
29
- <%- if config[:rails] -%>
30
- spec.add_dependency "rails", "~> <%= config[:rails_version] %>"
26
+ <%- if config.fetch(:create).fetch(:rails) -%>
27
+ spec.add_dependency "rails", "~> <%= config.fetch(:versions).fetch(:rails) %>"
31
28
  <%- end -%>
32
- <%- if config[:travis] -%>
33
29
  spec.add_development_dependency "rake"
34
- <%- end -%>
35
30
  spec.add_development_dependency "gemsmith"
36
- <%- if config[:pry] -%>
31
+ <%- if config.fetch(:create).fetch(:pry) -%>
37
32
  spec.add_development_dependency "pry"
38
33
  spec.add_development_dependency "pry-byebug"
39
- spec.add_development_dependency "pry-state"
40
- spec.add_development_dependency "pry-stack_explorer"
41
34
  spec.add_development_dependency "pry-remote"
35
+ spec.add_development_dependency "pry-state"
42
36
  spec.add_development_dependency "pry-rescue"
37
+ spec.add_development_dependency "pry-stack_explorer"
43
38
  <%- end -%>
44
- <%- if config[:rspec] -%>
45
- <%- rspec_gem = config[:rails] ? "rspec-rails" : "rspec" -%>
46
- spec.add_development_dependency "<%= rspec_gem %>"
39
+ <%- if config.fetch(:create).fetch(:rspec) -%>
40
+ spec.add_development_dependency "<%= config.fetch(:create).fetch(:rails) ? "rspec-rails" : "rspec" %>"
47
41
  <%- end -%>
48
- <%- if config[:guard] -%>
42
+ <%- if config.fetch(:create).fetch(:guard) -%>
49
43
  spec.add_development_dependency "rb-fsevent" # Guard file events for OSX.
50
44
  spec.add_development_dependency "guard-rspec"
51
45
  spec.add_development_dependency "terminal-notifier"
52
46
  spec.add_development_dependency "terminal-notifier-guard"
53
47
  <%- end -%>
54
- <%- if config[:rubocop] -%>
48
+ <%- if config.fetch(:create).fetch(:rubocop) -%>
55
49
  spec.add_development_dependency "rubocop"
56
50
  <%- end -%>
57
- <%- if config[:code_climate] -%>
51
+ <%- if config.fetch(:create).fetch(:code_climate) -%>
58
52
  spec.add_development_dependency "codeclimate-test-reporter"
59
53
  <%- end -%>
60
54
 
61
55
  spec.files = Dir["lib/**/*", "vendor/**/*"]
62
56
  spec.extra_rdoc_files = Dir["README*", "LICENSE*"]
63
- <%- if config[:bin] -%>
64
- spec.executables << "<%= config[:gem_name] %>"
57
+ <%- if config.fetch(:create).fetch(:cli) -%>
58
+ spec.executables << "<%= config.fetch(:gem).fetch(:name) %>"
65
59
  <%- end -%>
66
60
  spec.require_paths = ["lib"]
67
61
  end
@@ -1,4 +1,3 @@
1
1
  *.gem
2
2
  .bundle
3
3
  pkg/*
4
- spec/tmp
@@ -1,4 +1,4 @@
1
- <%- if config[:rails] -%>
1
+ <%- if config.fetch(:create).fetch(:rails) -%>
2
2
  AllCops:
3
3
  RunRailsCops: true
4
4
  Exclude:
@@ -21,5 +21,7 @@ Style/SpaceInsideHashLiteralBraces:
21
21
  EnforcedStyle: no_space
22
22
  Style/StringLiterals:
23
23
  EnforcedStyle: double_quotes
24
+ Style/StringLiteralsInInterpolation:
25
+ EnforcedStyle: double_quotes
24
26
  Metrics/LineLength:
25
27
  Max: 120
@@ -1 +1 @@
1
- <%= config[:ruby_version] %>
1
+ <%= config.fetch(:versions).fetch(:ruby) %>
@@ -1,10 +1,9 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.0.0
4
- - 2.1.0
5
- <%- if config[:rails] -%>
3
+ - <%= config.fetch(:versions).fetch(:ruby) %>
4
+ <%- if config.fetch(:create).fetch(:rails) -%>
6
5
  gemfile:
7
- - gemfiles/rails-4.1.x.gemfile
6
+ - gemfiles/rails-<%= config.fetch(:versions).fetch(:rails) %>.x.gemfile
8
7
  <%- end -%>
9
8
  script: bundle exec rake
10
9
  notifications:
@@ -15,19 +15,28 @@ Examples of unacceptable behavior by participants include:
15
15
  * Trolling or insulting/derogatory comments
16
16
  * Public or private harassment
17
17
  * Publishing other's private information, such as physical or electronic addresses, without explicit permission
18
- * Other unethical or unprofessional conduct.
18
+ * Other unethical or unprofessional conduct
19
19
 
20
20
  Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
21
- issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project
22
- maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this
23
- project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the
24
- project team.
21
+ issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any
22
+ contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
23
+
24
+ By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these
25
+ principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of
26
+ Conduct may be permanently removed from the project team.
25
27
 
26
28
  This code of conduct applies both within project spaces and in public spaces when an individual is representing the
27
29
  project or its community.
28
30
 
29
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting
30
- one or more of the project maintainers.
31
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting a project maintainer
32
+ at [INSERT EMAIL ADDRESS]. All complaints will be reviewed and investigated and will result in a response that is deemed
33
+ necessary and appropriate to the circumstances. Maintainers are obligated to maintain confidentiality with regard to the
34
+ reporter of an incident.
35
+
36
+
37
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
38
+ version 1.3.0, available at
39
+ [http://contributor-covenant.org/version/1/3/0/][version]
31
40
 
32
- This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0,
33
- available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
41
+ [homepage]: http://contributor-covenant.org
42
+ [version]: http://contributor-covenant.org/version/1/3/0/
@@ -2,7 +2,7 @@ guard :rspec, cmd: "bundle exec rspec" do
2
2
  watch(%r(^spec/.+_spec\.rb$))
3
3
  watch(%r(^lib/(.+)\.rb$)) { |m| "spec/lib/#{m[1]}_spec.rb" }
4
4
  watch("spec/spec_helper.rb") { "spec" }
5
- <%- if config[:rails] -%>
5
+ <%- if config.fetch(:create).fetch(:rails) -%>
6
6
 
7
7
  # Rails
8
8
  watch(%r(^app/(.+)\.rb$)) { |m| "spec/#{m[1]}_spec.rb" }
@@ -1,4 +1,4 @@
1
- Copyright (c) <%= config[:year] %> [<%= config[:company_name] %>](<%= config[:company_url] %>).
1
+ Copyright (c) <%= config.fetch(:year) %> [<%= config.fetch(:organization).fetch(:name) %>](<%= config.fetch(:organization).fetch(:url) %>).
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -1,62 +1,65 @@
1
- # <%= config[:gem_class] %>
1
+ # <%= config.fetch(:gem).fetch(:class) %>
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/<%= config[:gem_name] %>.svg)](http://badge.fury.io/rb/<%= config[:gem_name] %>)
4
- <%- if config[:code_climate] -%>
5
- [![Code Climate GPA](https://codeclimate.com/github/<%= config[:github_user] %>/<%= config[:gem_name] %>.svg)](https://codeclimate.com/github/<%= config[:github_user] %>/<%= config[:gem_name] %>)
6
- [![Code Climate Coverage](https://codeclimate.com/github/<%= config[:github_user] %>/<%= config[:gem_name] %>/coverage.svg)](https://codeclimate.com/github/<%= config[:github_user] %>/<%= config[:gem_name] %>)
3
+ [![Gem Version](https://badge.fury.io/rb/<%= config.fetch(:gem).fetch(:name) %>.svg)](http://badge.fury.io/rb/<%= config.fetch(:gem).fetch(:name) %>)
4
+ <%- if config.fetch(:create).fetch(:code_climate) -%>
5
+ [![Code Climate GPA](https://codeclimate.com/github/<%= config.fetch :github_user %>/<%= config.fetch(:gem).fetch(:name) %>.svg)](https://codeclimate.com/github/<%= config.fetch :github_user %>/<%= config.fetch(:gem).fetch(:name) %>)
6
+ [![Code Climate Coverage](https://codeclimate.com/github/<%= config.fetch :github_user %>/<%= config.fetch(:gem).fetch(:name) %>/coverage.svg)](https://codeclimate.com/github/<%= config.fetch :github_user %>/<%= config.fetch(:gem).fetch(:name) %>)
7
7
  <%- end -%>
8
- <%- if config[:gemnasium] -%>
9
- [![Gemnasium Status](https://gemnasium.com/<%= config[:github_user] %>/<%= config[:gem_name] %>.svg)](https://gemnasium.com/<%= config[:github_user] %>/<%= config[:gem_name] %>)
8
+ <%- if config.fetch(:create).fetch(:gemnasium) -%>
9
+ [![Gemnasium Status](https://gemnasium.com/<%= config.fetch :github_user %>/<%= config.fetch(:gem).fetch(:name) %>.svg)](https://gemnasium.com/<%= config.fetch :github_user %>/<%= config.fetch(:gem).fetch(:name) %>)
10
10
  <%- end -%>
11
- <%- if config[:travis] -%>
12
- [![Travis CI Status](https://secure.travis-ci.org/<%= config[:github_user] %>/<%= config[:gem_name] %>.svg)](http://travis-ci.org/<%= config[:github_user] %>/<%= config[:gem_name] %>)
11
+ <%- if config.fetch(:create).fetch(:travis) -%>
12
+ [![Travis CI Status](https://secure.travis-ci.org/<%= config.fetch :github_user %>/<%= config.fetch(:gem).fetch(:name) %>.svg)](http://travis-ci.org/<%= config.fetch :github_user %>/<%= config.fetch(:gem).fetch(:name) %>)
13
+ <%- end -%>
14
+ <%- if config.fetch(:create).fetch(:patreon) -%>
15
+ [![Patreon](https://img.shields.io/badge/patreon-donate-brightgreen.svg)](https://www.patreon.com/<%= config.fetch :github_user %>)
13
16
  <%- end -%>
14
17
 
15
- <!-- START doctoc - For use by DocToc (https://github.com/thlorenz/doctoc), autogenerates the table of contents -->
16
- <!-- END doctoc -->
18
+ <!-- Tocer[start]: Auto-generated, don't remove. -->
19
+ <!-- Tocer[finish]: Auto-generated, don't remove. -->
17
20
 
18
21
  # Features
19
22
 
20
23
  # Requirements
21
24
 
22
- <%- if config[:rails] -%>
25
+ <%- if config.fetch(:create).fetch(:rails) -%>
23
26
  0. [Ruby on Rails](http://rubyonrails.org).
24
27
  <%- end -%>
25
28
 
26
29
  # Setup
27
30
 
28
- <%- if config[:security] -%>
31
+ <%- if config.fetch(:create).fetch(:security) -%>
29
32
  For a secure install, type the following (recommended):
30
33
 
31
34
  gem cert --add <(curl -Ls http://www.my-website.com/gem-public.pem)
32
- gem install <%= config[:gem_name] %> --trust-policy MediumSecurity
35
+ gem install <%= config.fetch(:gem).fetch(:name) %> --trust-policy MediumSecurity
33
36
 
34
37
  NOTE: A HighSecurity trust policy would be best but MediumSecurity enables signed gem verification while
35
38
  allowing the installation of unsigned dependencies since they are beyond the scope of this gem.
36
39
 
37
40
  For an insecure install, type the following (not recommended):
38
41
 
39
- gem install <%= config[:gem_name] %>
42
+ gem install <%= config.fetch(:gem).fetch(:name) %>
40
43
  <%- else -%>
41
44
  To install, type the following:
42
45
 
43
- gem install <%= config[:gem_name] %>
46
+ gem install <%= config.fetch(:gem).fetch(:name) %>
44
47
  <%- end -%>
45
48
 
46
- <%- if config[:rails] -%>
49
+ <%- unless config.fetch(:create).fetch(:cli) -%>
47
50
  Add the following to your Gemfile:
48
51
 
49
- gem "<%= config[:gem_name] %>"
52
+ gem "<%= config.fetch(:gem).fetch(:name) %>"
50
53
  <%- end -%>
51
54
 
52
55
  # Usage
53
56
 
54
- <%- if config[:rspec] -%>
57
+ <%- if config.fetch(:create).fetch(:rspec) -%>
55
58
  # Tests
56
59
 
57
60
  To test, run:
58
61
 
59
- bundle exec rspec spec
62
+ bundle exec rake
60
63
  <%- end -%>
61
64
 
62
65
  # Versioning
@@ -78,7 +81,7 @@ Read [CONTRIBUTING](CONTRIBUTING.md) for details.
78
81
 
79
82
  # License
80
83
 
81
- Copyright (c) <%= config[:year] %> [<%= config[:company_name] %>](<%= config[:company_url] %>).
84
+ Copyright (c) <%= config.fetch :year %> [<%= config.fetch(:organization).fetch(:name) %>](<%= config.fetch(:organization).fetch(:url) %>).
82
85
  Read the [LICENSE](LICENSE.md) for details.
83
86
 
84
87
  # History
@@ -88,4 +91,4 @@ Built with [Gemsmith](https://github.com/bkuhlmann/gemsmith).
88
91
 
89
92
  # Credits
90
93
 
91
- Developed by [<%= config[:author_name] %>](<%= config[:author_url] %>) at [<%= config[:company_name] %>](<%= config[:company_url] %>).
94
+ Developed by [<%= config.fetch(:author).fetch(:name) %>](<%= config.fetch(:author).fetch(:url) %>) at [<%= config.fetch(:organization).fetch(:name) %>](<%= config.fetch(:organization).fetch(:url) %>).