Class: Michael::Models::Guard

Inherits:
Command
  • Object
show all
Defined in:
lib/michael/models/guard.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Command

#command, #cursor, #editor, #exec_exist?, #execute, #generator, #pager, #pastel, #platform, #prompt, #screen, #spinner, #which

Constructor Details

#initializeGuard

Returns a new instance of Guard.



11
12
13
14
15
16
17
# File 'lib/michael/models/guard.rb', line 11

def initialize
  @config = Configuration.new
  @repos_config = Configuration.new(config_name: 'repositories')

  token_valid = Github::TokenValidator.token_valid?(config.fetch(:token))
  abort 'Your token is invalid' unless token_valid
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



9
10
11
# File 'lib/michael/models/guard.rb', line 9

def config
  @config
end

#repos_configObject (readonly)

Returns the value of attribute repos_config.



9
10
11
# File 'lib/michael/models/guard.rb', line 9

def repos_config
  @repos_config
end