lib/hanamismith/builders/ci/git_hub.rb in hanamismith-0.34.0 vs lib/hanamismith/builders/ci/git_hub.rb in hanamismith-0.37.0
- old
+ new
@@ -4,30 +4,19 @@
module Hanamismith
module Builders
module CI
# Builds project skeleton GitHub CI configuration.
- class GitHub
+ class GitHub < Rubysmith::Builders::Abstract
using Refinements::Struct
- def self.call(...) = new(...).call
-
- def initialize configuration, builder: Rubysmith::Builder
- @configuration = configuration
- @builder = builder
- end
-
def call
return configuration unless configuration.build_git_hub_ci
path = "%project_name%/.github/workflows/ci.yml.erb"
builder.call(configuration.merge(template_path: path)).render.replace(/\n\n\Z/, "\n")
configuration
end
-
- private
-
- attr_reader :configuration, :builder
end
end
end
end