yaml_b_sides 0.4.0 → 0.4.3

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: 7cce0a0ddcc46c69a3a4c195187c7be25009b4b2
4
- data.tar.gz: b6d69e0b119b8e6696ce4fa3195c6847eae28d1c
3
+ metadata.gz: fe6d60416f8f0b980e021475bc8bec4d22816232
4
+ data.tar.gz: c0eb789a44fb284ed36afc977490fe2e097c6915
5
5
  SHA512:
6
- metadata.gz: 46477bf5fabecaaac51a0bbb457fa7b60720141a5a4e426191c4ba54578814b04f928a37044438cf144305db733bd3dcfda9831e0fa16f8a8bb0f4abec4ef115
7
- data.tar.gz: c3636b15c10d3621df75184df1fabe107a4c1d0238e6e5244ee78f4087de385ba1e14083fdd7047dc45ce8a46e706ad491d7323d54befde928eb8165a56f32e5
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'
@@ -0,0 +1,6 @@
1
+ module YamlBSides
2
+ module Errors
3
+ class RecordNotFound < StandardError
4
+ end
5
+ end
6
+ end
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module YamlBSides
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.3"
3
3
  end
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.0
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-20 00:00:00.000000000 Z
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