-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathRakefile
90 lines (72 loc) · 1.99 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
require 'rake'
require 'rake/clean'
require 'rake/testtask'
require 'rbconfig'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
include RbConfig
CLEAN.include("**/*.gem", "**/*.rbc", "**/*coverage*", "**/*.lock")
desc 'Install the ptools package (non-gem)'
task :install do
sitelibdir = CONFIG["sitelibdir"]
file = "lib/ptools.rb"
FileUtils.cp(file, sitelibdir, :verbose => true)
end
namespace 'gem' do
desc 'Create the ptools gem'
task :create => [:clean] do
require 'rubygems/package'
spec = Gem::Specification.load('ptools.gemspec')
spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
Gem::Package.build(spec)
end
desc 'Install the ptools gem'
task :install => [:create] do
file = Dir["*.gem"].first
if RUBY_PLATFORM == 'java'
sh "jruby -S gem install -l #{file}"
else
sh "gem install -l #{file}"
end
end
end
namespace 'spec' do
RSpec::Core::RakeTask.new(:binary) do |t|
t.pattern = 'spec/binary_spec.rb'
end
RSpec::Core::RakeTask.new(:constants) do |t|
t.pattern = 'spec/constants_spec.rb'
end
RSpec::Core::RakeTask.new(:head) do |t|
t.pattern = 'spec/head_spec.rb'
end
RSpec::Core::RakeTask.new(:image) do |t|
t.pattern = 'spec/image_spec.rb'
end
RSpec::Core::RakeTask.new(:nlconvert) do |t|
t.pattern = 'spec/nlconvert_spec.rb'
end
RSpec::Core::RakeTask.new(:sparse) do |t|
t.pattern = 'spec/sparse_spec.rb'
end
RSpec::Core::RakeTask.new(:tail) do |t|
t.pattern = 'spec/tail_spec.rb'
end
RSpec::Core::RakeTask.new(:touch) do |t|
t.pattern = 'spec/touch_spec.rb'
end
RSpec::Core::RakeTask.new(:wc) do |t|
t.pattern = 'spec/wc_spec.rb'
end
RSpec::Core::RakeTask.new(:whereis) do |t|
t.pattern = 'spec/whereis_spec.rb'
end
RSpec::Core::RakeTask.new(:which) do |t|
t.pattern = 'spec/which_spec.rb'
end
RSpec::Core::RakeTask.new(:all) do |t|
t.pattern = 'spec/*_spec.rb'
end
end
RuboCop::RakeTask.new
task :default => 'spec:all'