lightly 0.1.4 → 0.1.5

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: 1c9b0b2be3fe414c1c6509bb156b89c9ea7d3f17
4
- data.tar.gz: 804c1020ef14715fa483d23c8fa6c9f4537d43f0
3
+ metadata.gz: 1c2942318c34892daf4b704803193ba893439552
4
+ data.tar.gz: 8a88022275376cf8f59815329808e9a16e1e7f90
5
5
  SHA512:
6
- metadata.gz: c765930300c11c45a40f396488cf850f0e2258bfe457f1eeb70b8bcc678329c61ef60e636efab98601435208bded4243d65a54fb080f99a6b982d1a79d3a0831
7
- data.tar.gz: 2420af8eb4db7877fcb9b32537ffcdbc92d1cbfe8f0005c7e51106a8a6e5faea1732a7ca3f10c36456e06bc1cb3b729c50dee21f9bccaeb9b2a28ca290b15e77
6
+ metadata.gz: 21a98d53fc241456a8870c14a32e482b3dbbed680671cb3efb4f7ae8a0dbdbd219f6143bf4bb50372bbafe7cf8888b9a840dfe800fece5bfbb5b33095f1d821c
7
+ data.tar.gz: 06406c0d223ba4f8d14a7968eba81f95f079ec276e13c8368b34157d8a10ae8d73d1a9fd72739dd2808a583c804ad0903f3801a7d53008fd65db048c81f7a13d
data/README.md CHANGED
@@ -110,6 +110,13 @@ lightly = Lightly.new
110
110
  lightly.flush
111
111
  ```
112
112
 
113
+ To clear the cache for a given key, call:
114
+
115
+ ```ruby
116
+ lightly = Lightly.new
117
+ lightly.clear 'example'
118
+ ```
119
+
113
120
  ---
114
121
 
115
122
  For a similar gem that provides caching specifically for HTTP downloads,
@@ -19,6 +19,11 @@ class Lightly
19
19
  content
20
20
  end
21
21
 
22
+ def clear(key)
23
+ path = get_path key
24
+ FileUtils.rm path if File.exist? path
25
+ end
26
+
22
27
  def flush
23
28
  return false if dir == '/' || dir.empty?
24
29
  FileUtils.rm_rf dir
@@ -1,3 +1,3 @@
1
1
  class Lightly
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lightly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-30 00:00:00.000000000 Z
11
+ date: 2016-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: runfile
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  version: '0'
111
111
  requirements: []
112
112
  rubyforge_project:
113
- rubygems_version: 2.5.1
113
+ rubygems_version: 2.6.6
114
114
  signing_key:
115
115
  specification_version: 4
116
116
  summary: File cache for performing heavy tasks, lightly.