-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* master: Support releasing feature branch from any repo update docs bump version Support optional branch name for git review command Bump version Remove unnecessary aggregate_branch method Add Thegarage::Gitx::Configuration class Fix bug creating double authorizations Fix mutating getter antipattern remove project name from token note DRY up use of paths bump version Store github authorization token globally add debug output bump version Retry failed authorization instead of exiting. Add custom configuration
- Loading branch information
Showing
19 changed files
with
310 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,6 @@ pkg | |
|
||
## bundler | ||
Gemfile.lock | ||
|
||
## RSpec temp files | ||
spec/tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
require 'yaml' | ||
|
||
module Thegarage | ||
module Gitx | ||
class Configuration | ||
DEFAULT_CONFIG = { | ||
'aggregate_branches' => %w( staging prototype ), | ||
'reserved_branches' => %w( HEAD master next_release staging prototype ), | ||
'taggable_branches' => %w( master staging ) | ||
} | ||
CONFIG_FILE = '.gitx.yml' | ||
|
||
attr_reader :config | ||
|
||
def initialize(root_dir) | ||
@config = Thor::CoreExt::HashWithIndifferentAccess.new(DEFAULT_CONFIG) | ||
config_file_path = File.join(root_dir, CONFIG_FILE) | ||
if File.exists?(config_file_path) | ||
@config.merge!(::YAML::load_file(config_file_path)) | ||
end | ||
end | ||
|
||
def aggregate_branches | ||
config[:aggregate_branches] | ||
end | ||
def aggregate_branch?(branch) | ||
aggregate_branches.include?(branch) | ||
end | ||
|
||
def reserved_branches | ||
config[:reserved_branches] | ||
end | ||
|
||
def reserved_branch?(branch) | ||
reserved_branches.include?(branch) | ||
end | ||
|
||
def taggable_branches | ||
config[:taggable_branches] | ||
end | ||
|
||
def taggable_branch?(branch) | ||
taggable_branches.include?(branch) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module Thegarage | ||
module Gitx | ||
VERSION = '2.10.1' | ||
VERSION = '2.13.0' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# helper for reading global config file | ||
module GlobalConfig | ||
def global_config_file | ||
config_file = File.join(temp_dir, '.config/gitx/github.yml') | ||
config_dir = File.dirname(config_file) | ||
FileUtils.mkdir_p(config_dir) unless File.exists?(config_dir) | ||
config_file | ||
end | ||
def global_config | ||
YAML.load_file(global_config_file) | ||
end | ||
def temp_dir | ||
tmp_dir = File.join(__dir__, '../tmp') | ||
end | ||
end | ||
|
||
RSpec.configure do |config| | ||
config.include GlobalConfig | ||
|
||
config.before do | ||
FileUtils.rm_rf(temp_dir) | ||
FileUtils.mkdir_p(temp_dir) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Swap home directory to current project spec/tmp | ||
# to allow for writing files + cleanup | ||
RSpec.configure do |config| | ||
config.before do | ||
@old_home = ENV['HOME'] | ||
ENV['HOME'] = temp_dir | ||
end | ||
config.after do | ||
ENV['HOME'] = @old_home | ||
end | ||
end |
Oops, something went wrong.