Sha256: fee52c00231f558e99a95190390cb0f3ce23236f42a4e3cee8c4da2e789c1b2d

Contents?: true

Size: 736 Bytes

Versions: 6

Compression:

Stored size: 736 Bytes

Contents

# frozen_string_literal: true

module Rubysmith
  module Builders
    # Builds project skeleton Rake support.
    class Rake
      def self.call realm, builder: Builder
        new(realm, builder: builder).call
      end

      def initialize realm, builder: Builder
        @realm = realm
        @builder = builder
      end

      def call
        builder.call(realm.with(template_path: "%project_name%/Rakefile.erb"))
               .render
               .replace(/\[\s+/, "[")
               .replace(/\s+\]/, "]")
               .replace("  ", "")
               .replace(/\n+(?=require)/, "\n")
               .replace(/\n{2,}/, "\n\n")
        nil
      end

      private

      attr_reader :realm, :builder
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rubysmith-0.9.1 lib/rubysmith/builders/rake.rb
rubysmith-0.9.0 lib/rubysmith/builders/rake.rb
rubysmith-0.8.0 lib/rubysmith/builders/rake.rb
rubysmith-0.7.0 lib/rubysmith/builders/rake.rb
rubysmith-0.6.1 lib/rubysmith/builders/rake.rb
rubysmith-0.6.0 lib/rubysmith/builders/rake.rb