Skip to content

Instantly share code, notes, and snippets.

@sunny4381
Last active September 21, 2023 01:14
Show Gist options
  • Save sunny4381/958f4d401a375003f362e7b36ef8ab5d to your computer and use it in GitHub Desktop.
Save sunny4381/958f4d401a375003f362e7b36ef8ab5d to your computer and use it in GitHub Desktop.
#
# 使用方法:
# bundle exec rails runner all_contents_download.rb www > all_contents.csv
#
site = Cms::Site.find_by(host: ARGV[0])
exporter = Cms::AllContent.new(site: site)
enumerable = exporter.enum_csv(encoding: "Shift_JIS")
enumerable.each do |csv|
STDOUT.write csv
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment