Class: Jirify::Config
- Inherits:
-
Object
- Object
- Jirify::Config
- Defined in:
- lib/jirify/config.rb
Class Method Summary collapse
- .atlassian_url ⇒ Object
- .client_options ⇒ Object
- .config_file ⇒ Object
- .initialized? ⇒ Boolean
- .issue_browse_url ⇒ Object
- .options ⇒ Object
- .write(config) ⇒ Object
Class Method Details
.atlassian_url ⇒ Object
26 27 28 |
# File 'lib/jirify/config.rb', line 26 def atlassian_url ['site'] end |
.client_options ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/jirify/config.rb', line 34 def { :username => ['username'], :password => ['token'], :site => atlassian_url, :context_path => '', :auth_type => :basic, } end |
.config_file ⇒ Object
17 18 19 |
# File 'lib/jirify/config.rb', line 17 def config_file @config_file ||= "#{Dir.home}/.jirify" end |
.initialized? ⇒ Boolean
6 7 8 |
# File 'lib/jirify/config.rb', line 6 def initialized? File.exists? config_file end |
.issue_browse_url ⇒ Object
30 31 32 |
# File 'lib/jirify/config.rb', line 30 def issue_browse_url "#{atlassian_url}/browse/" end |
.options ⇒ Object
21 22 23 24 |
# File 'lib/jirify/config.rb', line 21 def raise StandardError unless initialized? ||= YAML.load_file(config_file)['options'] end |
.write(config) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/jirify/config.rb', line 10 def write(config) puts "Writing config:" puts config.to_yaml File.write(config_file, config.to_yaml) end |