Class: OfflineDeployer::GemsHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/offline_deployer/gems_handler.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from_tag, to_tag, app_root, zip_file_path, from_path = nil) ⇒ GemsHandler

Returns a new instance of GemsHandler.



3
4
5
6
7
8
9
10
# File 'lib/offline_deployer/gems_handler.rb', line 3

def initialize(from_tag, to_tag, app_root, zip_file_path, from_path = nil)
  @zip_file_path = zip_file_path
  @from_tag = from_tag
  @to_tag = to_tag
  @app_root = app_root
  @from_path = from_path || default_from_path
  @branch = current_branch
end

Instance Attribute Details

#app_rootObject (readonly)

Returns the value of attribute app_root.



12
13
14
# File 'lib/offline_deployer/gems_handler.rb', line 12

def app_root
  @app_root
end

#branchObject (readonly)

Returns the value of attribute branch.



12
13
14
# File 'lib/offline_deployer/gems_handler.rb', line 12

def branch
  @branch
end

#from_pathObject (readonly)

Returns the value of attribute from_path.



12
13
14
# File 'lib/offline_deployer/gems_handler.rb', line 12

def from_path
  @from_path
end

#from_tagObject (readonly)

Returns the value of attribute from_tag.



12
13
14
# File 'lib/offline_deployer/gems_handler.rb', line 12

def from_tag
  @from_tag
end

#to_tagObject (readonly)

Returns the value of attribute to_tag.



12
13
14
# File 'lib/offline_deployer/gems_handler.rb', line 12

def to_tag
  @to_tag
end

#zip_file_pathObject (readonly)

Returns the value of attribute zip_file_path.



12
13
14
# File 'lib/offline_deployer/gems_handler.rb', line 12

def zip_file_path
  @zip_file_path
end

Instance Method Details

#callObject



14
15
16
17
18
19
20
# File 'lib/offline_deployer/gems_handler.rb', line 14

def call
  prepare_tmp_folder
  copy_gems_to_tmp_folder
  add_gems_to_zip
  destroy_tmp_folder
  checkout_branch
end