Module: Bundler::GemBytes::Actions
- Included in:
- ScriptExecutor
- Defined in:
- lib/bundler/gem_bytes/actions.rb,
lib/bundler/gem_bytes/actions/gemspec.rb,
lib/bundler/gem_bytes/actions/gemspec/attribute.rb,
lib/bundler/gem_bytes/actions/gemspec/dependency.rb,
lib/bundler/gem_bytes/actions/gemspec/attribute_node.rb,
lib/bundler/gem_bytes/actions/gemspec/dependency_node.rb,
lib/bundler/gem_bytes/actions/gemspec/delete_dependency.rb,
lib/bundler/gem_bytes/actions/gemspec/gem_specification.rb,
lib/bundler/gem_bytes/actions/gemspec/upsert_dependency.rb
Overview
The API for GemBytes templates
Defined Under Namespace
Classes: Gemspec
Instance Method Summary collapse
-
#gemspec(gemspec_path: Dir['*.gemspec'].first) {|gemspec_name, gemspec| ... } ⇒ void
The gemspec at ‘gemspec_path` is updated per instructions in `action_block`.
Instance Method Details
#gemspec(gemspec_path: Dir['*.gemspec'].first) {|gemspec_name, gemspec| ... } ⇒ void
This method returns an undefined value.
The gemspec at ‘gemspec_path` is updated per instructions in `action_block`
33 34 35 36 37 38 |
# File 'lib/bundler/gem_bytes/actions.rb', line 33 def gemspec(gemspec_path: Dir['*.gemspec'].first, &action_block) source = File.read(gemspec_path) action = Bundler::GemBytes::Actions::Gemspec.new(context: self) updated_source = action.call(source, source_path: gemspec_path, &action_block) File.write(gemspec_path, updated_source) end |