Rakefile in rabbit-1.0.9 vs Rakefile in rabbit-2.0.0

- old
+ new

@@ -1,21 +1,38 @@ # -*- ruby -*- +# +# Copyright (C) 2008-2012 Kouhei Sutou <kou@cozmixng.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. require "find" require "rubygems" require "rubygems/package_task" require "bundler/gem_helper" +require "gettext/task" base_dir = File.expand_path(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.join(base_dir, 'lib')) -require 'rabbit/rabbit' rsync_base_path = "rabbit@rabbit-shockers.org:public_html/" helper = Bundler::GemHelper.new(base_dir) helper.install spec = helper.gemspec +version = spec.version.to_s def force_array(enumerable) array = [] enumerable.each do |element| array << element @@ -29,10 +46,15 @@ def spec.extra_rdoc_files @extra_rdoc_files = force_array(super) end +GetText::Task.new(spec) do |task| + task.files -= Dir.glob("sample/**/*.*") + task.mo_base_directory = "data" +end + Gem::PackageTask.new(spec) do |package| package.need_tar_gz = true end rule '.png' => ['.svg'] do |t| @@ -145,18 +167,11 @@ desc "Tag the current revision." task :tag do sh("git tag -a #{version} -m 'release #{version}!!!'") end -namespace :mo do - desc "Update .mo." - task :update do - ruby("update-mo.rb") - end -end - -task :build => "mo:update" -task :package => "mo:update" +task :build => "gettext" +task :package => "gettext" namespace :package do desc "Upload tar.gz." task :upload => :package do htaccess = ".htaccess"