Class: Packerman::Client

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

Instance Method Summary collapse

Instance Method Details

#convert(file) ⇒ Object



2
3
4
5
6
7
8
9
10
11
# File 'lib/packerman/client.rb', line 2

def convert(file)
  basename = File.basename(file, ".*")
  puts "converting #{file} to #{basename}.json ..."

  template = File.open(file).read
  File.open("#{basename}.json", "w") do |f|
    f.write to_json(template)
  end
  puts "converted!"
end