Module: Helper::Environment
- Defined in:
- lib/cucumber_salad/helper/environment.rb
Class Method Summary collapse
- .allow_driver_override? ⇒ Boolean
- .default_stub_path ⇒ Object
- .default_stub_path=(path) ⇒ Object
- .env ⇒ Object
- .host(prefix = 'pal') ⇒ Object
- .proxy ⇒ Object
- .remote? ⇒ Boolean
- .stub_path ⇒ Object
- .stub_path=(path) ⇒ Object
- .syd_proxy ⇒ Object
Class Method Details
.allow_driver_override? ⇒ Boolean
46 47 48 |
# File 'lib/cucumber_salad/helper/environment.rb', line 46 def allow_driver_override? true if ENV["device_override"] end |
.default_stub_path ⇒ Object
28 29 30 31 32 |
# File 'lib/cucumber_salad/helper/environment.rb', line 28 def default_stub_path raise "Please set your default stub path using Helper::Environment.default_stub_path = '/path'" unless @default_stub_path FileUtils.mkdir_p(@default_stub_path) unless Dir.exists?(@default_stub_path) @default_stub_path end |
.default_stub_path=(path) ⇒ Object
34 35 36 |
# File 'lib/cucumber_salad/helper/environment.rb', line 34 def default_stub_path=(path) @default_stub_path = path end |
.env ⇒ Object
14 15 16 |
# File 'lib/cucumber_salad/helper/environment.rb', line 14 def env ENV["TARGET_ENV"] || "sandbox" end |
.host(prefix = 'pal') ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/cucumber_salad/helper/environment.rb', line 4 def host(prefix = 'pal') app_host = "http://#{prefix}." if self.env == "sandbox" app_host << "sandbox.dev" else app_host << "#{self.env}" end "#{app_host}.bbc.co.uk" end |
.proxy ⇒ Object
38 39 40 |
# File 'lib/cucumber_salad/helper/environment.rb', line 38 def proxy ENV["http_proxy"] || "" end |
.remote? ⇒ Boolean
50 51 52 |
# File 'lib/cucumber_salad/helper/environment.rb', line 50 def remote? self.env != "sandbox" end |
.stub_path ⇒ Object
18 19 20 21 22 |
# File 'lib/cucumber_salad/helper/environment.rb', line 18 def stub_path raise "Please set your stub path using Helper::Environment.stub_path = '/path'" unless @stub_path FileUtils.mkdir_p(@stub_path) unless Dir.exists?(@stub_path) @stub_path end |
.stub_path=(path) ⇒ Object
24 25 26 |
# File 'lib/cucumber_salad/helper/environment.rb', line 24 def stub_path=(path) @stub_path = path end |
.syd_proxy ⇒ Object
42 43 44 |
# File 'lib/cucumber_salad/helper/environment.rb', line 42 def syd_proxy "http://www-cache-syd.reith.bbc.co.uk:80" end |