yaml_b_sides 0.4.0 → 0.4.3
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/lib/yaml_b_sides.rb +1 -0
- data/lib/yaml_b_sides/errors.rb +6 -0
- data/lib/yaml_b_sides/queriable.rb +2 -2
- data/lib/yaml_b_sides/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe6d60416f8f0b980e021475bc8bec4d22816232
|
4
|
+
data.tar.gz: c0eb789a44fb284ed36afc977490fe2e097c6915
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5966c40826854c511bc4a3108139de921bbf32f61e5bc26f474957103dc6b47fd36718e50198267c3b9bd1fa6b5c3a604b17bf62f26ceb29a321606f9c66f2e3
|
7
|
+
data.tar.gz: 7d6101f9afc46dfc442ad78dc61ebe614a62770148b41777ebef9a35e5370e8ad82f37f2f2cf2c70528935dcb671ae67a90d8880649549f477a4e1eb2b7c6387
|
data/lib/yaml_b_sides.rb
CHANGED
@@ -12,6 +12,7 @@ module YamlBSides
|
|
12
12
|
autoload :Associations, 'yaml_b_sides/associations'
|
13
13
|
autoload :Base, 'yaml_b_sides/base'
|
14
14
|
autoload :Cacheable, 'yaml_b_sides/cacheable'
|
15
|
+
autoload :Errors, 'yaml_b_sides/errors'
|
15
16
|
autoload :Instanceable, 'yaml_b_sides/instanceable'
|
16
17
|
autoload :Index, 'yaml_b_sides/index'
|
17
18
|
autoload :Indexable, 'yaml_b_sides/indexable'
|
@@ -6,13 +6,13 @@ module YamlBSides
|
|
6
6
|
class << self
|
7
7
|
def find(id)
|
8
8
|
record = @data[id]
|
9
|
-
raise "Record not found: #{id}" unless record
|
9
|
+
raise Errors::RecordNotFound, "Record not found: #{id}" unless record
|
10
10
|
new record
|
11
11
|
end
|
12
12
|
|
13
13
|
def find_by(params = {})
|
14
14
|
results = where params
|
15
|
-
raise "Could not find record that matches: #{params.inspect}" if results.empty?
|
15
|
+
raise Errors::RecordNotFound, "Could not find record that matches: #{params.inspect}" if results.empty?
|
16
16
|
results.first
|
17
17
|
end
|
18
18
|
|
data/lib/yaml_b_sides/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yaml_b_sides
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Orlov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -120,6 +120,7 @@ files:
|
|
120
120
|
- lib/yaml_b_sides/associations/through.rb
|
121
121
|
- lib/yaml_b_sides/base.rb
|
122
122
|
- lib/yaml_b_sides/cacheable.rb
|
123
|
+
- lib/yaml_b_sides/errors.rb
|
123
124
|
- lib/yaml_b_sides/index.rb
|
124
125
|
- lib/yaml_b_sides/indexable.rb
|
125
126
|
- lib/yaml_b_sides/instanceable.rb
|