Sha256: 74774e4caf54075324fa85b8eded1b4a149fe157eeca4d1b3a3f60d041482332

Contents?: true

Size: 615 Bytes

Versions: 19

Compression:

Stored size: 615 Bytes

Contents

# frozen_string_literal: true

require "refinements/structs"

module Hanamismith
  module Builders
    module RSpec
      # Builds project skeleton RSpec helper.
      class Helper < Rubysmith::Builders::RSpec::Helper
        using Refinements::Structs

        def call
          return configuration unless configuration.build_rspec

          super
          path = "%project_name%/spec/spec_helper.rb.erb"
          builder.call(configuration.merge(template_path: path))
                 .replace(/require.+#{configuration.project_name}.+\n/, "")
          configuration
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
hanamismith-0.16.0 lib/hanamismith/builders/rspec/helper.rb
hanamismith-0.15.0 lib/hanamismith/builders/rspec/helper.rb
hanamismith-0.14.1 lib/hanamismith/builders/rspec/helper.rb
hanamismith-0.14.0 lib/hanamismith/builders/rspec/helper.rb
hanamismith-0.13.0 lib/hanamismith/builders/rspec/helper.rb
hanamismith-0.12.0 lib/hanamismith/builders/rspec/helper.rb
hanamismith-0.11.0 lib/hanamismith/builders/rspec/helper.rb
hanamismith-0.10.0 lib/hanamismith/builders/rspec/helper.rb
hanamismith-0.9.0 lib/hanamismith/builders/rspec/helper.rb
hanamismith-0.8.0 lib/hanamismith/builders/rspec/helper.rb
hanamismith-0.7.0 lib/hanamismith/builders/rspec/helper.rb
hanamismith-0.6.0 lib/hanamismith/builders/rspec/helper.rb
hanamismith-0.5.0 lib/hanamismith/builders/rspec/helper.rb
hanamismith-0.4.0 lib/hanamismith/builders/rspec/helper.rb
hanamismith-0.3.1 lib/hanamismith/builders/rspec/helper.rb
hanamismith-0.3.0 lib/hanamismith/builders/rspec/helper.rb
hanamismith-0.2.0 lib/hanamismith/builders/rspec/helper.rb
hanamismith-0.1.0 lib/hanamismith/builders/rspec/helper.rb
hanamismith-0.0.0 lib/hanamismith/builders/rspec/helper.rb