Module: Teapot::Commands
- Defined in:
- lib/teapot/commands.rb
Defined Under Namespace
Classes: CommandError, Pool
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.make(*args) ⇒ Object
65
66
67
|
# File 'lib/teapot/commands.rb', line 65
def self.make(*args)
run("make", *args, "-j", processor_count)
end
|
.make_install ⇒ Object
69
70
71
|
# File 'lib/teapot/commands.rb', line 69
def self.make_install
make("install")
end
|
.pipeline(parallel = false) ⇒ Object
115
116
117
118
119
120
121
122
123
|
# File 'lib/teapot/commands.rb', line 115
def self.pipeline(parallel = false)
if parallel == false
Commands
else
Pool.new(parallel == true ? {} : parallel)
end
end
|
.processor_count ⇒ Object
28
29
30
31
32
33
34
|
# File 'lib/teapot/commands.rb', line 28
def self.processor_count
count = Facter.processorcount.to_i rescue 1
count < 1 ? 1 : count
end
|
.run(*args) ⇒ Object
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/teapot/commands.rb', line 43
def self.run(*args)
args = args.flatten.collect &:to_s
puts args.join(' ').color(:blue)
if system(*args)
true
else
raise CommandError.new("Non-zero exit status!")
end
end
|
.run!(*args) ⇒ Object
55
56
57
58
59
|
# File 'lib/teapot/commands.rb', line 55
def self.run!(*args)
run(*args)
rescue CommandError
false
end
|
.split(arg) ⇒ Object
39
40
41
|
# File 'lib/teapot/commands.rb', line 39
def self.split(arg)
Shellwords.split(arg || "")
end
|
Instance Method Details
#wait ⇒ Object
61
62
63
|
# File 'lib/teapot/commands.rb', line 61
def wait
end
|