util/rake/omfgenerate.rb in alexandria-book-collection-manager-0.7.3 vs util/rake/omfgenerate.rb in alexandria-book-collection-manager-0.7.4

- old
+ new

@@ -24,24 +24,24 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #++ -require 'fileutils' -require 'pathname' -require 'rake/tasklib' +require "fileutils" +require "pathname" +require "rake/tasklib" class OmfGenerateTask < Rake::TaskLib def initialize(projectname) @projectname = projectname @generated_files = [] yield self if block_given? make_task end def make_task - desc 'Generate Open Metadata Framework files' + desc "Generate Open Metadata Framework files" task omf: @generated_files @generated_files.each { |gen| CLOBBER << gen } if CLOBBER end @@ -53,25 +53,25 @@ def in_files FileList["#{@source_dir}/*.omf.in"] end def omf_files - in_files.map { |f| f.sub(/.omf.in/, '.omf') } + in_files.map { |f| f.sub(/.omf.in/, ".omf") } end attr_writer :gnome_helpfiles_dir def generate_omf(src_dir, file_glob) @source_dir = src_dir @source_files_glob = file_glob - rule '.omf' => ['.omf.in'] do |t| + rule ".omf" => [".omf.in"] do |t| path = File.join(@gnome_helpfiles_dir, @projectname, locale_for(t.name), "#{@projectname}.xml") data = IO.read(t.source) data.sub!(/PATH_TO_DOC_FILE/, path) puts "Generating #{t.name}..." - File.open(t.name, 'w') { |io| io.puts data } + File.open(t.name, "w") { |io| io.puts data } end omf_files.each { |o| @generated_files << o } end end