root/lang/ruby/ssb/trunk/Rakefile @ 2201

Revision 2201, 1.7 kB (checked in by lchin, 6 years ago)

/lang/ruby/ssb Using more appropriate assertions, tiny Rakefile fix.

  • Property svn:mime-type set to text/x-ruby; charset=utf-8
Line 
1require (File.join(File.dirname(__FILE__), 'config', 'common'))
2
3require 'rake'
4require 'rake/testtask'
5require 'scripts/emoji_scrape.rb'
6
7desc "Run all unit tests"
8task :test do
9  ruby "test/all.rb"
10end
11
12desc "Initial setup"
13task :setup => ["chmod_logs", "config/config.yaml", "public_html/.htaccess"]
14task :setup => [:scrape]
15task :setup => ["ktai:update"]
16
17desc "Scrape all emoji"
18task :scrape => ["scrape:kddi", "scrape:docomo", "scrape:thirdforce"]
19namespace :scrape do
20  desc "Scrape KDDI(AU) emoji"
21  task :kddi => ["public_html/emoji/kddi"] do
22    puts "Retrieving KDDI emoji"
23    EmojiScraper.scrape_kddi
24    puts "done."
25  end
26  desc "Scrape NTT Docomo emoji"
27  task :docomo => ["public_html/emoji/docomo"] do
28    puts "Retrieving Docomo emoji"
29    EmojiScraper.scrape_docomo
30    puts "done."
31  end
32  desc "Scrape Softbank emoji"
33  task :softbank => :thirdforce
34  desc "Scrape Thirdforce (Softbank) emoji"
35  task :thirdforce => ["public_html/emoji/softbank"] do
36    puts "Retrieving Softbank emoji"
37    EmojiScraper.scrape_thirdforce
38    puts "done."
39  end
40  desc "Delete all emoji"
41  task :clear do
42    rm_rf "public_html/emoji"
43    rm_f "ezicon.lzh"
44    rm_rf "icon_image"
45  end
46end
47
48namespace :logs do
49  desc "Delete logs"
50  task :clear do
51    rm Dir.glob("logs/*"), :force => true
52  end
53end
54
55namespace :ktai do
56  desc "Update ke-tai.org lists"
57  task :update do
58    ruby "scripts/download_ktai_list.rb"
59  end
60end
61
62directory "public_html/emoji/docomo"
63directory "public_html/emoji/kddi"
64directory "public_html/emoji/softbank"
65directory "logs"
66task "chmod_logs" => ["logs"] do chmod(0777, "logs") end
67file "config/config.yaml" do |t| cp "#{t.name}.default", t.name end
68file "public_html/.htaccess" do |t| cp "#{t.name}.default", t.name end
Note: See TracBrowser for help on using the browser.