Class: PortalGun::Firing

Inherits:
Object
  • Object
show all
Defined in:
lib/portal_gun/firing.rb

Instance Method Summary collapse

Instance Method Details

#start(date = nil, gem_file_source = nil, ruby_versions = nil) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/portal_gun/firing.rb', line 7

def start(date=nil, gem_file_source=nil, ruby_versions=nil)
  date = eval(date) unless date.nil?
  gem_file_source ||= "Gemfile"
  puts "I don't know about this Rick...."
  date ||= (Date.today - 365)
  write_line(intro_block)

  write_line("#These are the most stable versions of the three latest minor ruby releases as of this point in time. Uncomment the one you wish to use.\n")
  ruby_versions.each do |rv|
    write_line "#ruby #{rv}"
  end
  write_line("\n")
  read_gem_file(gem_file_source).each do |line|
    if valid_gem_line(line)
      puts "Now processing: #{line}"
      write_line(find_latest_by_date(date, line))
    else
      write_line(line)
    end
  end
end