Top Level Namespace

Defined Under Namespace

Modules: PREP Classes: HPDFPage, Numeric

Instance Method Summary collapse

Instance Method Details

#conv(msg) ⇒ Object

文字列変換



10
11
12
13
14
15
16
17
18
# File 'bin/prep-test', line 10

def conv(msg)
  if is_win?
    encoding = 'cp932'
  else
    encoding = 'utf8'
  end

  return NKF.nkf("--oc=#{encoding}", msg)
end

#is_win?Boolean

OS 判定

Returns:

  • (Boolean)


5
6
7
# File 'bin/prep-test', line 5

def is_win?
  return RUBY_PLATFORM.downcase =~ /mswin(?!ce)|mingw|cygwin|bccwin/
end

#usageObject

usage



21
22
23
# File 'bin/prep-test', line 21

def usage
  puts conv("Usage: #{File.basename($0)} report_yaml_file_path pdf_output_path")
end