gemsmith 5.6.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - checksums.yaml.gz.sig +0 -0
 - data.tar.gz.sig +4 -3
 - data/README.md +90 -54
 - data/lib/gemsmith.rb +0 -1
 - data/lib/gemsmith/aids/gem.rb +24 -0
 - data/lib/gemsmith/aids/git.rb +10 -0
 - data/lib/gemsmith/aids/spec.rb +41 -0
 - data/lib/gemsmith/cli.rb +26 -11
 - data/lib/gemsmith/cli_helpers.rb +20 -69
 - data/lib/gemsmith/configuration.rb +189 -0
 - data/lib/gemsmith/identity.rb +2 -2
 - data/lib/gemsmith/rake/build.rb +17 -19
 - data/lib/gemsmith/rake/tasks.rb +11 -9
 - data/lib/gemsmith/skeletons/base_skeleton.rb +6 -9
 - data/lib/gemsmith/skeletons/bundler_skeleton.rb +1 -1
 - data/lib/gemsmith/skeletons/cli_skeleton.rb +3 -7
 - data/lib/gemsmith/skeletons/documentation_skeleton.rb +17 -5
 - data/lib/gemsmith/skeletons/gem_skeleton.rb +4 -4
 - data/lib/gemsmith/skeletons/git_skeleton.rb +2 -2
 - data/lib/gemsmith/skeletons/guard_skeleton.rb +2 -6
 - data/lib/gemsmith/skeletons/pry_skeleton.rb +11 -0
 - data/lib/gemsmith/skeletons/rails_skeleton.rb +21 -19
 - data/lib/gemsmith/skeletons/rake_skeleton.rb +10 -15
 - data/lib/gemsmith/skeletons/rspec_skeleton.rb +8 -12
 - data/lib/gemsmith/skeletons/rubocop_skeleton.rb +3 -7
 - data/lib/gemsmith/skeletons/ruby_skeleton.rb +1 -1
 - data/lib/gemsmith/skeletons/travis_skeleton.rb +2 -6
 - data/lib/gemsmith/templates/%gem_name%/%gem_name%.gemspec.tt +23 -29
 - data/lib/gemsmith/templates/%gem_name%/.gitignore.tt +0 -1
 - data/lib/gemsmith/templates/%gem_name%/.rubocop.yml.tt +3 -1
 - data/lib/gemsmith/templates/%gem_name%/.ruby-version.tt +1 -1
 - data/lib/gemsmith/templates/%gem_name%/.travis.yml.tt +3 -4
 - data/lib/gemsmith/templates/%gem_name%/CODE_OF_CONDUCT.md.tt +18 -9
 - data/lib/gemsmith/templates/%gem_name%/Guardfile.tt +1 -1
 - data/lib/gemsmith/templates/%gem_name%/LICENSE.md.tt +1 -1
 - data/lib/gemsmith/templates/%gem_name%/README.md.tt +25 -22
 - data/lib/gemsmith/templates/%gem_name%/Rakefile.tt +1 -1
 - data/lib/gemsmith/templates/%gem_name%/bin/%gem_name%.tt +5 -5
 - data/lib/gemsmith/templates/%gem_name%/gemfiles/rails-%rails_version%.x.gemfile.tt +5 -0
 - data/lib/gemsmith/templates/%gem_name%/lib/%gem_name%.rb.tt +3 -3
 - data/lib/gemsmith/templates/%gem_name%/lib/%gem_name%/cli.rb.tt +7 -7
 - data/lib/gemsmith/templates/%gem_name%/lib/%gem_name%/engine.rb.tt +2 -2
 - data/lib/gemsmith/templates/%gem_name%/lib/%gem_name%/identity.rb.tt +5 -5
 - data/lib/gemsmith/templates/%gem_name%/lib/generators/%gem_name%/install/USAGE.tt +2 -2
 - data/lib/gemsmith/templates/%gem_name%/lib/generators/%gem_name%/install/install_generator.rb.tt +2 -2
 - data/lib/gemsmith/templates/%gem_name%/lib/generators/%gem_name%/upgrade/USAGE.tt +2 -2
 - data/lib/gemsmith/templates/%gem_name%/lib/generators/%gem_name%/upgrade/upgrade_generator.rb.tt +2 -2
 - data/lib/gemsmith/templates/%gem_name%/lib/{%gem_name%/tasks → tasks}/rspec.rake.tt +0 -0
 - data/lib/gemsmith/templates/%gem_name%/lib/{%gem_name%/tasks → tasks}/rubocop.rake.tt +0 -0
 - data/lib/gemsmith/templates/%gem_name%/spec/lib/%gem_name%/%gem_name%_spec.rb.tt +1 -1
 - data/lib/gemsmith/templates/%gem_name%/spec/spec_helper.rb.tt +5 -16
 - data/lib/gemsmith/templates/%gem_name%/spec/support/extensions/pry.rb.tt +6 -0
 - data/lib/{gemsmith/tasks → tasks}/rspec.rake +0 -0
 - data/lib/{gemsmith/tasks → tasks}/rubocop.rake +0 -0
 - metadata +47 -15
 - metadata.gz.sig +0 -0
 - data/lib/gemsmith/cli_options.rb +0 -103
 - data/lib/gemsmith/kit.rb +0 -12
 - 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  
     | 
| 
       6 
     | 
    
         
            -
                    cli. 
     | 
| 
      
 5 
     | 
    
         
            +
                  def rails?
         
     | 
| 
      
 6 
     | 
    
         
            +
                    cli.run "command -v rails > /dev/null"
         
     | 
| 
       7 
7 
     | 
    
         
             
                  end
         
     | 
| 
       8 
8 
     | 
    
         | 
| 
       9 
     | 
    
         
            -
                  def  
     | 
| 
       10 
     | 
    
         
            -
                     
     | 
| 
      
 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 
     | 
    
         
            -
                     
     | 
| 
       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. 
     | 
| 
       20 
     | 
    
         
            -
                    cli. 
     | 
| 
       21 
     | 
    
         
            -
                    cli.remove_file "#{gem_name}/ 
     | 
| 
       22 
     | 
    
         
            -
                    cli.remove_file "#{gem_name}/ 
     | 
| 
      
 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",  
     | 
| 
       28 
     | 
    
         
            -
                    cli.template "#{generator_root}/install/USAGE.tt",  
     | 
| 
       29 
     | 
    
         
            -
                    cli.template "#{generator_root}/upgrade/upgrade_generator.rb.tt",  
     | 
| 
       30 
     | 
    
         
            -
                    cli.template "#{generator_root}/upgrade/USAGE.tt",  
     | 
| 
      
 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  
     | 
| 
       35 
     | 
    
         
            -
                    cli.template "%gem_name%/gemfiles/rails 
     | 
| 
      
 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  
     | 
| 
      
 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",  
     | 
| 
      
 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  
     | 
| 
       20 
     | 
    
         
            -
                     
     | 
| 
      
 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 
     | 
    
         
            -
                     
     | 
| 
       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  
     | 
| 
       31 
     | 
    
         
            -
                    cli.append_to_file "%gem_name%/Rakefile",  
     | 
| 
      
 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  
     | 
| 
      
 6 
     | 
    
         
            +
                    return unless configuration.create_rspec?
         
     | 
| 
       11 
7 
     | 
    
         | 
| 
       12 
     | 
    
         
            -
                    cli.template "%gem_name%/lib 
     | 
| 
       13 
     | 
    
         
            -
                    cli.template "#{rspec_root}/spec_helper.rb.tt",  
     | 
| 
       14 
     | 
    
         
            -
                    cli.template "#{rspec_root}/lib/%gem_name%/%gem_name%_spec.rb.tt",  
     | 
| 
       15 
     | 
    
         
            -
                    cli.template "#{rspec_root}/support/kit/default_config.rb.tt",  
     | 
| 
       16 
     | 
    
         
            -
                    cli.template "#{rspec_root}/support/kit/stderr.rb.tt",  
     | 
| 
       17 
     | 
    
         
            -
                    cli.template "#{rspec_root}/support/kit/stdout.rb.tt",  
     | 
| 
       18 
     | 
    
         
            -
                    cli.template "#{rspec_root}/support/kit/temp_dir.rb.tt",  
     | 
| 
      
 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  
     | 
| 
      
 6 
     | 
    
         
            +
                    return unless configuration.create_rubocop?
         
     | 
| 
       11 
7 
     | 
    
         | 
| 
       12 
     | 
    
         
            -
                    cli.template "%gem_name%/.rubocop.yml.tt",  
     | 
| 
       13 
     | 
    
         
            -
                    cli.template "%gem_name%/lib 
     | 
| 
      
 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
         
     | 
| 
         @@ -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  
     | 
| 
       11 
     | 
    
         
            -
                    cli.template "%gem_name%/.travis.yml.tt",  
     | 
| 
      
 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 
     | 
| 
      
 2 
     | 
    
         
            +
            require "<%= config.fetch(:gem).fetch(:name) %>/identity"
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
       4 
4 
     | 
    
         
             
            Gem::Specification.new do |spec|
         
     | 
| 
       5 
     | 
    
         
            -
              spec.name = <%= config 
     | 
| 
       6 
     | 
    
         
            -
              spec.version = <%= config 
     | 
| 
       7 
     | 
    
         
            -
              spec.platform = <%= config 
     | 
| 
       8 
     | 
    
         
            -
              spec.authors = ["<%= config 
     | 
| 
       9 
     | 
    
         
            -
              spec.email = ["<%= config 
     | 
| 
       10 
     | 
    
         
            -
              spec.homepage = "<%= config 
     | 
| 
      
 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 
     | 
| 
      
 15 
     | 
    
         
            +
              <%- if config.fetch(:create).fetch(:security) -%>
         
     | 
| 
       19 
16 
     | 
    
         
             
              if ENV["RUBY_GEM_SECURITY"] == "enabled"
         
     | 
| 
       20 
     | 
    
         
            -
                spec.signing_key = File.expand_path("<%= config 
     | 
| 
       21 
     | 
    
         
            -
                spec.cert_chain = [File.expand_path("<%= config 
     | 
| 
      
 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 
     | 
| 
      
 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 
     | 
| 
       30 
     | 
    
         
            -
              spec.add_dependency "rails", "~> <%= config 
     | 
| 
      
 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 
     | 
| 
      
 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 
     | 
| 
       45 
     | 
    
         
            -
               
     | 
| 
       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 
     | 
| 
      
 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 
     | 
| 
      
 48 
     | 
    
         
            +
              <%- if config.fetch(:create).fetch(:rubocop) -%>
         
     | 
| 
       55 
49 
     | 
    
         
             
              spec.add_development_dependency "rubocop"
         
     | 
| 
       56 
50 
     | 
    
         
             
              <%- end -%>
         
     | 
| 
       57 
     | 
    
         
            -
              <%- if config 
     | 
| 
      
 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 
     | 
| 
       64 
     | 
    
         
            -
              spec.executables << "<%= config 
     | 
| 
      
 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,4 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            <%- if config 
     | 
| 
      
 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 
     | 
| 
      
 1 
     | 
    
         
            +
            <%= config.fetch(:versions).fetch(:ruby) %>
         
     | 
| 
         @@ -1,10 +1,9 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            language: ruby
         
     | 
| 
       2 
2 
     | 
    
         
             
            rvm:
         
     | 
| 
       3 
     | 
    
         
            -
              -  
     | 
| 
       4 
     | 
    
         
            -
             
     | 
| 
       5 
     | 
    
         
            -
            <%- if config[:rails] -%>
         
     | 
| 
      
 3 
     | 
    
         
            +
              - <%= config.fetch(:versions).fetch(:ruby) %>
         
     | 
| 
      
 4 
     | 
    
         
            +
            <%- if config.fetch(:create).fetch(:rails) -%>
         
     | 
| 
       6 
5 
     | 
    
         
             
            gemfile:
         
     | 
| 
       7 
     | 
    
         
            -
              - gemfiles/rails 
     | 
| 
      
 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 
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
            project  
     | 
| 
      
 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  
     | 
| 
       30 
     | 
    
         
            -
             
     | 
| 
      
 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 
     | 
    
         
            -
             
     | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
      
 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 
     | 
| 
      
 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 
     | 
| 
      
 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 
     | 
| 
      
 1 
     | 
    
         
            +
            # <%= config.fetch(:gem).fetch(:class) %>
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
     | 
    
         
            -
            [.fetch(:name) %>.svg)](http://badge.fury.io/rb/<%= config.fetch(:gem).fetch(:name) %>)
         
     | 
| 
      
 4 
     | 
    
         
            +
            <%- if config.fetch(:create).fetch(:code_climate) -%>
         
     | 
| 
      
 5 
     | 
    
         
            +
            [.fetch(:name) %>.svg)](https://codeclimate.com/github/<%= config.fetch :github_user %>/<%= config.fetch(:gem).fetch(:name) %>)
         
     | 
| 
      
 6 
     | 
    
         
            +
            [.fetch(:name) %>/coverage.svg)](https://codeclimate.com/github/<%= config.fetch :github_user %>/<%= config.fetch(:gem).fetch(:name) %>)
         
     | 
| 
       7 
7 
     | 
    
         
             
            <%- end -%>
         
     | 
| 
       8 
     | 
    
         
            -
            <%- if config 
     | 
| 
       9 
     | 
    
         
            -
            [.fetch(:gemnasium) -%>
         
     | 
| 
      
 9 
     | 
    
         
            +
            [.fetch(:name) %>.svg)](https://gemnasium.com/<%= config.fetch :github_user %>/<%= config.fetch(:gem).fetch(:name) %>)
         
     | 
| 
       10 
10 
     | 
    
         
             
            <%- end -%>
         
     | 
| 
       11 
     | 
    
         
            -
            <%- if config 
     | 
| 
       12 
     | 
    
         
            -
            [.fetch(:travis) -%>
         
     | 
| 
      
 12 
     | 
    
         
            +
            [.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 
     | 
    
         
            +
            [](https://www.patreon.com/<%= config.fetch :github_user %>)
         
     | 
| 
       13 
16 
     | 
    
         
             
            <%- end -%>
         
     | 
| 
       14 
17 
     | 
    
         | 
| 
       15 
     | 
    
         
            -
            <!--  
     | 
| 
       16 
     | 
    
         
            -
            <!--  
     | 
| 
      
 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 
     | 
| 
      
 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 
     | 
| 
      
 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 
     | 
| 
      
 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 
     | 
| 
      
 42 
     | 
    
         
            +
                gem install <%= config.fetch(:gem).fetch(:name) %>
         
     | 
| 
       40 
43 
     | 
    
         
             
            <%- else -%>
         
     | 
| 
       41 
44 
     | 
    
         
             
            To install, type the following:
         
     | 
| 
       42 
45 
     | 
    
         | 
| 
       43 
     | 
    
         
            -
                gem install <%= config 
     | 
| 
      
 46 
     | 
    
         
            +
                gem install <%= config.fetch(:gem).fetch(:name) %>
         
     | 
| 
       44 
47 
     | 
    
         
             
            <%- end -%>
         
     | 
| 
       45 
48 
     | 
    
         | 
| 
       46 
     | 
    
         
            -
            <%-  
     | 
| 
      
 49 
     | 
    
         
            +
            <%- unless config.fetch(:create).fetch(:cli) -%>
         
     | 
| 
       47 
50 
     | 
    
         
             
            Add the following to your Gemfile:
         
     | 
| 
       48 
51 
     | 
    
         | 
| 
       49 
     | 
    
         
            -
                gem "<%= config 
     | 
| 
      
 52 
     | 
    
         
            +
                gem "<%= config.fetch(:gem).fetch(:name) %>"
         
     | 
| 
       50 
53 
     | 
    
         
             
            <%- end -%>
         
     | 
| 
       51 
54 
     | 
    
         | 
| 
       52 
55 
     | 
    
         
             
            # Usage
         
     | 
| 
       53 
56 
     | 
    
         | 
| 
       54 
     | 
    
         
            -
            <%- if config 
     | 
| 
      
 57 
     | 
    
         
            +
            <%- if config.fetch(:create).fetch(:rspec) -%>
         
     | 
| 
       55 
58 
     | 
    
         
             
            # Tests
         
     | 
| 
       56 
59 
     | 
    
         | 
| 
       57 
60 
     | 
    
         
             
            To test, run:
         
     | 
| 
       58 
61 
     | 
    
         | 
| 
       59 
     | 
    
         
            -
                bundle exec  
     | 
| 
      
 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 
     | 
| 
      
 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 
     | 
| 
      
 94 
     | 
    
         
            +
            Developed by [<%= config.fetch(:author).fetch(:name) %>](<%= config.fetch(:author).fetch(:url) %>) at [<%= config.fetch(:organization).fetch(:name) %>](<%= config.fetch(:organization).fetch(:url) %>).
         
     |