Class: KRL_CMD::Commit

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

Class Method Summary collapse

Class Method Details

.go(options) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/commit.rb', line 3

def self.go(options)
  app = KRL_COMMON::get_app
  krl_file = File.join(Dir.pwd, app.application_id + ".krl")
  if File.exists?(krl_file)
    begin
      app.krl = File.open(krl_file, 'r') { |f| f.read }
		app.set_version_note(app.version, options["note"]) if options["note"]
      puts "Committed version: #{app.version}"
      if options["deploy"]
        KRL_CMD::Deploy.go({"version" => app.version})
      end
    rescue KRLParseError => e
      puts "Unable to parse your krl."
      puts "Errors:"
      puts e.parse_errors.join("\n")
    end
  else
    raise "Unable to find file: #{krl_file}"
  end
end