Sha256: e77e0211a5f180fcf141d26ed0adc0bf730c217cb9df2c4965c81b7aeb3fe9de

Contents?: true

Size: 758 Bytes

Versions: 11

Compression:

Stored size: 758 Bytes

Contents

module Cp8Cli
  module Commands
    class Suggest

      def run
        cache_original_branch

        suggestion_branch.checkout
        suggestion_branch.push
        pull_request.open

        original_branch.checkout
        original_branch.reset
      end

      private

        def cache_original_branch
          original_branch # Keep reference for later
        end

        def original_branch
          @_original_branch ||= Branch.current
        end

        def suggestion_branch
          @_suggestion_branch ||= Branch.suggestion
        end

        def pull_request
          Github::PullRequest.new(
            from: suggestion_branch,
            to: original_branch,
            expand: nil
          )
        end

    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
cp8_cli-9.1.1 lib/cp8_cli/commands/suggest.rb
cp8_cli-9.1.0 lib/cp8_cli/commands/suggest.rb
cp8_cli-9.0.3 lib/cp8_cli/commands/suggest.rb
cp8_cli-9.0.2 lib/cp8_cli/commands/suggest.rb
cp8_cli-9.0.1 lib/cp8_cli/commands/suggest.rb
cp8_cli-9.0.0 lib/cp8_cli/commands/suggest.rb
cp8_cli-8.2.1 lib/cp8_cli/commands/suggest.rb
cp8_cli-8.2.0 lib/cp8_cli/commands/suggest.rb
cp8_cli-8.1.0 lib/cp8_cli/commands/suggest.rb
cp8_cli-8.0.1 lib/cp8_cli/commands/suggest.rb
cp8_cli-8.0.0 lib/cp8_cli/commands/suggest.rb