ensurance 0.1.0 → 0.1.1
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 +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +3 -3
- data/ensurance.gemspec +3 -3
- data/file:memdb1?mode=memory&cache=shared +0 -0
- data/lib/ensurance.rb +0 -4
- data/lib/ensurance/date.rb +4 -1
- data/lib/ensurance/hash.rb +7 -2
- data/lib/ensurance/time.rb +5 -1
- data/lib/ensurance/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2730601cced0af6c9f54a2aabf877098b16b234d
|
|
4
|
+
data.tar.gz: 8ad471692d7c97dccdfa3a71dbdb1325840c61fd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1bedafd66aa7f785ff06f002f63c5acbe02db78f61fb8cb5b495a5f568237de2a31bc52b20fd7561cb75290118aed60d10e27ee1ca95835b748c9987fc6e6d43
|
|
7
|
+
data.tar.gz: 339991a51002d16c3d20e301733a4a685454873465ea48abae780553709be61b88229ade531e64da2335b1c814daba8fa8c1ada1e5105ecef61dd48b19a3642e
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -49,13 +49,13 @@ PLATFORMS
|
|
|
49
49
|
ruby
|
|
50
50
|
|
|
51
51
|
DEPENDENCIES
|
|
52
|
-
activerecord (>= 3)
|
|
52
|
+
activerecord (>= 3, < 6)
|
|
53
53
|
bundler (~> 1.16)
|
|
54
54
|
ensurance!
|
|
55
|
-
globalid (>= 0.3.6)
|
|
55
|
+
globalid (>= 0.3.6, < 2)
|
|
56
56
|
rake (~> 10.0)
|
|
57
57
|
rspec (~> 3.0)
|
|
58
|
-
sqlite3 (>= 1.3.0)
|
|
58
|
+
sqlite3 (>= 1.3.0, < 4)
|
|
59
59
|
|
|
60
60
|
BUNDLED WITH
|
|
61
61
|
1.16.0
|
data/ensurance.gemspec
CHANGED
|
@@ -9,9 +9,9 @@ Gem::Specification.new do |spec|
|
|
|
9
9
|
spec.authors = ["Ben Sharpe"]
|
|
10
10
|
spec.email = ["bsharpe@gmail.com"]
|
|
11
11
|
|
|
12
|
-
spec.summary = %q{Add ability to ensure
|
|
13
|
-
spec.description = %q{}
|
|
14
|
-
spec.homepage = ""
|
|
12
|
+
spec.summary = %q{Add ability to ensure ActiveRecord models}
|
|
13
|
+
spec.description = %q{A handy shortcut for user = user.is_a?(User) ? user : User.find(user)}
|
|
14
|
+
spec.homepage = "https://github.com/bsharpe/ensurance"
|
|
15
15
|
spec.license = "MIT"
|
|
16
16
|
|
|
17
17
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
|
Binary file
|
data/lib/ensurance.rb
CHANGED
data/lib/ensurance/date.rb
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
require 'active_support/core_ext/date'
|
|
1
2
|
|
|
2
3
|
module Ensurance
|
|
3
|
-
|
|
4
|
+
module Date
|
|
4
5
|
FORMATS = %w|%m/%d/%Y %Y/%m/%d|.freeze
|
|
5
6
|
def self.ensure(thing)
|
|
6
7
|
case thing.class.name
|
|
@@ -40,3 +41,5 @@ module Ensurance
|
|
|
40
41
|
end
|
|
41
42
|
end
|
|
42
43
|
end
|
|
44
|
+
|
|
45
|
+
::Date.include Ensurance::Date
|
data/lib/ensurance/hash.rb
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
require 'active_support/core_ext/hash'
|
|
2
|
+
require 'json'
|
|
3
|
+
|
|
1
4
|
module Ensurance
|
|
2
|
-
|
|
5
|
+
module Hash
|
|
3
6
|
def self.ensure(thing)
|
|
4
7
|
case thing.class.name
|
|
5
8
|
when "Hash","HashWithIndifferentAccess"
|
|
@@ -21,4 +24,6 @@ module Ensurance
|
|
|
21
24
|
end
|
|
22
25
|
end
|
|
23
26
|
end
|
|
24
|
-
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
::Hash.include Ensurance::Hash
|
data/lib/ensurance/time.rb
CHANGED
data/lib/ensurance/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ensurance
|
|
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
|
- Ben Sharpe
|
|
@@ -132,7 +132,7 @@ dependencies:
|
|
|
132
132
|
- - "<"
|
|
133
133
|
- !ruby/object:Gem::Version
|
|
134
134
|
version: '4'
|
|
135
|
-
description: ''
|
|
135
|
+
description: 'A handy shortcut for user = user.is_a?(User) ? user : User.find(user)'
|
|
136
136
|
email:
|
|
137
137
|
- bsharpe@gmail.com
|
|
138
138
|
executables: []
|
|
@@ -149,6 +149,7 @@ files:
|
|
|
149
149
|
- Rakefile
|
|
150
150
|
- bin/console
|
|
151
151
|
- bin/setup
|
|
152
|
+
- ensurance-0.1.0.gem
|
|
152
153
|
- ensurance.gemspec
|
|
153
154
|
- file:memdb1?mode=memory&cache=shared
|
|
154
155
|
- lib/ensurance.rb
|
|
@@ -156,7 +157,7 @@ files:
|
|
|
156
157
|
- lib/ensurance/hash.rb
|
|
157
158
|
- lib/ensurance/time.rb
|
|
158
159
|
- lib/ensurance/version.rb
|
|
159
|
-
homepage:
|
|
160
|
+
homepage: https://github.com/bsharpe/ensurance
|
|
160
161
|
licenses:
|
|
161
162
|
- MIT
|
|
162
163
|
metadata: {}
|
|
@@ -179,5 +180,5 @@ rubyforge_project:
|
|
|
179
180
|
rubygems_version: 2.6.13
|
|
180
181
|
signing_key:
|
|
181
182
|
specification_version: 4
|
|
182
|
-
summary: Add ability to ensure
|
|
183
|
+
summary: Add ability to ensure ActiveRecord models
|
|
183
184
|
test_files: []
|