Sha256: 54f08a92cc69c6e141d01ae82bd5fb64a58b110a0c2b5b00e6dda2b22aed52aa

Contents?: true

Size: 654 Bytes

Versions: 7

Compression:

Stored size: 654 Bytes

Contents

# frozen_string_literal: true

module Gemsmith
  module Generators
    # Generates Git support.
    class Git < Base
      def create_ignore_file
        cli.template "%gem_name%/.gitignore.tt", configuration
      end

      # :reek:TooManyStatements
      def create_repository
        subject = "Added Gemsmith files."
        body = "Built with #{Identity.version_label}."

        Dir.chdir(gem_root) do
          `git init`
          `git add .`
          `git commit --all --no-verify --message "#{subject}" --message "#{body}"`
        end
      end

      def run
        create_ignore_file
        create_repository
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
gemsmith-11.0.1 lib/gemsmith/generators/git.rb
gemsmith-11.0.0 lib/gemsmith/generators/git.rb
gemsmith-10.4.2 lib/gemsmith/generators/git.rb
gemsmith-10.4.1 lib/gemsmith/generators/git.rb
gemsmith-10.4.0 lib/gemsmith/generators/git.rb
gemsmith-10.3.0 lib/gemsmith/generators/git.rb
gemsmith-10.2.0 lib/gemsmith/generators/git.rb