OSDN Git Service

save src
authornomeu <nomeu@users.sourceforge.jp>
Fri, 19 Oct 2012 09:20:50 +0000 (18:20 +0900)
committernomeu <nomeu@users.sourceforge.jp>
Fri, 19 Oct 2012 09:20:50 +0000 (18:20 +0900)
bin/crawl-bowl.rb
bin/scrap-bowl.rb
lib/bowl.rb

index 87d4d02..13ad364 100644 (file)
@@ -9,9 +9,10 @@ for number in 745..1045
   code = "dl#{number}"
   bowl_class = (number > 650) ? Bowl20110904 : Bowl
   bowl = bowl_class.new(code)
-  unless File.exist?(bowl.src_path)
-    puts "PASS: src #{code} not found"
-    next
+  if bowl.save_src
+    puts "saved src #{code}"
+  else
+    puts "PASS: src #{code} exists"
   end
   bowl.load
   if bowl.save_arc
index 712439c..445754b 100644 (file)
@@ -13,7 +13,7 @@ require 'bowl'
 
 site = Site.find('mmdbowl')
 
-for number in 755..1045
+for number in 745..1045
   code = "dl#{number}"
   bowl_class = (number > 650) ? Bowl20110904 : Bowl
   bowl = bowl_class.new(code)
index b5abdb7..ac1ecf8 100644 (file)
@@ -59,7 +59,11 @@ class Bowl
   end
 
   def removed?
-    !!/削除され/.match(@source)
+    !!/削除されました/.match(@source)
+  end
+
+  def denied?
+    !!/アクセス制限が/.match(@source)
   end
 
   def locked?
@@ -145,10 +149,7 @@ class Bowl
   end
 
   def save_arc
-    if removed?
-      return false
-    end
-    if locked?
+    if removed? || denied? || locked?
       return false
     end
     if File.exist? arc_path