Class: JsonLog

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

Instance Method Summary collapse

Constructor Details

#initializeJsonLog

Returns a new instance of JsonLog.



4
5
# File 'lib/jsonlog.rb', line 4

def initialize
end

Instance Method Details

#finalizeObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/jsonlog.rb', line 7

def finalize
	name='DEV'
	ARGV.each do|a|
		name="#{name}.#{a}"
	end
	name="#{name}.json"
	FileUtils.mkdir("#{DEV[:dev_root]}/log") if !File.exists?("#{DEV[:dev_root]}/log")
	File.open("#{DEV[:dev_root]}/log/#{name}","w") do |f|
 			f.write(JSON.pretty_generate(DEV))
	end
end