-
Notifications
You must be signed in to change notification settings - Fork 96
/
Rakefile
119 lines (98 loc) · 3.46 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/usr/bin/ruby
# -*- ruby -*-
# -*- coding: utf-8 -*-
$:.unshift(File.dirname(__FILE__)+'/lib/')
require 'rubygems'
require 'statsample'
require 'hoe'
require 'rdoc'
Hoe.plugin :git
Hoe.plugin :doofus
desc "Ruby Lint"
task :lint do
executable=Config::CONFIG['RUBY_INSTALL_NAME']
Dir.glob("lib/**/*.rb") {|f|
if !system %{#{executable} -w -c "#{f}"}
puts "Error on: #{f}"
end
}
end
task :release do
system %{git push origin master}
end
task "clobber_docs" do
# Only to omit warnings
end
desc "Update pot/po files."
task "gettext:updatepo" do
require 'gettext/tools'
GetText.update_pofiles("statsample", Dir.glob("{lib,bin}/**/*.{rb,rhtml}"), "statsample #{Statsample::VERSION}")
end
desc "Create mo-files"
task "gettext:makemo" do
require 'gettext/tools'
GetText.create_mofiles()
# GetText.create_mofiles(true, "po", "locale") # This is for "Ruby on Rails".
end
h=Hoe.spec('statsample') do
self.version=Statsample::VERSION
self.urls=["https://github.com/clbustos/statsample"]
#self.testlib=:minitest
self.readme_file = 'README.md'
self.urls = ['https://github.com/clbustos/statsample']
self.developer('Claudio Bustos', '[email protected]')
self.extra_deps << ["spreadsheet","~>0.6"] << ["reportbuilder", "~>1.4"] << ["minimization", "~>0.2.0"] << ["fastercsv", ">0"] << ["dirty-memoize", "~>0.0"] << ["extendmatrix","~>0.3.1"] << ["statsample-bivariate-extension", ">0"] << ["rserve-client"] << ["rubyvis"] << ["distribution"]
self.extra_dev_deps << ["hoe","~>0"] << ["shoulda","~>3"] << ["minitest", "~>2"] << ["gettext", "~>0"] << ["mocha", "~>0"] << ["hoe-git", "~>0"]
self.clean_globs << "test/images/*" << "demo/item_analysis/*" << "demo/Regression"
self.post_install_message = <<-EOF
***************************************************
Thanks for installing statsample.
On *nix, you could install statsample-optimization
to retrieve gems gsl, statistics2 and a C extension
to speed some methods.
$ sudo gem install statsample-optimization
On Ubuntu, install build-essential and libgsl0-dev
using apt-get. Compile ruby 1.8 or 1.9 from
source code first.
$ sudo apt-get install build-essential libgsl0-dev
*****************************************************
EOF
self.need_rdoc=false
end
if Rake.const_defined?(:RDocTask)
Rake::RDocTask.new(:docs) do |rd|
rd.main = h.readme_file
rd.options << '-d' if (`which dot` =~ /\/dot/) unless
ENV['NODOT'] || Hoe::WINDOZE
rd.rdoc_dir = 'doc'
rd.rdoc_files.include("lib/**/*.rb")
rd.rdoc_files += h.spec.extra_rdoc_files
rd.rdoc_files.reject! {|f| f=="Manifest.txt"}
title = h.spec.rdoc_options.grep(/^(-t|--title)=?$/).first
if title then
rd.options << title
unless title =~ /\=/ then # for ['-t', 'title here']
title_index = spec.rdoc_options.index(title)
rd.options << spec.rdoc_options[title_index + 1]
end
else
title = "#{h.name}-#{h.version} Documentation"
title = "#{h.rubyforge_name}'s " + title if h.rubyforge_name != h.name
rd.options << '--title' << title
end
end
end
desc 'Publish rdocs with analytics support'
task :publicar_docs => [:clean] do
# ruby %{agregar_adsense_a_doc.rb}
path = File.expand_path("./doc.yaml")
config = YAML.load(File.read(path))
host = "#{config["user"]}@#{config["host"]}"
remote_dir = config["dir"]
local_dir = h.local_rdoc_dir
Dir.glob(local_dir+"/**/*") {|file|
sh %{chmod 755 #{file}}
}
sh %{rsync #{h.rsync_args} #{local_dir}/ #{host}:#{remote_dir}}
end
# vim: syntax=Ruby