Class: Smartguard::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/smartguard/application.rb

Direct Known Subclasses

Smartguard::Applications::Smartkiosk

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Application

Returns a new instance of Application.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/smartguard/application.rb', line 5

def initialize(path)
  @base_path = Pathname.new(File.absolute_path path)

  if Smartguard.environment == :production
    @current_path  = @base_path.join('current')
    @releases_path = @base_path.join('releases')
    @shared_path   = @base_path.join('shared')
    @active_path   = File.readlink @current_path
  else
    @current_path  = @base_path
    @releases_path = @base_path.join('tmp/releases')
    @shared_path   = @base_path
    @active_path   = @base_path
  end
end

Instance Attribute Details

#active_pathObject (readonly)

Returns the value of attribute active_path.



3
4
5
# File 'lib/smartguard/application.rb', line 3

def active_path
  @active_path
end

#current_pathObject (readonly)

Returns the value of attribute current_path.



3
4
5
# File 'lib/smartguard/application.rb', line 3

def current_path
  @current_path
end

#releases_pathObject (readonly)

Returns the value of attribute releases_path.



3
4
5
# File 'lib/smartguard/application.rb', line 3

def releases_path
  @releases_path
end

#shared_pathObject (readonly)

Returns the value of attribute shared_path.



3
4
5
# File 'lib/smartguard/application.rb', line 3

def shared_path
  @shared_path
end