Sha256: 19f9d7507a1b829ea682d37cd1dccaaa577ea42640ce7d88511e04e276873b61
Contents?: true
Size: 904 Bytes
Versions: 22
Compression:
Stored size: 904 Bytes
Contents
# frozen_string_literal: true require "refinements/structs" module Rubysmith module Builders # Builds project skeleton Rake support. class Rake using Refinements::Structs def self.call(...) = new(...).call def initialize configuration, builder: Builder @configuration = configuration @builder = builder end def call return configuration unless configuration.build_rake builder.call(configuration.merge(template_path: "%project_name%/Rakefile.erb")) .render .replace(/\[\s+/, "[") .replace(/\s+\]/, "]") .replace(" ", "") .replace("task.", " task.") .replace(/\n+(?=require)/, "\n") .replace(/\n{2,}/, "\n\n") configuration end private attr_reader :configuration, :builder end end end
Version data entries
22 entries across 22 versions & 1 rubygems
Version | Path |
---|---|
rubysmith-1.1.1 | lib/rubysmith/builders/rake.rb |
rubysmith-1.1.0 | lib/rubysmith/builders/rake.rb |