Class: Jax::Generators::Plugin::Credentials

Inherits:
Object
  • Object
show all
Defined in:
lib/jax/generators/plugin/credentials.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options = {})
  @home = home_path(options)
  @out = options[:out] || $stdout || STDOUT
  @in = options[:in] || $stdin || STDIN
end

Instance Attribute Details

#homeObject (readonly)

Returns the value of attribute home.



4
5
6
# File 'lib/jax/generators/plugin/credentials.rb', line 4

def home
  @home
end

#inObject (readonly)

Returns the value of attribute in.



4
5
6
# File 'lib/jax/generators/plugin/credentials.rb', line 4

def in
  @in
end

#outObject (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_keyObject



6
7
8
# File 'lib/jax/generators/plugin/credentials.rb', line 6

def api_key
  @api_key ||= find_api_key
end

#authorsObject



28
29
30
# File 'lib/jax/generators/plugin/credentials.rb', line 28

def authors
  @authors ||= RestClient::Resource.new(File.join(Jax.application.plugin_repository_url, "authors"), :accept => :xml)
end

#config_fileObject



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(options = {})
  File.expand_path(options[:home] || Thor::Util.user_home)
end

#pluginsObject



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

#profileObject



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