Class: Tennpipes::Mounter::ApplicationWrapper

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/tennpipes-base/mounter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, options = {}) ⇒ ApplicationWrapper

Returns a new instance of ApplicationWrapper.



21
22
23
24
# File 'lib/tennpipes-base/mounter.rb', line 21

def initialize(app, options = {})
  @options = options
  super(app)
end

Instance Attribute Details

#public_folderObject



46
47
48
49
50
# File 'lib/tennpipes-base/mounter.rb', line 46

def public_folder
  return @public_folder if @public_folder
  obj = __getobj__
  @public_folder = obj.respond_to?(:public_folder) ? obj.public_folder : ""
end

#uri_rootObject

Returns the value of attribute uri_root.



18
19
20
# File 'lib/tennpipes-base/mounter.rb', line 18

def uri_root
  @uri_root
end

Instance Method Details

#app_fileObject



34
35
36
37
38
# File 'lib/tennpipes-base/mounter.rb', line 34

def app_file
  return @__app_file if @__app_file
  obj = __getobj__
  @__app_file = obj.respond_to?(:app_file) ? obj.app_file : @options[:app_file]
end

#app_nameObject



52
53
54
# File 'lib/tennpipes-base/mounter.rb', line 52

def app_name
  @__app_name ||= @options[:app_name] || __getobj__.to_s.underscore.to_sym
end

#dependenciesObject



26
27
28
# File 'lib/tennpipes-base/mounter.rb', line 26

def dependencies
  @__dependencies ||= Dir["#{root}/**/*.rb"]
end

#prerequisitesObject



30
31
32
# File 'lib/tennpipes-base/mounter.rb', line 30

def prerequisites
  @__prerequisites ||= []
end

#rootObject



40
41
42
43
44
# File 'lib/tennpipes-base/mounter.rb', line 40

def root
  return @__root if @__root
  obj = __getobj__
  @__root = obj.respond_to?(:root) ? obj.root : File.expand_path("#{app_file}/../")
end

#setup_application!Object



56
57
58
59
60
61
62
63
# File 'lib/tennpipes-base/mounter.rb', line 56

def setup_application!
  @configured ||=
    begin
      $LOAD_PATH.concat(prerequisites)
      Tennpipes.require_dependencies(dependencies, :force => true) if root.start_with?(Tennpipes.root)
      true
    end
end