Class: SugarJar::Commands
- Inherits:
-
Object
- Object
- SugarJar::Commands
- Defined in:
- lib/sugarjar/commands.rb
Overview
This is the workhorse of SugarJar. Short of #initialize, all other public methods are “commands”. Anything in private is internal implementation details.
Constant Summary collapse
- MAIN_BRANCHES =
%w{master main}.freeze
Instance Method Summary collapse
-
#initialize(options) ⇒ Commands
constructor
A new instance of Commands.
Constructor Details
#initialize(options) ⇒ Commands
Returns a new instance of Commands.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/sugarjar/commands.rb', line 26 def initialize() SugarJar::Log.debug("Commands.initialize options: #{}") @ignore_dirty = ['ignore_dirty'] @ignore_prerun_failure = ['ignore_prerun_failure'] @repo_config = SugarJar::RepoConfig.config SugarJar::Log.debug("Repoconfig: #{@repo_config}") @color = ['color'] @pr_autofill = ['pr_autofill'] @pr_autostack = ['pr_autostack'] @feature_prefix = ['feature_prefix'] @checks = {} @main_branch = nil @main_remote_branches = {} @ghuser = @repo_config['github_user'] || ['github_user'] @ghhost = @repo_config['github_host'] || ['github_host'] die("No 'gh' found, please install 'gh'") unless gh_avail? # Tell the 'gh' cli where to talk to, if not github.com ENV['GH_HOST'] = @ghhost if @ghhost return if ['no_change'] set_commit_template if @repo_config['commit_template'] end |