Skip to content

Instantly share code, notes, and snippets.

@yllan
Created October 16, 2011 13:46
Show Gist options
  • Select an option

  • Save yllan/1290892 to your computer and use it in GitHub Desktop.

Select an option

Save yllan/1290892 to your computer and use it in GitHub Desktop.
hypo 疑難排除

執行 Rails 程式之前

env RAILS_ENV="production"

生 pdf

  • 12SQ / ticket 用 bin/runpdf.rb run sale_id
  • wide 用 bundle_wide_pdf/runpdf.rb sale [tw|cn]_[sale_id]
  • Qcard 用 bin/runpdf_remote_once.rb run sale_id

把 WIDE 進度放回編輯器

script/console


a = HypoOrder.find_by_sale_id xxxxx
b = a.to_book
b.save

重開後

記得


cd ../hypoQcard/
ls
nohup bin/pageserver.rb &

書衣重生條碼

  • 12SQ 用 ./bin/BarcodeOverprinter.app/Contents/MacOS/BarcodeOverprinter input.pdf bookcloth BARCODE output.pdf

Calendar 生單獨頁面

./script/rails console 取得該頁 json:

o = HypoOrder.find_by_sale_id xxxxx
d = JSON.parse(o.data)
File.open(**json_path**, 'w') {|f| f.write(d[index].to_json) }

然後再跑 ./tools/CalendarTick.rb - **output_pdf_path** < **json_path**

12SQ 找資料

注意進 console 後要用 ProductSource

t = ProductSource.find(:all, :conditions=>["sale_id = ?", 33406])
t.data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment