class Transpec::CommitMessage

Public Class Methods

new(report, rspec_version, cli_args = []) click to toggle source
# File lib/transpec/commit_message.rb, line 7
def initialize(report, rspec_version, cli_args = [])
  @report = report
  @rspec_version = rspec_version
  @cli_args = cli_args
end

Public Instance Methods

smart_cli_args() click to toggle source
# File lib/transpec/commit_message.rb, line 28
def smart_cli_args
  @cli_args.map do |arg|
    if arg.include?(' ')
      arg.inspect
    else
      arg
    end
  end.join(' ')
end
to_s() click to toggle source
# File lib/transpec/commit_message.rb, line 13
    def to_s
      conversion_summary = @report.summary(bullet: '*', separate_by_blank_line: true)

      <<-END.gsub(/^\s+\|/, '').chomp
        |Convert specs to RSpec #{@rspec_version} syntax with Transpec
        |
        |This conversion is done by Transpec #{Transpec::Version} with the following command:
        |    transpec #{smart_cli_args}
        |
        |#{conversion_summary}
        |
        |For more details: https://github.com/yujinakayama/transpec#supported-conversions
      END
    end