Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

115 lines (92 sloc) 2.791 kb
require 'rubygems'
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/gempackagetask'
require 'rake/contrib/rubyforgepublisher'
require File.dirname(__FILE__) + '/lib/tasks/cia'
PKG_VERSION = "1.0.0"
PKG_NAME = "activemerchant"
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
PKG_FILES = FileList[
"lib/**/*", "examples/**/*", "[A-Z]*", "rakefile"
].exclude(/\.svn$/)
desc "Default Task"
task :default => [ :test_units ]
# Run the unit tests
Rake::TestTask.new(:test_units) do |t|
t.pattern = 'test/unit/**/*_test.rb'
t.ruby_opts << '-rubygems'
t.verbose = true
end
Rake::TestTask.new(:test_remote) do |t|
t.pattern = 'test/remote_tests/*_test.rb'
t.ruby_opts << '-rubygems'
t.verbose = true
end
# Genereate the RDoc documentation
Rake::RDocTask.new do |rdoc|
rdoc.rdoc_dir = 'doc'
rdoc.title = "ActiveMerchant library"
rdoc.options << '--line-numbers' << '--inline-source' << '--main=README'
rdoc.rdoc_files.include('README', 'CHANGELOG')
rdoc.rdoc_files.include('lib/**/*.rb')
rdoc.rdoc_files.exclude('lib/tasks')
end
task :install => [:package] do
`gem install pkg/#{PKG_FILE_NAME}.gem`
end
task :lines do
lines = 0
codelines = 0
Dir.foreach("lib") { |file_name|
next unless file_name =~ /.*rb/
f = File.open("lib/" + file_name)
while line = f.gets
lines += 1
next if line =~ /^\s*$/
next if line =~ /^\s*#/
codelines += 1
end
}
puts "Lines #{lines}, LOC #{codelines}"
end
desc "Delete tar.gz / zip / rdoc"
task :cleanup => [ :clobber_package, :clobber_rdoc ]
spec = Gem::Specification.new do |s|
s.name = PKG_NAME
s.version = PKG_VERSION
s.summary = "Framework and tools for dealing with credit card transactions."
s.has_rdoc = true
s.files = %w(README MIT-LICENSE CHANGELOG) + Dir['lib/**/*']
s.require_path = 'lib'
s.autorequire = 'active_merchant'
s.author = "Tobias Luetke"
s.email = "tobi@leetsoft.com"
s.homepage = "http://activemerchant.org/"
s.add_dependency('activesupport', '>= 1.4.1')
s.add_dependency('builder', '>= 2.0.0')
end
Rake::GemPackageTask.new(spec) do |p|
p.gem_spec = spec
p.need_tar = true
p.need_zip = true
end
desc "Continuously watch unit tests"
task :watch do
system("clear")
system("stakeout \"rake\" `find . -name '*.rb'`")
end
desc "Publish the release files to RubyForge."
task :publish => [ :gem, :upload ] do
`rubyforge login`
system("rubyforge add_release #{PKG_NAME} #{PKG_NAME} 'REL #{PKG_VERSION}' pkg/#{PKG_NAME}-#{PKG_VERSION}.gem")
end
desc 'Upload RDoc to RubyForge'
task :upload => :rdoc do
user = "cfauser@rubyforge.org"
project = "/var/www/gforge-projects/#{PKG_NAME}"
local_dir = 'doc'
pub = Rake::SshDirPublisher.new user, project, local_dir
pub.upload
end
Jump to Line
Something went wrong with that request. Please try again.