Class: JsonLog
- Inherits:
-
Object
- Object
- JsonLog
- Defined in:
- lib/jsonlog.rb
Instance Method Summary collapse
- #finalize ⇒ Object
-
#initialize ⇒ JsonLog
constructor
A new instance of JsonLog.
Constructor Details
#initialize ⇒ JsonLog
Returns a new instance of JsonLog.
4 5 |
# File 'lib/jsonlog.rb', line 4 def initialize end |
Instance Method Details
#finalize ⇒ Object
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 |