Module: Hap

Extended by:
ActiveSupport::Autoload
Includes:
Constants
Defined in:
lib/hap.rb,
lib/hap/app.rb,
lib/hap/cli.rb,
lib/hap/helpers.rb,
lib/hap/version.rb,
lib/hap/constants.rb,
lib/hap/generators.rb,
lib/hap/helpers/git.rb,
lib/hap/helpers/heroku.rb,
lib/hap/helpers/endpoint.rb,
lib/hap/generators/gemfile.rb,
lib/hap/generators/haproxy.rb,
lib/hap/generators/install.rb,
lib/hap/helpers/user_input.rb,
lib/hap/generators/endpoint.rb,
lib/hap/generators/procfile.rb

Defined Under Namespace

Modules: Constants, Generators, Helpers Classes: App, CLI

Constant Summary collapse

VERSION =
"0.0.2"

Constants included from Constants

Constants::APP_DATA_FILE, Constants::BACK_END, Constants::BUILDPACK_URL, Constants::CONFIG_DIR, Constants::DEFAULT_PROCESS_TYPE, Constants::DEFAULT_TCP_PORT, Constants::DEPLOYED_FRONTEND, Constants::DEPLOYMENT_DIR, Constants::DEVELOPMENT_HOST, Constants::ENDPOINTS_DIR, Constants::FRONT_END, Constants::HAPROXY_BACKEND_SERVER_OPTIONS, Constants::REMOTE_REPO_NAME, Constants::RUNTIME_DIR

Class Method Summary collapse

Class Method Details

.app_rootObject



33
34
35
# File 'lib/hap.rb', line 33

def app_root
  @app_root ||= find_root_with_flag('server.rb', Dir.pwd)
end

.app_root=(app_root) ⇒ Object



37
38
39
# File 'lib/hap.rb', line 37

def app_root= app_root
  @app_root = app_root
end

.envObject



25
26
27
# File 'lib/hap.rb', line 25

def env
  @env ||= ActiveSupport::StringInquirer.new(ENV['RACK_ENV'] ||= "development")
end

.env=(environment) ⇒ Object



29
30
31
# File 'lib/hap.rb', line 29

def env=(environment)
  @env = ActiveSupport::StringInquirer.new(environment)
end

.in_app_dir?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/hap.rb', line 41

def in_app_dir?
  File.exists?("#{Hap.app_root}/server.rb")
end