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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73ed04613ebf3946434e575c85ca906f25d39626
4
- data.tar.gz: 77c943a28db5eaf457eab1d3f38baaa345f0afc4
3
+ metadata.gz: 2730601cced0af6c9f54a2aabf877098b16b234d
4
+ data.tar.gz: 8ad471692d7c97dccdfa3a71dbdb1325840c61fd
5
5
  SHA512:
6
- metadata.gz: 821667d18e5db34c6cd5219bca2749eddc0fbd3f706350c1dce1b8143048424fbdac3790d8de1c269ce5a84340e1deccf26b6885d180e7324c2a5875b6d8ce50
7
- data.tar.gz: 8547c089119cee156698b63e6dee1cd89d4a89f16ceabd1e60391342754bacac53656469cf98ff0a3b6ec8b7e289bab7297084511c449dcdaaf4179784910cb3
6
+ metadata.gz: 1bedafd66aa7f785ff06f002f63c5acbe02db78f61fb8cb5b495a5f568237de2a31bc52b20fd7561cb75290118aed60d10e27ee1ca95835b748c9987fc6e6d43
7
+ data.tar.gz: 339991a51002d16c3d20e301733a4a685454873465ea48abae780553709be61b88229ade531e64da2335b1c814daba8fa8c1ada1e5105ecef61dd48b19a3642e
data/.gitignore CHANGED
@@ -9,3 +9,4 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+ *.gem
@@ -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
@@ -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 common types and AR models}
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'
@@ -1,9 +1,5 @@
1
1
  require "ensurance/version"
2
2
  require 'active_support'
3
- require 'active_support/core_ext/date'
4
- require 'active_support/core_ext/time'
5
- require 'active_support/core_ext/hash'
6
- require 'json'
7
3
 
8
4
  require 'ensurance/date'
9
5
  require 'ensurance/time'
@@ -1,6 +1,7 @@
1
+ require 'active_support/core_ext/date'
1
2
 
2
3
  module Ensurance
3
- class Date
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
@@ -1,5 +1,8 @@
1
+ require 'active_support/core_ext/hash'
2
+ require 'json'
3
+
1
4
  module Ensurance
2
- class Hash
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
@@ -1,5 +1,7 @@
1
+ require 'active_support/core_ext/time'
2
+
1
3
  module Ensurance
2
- class Time
4
+ module Time
3
5
  def self.ensure(thing)
4
6
  case thing.class.name
5
7
  when "NilClass"
@@ -28,3 +30,5 @@ module Ensurance
28
30
  end
29
31
  end
30
32
  end
33
+
34
+ ::Time.include Ensurance::Time
@@ -1,3 +1,3 @@
1
1
  module Ensurance
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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 common types and AR models
183
+ summary: Add ability to ensure ActiveRecord models
183
184
  test_files: []