Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 101 lines (71 sloc) 1.955 kb
ad5a548 @metaskills [1.9] Added a few #encoding file hints. Add 1px.gif as a schema fixture ...
metaskills authored
1 # encoding: UTF-8
74f0121 @metaskills Initial checking.
metaskills authored
2 require 'rake'
7120f62 @metaskills Final push for release.
metaskills authored
3 require "rake/clean"
4 require 'rbconfig'
8e03fcb @metaskills Get the Rakefile working and building extension by finding freetds inclu...
metaskills authored
5 require 'rake/testtask'
74f0121 @metaskills Initial checking.
metaskills authored
6 require 'rake/extensiontask'
7
f9a5d1e @luislavena Load additional rake tasks
luislavena authored
8 Dir["tasks/*.rake"].sort.each { |f| load f }
7120f62 @metaskills Final push for release.
metaskills authored
9
74f0121 @metaskills Initial checking.
metaskills authored
10 def test_libs
11 ['lib','test']
12 end
13
14 def test_files
3839fc8 @metaskills Woot! Passing a few basic tests that prove the structure and build are c...
metaskills authored
15 Dir.glob("test/**/*_test.rb").sort
74f0121 @metaskills Initial checking.
metaskills authored
16 end
17
7120f62 @metaskills Final push for release.
metaskills authored
18 def gemspec
19 @clean_gemspec ||= eval(File.read(File.expand_path('../tiny_tds.gemspec', __FILE__)))
20 end
21
8e03fcb @metaskills Get the Rakefile working and building extension by finding freetds inclu...
metaskills authored
22 Rake::TestTask.new do |t|
74f0121 @metaskills Initial checking.
metaskills authored
23 t.libs = test_libs
24 t.test_files = test_files
25 t.verbose = true
26 end
27
7120f62 @metaskills Final push for release.
metaskills authored
28 desc "Build the gem"
29 task :gem => [:distclean] do
30 sh %{gem build tiny_tds.gemspec}
31 end
32
33 desc "Try to clean up everything"
34 task :distclean do
9eabf48 @metaskills Helping me release a gem.
metaskills authored
35 CLEAN.concat(['pkg', 'tiny_tds-*.gem', 'tmp', 'lib/tiny_tds/tiny_tds.bundle'])
7120f62 @metaskills Final push for release.
metaskills authored
36 Rake::Task[:clean].invoke
49acc0b @metaskills More prep for gem release.
metaskills authored
37 end
38
8f24f7f @luislavena Force freetds port dependency on compile
luislavena authored
39 # to compile you need FreeTDS (first than anything)
40 task :compile => ["ports:freetds"]
41
49acc0b @metaskills More prep for gem release.
metaskills authored
42 Rake::ExtensionTask.new('tiny_tds', gemspec) do |ext|
43 ext.lib_dir = 'lib/tiny_tds'
8f24f7f @luislavena Force freetds port dependency on compile
luislavena authored
44 ext.config_options << "--enable-iconv"
74f0121 @metaskills Initial checking.
metaskills authored
45 end
46
47 task :build => [:clean, :compile]
48
3839fc8 @metaskills Woot! Passing a few basic tests that prove the structure and build are c...
metaskills authored
49 task :default => [:build, :test]
74f0121 @metaskills Initial checking.
metaskills authored
50
51
0ca6931 @metaskills A few RVM helpers.
metaskills authored
52
53 namespace :rvm do
54
7f4a196 @metaskills Small changes while testing JRuby. Using options hash for connect vs man...
metaskills authored
55 RVM_RUBIES = ['ruby-1.8.6', 'ruby-1.8.7', 'ruby-1.9.1', 'ruby-1.9.2', 'ree-1.8.7', 'jruby-head']
0ca6931 @metaskills A few RVM helpers.
metaskills authored
56 RVM_GEMSET_NAME = 'tinytds'
57
58
59 task :setup do
60 unless @rvm_setup
61 rvm_lib_path = "#{`echo $rvm_path`.strip}/lib"
62 $LOAD_PATH.unshift(rvm_lib_path) unless $LOAD_PATH.include?(rvm_lib_path)
63 require 'rvm'
64 require 'tmpdir'
65 @rvm_setup = true
66 end
67 end
68
69 desc "Install development gems using bundler to each rubie version."
70 task :bundle => :setup do
71 rvm_each_rubie { RVM.run 'bundle install' }
72 end
73
74 desc "Echo command to test under each rvm rubie."
75 task :test => :setup do
76 puts "rvm #{rvm_rubies.join(',')} rake"
77 end
78
79 end
80
81
82
83 # RVM Helper Methods
84
85 def rvm_each_rubie
86 rvm_rubies.each do |rubie|
87 RVM.use(rubie)
88 yield
89 end
90 ensure
91 RVM.reset_current!
92 end
93
94 def rvm_rubies(options={})
95 RVM_RUBIES.map{ |rubie| "#{rubie}@#{RVM_GEMSET_NAME}" }
96 end
97
98
99
100
Something went wrong with that request. Please try again.