la_maquina 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -1
- data/README.md +8 -0
- data/lib/la_maquina/dependency_map/constant_map.rb +1 -4
- data/lib/la_maquina/dependency_map/yaml_map.rb +0 -2
- data/lib/la_maquina/version.rb +1 -1
- data/test/unit/dependency_maps/constant_map_test.rb +4 -4
- data/test/unit/dependency_maps/yamp_map_test.rb +5 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a89beff8f1273d9f405dd8d3688cab29d46d0ed
|
4
|
+
data.tar.gz: 8579494fde2abdfa66c2269ba60c594ab79e6c4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13bdd3d29f2ca0b9623a7670b1719af725b58619a107da724aca4b208458c2cc4414b5a736adb0c8bf974851a0050cd2a471f204e01828f8249b817f804350fa
|
7
|
+
data.tar.gz: 664e006fd2771cbf4c0a7fbe39a80a7f17ab9789e69f04f32e071e5ac246c35d62d0cf4548e6eb2ef7965716bcb8e80357dfb401d936c7b97b93d057ff4e43d2
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -36,11 +36,19 @@ end
|
|
36
36
|
class Machete < ActiveRecord::Base
|
37
37
|
belongs_to :danny_trejo
|
38
38
|
|
39
|
+
# all you need to add to get danny_trejo to reindex on machete update
|
39
40
|
include LaMaquina::Notifier
|
40
41
|
notifies_about :danny_trejo
|
41
42
|
end
|
42
43
|
```
|
43
44
|
|
45
|
+
With the config of
|
46
|
+
```ruby
|
47
|
+
LaMaquina::Engine.install LaMaquina::Piston::SunspotPison
|
48
|
+
```
|
49
|
+
|
50
|
+
When a `machete` updates, the piston will fire, re-indexing its `danny_trejo`.
|
51
|
+
|
44
52
|
## Usage
|
45
53
|
|
46
54
|
There are 4 main components to this gem:
|
@@ -3,10 +3,7 @@ module LaMaquina
|
|
3
3
|
class ConstantMap < LaMaquina::DependencyMap::Base
|
4
4
|
|
5
5
|
def find(notified_class)
|
6
|
-
notified_class.camelize.constantize
|
7
|
-
rescue => e
|
8
|
-
LaMaquina.error_notifier.notify( e,
|
9
|
-
missing_class: notified_class )
|
6
|
+
notified_class.to_s.camelize.constantize
|
10
7
|
end
|
11
8
|
end
|
12
9
|
end
|
data/lib/la_maquina/version.rb
CHANGED
@@ -11,10 +11,10 @@ class ConstantMapTest < ActiveSupport::TestCase
|
|
11
11
|
assert Admin, @map.find(:admin)
|
12
12
|
end
|
13
13
|
|
14
|
-
def
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
def test_throws_on_mapless_lookup
|
15
|
+
assert_raise NameError do
|
16
|
+
@map.find :lol
|
17
|
+
end
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_is_with_indifferent_access
|
@@ -12,11 +12,11 @@ class YamlMapTest < ActiveSupport::TestCase
|
|
12
12
|
assert 'admin', @map.find(:admin)
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
def test_throws_mapless_lookup
|
16
|
+
assert_raise NoMethodError do
|
17
|
+
map = LaMaquina::DependencyMap::YamlMap.new
|
18
|
+
map.find :admin
|
19
|
+
end
|
20
20
|
end
|
21
21
|
|
22
22
|
def test_is_with_indifferent_access
|
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.
|
4
|
+
version: 1.1.0
|
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
|
+
date: 2015-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -180,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
180
|
version: '0'
|
181
181
|
requirements: []
|
182
182
|
rubyforge_project:
|
183
|
-
rubygems_version: 2.4.
|
183
|
+
rubygems_version: 2.4.6
|
184
184
|
signing_key:
|
185
185
|
specification_version: 4
|
186
186
|
summary: depnendency tree update notifications
|