stale_options 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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +8 -5
- data/lib/backend/backend.rb +6 -2
- data/lib/stale_options/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b2d653da08ef4da6da66125dbadaa2bafe4bf27
|
4
|
+
data.tar.gz: a34bc8a9fa206d64e91bcc8050bbc8292dc7c21e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e67f1e690a4646bac71b42df63a3c7b6fab57111c382b4b588a63922711fe1d68fee2baa1dcc56c2389954d3aef45c5dc485def0d258c48e0bdf77b7eee71de
|
7
|
+
data.tar.gz: 21a9f264caae994b9348201f6e0c23f3009a7fe1881eec9688fe648e46dc8f1e3a33552a612a8b1ebf58689cfae883d366e15cda1c21bb9e7d1141e82d648abc
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# StaleOptions
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/stale_options.svg)](https://badge.fury.io/rb/stale_options)
|
3
4
|
[![Build Status](https://travis-ci.org/digaev/stale_options.svg?branch=master)](https://travis-ci.org/digaev/stale_options) [![Coverage Status](https://coveralls.io/repos/github/digaev/stale_options/badge.svg?branch=master)](https://coveralls.io/github/digaev/stale_options?branch=master)
|
4
5
|
|
5
6
|
A gem for caching HTTP responses.
|
@@ -8,11 +9,13 @@ The gem was built with an idea to implement a class which will create options fo
|
|
8
9
|
|
9
10
|
___
|
10
11
|
|
11
|
-
* Installation
|
12
|
-
* Usage
|
13
|
-
* Caching options
|
14
|
-
* Examples
|
15
|
-
* Controller helpers
|
12
|
+
* [Installation](#installation)
|
13
|
+
* [Usage](#usage)
|
14
|
+
* [Caching options](#caching-options)
|
15
|
+
* [Examples](#examples)
|
16
|
+
* [Controller helpers](#controller-helpers)
|
17
|
+
* [Contributing](#contributing)
|
18
|
+
* [License](#license)
|
16
19
|
|
17
20
|
## Installation
|
18
21
|
|
data/lib/backend/backend.rb
CHANGED
@@ -15,11 +15,15 @@ module StaleOptions
|
|
15
15
|
# end
|
16
16
|
#
|
17
17
|
def if_stale?(record, options = {})
|
18
|
-
|
18
|
+
if stale?(StaleOptions.create(record, options))
|
19
|
+
block_given? ? yield(record) : true
|
20
|
+
end
|
19
21
|
end
|
20
22
|
|
21
23
|
def unless_stale?(record, options = {})
|
22
|
-
|
24
|
+
unless stale?(StaleOptions.create(record, options))
|
25
|
+
block_given? ? yield(record) : true
|
26
|
+
end
|
23
27
|
end
|
24
28
|
end
|
25
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stale_options
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikolay Digaev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|