[Groonga-commit] pgroonga/pgroonga.github.io at 5181ac9 [master] Support multiple Gnuplot files

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Nov 17 11:42:04 JST 2016


Kouhei Sutou	2016-11-17 11:42:04 +0900 (Thu, 17 Nov 2016)

  New Revision: 5181ac9ca6a8e7710382409a451b30a22bbe622a
  https://github.com/pgroonga/pgroonga.github.io/commit/5181ac9ca6a8e7710382409a451b30a22bbe622a

  Message:
    Support multiple Gnuplot files

  Modified files:
    Rakefile

  Modified: Rakefile (+27 -18)
===================================================================
--- Rakefile    2016-11-17 00:59:22 +0900 (f6f70be)
+++ Rakefile    2016-11-17 11:42:04 +0900 (3c701cc)
@@ -12,27 +12,36 @@ Jekyll::Task::I18n.define do |task|
   end
 end
 
-plot = Pathname.new("data/pgroonga-textsearch-pg-trgm/search.gnuplot")
-svgs = []
-plot.open do |plot_file|
-  plot_file.each_line do |line|
-    case line.chomp
-    when /\Aset output "(.*?)"\z/
-      svgs << "images/pgroonga-textsearch-pg-trgm/#{$1}"
+key_svgs = []
+all_svgs = []
+plots = Pathname.glob("data/**/*.gnuplot")
+plots.each do |plot|
+  output_base_dir = plot.dirname.to_s.gsub(/\Adata\//, "images/")
+  svgs = []
+
+  plot.open do |plot_file|
+    plot_file.each_line do |line|
+      case line.chomp
+      when /\Aset output "(.*?)"\z/
+        svgs << "#{output_base_dir}/#{$1}"
+      end
     end
   end
-end
 
-key_svg = svgs.first
-file key_svg => plot.to_s do
-  cd(plot.dirname) do
-    sh("gnuplot", plot.basename.to_s)
-  end
-  svgs.each do |svg|
-    mkdir_p(File.dirname(svg))
-    mv("#{plot.dirname}/#{File.basename(svg)}",
-       svg)
+  key_svg = svgs.first
+  key_svgs << key_svg
+  file key_svg => plot.to_s do
+    cd(plot.dirname) do
+      sh("gnuplot", plot.basename.to_s)
+    end
+    svgs.each do |svg|
+      mkdir_p(File.dirname(svg))
+      mv("#{plot.dirname}/#{File.basename(svg)}",
+         svg)
+    end
   end
+
+  all_svgs.concat(svgs)
 end
 
-task :default => ["jekyll:i18n:translate", key_svg]
+task :default => ["jekyll:i18n:translate", *key_svgs]
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index