Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: v0.0.7
Fetching contributors…

Cannot retrieve contributors at this time

file 78 lines (69 sloc) 2.265 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
require 'rubygems'
require 'rake/gempackagetask'
require 'rake/rdoctask'

PLUGIN = "merb_global"
NAME = "merb_global"
GEM_VERSION = "0.0.7"
AUTHORS = ["Alex Coles", "Maciej Piechotka"]
EMAIL = "merb_global@googlegroups.com"
HOMEPAGE = "http://trac.ikonoklastik.com/merb_global/"
SUMMARY = "Localization (L10n) and Internationalization (i18n) support for the Merb MVC Framework"

def spec
  require 'spec/rake/spectask'
  Gem::Specification.new do |s|
    s.name = NAME
    s.version = GEM_VERSION
    s.platform = Gem::Platform::RUBY
    s.summary = SUMMARY
    s.description = s.summary
    s.authors = AUTHORS
    s.email = EMAIL
    s.homepage = HOMEPAGE
    s.rubyforge_project = 'merb-global'
    s.add_dependency('merb-core', '>= 0.9.1')
    s.add_dependency('treetop', '>= 1.2.3') # Tested on 1.2.3
    s.require_path = 'lib'
    s.autorequire = PLUGIN
    s.files = %w(LICENSE README Rakefile TODO HISTORY) +
              Dir.glob("{lib,specs,*_generators,examples}/**/*")
    
    # rdoc
    s.has_rdoc = true
    s.extra_rdoc_files = %w(README LICENSE TODO HISTORY)
  end
end

Rake::GemPackageTask.new(spec) do |pkg|
  pkg.gem_spec = spec
end

desc "Install merb_global"
task :install => [:package] do
  sh %{gem install pkg/#{NAME}-#{GEM_VERSION}}
end

Rake::RDocTask.new do |rd|
  rd.rdoc_dir = "doc"
  rd.rdoc_files.include "lib/**/*.rb"
end

desc "Creates database for examples"
task :populate_db do
  require 'fileutils'
  pwd = File.dirname __FILE__
  db = "#{pwd}/examples/database.db"
  sh %{sqlite3 #{db} < #{pwd}/examples/database.sql}
  FileUtils.cp db, "#{pwd}/examples/active_record_example/database.db"
  FileUtils.cp db, "#{pwd}/examples/data_mapper_example/database.db"
  FileUtils.cp db, "#{pwd}/examples/sequel_example/database.db"
end
task "pkg/#{NAME}-#{GEM_VERSION}" => [:populate_db]

desc "Run all specs"
Spec::Rake::SpecTask.new('specs') do |st|
  st.libs = ['lib', 'spec']
  st.spec_files = FileList['spec/**/*_spec.rb']
  st.spec_opts = ['--format specdoc', '--color']
end

desc "Run rcov"
Spec::Rake::SpecTask.new('rcov') do |rct|
  rct.libs = ['lib', 'spec']
  rct.rcov = true
  rct.rcov_opts = ['-x gems', '-x usr', '-x spec']
  rct.spec_files = FileList['spec/**/*.rb']
  rct.spec_opts = ['--format specdoc', '--color']
end
Something went wrong with that request. Please try again.