class InvocaGems::GemspecLine attr_reader :gemspec, :gem_name, :line, :index, :prefix def initialize(gemspec, gem_name, line, index) @gemspec = gemspec @gem_name = gem_name @line = line @index = index @prefix = @line.match(/\A(\s*\S+\s+)[\'\"]/)[1] end def save! gemspec.save!(self) end def update_version(new_version) @line = "#{@prefix}'#{gem_name}', '#{new_version}'" end end