-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
66 lines (56 loc) · 1.09 KB
/
Rakefile
File metadata and controls
66 lines (56 loc) · 1.09 KB
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
def clean
Dir['sometimes_memoize-*.gem'].each{|f| File.unlink(f)}
end
def build
`gem build sometimes_memoize.gemspec`
end
def publish_local
dir = '~/Development/Gems/'
`cp sometimes_memoize-*.gem #{dir}/gems/`
`gem generate_index --update --modern -d #{dir}`
end
def publish_remote
##@@!!
end
def uninstall
`sudo gem uninstall sometimes_memoize`
end
def install_local
install('http://localhost/Gems/')
end
def install_remote
install
end
def install(source=nil)
cmd = 'sudo gem install sometimes_memoize'
if !source.nil?
cmd << " --source #{source}"
end
`#{cmd}`
end
def run_tests(gem=true)
cmd = "ruby test/sometimes_memoize_test.rb"
if gem
cmd << ' gem'
end
puts `#{cmd}`
end
def test
clean
uninstall
build
publish_local
install_local
run_tests
end
namespace :gem do
task(:clean){clean}
task(:build){build}
task(:uninstall){uninstall}
task(:install_local){install_local}
task(:install_remote){install_remote}
task(:publish_local){publish_local}
task(:publish_remote){publish_remote}
task(:run_tests){run_tests}
task(:test){test}
end