Module: Fontana
- Extended by:
- Fixture
- Defined in:
- lib/fontana.rb,
lib/fontana/fixture.rb,
lib/fontana/rake_utils.rb,
lib/fontana/server_rake.rb,
lib/fontana/command_utils.rb
Defined Under Namespace
Modules: CommandUtils, Fixture, RakeUtils, ServerRake
Class Attribute Summary collapse
Class Method Summary
collapse
Methods included from Fixture
load_fixture
Class Attribute Details
.gemfile ⇒ Object
13
14
15
|
# File 'lib/fontana.rb', line 13
def gemfile
@gemfile
end
|
.repo_url ⇒ Object
Returns the value of attribute repo_url.
15
16
17
|
# File 'lib/fontana.rb', line 15
def repo_url
@repo_url
end
|
Class Method Details
.app_mode ⇒ Object
33
34
35
|
# File 'lib/fontana.rb', line 33
def app_mode
(ENV["FONTANA_APP_MODE"] || "test").to_sym
end
|
.app_mode=(value) ⇒ Object
37
38
39
|
# File 'lib/fontana.rb', line 37
def app_mode=(value)
ENV["FONTANA_APP_MODE"] = value
end
|
.branch ⇒ Object
41
42
43
44
45
46
47
|
# File 'lib/fontana.rb', line 41
def branch
unless @branch
@branch = ENV['FONTANA_BRANCH' ]
load_fontana_version_file unless @branch
end
@branch
end
|
.development_http_server_port ⇒ Object
65
66
67
|
# File 'lib/fontana.rb', line 65
def development_http_server_port
(ENV["FONTANA_DEVELOPMENT_HTTP_SERVER_PORT" ] || 3000).to_i
end
|
.development_https_server_port ⇒ Object
69
70
71
|
# File 'lib/fontana.rb', line 69
def development_https_server_port
(ENV["FONTANA_DEVELOPMENT_HTTPS_SERVER_PORT"] || 3001).to_i
end
|
.env ⇒ Object
27
28
29
|
# File 'lib/fontana.rb', line 27
def env
@env ||= (ENV["FONTANA_ENV"] || "DEVELOPMENT").to_sym
end
|
.home ⇒ Object
17
18
19
|
# File 'lib/fontana.rb', line 17
def home
@home ||= ENV['FONTANA_HOME'] || (Dir.exist?(FontanaClientSupport.vendor_fontana) or Fontana.repo_url) ? FontanaClientSupport.vendor_fontana : nil
end
|
.home=(value) ⇒ Object
21
22
23
|
# File 'lib/fontana.rb', line 21
def home=(value)
@home = value
end
|
.load_fontana_version_file ⇒ Object
57
58
59
60
61
62
|
# File 'lib/fontana.rb', line 57
def load_fontana_version_file
path = File.expand_path("FONTANA_VERSION", FontanaClientSupport.root_dir)
line = File.read(path).strip
@version, @branch = line.split(/\@/, 2).map{|s| s.empty? ? nil : s }
@branch ||= "master"
end
|
.test_http_server_port ⇒ Object
73
74
75
|
# File 'lib/fontana.rb', line 73
def test_http_server_port
(ENV["FONTANA_TEST_HTTP_SERVER_PORT" ] || 4000).to_i
end
|
.test_https_server_port ⇒ Object
77
78
79
|
# File 'lib/fontana.rb', line 77
def test_https_server_port
(ENV["FONTANA_TEST_HTTPS_SERVER_PORT"] || 4001).to_i
end
|
.test_server_url(hostname = "localhost") ⇒ Object
81
82
83
|
# File 'lib/fontana.rb', line 81
def test_server_url(hostname = "localhost")
"http://#{hostname}:#{test_http_server_port}"
end
|
.version ⇒ Object
49
50
51
52
53
54
55
|
# File 'lib/fontana.rb', line 49
def version
unless @version
@version = ENV['FONTANA_VERSION' ]
load_fontana_version_file unless @version
end
@version
end
|