class RSGem::Tasks::SimpleCovPostInstall

Constants

OUTPUT

Public Instance Methods

perform() click to toggle source
# File lib/rsgem/tasks/simple_cov_post_install.rb, line 7
      def perform
        spec_helper.sub!("require \"#{gem_name}\"", <<~RUBY)
          require 'simplecov'

          SimpleCov.start do
            add_filter '/spec/'
          end

          require '#{gem_name}'
        RUBY

        write
      end

Private Instance Methods

gem_name() click to toggle source
# File lib/rsgem/tasks/simple_cov_post_install.rb, line 23
def gem_name
  context.gem_name
end
spec_helper() click to toggle source
# File lib/rsgem/tasks/simple_cov_post_install.rb, line 27
def spec_helper
  @spec_helper ||= File.read(context.spec_helper_path)
end
write() click to toggle source
# File lib/rsgem/tasks/simple_cov_post_install.rb, line 31
def write
  File.open(context.spec_helper_path, 'w') do |file|
    file.puts spec_helper
  end
end