Sha256: 542a4ef6f76cc1b27cd8b8c7a24b617fd828f9d4cbfd9b19c0912b49aa371e8f

Contents?: true

Size: 823 Bytes

Versions: 10

Compression:

Stored size: 823 Bytes

Contents

# frozen_string_literal: true

module Rubysmith
  module Builders
    module Git
      # Builds project skeleton initial Git commit message.
      class Commit < Abstract
        include Import[:specification]

        def call
          return false unless settings.build_git

          builder.call(settings)
                 .run("git add .", chdir: project_name)
                 .run(
                   %(git commit --all --message "Added project skeleton" --message "#{body}"),
                   chdir: project_name
                 )

          true
        end

        private

        def body
          "Generated with link:#{specification.homepage_url}[#{specification.label}] " \
          "#{specification.version}."
        end

        def project_name = settings.project_name
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rubysmith-7.9.0 lib/rubysmith/builders/git/commit.rb
rubysmith-7.8.0 lib/rubysmith/builders/git/commit.rb
rubysmith-7.7.0 lib/rubysmith/builders/git/commit.rb
rubysmith-7.6.0 lib/rubysmith/builders/git/commit.rb
rubysmith-7.5.0 lib/rubysmith/builders/git/commit.rb
rubysmith-7.4.0 lib/rubysmith/builders/git/commit.rb
rubysmith-7.3.0 lib/rubysmith/builders/git/commit.rb
rubysmith-7.2.0 lib/rubysmith/builders/git/commit.rb
rubysmith-7.1.0 lib/rubysmith/builders/git/commit.rb
rubysmith-7.0.0 lib/rubysmith/builders/git/commit.rb