Class: Ji2p::Package::GemInstaller

Inherits:
Object
  • Object
show all
Defined in:
lib/ji2p/package/gem_installer.rb

Constant Summary collapse

GEM_HOME =
Pathname.new(::File.join(Ji2p::Environment::BUNDLE_DIR, "jruby", "2.5.0"))
SPECIFICATIONS_DIR =
"specifications"
GEMS_DIR =
"gems"
CACHE_DIR =
"cache"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gem_file, display_post_install_message = false, gem_home = GEM_HOME) ⇒ GemInstaller

Returns a new instance of GemInstaller.



18
19
20
21
22
23
# File 'lib/ji2p/package/gem_installer.rb', line 18

def initialize(gem_file, display_post_install_message = false, gem_home = GEM_HOME)
  @gem_file = gem_file
  @gem = ::Gem::Package.new(@gem_file)
  @gem_home = Pathname.new(gem_home)
  @display_post_install_message = display_post_install_message
end

Instance Attribute Details

#gem_homeObject (readonly)

Returns the value of attribute gem_home.



16
17
18
# File 'lib/ji2p/package/gem_installer.rb', line 16

def gem_home
  @gem_home
end

Class Method Details

.install(gem_file, display_post_install_message = false, gem_home = GEM_HOME) ⇒ Object



33
34
35
# File 'lib/ji2p/package/gem_installer.rb', line 33

def self.install(gem_file, display_post_install_message = false, gem_home = GEM_HOME)
  self.new(gem_file, display_post_install_message, gem_home).install
end

Instance Method Details

#installObject



25
26
27
28
29
30
31
# File 'lib/ji2p/package/gem_installer.rb', line 25

def install
  create_destination_folders
  extract_files
  write_specification
  copy_gem_file_to_cache
  post_install_message
end