Module: Jets::Core

Extended by:
Memoist
Included in:
Jets
Defined in:
lib/jets/core.rb,
lib/jets/core/booter.rb

Defined Under Namespace

Modules: Config Classes: Booter

Instance Method Summary collapse

Instance Method Details

#awsObject

delegate :aws, :autoloaders, :config, to: :application



39
40
41
# File 'lib/jets/core.rb', line 39

def aws
  Jets::AwsServices::AwsInfo.new
end

#bootObject

Load project and app config files



34
35
36
# File 'lib/jets/core.rb', line 34

def boot
  Jets::Core::Booter.boot!
end

#bootstrapObject



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

def bootstrap
  Config::Bootstrap.instance
end

#build_rootObject



50
51
52
53
# File 'lib/jets/core.rb', line 50

def build_root
  root = ENV["JETS_BUILD_ROOT"] || "/tmp/jets"
  "#{root}/#{Jets.project.namespace}".freeze
end

#deprecatorObject

:nodoc:



60
61
62
# File 'lib/jets/core.rb', line 60

def deprecator # :nodoc:
  @deprecator ||= ActiveSupport::Deprecation.new
end

#envObject



11
12
13
14
# File 'lib/jets/core.rb', line 11

def env
  env = ENV["JETS_ENV"] || "dev"
  ActiveSupport::StringInquirer.new(env)
end

#errorObject

Returns the ActiveSupport::ErrorReporter of the current Jets project, otherwise it returns nil if there is no project.

Jets.error.handle(IOError) do
  # ...
end
Jets.error.report(error)


84
85
86
87
# File 'lib/jets/core.rb', line 84

def error
  application && application.executor.error_reporter
  # ActiveSupport.error_reporter
end

#extraObject



17
18
19
# File 'lib/jets/core.rb', line 17

def extra
  ENV["JETS_EXTRA"] unless ENV["JETS_EXTRA"].blank?
end

#loggerObject



46
47
48
# File 'lib/jets/core.rb', line 46

def logger
  @logger ||= Jets.bootstrap.config.logger
end

#projectObject



21
22
23
# File 'lib/jets/core.rb', line 21

def project
  Config::Project.instance
end

#report_exception(exception) ⇒ Object



64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/jets/core.rb', line 64

def report_exception(exception)
  # See Jets::ExceptionReporting decorate_exception_with_exception_reported!
  if exception.respond_to?(:with_exception_reported?) && exception.with_exception_reported?
    return
  end

  Jets.application.turbines.each do |turbine|
    turbine.on_exception_blocks.each do |block|
      block.call(exception)
    end
  end
end

#rootObject



4
5
6
7
8
# File 'lib/jets/core.rb', line 4

def root
  root = ENV["JETS_ROOT"].to_s
  root = Dir.pwd if root == ""
  Pathname.new(root)
end

#s3_bucketObject



56
57
58
# File 'lib/jets/core.rb', line 56

def s3_bucket
  Jets::Cfn::Resource::S3::JetsBucket.name
end

#shimObject



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

def shim
  Jets::Shim
end