Class: Jax::Plugin::Credentials
- Inherits:
-
Object
- Object
- Jax::Plugin::Credentials
- Defined in:
- lib/generators/jax/base/plugin_credentials.rb
Instance Attribute Summary collapse
-
#home ⇒ Object
readonly
Returns the value of attribute home.
-
#shell ⇒ Object
readonly
Returns the value of attribute shell.
Instance Method Summary collapse
- #api_key ⇒ Object
- #authors ⇒ Object
- #config_file ⇒ Object
- #home_path(options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Credentials
constructor
A new instance of Credentials.
- #plugins ⇒ Object
- #profile ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Credentials
Returns a new instance of Credentials.
11 12 13 14 |
# File 'lib/generators/jax/base/plugin_credentials.rb', line 11 def initialize( = {}) @shell = [:shell] || Thor::Shell::Basic.new @home = home_path() end |
Instance Attribute Details
#home ⇒ Object (readonly)
Returns the value of attribute home.
5 6 7 |
# File 'lib/generators/jax/base/plugin_credentials.rb', line 5 def home @home end |
#shell ⇒ Object (readonly)
Returns the value of attribute shell.
5 6 7 |
# File 'lib/generators/jax/base/plugin_credentials.rb', line 5 def shell @shell end |
Instance Method Details
#api_key ⇒ Object
7 8 9 |
# File 'lib/generators/jax/base/plugin_credentials.rb', line 7 def api_key @api_key ||= find_api_key end |
#authors ⇒ Object
28 29 30 |
# File 'lib/generators/jax/base/plugin_credentials.rb', line 28 def @authors ||= RestClient::Resource.new(File.join(Jax.config.plugin_repository_url, "authors"), :accept => :xml) end |
#config_file ⇒ Object
16 17 18 |
# File 'lib/generators/jax/base/plugin_credentials.rb', line 16 def config_file File.join(home, ".jax") end |
#home_path(options = {}) ⇒ Object
20 21 22 |
# File 'lib/generators/jax/base/plugin_credentials.rb', line 20 def home_path( = {}) File.([:home] || Thor::Util.user_home) end |