Class: V1gittools::BaseTool
- Inherits:
-
Object
- Object
- V1gittools::BaseTool
- Defined in:
- lib/v1gittools/base_tool.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#git ⇒ Object
readonly
Returns the value of attribute git.
-
#github ⇒ Object
readonly
Returns the value of attribute github.
-
#repo_config ⇒ Object
readonly
Returns the value of attribute repo_config.
-
#v1 ⇒ Object
readonly
Returns the value of attribute v1.
Instance Method Summary collapse
- #check_proper_init ⇒ Object
-
#initialize(args = nil) ⇒ BaseTool
constructor
A new instance of BaseTool.
Constructor Details
#initialize(args = nil) ⇒ BaseTool
Returns a new instance of BaseTool.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/v1gittools/base_tool.rb', line 5 def initialize args=nil @args = args @config = V1gittools::config check_proper_init @repo_config = V1gittools::repo_config git_root_path = `git rev-parse --show-toplevel`.strip @git = Git.open(git_root_path) @v1 = VersiononeSdk::Client.new(@config[:v1config]) @github = Github.new(Hash[@config[:github].map{ |k, v| [k.to_sym, v] }]) end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
3 4 5 |
# File 'lib/v1gittools/base_tool.rb', line 3 def args @args end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
3 4 5 |
# File 'lib/v1gittools/base_tool.rb', line 3 def config @config end |
#git ⇒ Object (readonly)
Returns the value of attribute git.
3 4 5 |
# File 'lib/v1gittools/base_tool.rb', line 3 def git @git end |
#github ⇒ Object (readonly)
Returns the value of attribute github.
3 4 5 |
# File 'lib/v1gittools/base_tool.rb', line 3 def github @github end |
#repo_config ⇒ Object (readonly)
Returns the value of attribute repo_config.
3 4 5 |
# File 'lib/v1gittools/base_tool.rb', line 3 def repo_config @repo_config end |
#v1 ⇒ Object (readonly)
Returns the value of attribute v1.
3 4 5 |
# File 'lib/v1gittools/base_tool.rb', line 3 def v1 @v1 end |
Instance Method Details
#check_proper_init ⇒ Object
18 19 20 21 22 23 |
# File 'lib/v1gittools/base_tool.rb', line 18 def check_proper_init if @config[:github] && @config[:github][:oauth_token] == 'AUTOGENERATE' puts "v1git has not been setup for this repository yet. Please run #{$0} init to initialize and setup v1git." exit end end |