Class: Github::CLI
- Inherits:
-
Thor
- Object
- Thor
- Github::CLI
- Defined in:
- lib/github/cli.rb,
lib/github/cli/shell_helpers.rb
Defined Under Namespace
Modules: ShellHelpers
Constant Summary collapse
- CONFIG_FILE_PATH =
File.('~/.github-cli.yml')
Class Attribute Summary collapse
-
.config ⇒ Object
readonly
Returns the value of attribute config.
-
.repository ⇒ Object
readonly
Returns the value of attribute repository.
-
.repository_dir ⇒ Object
readonly
Returns the value of attribute repository_dir.
Class Method Summary collapse
Class Attribute Details
.config ⇒ Object (readonly)
Returns the value of attribute config.
14 15 16 |
# File 'lib/github/cli.rb', line 14 def config @config end |
.repository ⇒ Object (readonly)
Returns the value of attribute repository.
14 15 16 |
# File 'lib/github/cli.rb', line 14 def repository @repository end |
.repository_dir ⇒ Object (readonly)
Returns the value of attribute repository_dir.
14 15 16 |
# File 'lib/github/cli.rb', line 14 def repository_dir @repository_dir end |
Class Method Details
.configure_repository(dir) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/github/cli.rb', line 16 def configure_repository(dir) return @repository if @repository @repository_dir = dir begin @repository = Github::Repository.new(@repository_dir) rescue Github::Repository::InvalidRepositoryDirectory parent_dir = File.('..', @repository_dir) if @repository_dir != parent_dir @repository_dir = parent_dir retry end end end |
.load_config ⇒ Object
32 33 34 35 |
# File 'lib/github/cli.rb', line 32 def load_config @config = YAML.load_file(CONFIG_FILE_PATH) @config end |