lib/xcmultilingual/parser.rb in xcmultilingual-0.1.7 vs lib/xcmultilingual/parser.rb in xcmultilingual-0.2.0
- old
+ new
@@ -7,12 +7,11 @@
def initialize(destination)
@destination = destination
end
def parse
- puts "+ START PARSING" if @verbose
- puts "" if @verbose
+ puts "[START PARSING]" if @verbose
destination_path = File.expand_path(@destination)
destination_dir = File.dirname(destination_path)
bundles = {}
@@ -39,11 +38,11 @@
# keys
File.readlines(file_path, encoding: 'UTF-8').each do |line|
safe_line = line.scrub('?')
if key = find_key(safe_line)
bundles[bundle_name][:tables][name] << key
- puts " PARSE: #{File.basename(file_path)} > #{line}" if @verbose
+ puts "<#{File.basename(file_path)}> #{line}" if @verbose
end
end
end
bundle_data = []
@@ -52,16 +51,14 @@
v[:tables].each do |o, p|
table = Table.new(o, p.to_a)
bundle.tables << table
end
- puts "" if @verbose
puts "#{bundle.description}" if @verbose
bundle_data << bundle
end
- puts "" if @verbose
- puts "+ PARSE SUCCEEDED" if @verbose
+ puts "[PARSE SUCCEEDED]" if @verbose
puts "" if @verbose
bundle_data
end