lib/appjam/generators/search.rb in appjam-0.1.8.pre12 vs lib/appjam/generators/search.rb in appjam-0.1.8.pre13

- old
+ new

@@ -44,10 +44,18 @@ self.destination_root = options[:root] puts puts colorize("Available Options contains [#{@gist_name}]") puts require 'yaml' - g = YAML.load_file(File.expand_path(File.dirname(__FILE__) + '/gist.yml')) + begin + page_source = Net::HTTP.get(URI.parse("http://eiffelqiu.github.com/appjam/gist.yml")) + rescue SocketError => e + end + begin + g = YAML::load(page_source) + rescue ArgumentError => e + g = YAML.load_file(File.expand_path(File.dirname(__FILE__) + '/gist.yml')) + end gitopt = [] g.each_pair {|key,value| # puts colorize("Gist Category [#{key.gsub('_',' ')}]") g[key].each { |k| k.each_pair { |k1,v1|