Module: RComponent::Trusted
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_info ⇒ Object
37 38 39 |
# File 'lib/rails_component.rb', line 37 def fetch_info @info ||= YAML::load(open(RComponent::Trusted::URL)) end |
#list ⇒ Object
21 22 23 |
# File 'lib/rails_component.rb', line 21 def list fetch_info['trusted'].keys end |