active_warnings 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6377ec19d1daf91d25d3c24a16b414d99f427f77
4
- data.tar.gz: a5a7cea71f84d2560407b8bc4661bd1421ee7b0e
3
+ metadata.gz: 3187048552ec6736d66f4d7cd5745b6380f1efc7
4
+ data.tar.gz: e65380ae6eadca11f13d1759fe8636fb54a38022
5
5
  SHA512:
6
- metadata.gz: fc5ec22bfedbc64d976ecf1470946189119d915e0946477421b94c0f0d66fbc698700901eeea07bdd0fdb8117ab895019aa6bdafe7fafd86a08ccf25c0958dec
7
- data.tar.gz: 24900fdbd7de478b0c86c274e9323ae83fffd023791228f2ce352ace50cff4e4a229615a0e8e01e8f2783ed13ce1e98c40a572615e31305323686248f98f374f
6
+ metadata.gz: 14ad7b0873b4fcac5774d51e6b77809e41b87da2feb0323b5356f51a331e56da6b2e8be45d6723ab7faefdba16ca970fb096e42b050f73b6fe77f19b8f8c6c64
7
+ data.tar.gz: 69db322b781c0118994613821ce2c2ceae90a556662d1140d59fbf711c7d70d5febb8e7d64df7c6a7902b41dd7be08ac6c34915ba3943d488eb5e9dd3a5c7903
data/README.md CHANGED
@@ -37,7 +37,12 @@ end
37
37
 
38
38
  model = BasicModel.new(name: "a")
39
39
  model.valid? # => true
40
- model.safe? == model.no_warnings? # => false
41
- model.warnings.keys # => [:warning_name]
42
40
  model.errors.keys # => []
41
+
42
+ model.safe? # => false
43
+ model.no_warnings? # => false, equivalent to #safe?
44
+ model.warnings.keys # => [:warning_name]
45
+
46
+ model.using_warnings? # => false, is true if warnings are used (within #safe call)
47
+
43
48
  ```
@@ -53,18 +53,18 @@ module ActiveWarnings
53
53
  alias_method :has_warnings?, :unsafe?
54
54
 
55
55
  def safe?(context=nil)
56
- with_warnings { valid?(context) }
56
+ using_warnings { valid?(context) }
57
57
  end
58
58
  alias_method :no_warnings?, :safe?
59
59
 
60
- def with_warnings
60
+ def using_warnings
61
61
  @run_warning_validations = true
62
62
  yield
63
63
  ensure
64
64
  @run_warning_validations = nil
65
65
  end
66
66
 
67
- def with_warnings?
67
+ def using_warnings?
68
68
  !!@run_warning_validations
69
69
  end
70
70
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveWarnings
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_warnings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Chung
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-07-23 00:00:00.000000000 Z
11
+ date: 2015-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel