droxi 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +44 -17
- data/droxi.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a500f22213cbc90fc4c1513119b783927df1c8c6
|
4
|
+
data.tar.gz: bd09c71d16ceeba0be7b7bf145a60c3b5e89ddf9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f242793872e450b07e68536096aaa4d337d4926c00be029805de4fa9c42eadd19b595da0432b1ebca2d03d8b75dcf5f3fa706eb2f2ffb413c9b50a53cc55a0e3
|
7
|
+
data.tar.gz: 2c0120dcf58351024453405c46e37e24565c4395c9a77a5fe00ce7e79d544b73982de8eba0e494de0eb9bbc4c8ccdf3d4484cd99c92782ee72191f2e368acad3
|
data/Rakefile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
task :default => :
|
1
|
+
task :default => :build
|
2
2
|
|
3
3
|
desc 'run unit tests'
|
4
4
|
task :test do
|
@@ -23,8 +23,20 @@ task :doc do
|
|
23
23
|
sh 'rdoc `find lib -name *.rb`'
|
24
24
|
end
|
25
25
|
|
26
|
-
desc '
|
27
|
-
task :
|
26
|
+
desc 'build executable and man page'
|
27
|
+
task :build do
|
28
|
+
def build_exe
|
29
|
+
filenames = `find lib -name *.rb`.split + ['bin/droxi']
|
30
|
+
|
31
|
+
contents = "#!/usr/bin/env ruby\n\n"
|
32
|
+
contents << `cat -s #{filenames.join(' ')} \
|
33
|
+
| grep -v require_relative \
|
34
|
+
| grep -v "require 'droxi'"`
|
35
|
+
|
36
|
+
IO.write('build/droxi', contents)
|
37
|
+
File.chmod(0755, 'build/droxi')
|
38
|
+
end
|
39
|
+
|
28
40
|
def date(gemspec)
|
29
41
|
require 'time'
|
30
42
|
Time.parse(/\d{4}-\d{2}-\d{2}/.match(gemspec)[0]).strftime('%B %Y')
|
@@ -46,23 +58,38 @@ task :man do
|
|
46
58
|
sub('{version}', /\d+\.\d+\.\d+/.match(gemspec)[0]).
|
47
59
|
sub('{commands}', commands)
|
48
60
|
|
49
|
-
Dir.mkdir('build') unless Dir.exists?('build')
|
50
61
|
IO.write('build/droxi.1', contents)
|
51
62
|
end
|
52
63
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
+
Dir.mkdir('build') unless Dir.exists?('build')
|
65
|
+
build_exe
|
66
|
+
build_page
|
67
|
+
end
|
68
|
+
|
69
|
+
PREFIX = ENV['PREFIX'] || ENV['prefix'] || '/usr/local'
|
70
|
+
BIN_PATH = "#{PREFIX}/bin"
|
71
|
+
MAN_PATH = "#{PREFIX}/share/man/man1"
|
72
|
+
|
73
|
+
desc 'install executable and man page'
|
74
|
+
task :install do
|
75
|
+
require 'fileutils'
|
76
|
+
begin
|
77
|
+
FileUtils.mkdir_p(BIN_PATH)
|
78
|
+
FileUtils.cp('build/droxi', BIN_PATH)
|
79
|
+
FileUtils.mkdir_p(MAN_PATH)
|
80
|
+
FileUtils.cp('build/droxi.1', MAN_PATH)
|
81
|
+
rescue Exception => error
|
82
|
+
puts error
|
64
83
|
end
|
84
|
+
end
|
65
85
|
|
66
|
-
|
67
|
-
|
86
|
+
desc 'uninstall executable and man page'
|
87
|
+
task :uninstall do
|
88
|
+
require 'fileutils'
|
89
|
+
begin
|
90
|
+
FileUtils.rm("#{BIN_PATH}/droxi")
|
91
|
+
FileUtils.rm("#{MAN_PATH}/droxi.1")
|
92
|
+
rescue Exception => error
|
93
|
+
puts error
|
94
|
+
end
|
68
95
|
end
|
data/droxi.gemspec
CHANGED