root/lang/ruby/ssb/Rakefile @ 2173

Revision 2155, 1.5 kB (checked in by lchin, 6 years ago)

lang/ruby/ssb: fixed setup issues (scraping) and improved Rakefile

  • 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 => ["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    EmojiScraper.scrape_kddi
23  end
24  desc "Scrape NTT Docomo emoji"
25  task :docomo => ["public_html/emoji/docomo"] do
26    EmojiScraper.scrape_docomo
27  end
28  desc "Scrape Softbank emoji"
29  task :softbank => :thirdforce
30  desc "Scrape Thirdforce (Softbank) emoji"
31  task :thirdforce => ["public_html/emoji/softbank"] do
32    EmojiScraper.scrape_thirdforce
33  end
34  desc "Delete all emoji"
35  task :clear do
36    rm_rf "public_html/emoji"
37    rm_f "ezicon.lzh"
38    rm_rf "icon_image"
39  end
40end
41
42namespace :logs do
43  desc "Delete logs"
44  task :clear do
45    rm Dir.glob("logs/*"), :force => true
46  end
47end
48
49namespace :ktai do
50  desc "Update ke-tai.org lists"
51  task :update do
52    ruby "scripts/download_ktai_list.rb"
53  end
54end
55
56directory "public_html/emoji/docomo"
57directory "public_html/emoji/kddi"
58directory "public_html/emoji/softbank"
59directory "logs"
60file "logs" do chmod(777, "logs") end
61
62rule(/^(?:¥.default)/ => ['.default']) do |t|
63  cp t.source, t.name
64end
65
Note: See TracBrowser for help on using the browser.