Class: Giblish::DeploymentPaths

Inherits:
Object
  • Object
show all
Defined in:
lib/giblish/utils.rb

Overview

returns the paths to the search assets and web assets in the deployment machine’s file system.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(web_path, search_asset_path) ⇒ DeploymentPaths

Returns a new instance of DeploymentPaths.



94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/giblish/utils.rb', line 94

def initialize(web_path, search_asset_path)
  @search_assets_path = if search_asset_path.nil?
                          nil
                        else
                          Pathname.new("/#{search_asset_path}").cleanpath
                        end
  @web_path = if web_path.nil?
                nil
              else
                Pathname.new("/#{web_path}/web_assets").cleanpath
              end
end

Instance Attribute Details

#search_assets_path(branch_dir = nil) ⇒ Object



107
108
109
110
111
112
113
# File 'lib/giblish/utils.rb', line 107

def search_assets_path(branch_dir = nil)
  if branch_dir.nil?
    @search_assets_path
  else
    @search_assets_path.join(branch_dir)
  end
end

#web_pathObject (readonly)

Returns the value of attribute web_path.



92
93
94
# File 'lib/giblish/utils.rb', line 92

def web_path
  @web_path
end