Sha256: 05639f887768c19f866aab239e430830133ddf4c7dd83081706698df4aece33c

Contents?: true

Size: 725 Bytes

Versions: 6

Compression:

Stored size: 725 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(/\A\n+/, "")
               .replace(/\[\s+/, "[")
               .replace(/\s+\]/, "]")
               .replace(/\n{2,}/, "\n\n")
               .replace("  ", "")
        nil
      end

      private

      attr_reader :realm, :builder
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rubysmith-0.5.0 lib/rubysmith/builders/rake.rb
rubysmith-0.4.0 lib/rubysmith/builders/rake.rb
rubysmith-0.3.0 lib/rubysmith/builders/rake.rb
rubysmith-0.2.0 lib/rubysmith/builders/rake.rb
rubysmith-0.1.1 lib/rubysmith/builders/rake.rb
rubysmith-0.1.0 lib/rubysmith/builders/rake.rb