Class: Ghostbuster::Config
- Inherits:
-
Object
- Object
- Ghostbuster::Config
- Defined in:
- lib/ghostbuster/config.rb
Instance Attribute Summary collapse
-
#pattern ⇒ Object
Returns the value of attribute pattern.
-
#phantom_bin ⇒ Object
Returns the value of attribute phantom_bin.
-
#screenshot_dir ⇒ Object
Returns the value of attribute screenshot_dir.
-
#screenshot_x ⇒ Object
readonly
Returns the value of attribute screenshot_x.
-
#screenshot_y ⇒ Object
readonly
Returns the value of attribute screenshot_y.
-
#start_command ⇒ Object
Returns the value of attribute start_command.
-
#start_wait ⇒ Object
Returns the value of attribute start_wait.
-
#stop_command ⇒ Object
Returns the value of attribute stop_command.
-
#temp_dir ⇒ Object
Returns the value of attribute temp_dir.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
- #do_not_take_screenshots! ⇒ Object
- #ghost ⇒ Object
-
#initialize(path_to_file = nil) ⇒ Config
constructor
A new instance of Config.
- #screenshot_dimensions(x, y) ⇒ Object
- #screenshots? ⇒ Boolean
- #take_screenshots! ⇒ Object
Constructor Details
#initialize(path_to_file = nil) ⇒ Config
Returns a new instance of Config.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/ghostbuster/config.rb', line 5 def initialize(path_to_file = nil) @config_file = path_to_file || './Ghostfile' @screenshot_x, @screenshot_y = 800, 2000 @pattern = "./test_*.{coffee,js}" @phantom_bin = File.join(ENV['HOME'], '.ghostbuster', 'phantomjs') @screenshot_dir = "." @screenshots = true @verbose = false @temp_dir = "/tmp" @start_command, @stop_command = "./start.sh", "./stop.sh" @start_wait = 2 if File.exist?(@config_file) instance_eval File.read(@config_file), @config_file, 1 end @screenshot_dir = File.(@screenshot_dir) end |
Instance Attribute Details
#pattern ⇒ Object
Returns the value of attribute pattern.
3 4 5 |
# File 'lib/ghostbuster/config.rb', line 3 def pattern @pattern end |
#phantom_bin ⇒ Object
Returns the value of attribute phantom_bin.
3 4 5 |
# File 'lib/ghostbuster/config.rb', line 3 def phantom_bin @phantom_bin end |
#screenshot_dir ⇒ Object
Returns the value of attribute screenshot_dir.
3 4 5 |
# File 'lib/ghostbuster/config.rb', line 3 def screenshot_dir @screenshot_dir end |
#screenshot_x ⇒ Object (readonly)
Returns the value of attribute screenshot_x.
4 5 6 |
# File 'lib/ghostbuster/config.rb', line 4 def screenshot_x @screenshot_x end |
#screenshot_y ⇒ Object (readonly)
Returns the value of attribute screenshot_y.
4 5 6 |
# File 'lib/ghostbuster/config.rb', line 4 def screenshot_y @screenshot_y end |
#start_command ⇒ Object
Returns the value of attribute start_command.
3 4 5 |
# File 'lib/ghostbuster/config.rb', line 3 def start_command @start_command end |
#start_wait ⇒ Object
Returns the value of attribute start_wait.
3 4 5 |
# File 'lib/ghostbuster/config.rb', line 3 def start_wait @start_wait end |
#stop_command ⇒ Object
Returns the value of attribute stop_command.
3 4 5 |
# File 'lib/ghostbuster/config.rb', line 3 def stop_command @stop_command end |
#temp_dir ⇒ Object
Returns the value of attribute temp_dir.
3 4 5 |
# File 'lib/ghostbuster/config.rb', line 3 def temp_dir @temp_dir end |
#verbose ⇒ Object
Returns the value of attribute verbose.
3 4 5 |
# File 'lib/ghostbuster/config.rb', line 3 def verbose @verbose end |
Instance Method Details
#do_not_take_screenshots! ⇒ Object
30 31 32 |
# File 'lib/ghostbuster/config.rb', line 30 def do_not_take_screenshots! @screenshots = false end |
#ghost ⇒ Object
22 23 24 |
# File 'lib/ghostbuster/config.rb', line 22 def ghost self end |
#screenshot_dimensions(x, y) ⇒ Object
26 27 28 |
# File 'lib/ghostbuster/config.rb', line 26 def screenshot_dimensions(x, y) @screenshot_x, @screenshot_y = x, y end |
#screenshots? ⇒ Boolean
38 39 40 |
# File 'lib/ghostbuster/config.rb', line 38 def screenshots? @screenshots end |
#take_screenshots! ⇒ Object
34 35 36 |
# File 'lib/ghostbuster/config.rb', line 34 def take_screenshots! @screenshots = true end |