fc2 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/lib/fc2.rb +3 -2
  4. data/lib/fc2/version.rb +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ce91581a0986b9b1bea724e1db1de8435d7ab9cc
4
- data.tar.gz: a9603fcc5255c5454867d90f86592e1738414fc2
3
+ metadata.gz: 5be86c57f3df20b9bae13d9959a89cc821f369c8
4
+ data.tar.gz: 2d3d29e7bc7da4ca0f8e96c3acd60c6cf2fa5fba
5
5
  SHA512:
6
- metadata.gz: dbec70f7f20bb815989b0826f3dc79b7552d63c5cac882a1a7f000fcba4e95f28b473282dc252c65665f21e3c2165ddb580cb5e80223bc0327744786d4575828
7
- data.tar.gz: 2951a29fc6ed9b3975e64b833ac7a970bfb4fa92f4255476c967fec641b169d12879e40265341366ba5abe1c23f678e779b79b02e3b827d2c05101157483b167
6
+ metadata.gz: 37394972d6a88044ab537263d5f8da338ccc370deb1fd6dda368604033ce9482fb7ed5357dfefd9287905c6c786c9c17e1a079bd3a4cabbc2fd816afb500bf0e
7
+ data.tar.gz: b39a6952cd003c733a29e236a72e176d01ad48e95ea309e2bccf74a16676c28a17920c8558eba4fa109cf877ba082d7d73858e374b1d42964523feb589b37167
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Fc2
2
2
 
3
- Very simple file cahce.
3
+ Very simple file cache.
4
4
 
5
5
 
6
6
  ## Installation
@@ -29,7 +29,7 @@ end
29
29
 
30
30
  or
31
31
 
32
- ```
32
+ ```ruby
33
33
  class Foo
34
34
  include Fc2
35
35
 
data/lib/fc2.rb CHANGED
@@ -12,7 +12,7 @@ module Fc2
12
12
  def use_cache(method_name)
13
13
  prepend(Module.new do
14
14
  define_method(method_name) do |*args, &block|
15
- Fc2.fetch do
15
+ Fc2.fetch(key: "#{self.class}\##{__method__}") do
16
16
  super(*args, &block)
17
17
  end
18
18
  end
@@ -20,7 +20,8 @@ module Fc2
20
20
  end
21
21
  end
22
22
 
23
- def self.fetch(key: Digest::MD5.hexdigest(caller.first), expires_in: 300)
23
+ def self.fetch(key: caller.first, expires_in: 300)
24
+ key = Digest::MD5.hexdigest(key)
24
25
  path = File.expand_path(key, cache_dir)
25
26
  return Marshal.load(File.read(path)) if use_cache?(path, expires_in)
26
27
  dump(path, yield)
@@ -1,3 +1,3 @@
1
1
  module Fc2
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fc2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshiori SHOJI