Sha256: 874604e9341d7c67744387e0029167c7f86c30c1bfbada12c1601f1ae03e98aa

Contents?: true

Size: 1.38 KB

Versions: 4

Compression:

Stored size: 1.38 KB

Contents

require "pastel"

require_relative "../commands/gem"
require_relative "vcs"

module Autowow
  module Features
    module Gem
      include EasyLogging
      include Commands::Gem
      include Commands::Vcs
      include Executor

      def gem_release
        pretty_with_output.run(git_status)
        start_branch = Vcs.working_branch
        logger.error("Not on master.") and return unless start_branch.eql?("master")
        pretty.run(push)

        Vcs.on_branch("release") do
          pretty.run(pull)
          pretty.run(rebase(start_branch))
          pretty_with_output.run(release)
        end

        pretty_with_output.run(git_status)
      end

      def gem_clean
        pretty_with_output.run(clean)
      end

      def rubocop_parallel_autocorrect
        pastel = Pastel.new
        result = pretty_with_output.run!(rubocop_parallel)
        if result.failed?
          filtered = result.out.each_line.select { |line| line.match(%r{(.*):([0-9]*):([0-9]*):}) }
                       .map { |line| line.split(":")[0] }
                       .uniq
                       .map { |line| pastel.strip(line) }
          pretty_with_output.run(rubocop_autocorrect(filtered)) if filtered.any?
        end
      end

      def bundle_exec(cmd)
        Autowow::Executor.pretty_with_output.run(["bundle", "exec"] + cmd)
      end

      include ReflectionUtils::CreateModuleFunctions
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
autowow-0.9.4 lib/autowow/features/gem.rb
autowow-0.9.3 lib/autowow/features/gem.rb
autowow-0.9.2 lib/autowow/features/gem.rb
autowow-0.9.1 lib/autowow/features/gem.rb