Class: Daimyo::Export
- Inherits:
-
Object
- Object
- Daimyo::Export
- Defined in:
- lib/daimyo/export.rb
Instance Method Summary collapse
-
#initialize ⇒ Export
constructor
A new instance of Export.
- #run(project_id, wiki_id = nil) ⇒ Object
Constructor Details
Instance Method Details
#run(project_id, wiki_id = nil) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/daimyo/export.rb', line 9 def run(project_id, wiki_id = nil) ids = select_wiki_ids(project_id) pb = ProgressBar.create(:format => "%a %b\u{15E7}%i %p%% %t", :progress_mark => ' ', :remainder_mark => "\u{FF65}", :starting_at => 10, :length => 50) ids.each do |id| wiki = @wiki.export(id).body name = wiki.name content = wiki.content write_file(project_id, id, name, content) pb.increment sleep 0.1 end pb.finish end |