diff --git a/CHANGELOG.md b/CHANGELOG.md index e531895..016a1c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +0.2.1 +----- + +- Fix issue when cache dir not exist. + 0.2.0 ----- diff --git a/lib/rucaptcha/cache.rb b/lib/rucaptcha/cache.rb index 783f7bd..d82b23c 100644 --- a/lib/rucaptcha/cache.rb +++ b/lib/rucaptcha/cache.rb @@ -1,3 +1,5 @@ +require 'fileutils' + module RuCaptcha # File Cache module Cache @@ -31,6 +33,9 @@ module RuCaptcha return @cache if defined?(@cache) cache_path = Rails.root.join('tmp', 'cache', 'rucaptcha') + if !File.exists? cache_path + FileUtils.mkdir_p(cache_path) + end @cache = ActiveSupport::Cache::FileStore.new(cache_path) @cache.clear @cache diff --git a/lib/rucaptcha/version.rb b/lib/rucaptcha/version.rb index 4269518..808d2fb 100644 --- a/lib/rucaptcha/version.rb +++ b/lib/rucaptcha/version.rb @@ -1,3 +1,3 @@ module RuCaptcha - VERSION = '0.2.0' + VERSION = '0.2.1' end