lib/review/makerhelper.rb in review-2.0.0.beta1 vs lib/review/makerhelper.rb in review-2.0.0

- old
+ new

@@ -1,23 +1,25 @@ # encoding: utf-8 # -# Copyright (c) 2012-2014 Yuto HAYAMIZU, Kenshi Muto +# Copyright (c) 2012-2016 Yuto HAYAMIZU, Kenshi Muto # # This program is free software. # You can distribute or modify this program under the terms of # the GNU LGPL, Lesser General Public License version 2.1. # For details of the GNU LGPL, see the file "COPYING". # require 'pathname' require 'fileutils' +require 'yaml' module ReVIEW - class MakerHelper + module MakerHelper # Return review/bin directory - def self.bindir + def bindir Pathname.new("#{Pathname.new(__FILE__).realpath.dirname}/../../bin").realpath end + module_function :bindir # Copy image files under from_dir to to_dir recursively # ==== Args # from_dir :: path to the directory which has image files to be copied # to_dir :: path to the directory to which the image files are copied @@ -31,11 +33,11 @@ # copy_images_to_dir("/path/to/foo", "/path/to/bar", :convert => {:eps => :png}) # # Image files are copied recursively, and each '.eps' file is converted into '.eps.png' # - def self.copy_images_to_dir(from_dir, to_dir, options = {}) + def copy_images_to_dir(from_dir, to_dir, options = {}) image_files = [] Dir.open(from_dir) do |dir| dir.each do |fname| next if fname =~ /^\./ @@ -61,7 +63,9 @@ end end image_files end + module_function :copy_images_to_dir + end end