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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a0e6a29f2972f187cb1732bccd2228d97e4fcc4
4
- data.tar.gz: a9415cbdc4633d3874a4f74c7d47592c7f644876
3
+ metadata.gz: 6b2d653da08ef4da6da66125dbadaa2bafe4bf27
4
+ data.tar.gz: a34bc8a9fa206d64e91bcc8050bbc8292dc7c21e
5
5
  SHA512:
6
- metadata.gz: 621005d40aef390b2fb9e16f0973e1fef10100b3c4c822859209b29bec5d047266ae3f2ca4ebf2bdebeb3ba07f35093b140df957fe56dbb1b43f653bcba996bc
7
- data.tar.gz: 4404a71ec56fe989b666f2608ce74cf01d3a6e37807bae31be693abc232648b16d8580edafdbedbcab2e7745ebd6684f3d7216a5a5f9de8bb2f83c4ae9949c18
6
+ metadata.gz: 5e67f1e690a4646bac71b42df63a3c7b6fab57111c382b4b588a63922711fe1d68fee2baa1dcc56c2389954d3aef45c5dc485def0d258c48e0bdf77b7eee71de
7
+ data.tar.gz: 21a9f264caae994b9348201f6e0c23f3009a7fe1881eec9688fe648e46dc8f1e3a33552a612a8b1ebf58689cfae883d366e15cda1c21bb9e7d1141e82d648abc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stale_options (0.1.0)
4
+ stale_options (0.1.1)
5
5
  activerecord (>= 5.0, < 6.0)
6
6
  activesupport (>= 5.0, < 6.0)
7
7
 
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
 
@@ -15,11 +15,15 @@ module StaleOptions
15
15
  # end
16
16
  #
17
17
  def if_stale?(record, options = {})
18
- yield(record) if stale?(StaleOptions.create(record, options))
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
- yield(record) unless stale?(StaleOptions.create(record, options))
24
+ unless stale?(StaleOptions.create(record, options))
25
+ block_given? ? yield(record) : true
26
+ end
23
27
  end
24
28
  end
25
29
  end
@@ -1,3 +1,3 @@
1
1
  module StaleOptions
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  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.0
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-08 00:00:00.000000000 Z
11
+ date: 2018-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord