lightly 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5956b20bd30f21389e0f3dc3daf5c5a2362b7224
4
- data.tar.gz: 5449ea6caf3d6388f32237911dde0efff5e58b9b
3
+ metadata.gz: 49e684faad48b523195a4ae035b1ab73266f1d86
4
+ data.tar.gz: 7a5b109eb7b8553a0fb0a303868f45cf4c7fecb5
5
5
  SHA512:
6
- metadata.gz: 8fafa50075e2d06872960f7903567a3d2b90a35df632dc068df554e3e471408131a7345ed48d65ac53dfe4b649faf867fdc5f7f7a8bab7a6b403a021dbbdd7f6
7
- data.tar.gz: edc55cef7671a634ee7fdffa6e8187f6811511a2b48b683ff20ddbd63c7e74342ad0cfe0351bd01c3eae6299767b948c854736dc3017b665d4f2293c8f77ee75
6
+ metadata.gz: 9213c70b1e949ff94950384e7539d5f1c6869e5677a09affdbfa6d409ff8b483775c4bcb7230d7a258a1554640bd8e013ee98630485ee278b358c6c1680ad646
7
+ data.tar.gz: e369201931051ee110404b3ad87636012aff1665c8ee00c1660a5edd2930a5b9cbf6c0d7e68012d757cabd6fa02eca63747a030baf92c0561e69ffe2f77d52d4
data/README.md CHANGED
@@ -98,6 +98,13 @@ lightly.cached? 'example'
98
98
  # => true
99
99
  ```
100
100
 
101
+ To flush the cache, call:
102
+
103
+ ```ruby
104
+ lightly = Lightly.new
105
+ lightly.flush
106
+ ```
107
+
101
108
  The `key` method is an alias to `with`, if you prefer a different wording:
102
109
 
103
110
  ```ruby
@@ -29,6 +29,11 @@ class Lightly
29
29
  @enabled
30
30
  end
31
31
 
32
+ def cached?(key)
33
+ path = get_path key
34
+ File.exist? path and !expired? path
35
+ end
36
+
32
37
  def enable
33
38
  @enabled = true
34
39
  end
@@ -37,11 +42,6 @@ class Lightly
37
42
  @enabled = false
38
43
  end
39
44
 
40
- def cached?(key)
41
- path = get_path key
42
- File.exist? path and !expired? path
43
- end
44
-
45
45
  private
46
46
 
47
47
  def save(key, content)
@@ -1,3 +1,3 @@
1
1
  class Lightly
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lightly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit