Sha256: eaaeaa7f86724cfe0a557ece52394dfd0a8c3b402590a0b4b7a38a01505d3b1c

Contents?: true

Size: 561 Bytes

Versions: 10

Compression:

Stored size: 561 Bytes

Contents

# frozen_string_literal: true

require "refinements/struct"

module Rubysmith
  module Builders
    module RSpec
      # Builds RSpec spec helper for project skeleton.
      class Helper < Abstract
        using Refinements::Struct

        def call
          return false unless settings.build_rspec

          builder.call(settings.merge(template_path: "%project_name%/spec/spec_helper.rb.erb"))
                 .render
                 .replace(/\A\n/, "")
                 .replace("\n\n\n", "\n\n")

          true
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rubysmith-7.9.0 lib/rubysmith/builders/rspec/helper.rb
rubysmith-7.8.0 lib/rubysmith/builders/rspec/helper.rb
rubysmith-7.7.0 lib/rubysmith/builders/rspec/helper.rb
rubysmith-7.6.0 lib/rubysmith/builders/rspec/helper.rb
rubysmith-7.5.0 lib/rubysmith/builders/rspec/helper.rb
rubysmith-7.4.0 lib/rubysmith/builders/rspec/helper.rb
rubysmith-7.3.0 lib/rubysmith/builders/rspec/helper.rb
rubysmith-7.2.0 lib/rubysmith/builders/rspec/helper.rb
rubysmith-7.1.0 lib/rubysmith/builders/rspec/helper.rb
rubysmith-7.0.0 lib/rubysmith/builders/rspec/helper.rb