Class: BundleHack::GemspecCloner
- Inherits:
-
Object
- Object
- BundleHack::GemspecCloner
- Defined in:
- lib/bundle_hack/gemspec_cloner.rb
Instance Method Summary collapse
- #clone ⇒ Object
-
#initialize(gem, root_path, options = {}) ⇒ GemspecCloner
constructor
A new instance of GemspecCloner.
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, = {}) @use_cache = .fetch(:use_cache, true) @use_rubygems = .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
#clone ⇒ Object
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 |