diff --git a/lib/noosfero/core_ext/active_record.rb b/lib/noosfero/core_ext/active_record.rb index 4935efa..d1a1637 100644 --- a/lib/noosfero/core_ext/active_record.rb +++ b/lib/noosfero/core_ext/active_record.rb @@ -1,3 +1,5 @@ +require 'active_record' + class ActiveRecord::Base def self.postgresql? diff --git a/lib/tasks/env.rake b/lib/tasks/env.rake deleted file mode 100644 index 9ebdcb5..0000000 --- a/lib/tasks/env.rake +++ /dev/null @@ -1 +0,0 @@ -require File.join(File.dirname(__FILE__), '../../config/environment.rb') diff --git a/lib/tasks/gettext.rake b/lib/tasks/gettext.rake index bf5fddd..0eff471 100644 --- a/lib/tasks/gettext.rake +++ b/lib/tasks/gettext.rake @@ -2,8 +2,6 @@ # Added for Ruby-GetText-Package # -require 'noosfero' - makemo_stamp = 'tmp/makemo.stamp' desc "Create mo-files for L10n" task :makemo => makemo_stamp @@ -40,6 +38,8 @@ end desc "Update pot/po files to match new version." task :updatepo do require 'gettext_rails/tools' + require 'noosfero' + GetText::RubyParser::ID << '__' GetText::RubyParser::PLURAL_ID << 'n__' GetText::ActiveRecordParser.init(:use_classname => false) diff --git a/lib/tasks/package.rake b/lib/tasks/package.rake index 08c2c52..35dadd9 100644 --- a/lib/tasks/package.rake +++ b/lib/tasks/package.rake @@ -1,7 +1,7 @@ -require 'noosfero' desc "Generate source tarball" task :package => 'package:clobber' do + require 'noosfero' begin sh 'test -d .git' rescue diff --git a/lib/tasks/release.rake b/lib/tasks/release.rake index 23f1b77..39b5e41 100644 --- a/lib/tasks/release.rake +++ b/lib/tasks/release.rake @@ -9,7 +9,11 @@ namespace :noosfero do end end - version = Noosfero::VERSION + def version + require 'noosfero' + Noosfero::VERSION + end + desc 'checks if there is already a tag for the current version' task :check_tag do sh "git tag | grep '^#{version}$' >/dev/null" do |ok, res| @@ -23,9 +27,9 @@ namespace :noosfero do desc 'checks the version of the Debian package' task :check_debian_package do debian_version = `dpkg-parsechangelog | grep Version: | cut -d ' ' -f 2`.strip - unless debian_version =~ /^#{Noosfero::VERSION}/ - puts "Version mismatch: Debian version = #{debian_version}, Noosfero upstream version = #{Noosfero::VERSION}" - puts "Run `dch -v #{Noosfero::VERSION}` to add a new changelog entry that upgrades the Debian version" + unless debian_version =~ /^#{version}/ + puts "Version mismatch: Debian version = #{debian_version}, Noosfero upstream version = #{version}" + puts "Run `dch -v #{version}` to add a new changelog entry that upgrades the Debian version" raise "Version mismatch between noosfero version and debian package version" end end diff --git a/lib/tasks/version.rake b/lib/tasks/version.rake index 50339b1..43cbaeb 100644 --- a/lib/tasks/version.rake +++ b/lib/tasks/version.rake @@ -1,5 +1,5 @@ -require 'noosfero' desc "shows noosfero version" task :version do + require 'noosfero' puts "noosfero, version #{Noosfero::VERSION}" end -- libgit2 0.21.2