Class: LearnTest::Dependency
- Inherits:
-
Object
- Object
- LearnTest::Dependency
show all
- Defined in:
- lib/learn_test/dependency.rb
Direct Known Subclasses
LearnTest::Dependencies::Ant, LearnTest::Dependencies::CSharp, LearnTest::Dependencies::Firefox, LearnTest::Dependencies::GreenOnion, LearnTest::Dependencies::Imagemagick, LearnTest::Dependencies::Java, LearnTest::Dependencies::Karma, LearnTest::Dependencies::NodeJS, LearnTest::Dependencies::PhantomJS, LearnTest::Dependencies::Protractor, LearnTest::Dependencies::SeleniumServer
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(options = {}) ⇒ Dependency
Returns a new instance of Dependency.
5
6
7
|
# File 'lib/learn_test/dependency.rb', line 5
def initialize(options = {})
@options = options
end
|
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
3
4
5
|
# File 'lib/learn_test/dependency.rb', line 3
def options
@options
end
|
Instance Method Details
#die(message) ⇒ Object
20
21
|
# File 'lib/learn_test/dependency.rb', line 20
def die(message)
end
|
#execute ⇒ Object
9
10
11
|
# File 'lib/learn_test/dependency.rb', line 9
def execute
install if missing?
end
|
#install ⇒ Object
17
18
|
# File 'lib/learn_test/dependency.rb', line 17
def install
end
|
#mac? ⇒ Boolean
23
24
25
|
# File 'lib/learn_test/dependency.rb', line 23
def mac?
!!RUBY_PLATFORM.match(/darwin/)
end
|
#missing? ⇒ Boolean
13
14
15
|
# File 'lib/learn_test/dependency.rb', line 13
def missing?
false
end
|
#print_installing(name) ⇒ Object
31
32
33
|
# File 'lib/learn_test/dependency.rb', line 31
def print_installing(name)
puts "Installing missing dependency #{name}...".green
end
|
#run_install(command) ⇒ Object
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/learn_test/dependency.rb', line 35
def run_install(command)
Open3.popen3(command) do |stdin, stdout, stderr, wait_thr|
while out = stdout.gets do
puts out
end
while err = stderr.gets do
puts err
end
if wait_thr.value.exitstatus != 0
die("There was an error running #{command}")
end
end
end
|
#win? ⇒ Boolean
27
28
29
|
# File 'lib/learn_test/dependency.rb', line 27
def win?
!!RUBY_PLATFORM.match(/mswin|mingw|cygwin/)
end
|