yaks 0.1.0 → 0.2.0
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 +8 -8
- data/.gitignore +1 -0
- data/Gemfile.lock +2 -2
- data/README.md +13 -0
- data/Rakefile +11 -0
- data/lib/yaks/mapper/link.rb +1 -0
- data/lib/yaks/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MGFhOGExMjUyNjQxOWEwYzY3ZGQyOWI2Mzc0MDYyYzgwZDMyN2ZlMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjQzODE2NjIwMDVlNzg2YTVlMjBiMWJiNTcyZTY3NmNkMzVhYWE1Mg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Y2UzZjk4YTg1MzNhNTA2NDZjNDQzMmJkNzQxZjEyMjU3ZWQ0ZWJmYjAyYWRj
|
10
|
+
OGMwMzcxMDkzYjc2OGE2OGQwNWJjODc2NDdjNGZkZTk2NjdjOGNkNzk4Y2Vm
|
11
|
+
ZjEyY2U3MTU1M2FlN2ZhZWFiZWFjYjdhNTdhYTBjYmMzMTcxZTg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZGZhMzA1OGQ3OTQxNTdmMWRiNTE0ZGQxOTgzZDc2MDllYzA5NjI3NmUwYTlj
|
14
|
+
M2EwYjhkZTVkYzBjMzBhOWRkZWFhODk0NDI3YmI2NjU1ZmQ0MDVlNzM1NmM2
|
15
|
+
MDJiZTllZTk0ZjM3ZDE4ZmU3N2E3YmQ2MDZiZTY4MWJjY2E5NjI=
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -7,7 +7,7 @@ GIT
|
|
7
7
|
PATH
|
8
8
|
remote: .
|
9
9
|
specs:
|
10
|
-
yaks (0.
|
10
|
+
yaks (0.2.0)
|
11
11
|
concord (~> 0.1.4)
|
12
12
|
hamster (~> 0.4.3)
|
13
13
|
inflection (~> 1.0.0)
|
@@ -19,7 +19,7 @@ GEM
|
|
19
19
|
adamantium (0.1.0)
|
20
20
|
ice_nine (~> 0.9)
|
21
21
|
thread_safe (~> 0.1.2)
|
22
|
-
atomic (1.1.
|
22
|
+
atomic (1.1.16)
|
23
23
|
axiom-types (0.0.5)
|
24
24
|
descendants_tracker (~> 0.0.1)
|
25
25
|
ice_nine (~> 0.9)
|
data/README.md
CHANGED
@@ -107,6 +107,19 @@ end
|
|
107
107
|
|
108
108
|
To prevent a link to be expanded, add `expand: false` as an option. Now the actual template will be rendered in the result, so clients can use it to generate links from.
|
109
109
|
|
110
|
+
You can pass a symbol instead of a template, in that case the symbol will be used as a method name on the object to retrieve the link. You can override this behavior just like with attributes.
|
111
|
+
|
112
|
+
```ruby
|
113
|
+
class FooMapper < Yaks::Mapper
|
114
|
+
link 'http://api.foo.com/rels/go_home', :home_url
|
115
|
+
# by default calls object.home_url
|
116
|
+
|
117
|
+
def home_url
|
118
|
+
object.setting('home_url')
|
119
|
+
end
|
120
|
+
end
|
121
|
+
```
|
122
|
+
|
110
123
|
### Associations
|
111
124
|
|
112
125
|
Use `has_one` for an association that returns a single object, or `has_many` for embedding a collection.
|
data/Rakefile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'rubygems/package_task'
|
2
|
+
|
3
|
+
spec = Gem::Specification.load(Pathname.glob('*.gemspec').first.to_s)
|
4
|
+
Gem::PackageTask.new(spec).define
|
5
|
+
|
6
|
+
desc "Push gem to rubygems.org"
|
7
|
+
task :push => :gem do
|
8
|
+
sh "git tag v#{Yaks::VERSION}"
|
9
|
+
sh "git push --tags"
|
10
|
+
sh "gem push pkg/yaks-#{Yaks::VERSION}.gem"
|
11
|
+
end
|
data/lib/yaks/mapper/link.rb
CHANGED
data/lib/yaks/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yaks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arne Brasseur
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
prerelease: false
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- Gemfile
|
136
136
|
- Gemfile.lock
|
137
137
|
- README.md
|
138
|
+
- Rakefile
|
138
139
|
- examples/hal01.rb
|
139
140
|
- examples/jsonapi01.rb
|
140
141
|
- examples/jsonapi02.rb
|