Module: RComponent::Trusted

Extended by:
Trusted
Included in:
Trusted
Defined in:
lib/rails_component.rb

Instance Method Summary collapse

Instance Method Details

#apply(component) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/rails_component.rb', line 25

def apply(component)
  info = fetch_info['trusted'][component]
  remote_url = info['url']
  if info['type'] == 'component'
    puts "Applying component from #{remote_url}"
    RComponent::Applier.remote(remote_url, Dir.pwd)
  elsif info['type'] == 'recept'
    puts "Applying recept from #{remote_url}"
    RComponent::Applier.remote_recept(remote_url, Dir.pwd)
  end
end

#fetch_infoObject



37
38
39
# File 'lib/rails_component.rb', line 37

def fetch_info
  @info ||= YAML::load(open(RComponent::Trusted::URL))
end

#listObject



21
22
23
# File 'lib/rails_component.rb', line 21

def list
  fetch_info['trusted'].keys
end