Sha256: 48082aa71035ff37840c4234363b72390d6b5159e1ef0409a49e41ebcf073b2d

Contents?: true

Size: 795 Bytes

Versions: 3

Compression:

Stored size: 795 Bytes

Contents

#!/usr/bin/env ruby

require "rubygems"
require "#{__dir__}/../lib/rgettext_poedit"


# Logging.
$fp_log = File.open("/tmp/rgettext_poedit.log", "a")
def debug(str)
  puts "#{str}" if $debug
  $fp_log.puts str
end


# Log initial stuff for debugging.
debug "ARGV: #{ARGV.join(", ")}"
debug "Executed command: #{Knj::Os.executed_cmd}"
debug "ENV: #{ENV.to_hash}"


# Parse arguments.
files = []
skipnext = false
ofn = nil

count = 0
ARGV.each do |value|
  if skipnext
    skipnext = false
    next
  end
  
  skipnext = false
  
  if value == "-o"
    ofn = ARGV[count + 1]
    skipnext = true
  elsif value == "--debug"
    $debug = true
  else
    files << value
  end
  
  count += 1
end

rgp = RgettextPoedit.new(
  :files => files,
  :output_filepath => ofn
)
rgp.parse_files
rgp.write_file

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rgettext_poedit-0.0.2 bin/rgettext_poedit
rgettext_poedit-0.0.1 bin/rgettext_poedit
rgettext_poedit-0.0.0 bin/rgettext_poedit