Class: Jax::Generators::Plugin::Credentials
- Inherits:
-
Object
- Object
- Jax::Generators::Plugin::Credentials
- Defined in:
- lib/jax/generators/plugin/credentials.rb
Instance Attribute Summary collapse
-
#home ⇒ Object
readonly
Returns the value of attribute home.
-
#in ⇒ Object
readonly
Returns the value of attribute in.
-
#out ⇒ Object
readonly
Returns the value of attribute out.
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.
10 11 12 13 14 |
# File 'lib/jax/generators/plugin/credentials.rb', line 10 def initialize( = {}) @home = home_path() @out = [:out] || $stdout || STDOUT @in = [:in] || $stdin || STDIN end |
Instance Attribute Details
#home ⇒ Object (readonly)
Returns the value of attribute home.
4 5 6 |
# File 'lib/jax/generators/plugin/credentials.rb', line 4 def home @home end |
#in ⇒ Object (readonly)
Returns the value of attribute in.
4 5 6 |
# File 'lib/jax/generators/plugin/credentials.rb', line 4 def in @in end |
#out ⇒ Object (readonly)
Returns the value of attribute out.
4 5 6 |
# File 'lib/jax/generators/plugin/credentials.rb', line 4 def out @out end |
Instance Method Details
#api_key ⇒ Object
6 7 8 |
# File 'lib/jax/generators/plugin/credentials.rb', line 6 def api_key @api_key ||= find_api_key end |
#authors ⇒ Object
28 29 30 |
# File 'lib/jax/generators/plugin/credentials.rb', line 28 def @authors ||= RestClient::Resource.new(File.join(Jax.application.plugin_repository_url, "authors"), :accept => :xml) end |
#config_file ⇒ Object
16 17 18 |
# File 'lib/jax/generators/plugin/credentials.rb', line 16 def config_file File.join(home, ".jax") end |
#home_path(options = {}) ⇒ Object
20 21 22 |
# File 'lib/jax/generators/plugin/credentials.rb', line 20 def home_path( = {}) File.([:home] || Thor::Util.user_home) end |
#plugins ⇒ Object
24 25 26 |
# File 'lib/jax/generators/plugin/credentials.rb', line 24 def plugins @plugins ||= RestClient::Resource.new(File.join(Jax.application.plugin_repository_url, "plugins"), :accept => :xml) end |
#profile ⇒ Object
32 33 34 |
# File 'lib/jax/generators/plugin/credentials.rb', line 32 def profile @profile ||= RestClient::Resource.new(File.join(Jax.application.plugin_repository_url, "profile"), :accept => :xml) end |