her 1.0.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +19 -1279
- data/.rubocop_todo.yml +232 -0
- data/.ruby-version +1 -0
- data/.travis.yml +16 -4
- data/README.md +25 -1
- data/gemfiles/Gemfile.faraday-1.0 +6 -0
- data/her.gemspec +4 -3
- data/lib/her/api.rb +8 -7
- data/lib/her/collection.rb +2 -1
- data/lib/her/errors.rb +3 -1
- data/lib/her/json_api/model.rb +8 -12
- data/lib/her/middleware.rb +1 -1
- data/lib/her/middleware/accept_json.rb +1 -0
- data/lib/her/middleware/first_level_parse_json.rb +6 -5
- data/lib/her/middleware/json_api_parser.rb +6 -5
- data/lib/her/middleware/parse_json.rb +2 -1
- data/lib/her/middleware/second_level_parse_json.rb +6 -5
- data/lib/her/model/associations.rb +7 -7
- data/lib/her/model/associations/association.rb +7 -9
- data/lib/her/model/associations/association_proxy.rb +2 -3
- data/lib/her/model/associations/belongs_to_association.rb +2 -3
- data/lib/her/model/attributes.rb +14 -6
- data/lib/her/model/base.rb +2 -2
- data/lib/her/model/http.rb +7 -2
- data/lib/her/model/introspection.rb +5 -3
- data/lib/her/model/nested_attributes.rb +1 -1
- data/lib/her/model/orm.rb +27 -9
- data/lib/her/model/parse.rb +10 -12
- data/lib/her/model/paths.rb +3 -4
- data/lib/her/model/relation.rb +5 -4
- data/lib/her/version.rb +1 -1
- data/spec/api_spec.rb +3 -0
- data/spec/middleware/accept_json_spec.rb +1 -0
- data/spec/middleware/first_level_parse_json_spec.rb +2 -1
- data/spec/middleware/json_api_parser_spec.rb +1 -0
- data/spec/middleware/second_level_parse_json_spec.rb +1 -0
- data/spec/model/associations/association_proxy_spec.rb +1 -0
- data/spec/model/associations_spec.rb +98 -14
- data/spec/model/attributes_spec.rb +9 -3
- data/spec/model/callbacks_spec.rb +14 -15
- data/spec/model/dirty_spec.rb +1 -0
- data/spec/model/http_spec.rb +29 -18
- data/spec/model/introspection_spec.rb +3 -2
- data/spec/model/nested_attributes_spec.rb +1 -0
- data/spec/model/orm_spec.rb +39 -16
- data/spec/model/parse_spec.rb +24 -0
- data/spec/model/paths_spec.rb +1 -0
- data/spec/model/relation_spec.rb +3 -2
- data/spec/model/validations_spec.rb +1 -0
- data/spec/model_spec.rb +1 -0
- data/spec/support/extensions/array.rb +1 -0
- data/spec/support/extensions/hash.rb +1 -0
- metadata +15 -19
data/spec/model/paths_spec.rb
CHANGED
data/spec/model/relation_spec.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
|
2
3
|
require File.join(File.dirname(__FILE__), "../spec_helper.rb")
|
3
4
|
|
4
5
|
describe Her::Model::Relation do
|
@@ -194,7 +195,7 @@ describe Her::Model::Relation do
|
|
194
195
|
builder.use Her::Middleware::FirstLevelParseJSON
|
195
196
|
builder.use Faraday::Request::UrlEncoded
|
196
197
|
builder.adapter :test do |stub|
|
197
|
-
stub.post("/users") { |env| ok! id: 3, active: (params(env)[:active] == "true"
|
198
|
+
stub.post("/users") { |env| ok! id: 3, active: (params(env)[:active] == "true") }
|
198
199
|
end
|
199
200
|
end
|
200
201
|
|
@@ -212,7 +213,7 @@ describe Her::Model::Relation do
|
|
212
213
|
builder.use Her::Middleware::FirstLevelParseJSON
|
213
214
|
builder.use Faraday::Request::UrlEncoded
|
214
215
|
builder.adapter :test do |stub|
|
215
|
-
stub.get("/users?active=true") { |env| ok! [{ id: 3, active: (params(env)[:active] == "true"
|
216
|
+
stub.get("/users?active=true") { |env| ok! [{ id: 3, active: (params(env)[:active] == "true") }] }
|
216
217
|
end
|
217
218
|
end
|
218
219
|
|
data/spec/model_spec.rb
CHANGED
metadata
CHANGED
@@ -1,57 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: her
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rémi Prévost
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: json
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1.8'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '1.8'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '3.5'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '3.5'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: activemodel
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,9 +73,6 @@ dependencies:
|
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0.8'
|
76
|
-
- - "<"
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version: '1.0'
|
79
76
|
type: :runtime
|
80
77
|
prerelease: false
|
81
78
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -83,9 +80,6 @@ dependencies:
|
|
83
80
|
- - ">="
|
84
81
|
- !ruby/object:Gem::Version
|
85
82
|
version: '0.8'
|
86
|
-
- - "<"
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '1.0'
|
89
83
|
- !ruby/object:Gem::Dependency
|
90
84
|
name: multi_json
|
91
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -110,6 +104,8 @@ files:
|
|
110
104
|
- ".gitignore"
|
111
105
|
- ".rspec"
|
112
106
|
- ".rubocop.yml"
|
107
|
+
- ".rubocop_todo.yml"
|
108
|
+
- ".ruby-version"
|
113
109
|
- ".travis.yml"
|
114
110
|
- ".yardopts"
|
115
111
|
- CONTRIBUTING.md
|
@@ -122,6 +118,7 @@ files:
|
|
122
118
|
- gemfiles/Gemfile.activemodel-5.0
|
123
119
|
- gemfiles/Gemfile.activemodel-5.1
|
124
120
|
- gemfiles/Gemfile.activemodel-5.2
|
121
|
+
- gemfiles/Gemfile.faraday-1.0
|
125
122
|
- her.gemspec
|
126
123
|
- lib/her.rb
|
127
124
|
- lib/her/api.rb
|
@@ -198,8 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
198
195
|
- !ruby/object:Gem::Version
|
199
196
|
version: '0'
|
200
197
|
requirements: []
|
201
|
-
|
202
|
-
rubygems_version: 2.4.5.1
|
198
|
+
rubygems_version: 3.1.2
|
203
199
|
signing_key:
|
204
200
|
specification_version: 4
|
205
201
|
summary: A simple Representational State Transfer-based Hypertext Transfer Protocol-powered
|