husky 0.0.6 → 0.0.7
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/husky.rb +1 -0
- data/lib/husky/repo.rb +47 -0
- data/lib/husky/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: 040d6409d951e16214443a5a98b941c37c0ab850
|
|
4
|
+
data.tar.gz: b126776173a085282e0ba2e2854404cb844068b9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 27600d127b14f6e5741dff20b1d442573a66a1f1e0b76f4e78847ec712ddf92f433446a3589b940af16626e705afcc8e8a4ad89bccb8285ac7da0b28259de0a7
|
|
7
|
+
data.tar.gz: 8855086c8b8bb7ef807ebe80035a662c53b6dc5f34410f8d0ec341f8c308fa961717f9ed251dc1f2e397fbc6e06b70afabe3d3ad30b5179b7eba40dd80d1136c
|
data/lib/husky.rb
CHANGED
data/lib/husky/repo.rb
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
module Husky
|
|
2
|
+
class Repo
|
|
3
|
+
|
|
4
|
+
class << self
|
|
5
|
+
|
|
6
|
+
def find(id)
|
|
7
|
+
entity.new(data_source.find(id))
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def all
|
|
11
|
+
entity.wrap(data_source)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def build(attributes)
|
|
15
|
+
entity.new(data_source.build(attributes))
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def create(attributes)
|
|
19
|
+
entity.new(data_source.create(attributes))
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def update(item, attributes)
|
|
23
|
+
entity.new(item.update_attributes(attributes))
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def save(item)
|
|
27
|
+
item.save
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def destroy(item)
|
|
31
|
+
item.destroy
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
private
|
|
35
|
+
|
|
36
|
+
def data_sourse
|
|
37
|
+
raise NotImplementedError
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def entity
|
|
41
|
+
raise NotImplementedError
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
end
|
|
47
|
+
end
|
data/lib/husky/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: husky
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stephen Fiser
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-03-
|
|
11
|
+
date: 2016-03-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -69,6 +69,7 @@ files:
|
|
|
69
69
|
- lib/husky/ears.rb
|
|
70
70
|
- lib/husky/interactor.rb
|
|
71
71
|
- lib/husky/pass_along.rb
|
|
72
|
+
- lib/husky/repo.rb
|
|
72
73
|
- lib/husky/responder.rb
|
|
73
74
|
- lib/husky/version.rb
|
|
74
75
|
- lib/tasks/husky_tasks.rake
|