forked from vinsol-spree-contrib/datashift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
56 lines (43 loc) · 1.49 KB
/
Rakefile
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
# Copyright:: (c) Autotelik Media Ltd 2011
# Author :: Tom Statter
# Date :: Aug 2010
#
# License:: MIT - Free, OpenSource
#
# Details:: Gem::Specification for DataShift gem.
#
# Provides classes for moving data between a number of enterprise
# type applications, files and databases.
#
# Provides support for moving data between .xls (Excel/OpenOffice)
# Spreedsheets via Ruby and AR, enabling direct import/export of
# ActiveRecord models with all their associations from database.
#
# Provides support for moving data between csv files and AR, enabling direct
# import/export of AR models and their associations from database.
#
## encoding: utf-8
require 'rubygems'
require 'rake'
lib = File.expand_path('../lib/', __FILE__)
$:.unshift '.'
$:.unshift lib unless $:.include?(lib)
require 'datashift'
# Add in our own Tasks
desc 'Build gem and install in one step'
task :build, :version do |_t, args|
v = (args[:version] || ENV['version'])
# Bump the VERSION file in library
File.open( File.join('VERSION'), 'w') do |f|
f << "#{v}\n"
end if v
system("jruby -S gem build datashift.gemspec")
#Rake::Task[:gem].invoke
version = DataShift.gem_version
puts "Installing version #{version}"
gem = "#{DataShift.gem_name}-#{version}.gem"
cmd = "gem install --no-ri --no-rdoc #{gem}"
system(cmd)
end
# Long parameter lists so ensure rake -T produces nice wide output
ENV['RAKE_COLUMNS'] = '180'