la_maquina 1.1.0 → 1.1.1

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: 5a89beff8f1273d9f405dd8d3688cab29d46d0ed
4
- data.tar.gz: 8579494fde2abdfa66c2269ba60c594ab79e6c4d
3
+ metadata.gz: e1fe1bcbcd73db3dbdb212fd054cb6b073e6d282
4
+ data.tar.gz: 91f55d38d57196ea2f95ca632648d89823439252
5
5
  SHA512:
6
- metadata.gz: 13bdd3d29f2ca0b9623a7670b1719af725b58619a107da724aca4b208458c2cc4414b5a736adb0c8bf974851a0050cd2a471f204e01828f8249b817f804350fa
7
- data.tar.gz: 664e006fd2771cbf4c0a7fbe39a80a7f17ab9789e69f04f32e071e5ac246c35d62d0cf4548e6eb2ef7965716bcb8e80357dfb401d936c7b97b93d057ff4e43d2
6
+ metadata.gz: 94215f87f61b34999536559d41d4d6cbbdefaae29ea8979032e1e26b7ebf8e4ed6b091031d0ef6cef6989a0e40d69559a9b9252cf4d3dc1e946249f99da21d11
7
+ data.tar.gz: 2aec762f2f3b7c8afb91dd15acc623367a3c5579a158a0ffff745fe6174ed44cb7eab574343f7ba885b31590d1ba9d56de0a2c8729e7df199985a3874111ad67
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- la_maquina (1.0.1)
4
+ la_maquina (1.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -148,4 +148,4 @@ DEPENDENCIES
148
148
  test_after_commit
149
149
 
150
150
  BUNDLED WITH
151
- 1.10.6
151
+ 1.11.2
data/lib/la_maquina.rb CHANGED
@@ -6,6 +6,7 @@ module LaMaquina
6
6
  autoload :ErrorNotifier, 'la_maquina/error_notifier'
7
7
  autoload :Piston, 'la_maquina/piston'
8
8
  autoload :Notifier, 'la_maquina/notifier'
9
+ autoload :Errors, 'la_maquina/errors'
9
10
 
10
11
  mattr_accessor :error_notifier
11
12
  error_notifier ||= LaMaquina::ErrorNotifier::Base
@@ -5,6 +5,9 @@ module LaMaquina
5
5
  submap = map
6
6
  args.each do |key|
7
7
  submap = submap[key]
8
+ if submap.blank?
9
+ raise LaMaquina::Errors::InvalidMappingError.new("#{key} not found in #{args} in dependency map")
10
+ end
8
11
  end
9
12
  submap
10
13
  end
@@ -0,0 +1,5 @@
1
+ module LaMaquina
2
+ module Errors
3
+ autoload :InvalidMappingError, 'la_maquina/errors/invalid_mapping_error'
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ module LaMaquina
2
+ module Errors
3
+ class InvalidMappingError < StandardError
4
+ end
5
+ end
6
+ end
@@ -1,3 +1,3 @@
1
1
  module LaMaquina
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -13,12 +13,6 @@
13
13
 
14
14
  ActiveRecord::Schema.define(version: 20150228015009) do
15
15
 
16
- create_table "admin_thing", force: :cascade do |t|
17
- t.integer "admin_id"
18
- t.string "value"
19
- t.integer "thing_id"
20
- end
21
-
22
16
  create_table "admin_things", force: :cascade do |t|
23
17
  t.integer "admin_id"
24
18
  t.string "value"
@@ -40,12 +34,6 @@ ActiveRecord::Schema.define(version: 20150228015009) do
40
34
  t.string "name"
41
35
  end
42
36
 
43
- create_table "guest_thing", force: :cascade do |t|
44
- t.integer "guest_id"
45
- t.string "value"
46
- t.integer "thing_id"
47
- end
48
-
49
37
  create_table "guest_things", force: :cascade do |t|
50
38
  t.integer "guest_id"
51
39
  t.string "value"
@@ -77,10 +65,6 @@ ActiveRecord::Schema.define(version: 20150228015009) do
77
65
  t.string "value"
78
66
  end
79
67
 
80
- create_table "thing", force: :cascade do |t|
81
- t.string "value"
82
- end
83
-
84
68
  create_table "things", force: :cascade do |t|
85
69
  t.string "value"
86
70
  end
@@ -13,12 +13,18 @@ class YamlMapTest < ActiveSupport::TestCase
13
13
  end
14
14
 
15
15
  def test_throws_mapless_lookup
16
- assert_raise NoMethodError do
16
+ assert_raise NoMethodError do
17
17
  map = LaMaquina::DependencyMap::YamlMap.new
18
18
  map.find :admin
19
19
  end
20
20
  end
21
21
 
22
+ def test_handles_invalid_notifier
23
+ assert_raise LaMaquina::Errors::InvalidMappingError do
24
+ @map.find 'totally fake thing', 'I raise an exception!'
25
+ end
26
+ end
27
+
22
28
  def test_is_with_indifferent_access
23
29
  assert :admin, @map.find("admin")
24
30
  assert :admin, @map.find(:admin)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: la_maquina
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Orlov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-16 00:00:00.000000000 Z
11
+ date: 2016-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -78,6 +78,8 @@ files:
78
78
  - lib/la_maquina/error_notifier/base.rb
79
79
  - lib/la_maquina/error_notifier/honeybadger_notifier.rb
80
80
  - lib/la_maquina/error_notifier/silent_notifier.rb
81
+ - lib/la_maquina/errors.rb
82
+ - lib/la_maquina/errors/invalid_mapping_error.rb
81
83
  - lib/la_maquina/notifier.rb
82
84
  - lib/la_maquina/piston.rb
83
85
  - lib/la_maquina/piston/base.rb
@@ -152,7 +154,7 @@ files:
152
154
  - test/dummy/test/fixtures/traits.yml
153
155
  - test/test_helper.rb
154
156
  - test/unit/dependency_maps/constant_map_test.rb
155
- - test/unit/dependency_maps/yamp_map_test.rb
157
+ - test/unit/dependency_maps/yaml_map_test.rb
156
158
  - test/unit/engine_test.rb
157
159
  - test/unit/error_notifier_test.rb
158
160
  - test/unit/la_maquina_test.rb
@@ -253,7 +255,7 @@ test_files:
253
255
  - test/dummy/test/fixtures/traits.yml
254
256
  - test/test_helper.rb
255
257
  - test/unit/dependency_maps/constant_map_test.rb
256
- - test/unit/dependency_maps/yamp_map_test.rb
258
+ - test/unit/dependency_maps/yaml_map_test.rb
257
259
  - test/unit/engine_test.rb
258
260
  - test/unit/error_notifier_test.rb
259
261
  - test/unit/la_maquina_test.rb
@@ -261,4 +263,3 @@ test_files:
261
263
  - test/unit/piston_test.rb
262
264
  - test/unit/pistons/cache_piston_test.rb
263
265
  - test/unit/pistons/sunspot_piston_test.rb
264
- has_rdoc: