husky 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/husky/repo.rb +33 -30
- data/lib/husky/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bca77cc0496ae923043c7d6365e634f0162ab913
|
4
|
+
data.tar.gz: e6dd3b51d6918b2960cacd1d8b15eb9552af9941
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aacce87652f53d3722687e07c8a1fc898197a484f6011fecf3bbab56a85413e801e9993a72b8a2532f5b5df12ab0e0b43648b273e7ebf573687ad27f6fe4952f
|
7
|
+
data.tar.gz: d7e37f0393434b9895f28519b56689311dd9a89440b6818bbf0e58cd75037eab80ec231af55d2ac73fd6480b35ac4a23d2fe423ca0a3dd1fa1a37f9f9e397974
|
data/lib/husky/repo.rb
CHANGED
@@ -1,47 +1,50 @@
|
|
1
1
|
module Husky
|
2
|
-
class Repo
|
3
2
|
|
4
|
-
|
3
|
+
class Repo
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
def new(attributes = {})
|
6
|
+
entity.new(data_source.new(attributes))
|
7
|
+
end
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
def find(id)
|
10
|
+
entity.new(data_source.find(id))
|
11
|
+
end
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
def all
|
14
|
+
entity.wrap(data_source.all)
|
15
|
+
end
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
# DEPRECATE
|
18
|
+
def build(attributes)
|
19
|
+
entity.new(data_source.build(attributes))
|
20
|
+
end
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
def create(attributes)
|
23
|
+
entity.new(data_source.create(attributes))
|
24
|
+
end
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
def update(item, attributes)
|
27
|
+
entity.new(item.update_attributes(attributes))
|
28
|
+
end
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
30
|
+
def save(item)
|
31
|
+
item.save
|
32
|
+
end
|
33
33
|
|
34
|
-
|
34
|
+
def destroy(item)
|
35
|
+
item.destroy
|
36
|
+
end
|
35
37
|
|
36
|
-
|
37
|
-
raise NotImplementedError
|
38
|
-
end
|
38
|
+
private
|
39
39
|
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
def data_source
|
41
|
+
raise NotImplementedError
|
42
|
+
end
|
43
43
|
|
44
|
+
def entity
|
45
|
+
raise NotImplementedError
|
44
46
|
end
|
45
47
|
|
46
48
|
end
|
49
|
+
|
47
50
|
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.1.
|
4
|
+
version: 0.1.6
|
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-
|
11
|
+
date: 2016-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|