rootstrap/rsgem

View on GitHub
lib/rsgem/tasks/add_code_analysis.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# frozen_string_literal: true

module RSGem
  module Tasks
    class AddCodeAnalysis < Base
      OUTPUT = OutputStruct.new(name: 'Add code analysis')

      def perform
        File.open(context.rakefile_path, 'w') do |file|
          file.puts rakefile
        end
      end

      private

      def rakefile
        @rakefile ||= File.read("#{File.dirname(__FILE__)}/../support/Rakefile")
      end
    end
  end
end