This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bson" | |
require "digest/sha2" | |
d = Digest::SHA256.new | |
d << "test" | |
string = d.digest | |
puts string.encoding | |
binary = BSON::Binary.new string | |
puts binary.to_bson |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/tasks/assets.rake | |
namespace :assets do | |
ManifestPattern = /^manifest-[0-9a-f]{32}\.json$/ | |
ExtensionsToCompress = %w{.js .css .json}.freeze | |
desc "GZip assets" | |
task :compress do | |
files = Pathname.glob(Rails.root.join('public/assets/**/*')).map do |file| | |
next unless file.extname.in? ExtensionsToCompress |
NewerOlder