lib/hackpad/cli/padlist.rb in hackpad-cli-0.1.0 vs lib/hackpad/cli/padlist.rb in hackpad-cli-0.1.1

- old
+ new

@@ -8,11 +8,11 @@ module Padlist module_function def get_list(refresh = false, output = STDOUT) all = [] - if refresh || !Store.exists?('padlist') + if refresh || !Store.exist?('padlist') output.print 'Refreshing ' list = Api.list list.each do |a| output.print '.' all << get_pad(a, refresh) @@ -29,16 +29,16 @@ pad = Pad.new id pad.load 'txt', refresh OpenStruct.new(id: id, title: pad.title) end - def check_list + def get_new all = [] list = Api.list list.each do |a| pad = Pad.new a unless pad.cached? - pad.load 'txt', false, false + pad.load 'txt' all << OpenStruct.new(id: a, title: pad.title) end end all end