module Fontana
Attributes
gemfile[RW]
attr_accessor :home
repo_url[RW]
Public Class Methods
app_mode()
click to toggle source
これは fontanaの Fontana.app_mode
と同じ動きをすることが期待されています。 github.com/tengine/fontana/blob/master/config/application.rb#L47
# File lib/fontana.rb, line 32 def app_mode (ENV["FONTANA_APP_MODE"] || "test").to_sym # production development test end
app_mode=(value)
click to toggle source
# File lib/fontana.rb, line 36 def app_mode=(value) ENV["FONTANA_APP_MODE"] = value end
branch()
click to toggle source
# File lib/fontana.rb, line 40 def branch unless @branch @branch = ENV['FONTANA_BRANCH' ] load_fontana_version_file unless @branch end @branch end
development_http_server_port()
click to toggle source
# File lib/fontana.rb, line 64 def development_http_server_port (ENV["FONTANA_DEVELOPMENT_HTTP_SERVER_PORT" ] || 3000).to_i end
development_https_server_port()
click to toggle source
# File lib/fontana.rb, line 68 def development_https_server_port (ENV["FONTANA_DEVELOPMENT_HTTPS_SERVER_PORT"] || 3001).to_i end
env()
click to toggle source
これは fontanaの Fontana.env
と同じ動きをすることが期待されています。 github.com/tengine/fontana/blob/master/config/application.rb#L24
# File lib/fontana.rb, line 26 def env @env ||= (ENV["FONTANA_ENV"] || "DEVELOPMENT").to_sym end
home()
click to toggle source
# File lib/fontana.rb, line 16 def home @home ||= ENV['FONTANA_HOME'] || (Dir.exist?(FontanaClientSupport.vendor_fontana) or Fontana.repo_url) ? FontanaClientSupport.vendor_fontana : nil end
home=(value)
click to toggle source
# File lib/fontana.rb, line 20 def home=(value) @home = value end
test_http_server_port()
click to toggle source
# File lib/fontana.rb, line 72 def test_http_server_port (ENV["FONTANA_TEST_HTTP_SERVER_PORT" ] || 4000).to_i end
test_https_server_port()
click to toggle source
# File lib/fontana.rb, line 76 def test_https_server_port (ENV["FONTANA_TEST_HTTPS_SERVER_PORT"] || 4001).to_i end
test_server_url(hostname = "localhost")
click to toggle source
# File lib/fontana.rb, line 80 def test_server_url(hostname = "localhost") "http://#{hostname}:#{test_http_server_port}" end
version()
click to toggle source
# File lib/fontana.rb, line 48 def version unless @version @version = ENV['FONTANA_VERSION' ] load_fontana_version_file unless @version end @version end
Private Class Methods
load_fontana_version_file()
click to toggle source
# File lib/fontana.rb, line 56 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