Class: GemfileLocker::GemfileProcessor::Rewriter

Inherits:
Parser::TreeRewriter
  • Object
show all
Defined in:
lib/gemfile_locker/gemfile_processor.rb

Instance Method Summary collapse

Instance Method Details

#on_send(node) ⇒ Object



13
14
15
16
17
18
# File 'lib/gemfile_locker/gemfile_processor.rb', line 13

def on_send(node)
  children = node.children
  return unless children[0].nil? && node.children[1] == :gem
  gem_entry = GemEntry.new(self, node)
  @rewrite_block[gem_entry]
end

#rewrite(*args, &block) ⇒ Object



8
9
10
11
# File 'lib/gemfile_locker/gemfile_processor.rb', line 8

def rewrite(*args, &block)
  @rewrite_block = block
  super(*args)
end