lib/rubysmith/builders/git/commit.rb in rubysmith-0.9.1 vs lib/rubysmith/builders/git/commit.rb in rubysmith-0.10.0
- old
+ new
@@ -3,43 +3,39 @@
module Rubysmith
module Builders
module Git
# Builds project skeleton initial Git commit message.
class Commit
- def self.call realm, builder: Builder
- new(realm, builder: builder).call
- end
+ def self.call(configuration, builder: Builder) = new(configuration, builder: builder).call
- def initialize realm, builder: Builder
- @realm = realm
+ def initialize configuration, builder: Builder
+ @configuration = configuration
@builder = builder
end
def call
- return unless realm.build_git
+ return unless configuration.build_git
- builder.call(realm)
+ builder.call(configuration)
.run("git add .", chdir: project_name)
.run(
%(git commit --all --message "Added project skeleton" --message "#{body}"),
chdir: project_name
)
end
private
- attr_reader :realm, :builder
+ attr_reader :configuration, :builder
def body
<<~CONTENT
Generated with [#{Identity::LABEL}]("https://www.alchemists.io/projects/rubysmith")
#{Identity::VERSION}.
CONTENT
end
- def project_name
- realm.project_name
- end
+ def project_name = configuration.project_name
end
end
end
end