airake 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +6 -0
- data/Rakefile +7 -0
- data/config/hoe.rb +2 -1
- data/lib/airake/runner.rb +49 -10
- data/lib/airake/version.rb +1 -1
- metadata +11 -2
data/History.txt
CHANGED
data/Rakefile
CHANGED
data/config/hoe.rb
CHANGED
@@ -61,7 +61,8 @@ hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
|
61
61
|
p.changes = p.paragraphs_of("History.txt", 0..1).join("\\n\\n")
|
62
62
|
#p.extra_deps = [] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
|
63
63
|
p.extra_deps = [
|
64
|
-
['rubigen','>=1.0.4']
|
64
|
+
['rubigen','>=1.0.4'],
|
65
|
+
['activesupport', '>=1.4.2']
|
65
66
|
]
|
66
67
|
|
67
68
|
#p.spec_extras = {} # A hash of extra values to set in the gemspec.
|
data/lib/airake/runner.rb
CHANGED
@@ -3,20 +3,59 @@ module Airake #:nodoc:
|
|
3
3
|
# Runs commands
|
4
4
|
class Runner
|
5
5
|
|
6
|
-
|
6
|
+
# Lifted from http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/a274d5d47feae95
|
7
|
+
attr_reader :output, :cmd, :took, :process
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
9
|
+
def initialize(cmd)
|
10
|
+
@cmd = RUBY_PLATFORM =~ /win32/ ? "cmd.exe /c #{cmd}" : cmd
|
11
|
+
end
|
12
|
+
|
13
|
+
def run(verbose = true)
|
14
|
+
puts "Running: #{cmd}" if verbose
|
11
15
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
puts "Running: #{cmd}"
|
17
|
-
system cmd or fail(cmd, $?)
|
16
|
+
t1 = Time.now
|
17
|
+
IO.popen(@cmd) do |f|
|
18
|
+
@output = f.read
|
19
|
+
@process = Process.waitpid2(f.pid)[1]
|
18
20
|
end
|
21
|
+
@took = Time.now - t1
|
19
22
|
|
23
|
+
if verbose
|
24
|
+
puts output
|
25
|
+
success? or fail
|
26
|
+
puts "Took %.2fs" % [ took ]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def fail
|
31
|
+
raise <<-EOS
|
32
|
+
[exited=#{exit_code}, pid=#{pid}] failed:
|
33
|
+
|
34
|
+
#{cmd}
|
35
|
+
|
36
|
+
EOS
|
37
|
+
end
|
38
|
+
|
39
|
+
def run?
|
40
|
+
!@process.nil?
|
41
|
+
end
|
42
|
+
|
43
|
+
def exit_code
|
44
|
+
@process ? @process.exitstatus : nil
|
45
|
+
end
|
46
|
+
|
47
|
+
def pid
|
48
|
+
@process ? @process.pid : nil
|
49
|
+
end
|
50
|
+
|
51
|
+
def success?
|
52
|
+
return run? && @process.success?
|
53
|
+
end
|
54
|
+
|
55
|
+
# Run airake command
|
56
|
+
def self.run(command, method, *args)
|
57
|
+
runner = self.new(command.send(method, *args))
|
58
|
+
runner.run
|
20
59
|
end
|
21
60
|
|
22
61
|
end
|
data/lib/airake/version.rb
CHANGED
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
|
|
3
3
|
specification_version: 1
|
4
4
|
name: airake
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.2.
|
7
|
-
date: 2007-11-
|
6
|
+
version: 0.2.8
|
7
|
+
date: 2007-11-07 00:00:00 -05:00
|
8
8
|
summary: Tasks and generators for Adobe AIR apps
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -120,3 +120,12 @@ dependencies:
|
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: 1.0.4
|
122
122
|
version:
|
123
|
+
- !ruby/object:Gem::Dependency
|
124
|
+
name: activesupport
|
125
|
+
version_requirement:
|
126
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
127
|
+
requirements:
|
128
|
+
- - ">="
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: 1.4.2
|
131
|
+
version:
|