Class: RoCommands::PostHandler

Inherits:
RailsBase
  • Object
show all
Defined in:
lib/ro_commands/post_handler.rb

Instance Method Summary collapse

Instance Method Details

#handleObject



58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/ro_commands/post_handler.rb', line 58

def handle
  path = File.join(::Rails.root, 'posts')
  futures = []
  ::Find.find(path) do |p|
    if test(?f, p) and p.match(%r{(.+)\.(html|md)})
      futures << PostCell.new.future.handle_single(p)
    end
  end

  futures.map(&:value).each do |record|
    post_create(record)
  end
end