Class: Wheelbarrow::Config

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/wheelbarrow/config.rb

Instance Method Summary collapse

Instance Method Details

#bitbucket_oauth_configObject



20
21
22
23
24
25
# File 'lib/wheelbarrow/config.rb', line 20

def bitbucket_oauth_config
  { site: 'https://bitbucket.org',
    request_token_path: '/!api/1.0/oauth/request_token',
    authorize_path: '/!api/1.0/oauth/authenticate',
    access_token_path: '/!api/1.0/oauth/access_token' }
end

#dump(config) ⇒ Object



14
15
16
17
18
# File 'lib/wheelbarrow/config.rb', line 14

def dump(config)
  create_config_dir

  File.open(config_file_path, 'w') { |f| YAML.dump config, f  }
end

#fetchObject



8
9
10
11
12
# File 'lib/wheelbarrow/config.rb', line 8

def fetch
  YAML.load_file config_file_path
rescue Errno::ENOENT
  {}
end