lib/kanoko/configure.rb in kanoko-0.0.2 vs lib/kanoko/configure.rb in kanoko-0.0.3
- old
+ new
@@ -10,19 +10,19 @@
# digest_func expect String
# secret_key expect String
# hash_proc expect Proc
#
# example:
- # Kanoko.configure.tap do |c|
+ # Kanoko.configure do |c|
# c.kanoko_host = "http://example.com"
# c.digest_func = "sha1"
# c.secret_key = "secret"
# end
# Kanoko.url_for(:resize, "100x100") #=> "http://example.com/.../.../..."
def initialize
@kanoko_host = nil
- @digest_func = nil
- @secret_key = nil
+ @digest_func = ENV['KANOKO_DIGEST_FUNC']
+ @secret_key = ENV['KANOKO_SECRET_KEY']
@hash_proc = ->(*args){
if @digest_func.nil? || @secret_key.nil?
fail ConfigureError, "`digest_func' and `secret_key' must be set"
end
Base64.urlsafe_encode64(