view · edit · sidebar · attach · print · history

20121012-create-fachinfo-chapter-exporter-job

<< 20121015-update-fachinfo-chapter-exporter-job | 2012 | 20121011-fixed-delete-link-instant-search-update-generika-lookandfeel >>


Summary

  • Create fachinfo chapter exporter job

Commits

Index


Create fachinfo chapter exporter job

$ ruby jobs/export_fachinfo_chapter test  amzv usage
$ ruby jobs/export_fachinfo_chapter test  amzv usage fr
$ ruby jobs/export_fachinfo_chapter test --chapter amzv usage
$ ruby jobs/export_fachinfo_chapter "test more" --chapter amzv usage --lang fr

net/protocol encoding warning

/path/to/ruby/1.9.1/net/protocol.rb:313: warning: regexp match /.../n against to UTF-8 string
/path/to/ruby/1.9.1/net/protocol.rb:313: warning: regexp match /.../n against to UTF-8 string
/path/to/ruby/1.9.1/net/protocol.rb:313: warning: regexp match /.../n against to UTF-8 string
...
# for encoding warning of each_crlf_line
require 'net/protocol'
class Net::InternetMessageIO
  private
  def each_crlf_line_with_force_encoding(src)
    buffer_filling(@wbuf, src) do
      @wbuf.force_encoding('ASCII-8BIT')
      while line = @wbuf.slice!(/\A.*(?:\n|\r\n|\r(?!\z))/n)
        yield line.chomp("\n") + "\r\n"
      end
    end
  end
  alias_method :each_crlf_line_without_force_encoding, :each_crlf_line
  alias_method :each_crlf_line, :each_crlf_line_with_force_encoding
end

Finaly used gzip(Binaly, ASCII-8BIT) as attachment.

commit

EX.

# Job
$ ruby jobs/export_fachinfo_chapter mg usage effects

# E-mail
Anzahl:                          13901
Packages:                        12413

Chapters:                        usage,effects
Lang:                            de
Term:                            mg

File: /var/ch.oddb.org/data/downloads/fachinfo_chapter_usage-effects_mg.2012-10-13.csv

# Attach
fachinfo_chapter_usage-effects_mg.2012-10-13.csv.gz
view · edit · sidebar · attach · print · history
Page last modified on February 28, 2014, at 11:59 AM