Module: Padrino::Mounter::ApplicationExtension

Defined in:
padrino-core/lib/padrino-core/mounter/application_extension.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cascadeObject

Returns the value of attribute cascade.



4
5
6
# File 'padrino-core/lib/padrino-core/mounter/application_extension.rb', line 4

def cascade
  @cascade
end

#mounter_optionsObject

Returns the value of attribute mounter_options.



4
5
6
# File 'padrino-core/lib/padrino-core/mounter/application_extension.rb', line 4

def mounter_options
  @mounter_options
end

#public_folderObject



23
24
25
# File 'padrino-core/lib/padrino-core/mounter/application_extension.rb', line 23

def public_folder
  @public_folder ||= trace_method(:public_folder) { "" }
end

#uri_rootObject

Returns the value of attribute uri_root.



4
5
6
# File 'padrino-core/lib/padrino-core/mounter/application_extension.rb', line 4

def uri_root
  @uri_root
end

Instance Method Details

#app_fileObject



15
16
17
# File 'padrino-core/lib/padrino-core/mounter/application_extension.rb', line 15

def app_file
  @__app_file ||= trace_method(:app_file) { mounter_options[:app_file] }
end

#app_nameObject



27
28
29
# File 'padrino-core/lib/padrino-core/mounter/application_extension.rb', line 27

def app_name
  @__app_name ||= mounter_options[:app_name] || self.to_s.underscore.to_sym
end

#dependenciesObject



7
8
9
# File 'padrino-core/lib/padrino-core/mounter/application_extension.rb', line 7

def dependencies
  @__dependencies ||= Dir.glob("#{root}/**/*.rb").delete_if { |path| path == app_file }
end

#prerequisitesObject



11
12
13
# File 'padrino-core/lib/padrino-core/mounter/application_extension.rb', line 11

def prerequisites
  @__prerequisites ||= []
end

#rootObject



19
20
21
# File 'padrino-core/lib/padrino-core/mounter/application_extension.rb', line 19

def root
  @__root ||= trace_method(:root) { File.expand_path("#{app_file}/../") }
end

#setup_application!Object



31
32
33
34
35
36
37
# File 'padrino-core/lib/padrino-core/mounter/application_extension.rb', line 31

def setup_application!
  @configured ||= trace_method(:setup_application!) do
    $LOAD_PATH.concat(prerequisites)
    require_dependencies if root.start_with?(Padrino.root)
    true
  end
end