Class: PairProgrammer::Configuration
- Inherits:
 - 
      Object
      
        
- Object
 - PairProgrammer::Configuration
 
 
- Defined in:
 - lib/pairprogrammer/configuration.rb
 
Constant Summary collapse
- @@api_key =
 nil
Class Method Summary collapse
- .absolute_path(relative_path) ⇒ Object
 - .api_key ⇒ Object
 - .api_key=(api_key) ⇒ Object
 - .development? ⇒ Boolean
 - .python_command ⇒ Object
 - .python_command=(python_command) ⇒ Object
 - .root ⇒ Object
 - .root=(root) ⇒ Object
 
Class Method Details
.absolute_path(relative_path) ⇒ Object
      22 23 24  | 
    
      # File 'lib/pairprogrammer/configuration.rb', line 22 def self.absolute_path(relative_path) File.join(root, relative_path) end  | 
  
.api_key ⇒ Object
      10 11 12  | 
    
      # File 'lib/pairprogrammer/configuration.rb', line 10 def self.api_key @@api_key || ENV["PEAR_PROGRAMMER_API_KEY"] end  | 
  
.api_key=(api_key) ⇒ Object
      14 15 16  | 
    
      # File 'lib/pairprogrammer/configuration.rb', line 14 def self.api_key=(api_key) @@api_key = api_key end  | 
  
.development? ⇒ Boolean
      39 40 41  | 
    
      # File 'lib/pairprogrammer/configuration.rb', line 39 def self.development? ENV["PEAR_PROGRAMMER_ENV"] == "development" end  | 
  
.python_command ⇒ Object
      26 27 28  | 
    
      # File 'lib/pairprogrammer/configuration.rb', line 26 def self.python_command @@python_command end  | 
  
.python_command=(python_command) ⇒ Object
      30 31 32 33 34 35 36 37  | 
    
      # File 'lib/pairprogrammer/configuration.rb', line 30 def self.python_command=(python_command) available_commands = ["python", "python2", "python3"] if available_commands.include?(python_command) @@python_command = python_command else raise "Invalid python command - #{python_command} - command must be one of #{available_commands}" end end  | 
  
.root ⇒ Object
      6 7 8  | 
    
      # File 'lib/pairprogrammer/configuration.rb', line 6 def self.root @@root || ENV["PEAR_PROGRAMMER_ROOT"] end  |