Class: BundleHack::GemspecCloner

Inherits:
Object
  • Object
show all
Defined in:
lib/bundle_hack/gemspec_cloner.rb

Instance Method Summary collapse

Constructor Details

#initialize(gem, root_path, options = {}) ⇒ GemspecCloner

Returns a new instance of GemspecCloner.



5
6
7
8
9
10
11
# File 'lib/bundle_hack/gemspec_cloner.rb', line 5

def initialize(gem, root_path, options = {})
  @use_cache = options.fetch(:use_cache, true)
  @use_rubygems = options.fetch(:use_rubygems, true)
  @gem = gem
  @root_path = root_path
  @spec_path = @root_path.join(HACK_DIR, @gem.name, "#{@gem.name}.gemspec")
end

Instance Method Details

#cloneObject



13
14
15
16
# File 'lib/bundle_hack/gemspec_cloner.rb', line 13

def clone
  FileUtils.mkdir_p(@root_path.join(HACK_DIR, @gem.name))
  File.write(@spec_path, find_spec)
end