Skip to content

Commit 504cceb

Browse files
committed
Merge branch 'master' into RomanKapitonov-master
2 parents 50cf6f4 + 61412d8 commit 504cceb

File tree

158 files changed

+7726
-4069
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+7726
-4069
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#### Expected behavior vs actual behavior
2+
3+
4+
5+
#### Steps to reproduce
6+
*(e.g., detailed walkthrough, runnable script, example application)*
7+
8+
9+
10+
#### Environment
11+
12+
ActiveModelSerializers Version *(commit ref if not on tag)*:
13+
14+
Output of `ruby -e "puts RUBY_DESCRIPTION"`:
15+
16+
OS Type & Version:
17+
18+
Integrated application and version *(e.g., Rails, Grape, etc)*:
19+
20+
21+
#### Backtrace
22+
*(e.g., provide any applicable backtraces from your application)*
23+
24+
25+
26+
#### Additonal helpful information
27+
*(e.g., Gemfile.lock, configurations, PR containing a failing test, git bisect results)*
28+
29+

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#### Purpose
2+
3+
4+
#### Changes
5+
6+
7+
#### Caveats
8+
9+
10+
#### Related GitHub issues
11+
12+
13+
#### Additional helpful information
14+
15+

.rubocop.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
inherit_from: .rubocop_todo.yml
22

33
AllCops:
4+
TargetRubyVersion: 2.2
45
Exclude:
56
- config/initializers/forbidden_yaml.rb
67
- !ruby/regexp /(vendor|bundle|bin|db|tmp)\/.*/
7-
RunRailsCops: true
88
DisplayCopNames: true
99
DisplayStyleGuide: true
1010

11+
Rails:
12+
Enabled: true
13+
1114
Lint/NestedMethodDefinition:
1215
Enabled: false
1316
Exclude:
1417
- test/action_controller/serialization_test.rb
1518

19+
Style/Alias:
20+
EnforcedStyle: prefer_alias
21+
1622
Style/StringLiterals:
1723
EnforcedStyle: single_quotes
1824

@@ -59,6 +65,18 @@ Style/BlockDelimiters:
5965
Enabled: true
6066
EnforcedStyle: line_count_based
6167

68+
Style/SignalException:
69+
EnforcedStyle: semantic
70+
71+
Style/TrailingCommaInLiteral:
72+
EnforcedStyleForMultiline: no_comma
73+
74+
Style/ConditionalAssignment:
75+
Enabled: false
76+
77+
Style/DotPosition:
78+
EnforcedStyle: leading
79+
6280
########## test_helper.rb sanity
6381
Style/EndBlock:
6482
Exclude:

.rubocop_todo.yml

Lines changed: 30 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2015-09-20 17:56:22 -0500 using RuboCop version 0.34.0.
3+
# on 2016-03-08 22:29:52 +0100 using RuboCop version 0.37.2.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -13,49 +13,31 @@ Lint/HandleExceptions:
1313

1414
# Offense count: 2
1515
# Cop supports --auto-correct.
16-
Lint/UnusedBlockArgument:
17-
Exclude:
18-
- 'lib/active_model/serializer/adapter/json_api/fragment_cache.rb'
19-
20-
# Offense count: 7
21-
# Cop supports --auto-correct.
16+
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
2217
Lint/UnusedMethodArgument:
2318
Exclude:
24-
- 'lib/active_model/serializer/adapter/null.rb'
25-
- 'lib/active_model/serializer/pass_through_serializer.rb'
26-
- 'test/fixtures/poro.rb'
2719
- 'test/lint_test.rb'
2820

29-
# Offense count: 2
30-
Lint/UselessAssignment:
31-
Exclude:
32-
- 'bench/perf.rb'
33-
- 'lib/active_model/serializer/adapter/json_api/fragment_cache.rb'
34-
35-
# Offense count: 1
36-
# Configuration parameters: EnforcedStyle, SupportedStyles.
37-
Rails/Date:
38-
Exclude:
39-
- 'test/fixtures/poro.rb'
40-
4121
# Offense count: 4
4222
# Configuration parameters: EnforcedStyle, SupportedStyles.
23+
# SupportedStyles: strict, flexible
4324
Rails/TimeZone:
4425
Exclude:
4526
- 'test/action_controller/serialization_test.rb'
46-
- 'test/fixtures/poro.rb'
4727
- 'test/serializers/cache_test.rb'
4828

4929
# Offense count: 16
5030
# Cop supports --auto-correct.
5131
# Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle, SupportedLastArgumentHashStyles.
32+
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
5233
Style/AlignHash:
5334
Exclude:
5435
- 'test/action_controller/json_api/pagination_test.rb'
5536

56-
# Offense count: 25
37+
# Offense count: 27
5738
# Cop supports --auto-correct.
5839
# Configuration parameters: EnforcedStyle, SupportedStyles.
40+
# SupportedStyles: braces, no_braces, context_dependent
5941
Style/BracesAroundHashParameters:
6042
Exclude:
6143
- 'test/action_controller/adapter_selector_test.rb'
@@ -67,17 +49,16 @@ Style/BracesAroundHashParameters:
6749
- 'test/collection_serializer_test.rb'
6850
- 'test/serializable_resource_test.rb'
6951
- 'test/serializers/associations_test.rb'
70-
- 'test/serializers/attribute_test.rb'
7152
- 'test/serializers/attributes_test.rb'
72-
- 'test/serializers/fieldset_test.rb'
7353
- 'test/serializers/root_test.rb'
7454

75-
# Offense count: 174
55+
# Offense count: 271
7656
# Configuration parameters: EnforcedStyle, SupportedStyles.
57+
# SupportedStyles: nested, compact
7758
Style/ClassAndModuleChildren:
7859
Enabled: false
7960

80-
# Offense count: 5
61+
# Offense count: 6
8162
# Cop supports --auto-correct.
8263
Style/CommentIndentation:
8364
Exclude:
@@ -89,34 +70,29 @@ Style/DoubleNegation:
8970
- 'lib/active_model/serializable_resource.rb'
9071

9172
# Offense count: 1
92-
Style/EachWithObject:
93-
Exclude:
94-
- 'lib/active_model/serializer/fieldset.rb'
95-
96-
# Offense count: 2
9773
# Configuration parameters: MinBodyLength.
9874
Style/GuardClause:
9975
Exclude:
10076
- 'lib/active_model/serializer.rb'
10177

102-
# Offense count: 12
78+
# Offense count: 58
10379
# Cop supports --auto-correct.
10480
# Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues.
81+
# SupportedStyles: ruby19, ruby19_no_mixed_keys, hash_rockets
10582
Style/HashSyntax:
10683
Enabled: false
10784

108-
# Offense count: 9
85+
# Offense count: 4
10986
# Cop supports --auto-correct.
87+
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
88+
# SupportedStyles: special_inside_parentheses, consistent, align_brackets
11089
Style/IndentArray:
111-
Exclude:
112-
- 'test/adapter/json/has_many_test.rb'
113-
- 'test/adapter/json_api/json_api_test.rb'
114-
- 'test/adapter/json_api/pagination_links_test.rb'
115-
- 'test/adapter/json_test.rb'
90+
Enabled: false
11691

117-
# Offense count: 8
92+
# Offense count: 10
11893
# Cop supports --auto-correct.
119-
# Configuration parameters: EnforcedStyle, SupportedStyles.
94+
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
95+
# SupportedStyles: special_inside_parentheses, consistent, align_braces
12096
Style/IndentHash:
12197
Enabled: false
12298

@@ -129,12 +105,14 @@ Style/Lambda:
129105
# Offense count: 1
130106
# Cop supports --auto-correct.
131107
# Configuration parameters: EnforcedStyle, SupportedStyles.
108+
# SupportedStyles: require_parentheses, require_no_parentheses, require_no_parentheses_except_multiline
132109
Style/MethodDefParentheses:
133110
Enabled: false
134111

135-
# Offense count: 3
112+
# Offense count: 1
136113
# Cop supports --auto-correct.
137-
# Configuration parameters: EnforcedStyle, SupportedStyles.
114+
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
115+
# SupportedStyles: aligned, indented
138116
Style/MultilineOperationIndentation:
139117
Enabled: false
140118

@@ -146,95 +124,44 @@ Style/NegatedIf:
146124

147125
# Offense count: 1
148126
# Cop supports --auto-correct.
149-
Style/NumericLiterals:
150-
MinDigits: 7
151-
152-
# Offense count: 2
153-
# Cop supports --auto-correct.
154127
Style/PerlBackrefs:
155128
Exclude:
156129
- 'test/fixtures/poro.rb'
157-
- 'test/serializers/associations_test.rb'
158130

159131
# Offense count: 3
160-
# Configuration parameters: NamePrefix, NamePrefixBlacklist.
132+
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
133+
# NamePrefix: is_, has_, have_
134+
# NamePrefixBlacklist: is_, has_, have_
135+
# NameWhitelist: is_a?
161136
Style/PredicateName:
162137
Exclude:
163138
- 'lib/active_model/serializer/associations.rb'
164139
- 'test/action_controller/json_api/linked_test.rb'
165140

166-
# Offense count: 5
141+
# Offense count: 1
167142
# Cop supports --auto-correct.
168143
Style/RedundantSelf:
169144
Exclude:
170-
- 'lib/active_model/serializer/associations.rb'
171145
- 'test/fixtures/poro.rb'
172146

173-
# Offense count: 1
174-
# Cop supports --auto-correct.
175-
# Configuration parameters: AllowAsExpressionSeparator.
176-
Style/Semicolon:
177-
Exclude:
178-
- 'lib/active_model/serializer/fieldset.rb'
179-
180-
# Offense count: 3
181-
# Cop supports --auto-correct.
182-
# Configuration parameters: EnforcedStyle, SupportedStyles.
183-
Style/SignalException:
184-
Exclude:
185-
- 'lib/active_model/serializer/fieldset.rb'
186-
- 'lib/active_model/serializer/pass_through_serializer.rb'
187-
188147
# Offense count: 1
189148
# Cop supports --auto-correct.
190149
# Configuration parameters: AllowIfMethodIsEmpty.
191150
Style/SingleLineMethods:
192151
Exclude:
193152
- 'test/serializers/serializer_for_test.rb'
194153

195-
# Offense count: 2
154+
# Offense count: 4
196155
# Cop supports --auto-correct.
197156
# Configuration parameters: EnforcedStyle, SupportedStyles.
157+
# SupportedStyles: single_quotes, double_quotes
198158
Style/StringLiteralsInInterpolation:
199159
Enabled: false
200160

201-
# Offense count: 1
202-
Style/StructInheritance:
203-
Exclude:
204-
- 'bench/perf.rb'
205-
206161
# Offense count: 1
207162
# Cop supports --auto-correct.
208-
# Configuration parameters: IgnoredMethods.
209-
Style/SymbolProc:
210-
Exclude:
211-
- 'lib/generators/serializer/serializer_generator.rb'
212-
213-
# Offense count: 8
214-
# Cop supports --auto-correct.
215163
# Configuration parameters: EnforcedStyle, SupportedStyles.
164+
# SupportedStyles: final_newline, final_blank_line
216165
Style/TrailingBlankLines:
217166
Exclude:
218-
- 'lib/active_model/serializer/pass_through_serializer.rb'
219-
- 'lib/generators/serializer/serializer_generator.rb'
220-
- 'test/adapter/fragment_cache_test.rb'
221-
- 'test/adapter/json_api/json_api_test.rb'
222167
- 'test/adapter/null_test.rb'
223-
- 'test/serializers/cache_test.rb'
224-
- 'test/serializers/fieldset_test.rb'
225-
- 'test/support/stream_capture.rb'
226-
227-
# Offense count: 5
228-
# Cop supports --auto-correct.
229-
# Configuration parameters: EnforcedStyleForMultiline, SupportedStyles.
230-
Style/TrailingComma:
231-
Exclude:
232-
- 'test/action_controller/adapter_selector_test.rb'
233-
- 'test/action_controller/serialization_test.rb'
234-
- 'test/adapter/json_api/belongs_to_test.rb'
235-
- 'test/adapter/json_api/linked_test.rb'
236-
237-
# Offense count: 1
238-
Style/UnlessElse:
239-
Exclude:
240-
- 'lib/active_model/serializer.rb'

.travis.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ rvm:
88
- 2.2.3
99
- 2.3.0
1010
- ruby-head
11-
- rbx-2
11+
- jruby-9.0.4.0
12+
- jruby-head
13+
14+
jdk:
15+
- oraclejdk8
1216

1317
install: bundle install --path=vendor/bundle --retry=3 --jobs=3
1418
cache:
@@ -19,21 +23,29 @@ script:
1923
- bundle exec rake ci
2024

2125
env:
22-
- "RAILS_VERSION=4.0"
23-
- "RAILS_VERSION=4.1"
24-
- "RAILS_VERSION=4.2"
25-
- "RAILS_VERSION=master"
26+
global:
27+
- "JRUBY_OPTS='--dev -J-Xmx1024M --debug'"
28+
matrix:
29+
- "RAILS_VERSION=4.0"
30+
- "RAILS_VERSION=4.1"
31+
- "RAILS_VERSION=4.2"
32+
- "RAILS_VERSION=master"
2633

2734
matrix:
2835
exclude:
2936
- rvm: 2.0.0
3037
env: RAILS_VERSION=master
3138
- rvm: 2.1
3239
env: RAILS_VERSION=master
33-
include:
3440
- rvm: jruby-9.0.4.0
35-
env: JRUBY_OPTS='-Xcompat.version=2.0 --server -Xcompile.invokedynamic=false -Xcli.debug=true --debug'
41+
env: RAILS_VERSION=master
42+
- rvm: jruby-9.0.4.0
43+
env: RAILS_VERSION=4.0
44+
- rvm: jruby-head
45+
env: RAILS_VERSION=master
46+
- rvm: jruby-head
47+
env: RAILS_VERSION=4.0
3648
allow_failures:
3749
- rvm: ruby-head
38-
- rvm: rbx-2
50+
- rvm: jruby-head
3951
fast_finish: true

0 commit comments

Comments
 (0)