active_model_serializers 0.10.9 → 0.10.10
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/CHANGELOG.md +18 -2
- data/lib/action_controller/serialization.rb +9 -1
- data/lib/active_model/serializer.rb +10 -2
- data/lib/active_model/serializer/version.rb +1 -1
- data/lib/active_model_serializers/adapter/attributes.rb +21 -0
- data/lib/active_model_serializers/adapter/json_api/resource_identifier.rb +1 -1
- metadata +12 -259
- data/.github/ISSUE_TEMPLATE.md +0 -29
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -15
- data/.gitignore +0 -35
- data/.rubocop.yml +0 -109
- data/.simplecov +0 -110
- data/.travis.yml +0 -63
- data/CODE_OF_CONDUCT.md +0 -74
- data/CONTRIBUTING.md +0 -105
- data/Gemfile +0 -74
- data/Rakefile +0 -76
- data/active_model_serializers.gemspec +0 -64
- data/appveyor.yml +0 -28
- data/bin/bench +0 -171
- data/bin/bench_regression +0 -316
- data/bin/rubocop +0 -38
- data/bin/serve_benchmark +0 -39
- data/docs/README.md +0 -41
- data/docs/STYLE.md +0 -58
- data/docs/general/adapters.md +0 -269
- data/docs/general/caching.md +0 -58
- data/docs/general/configuration_options.md +0 -185
- data/docs/general/deserialization.md +0 -100
- data/docs/general/fields.md +0 -31
- data/docs/general/getting_started.md +0 -133
- data/docs/general/instrumentation.md +0 -40
- data/docs/general/key_transforms.md +0 -40
- data/docs/general/logging.md +0 -21
- data/docs/general/rendering.md +0 -293
- data/docs/general/serializers.md +0 -495
- data/docs/how-open-source-maintained.jpg +0 -0
- data/docs/howto/add_pagination_links.md +0 -138
- data/docs/howto/add_relationship_links.md +0 -140
- data/docs/howto/add_root_key.md +0 -62
- data/docs/howto/grape_integration.md +0 -42
- data/docs/howto/outside_controller_use.md +0 -66
- data/docs/howto/passing_arbitrary_options.md +0 -27
- data/docs/howto/serialize_poro.md +0 -73
- data/docs/howto/test.md +0 -154
- data/docs/howto/upgrade_from_0_8_to_0_10.md +0 -265
- data/docs/integrations/ember-and-json-api.md +0 -147
- data/docs/integrations/grape.md +0 -19
- data/docs/jsonapi/errors.md +0 -56
- data/docs/jsonapi/schema.md +0 -151
- data/docs/jsonapi/schema/schema.json +0 -366
- data/docs/rfcs/0000-namespace.md +0 -106
- data/docs/rfcs/template.md +0 -15
- data/test/action_controller/adapter_selector_test.rb +0 -64
- data/test/action_controller/explicit_serializer_test.rb +0 -137
- data/test/action_controller/json/include_test.rb +0 -248
- data/test/action_controller/json_api/deserialization_test.rb +0 -114
- data/test/action_controller/json_api/errors_test.rb +0 -42
- data/test/action_controller/json_api/fields_test.rb +0 -68
- data/test/action_controller/json_api/linked_test.rb +0 -204
- data/test/action_controller/json_api/pagination_test.rb +0 -126
- data/test/action_controller/json_api/transform_test.rb +0 -191
- data/test/action_controller/lookup_proc_test.rb +0 -51
- data/test/action_controller/namespace_lookup_test.rb +0 -234
- data/test/action_controller/serialization_scope_name_test.rb +0 -237
- data/test/action_controller/serialization_test.rb +0 -480
- data/test/active_model_serializers/adapter_for_test.rb +0 -210
- data/test/active_model_serializers/json_pointer_test.rb +0 -24
- data/test/active_model_serializers/logging_test.rb +0 -79
- data/test/active_model_serializers/model_test.rb +0 -144
- data/test/active_model_serializers/railtie_test_isolated.rb +0 -70
- data/test/active_model_serializers/register_jsonapi_renderer_test_isolated.rb +0 -163
- data/test/active_model_serializers/serialization_context_test_isolated.rb +0 -73
- data/test/active_model_serializers/test/schema_test.rb +0 -133
- data/test/active_model_serializers/test/serializer_test.rb +0 -64
- data/test/active_record_test.rb +0 -11
- data/test/adapter/attributes_test.rb +0 -42
- data/test/adapter/deprecation_test.rb +0 -102
- data/test/adapter/json/belongs_to_test.rb +0 -47
- data/test/adapter/json/collection_test.rb +0 -106
- data/test/adapter/json/has_many_test.rb +0 -55
- data/test/adapter/json/transform_test.rb +0 -95
- data/test/adapter/json_api/belongs_to_test.rb +0 -157
- data/test/adapter/json_api/collection_test.rb +0 -98
- data/test/adapter/json_api/errors_test.rb +0 -78
- data/test/adapter/json_api/fields_test.rb +0 -98
- data/test/adapter/json_api/has_many_explicit_serializer_test.rb +0 -98
- data/test/adapter/json_api/has_many_test.rb +0 -175
- data/test/adapter/json_api/has_one_test.rb +0 -82
- data/test/adapter/json_api/include_data_if_sideloaded_test.rb +0 -215
- data/test/adapter/json_api/json_api_test.rb +0 -35
- data/test/adapter/json_api/linked_test.rb +0 -415
- data/test/adapter/json_api/links_test.rb +0 -112
- data/test/adapter/json_api/pagination_links_test.rb +0 -208
- data/test/adapter/json_api/parse_test.rb +0 -139
- data/test/adapter/json_api/relationship_test.rb +0 -399
- data/test/adapter/json_api/resource_meta_test.rb +0 -102
- data/test/adapter/json_api/toplevel_jsonapi_test.rb +0 -84
- data/test/adapter/json_api/transform_test.rb +0 -514
- data/test/adapter/json_api/type_test.rb +0 -195
- data/test/adapter/json_test.rb +0 -48
- data/test/adapter/null_test.rb +0 -24
- data/test/adapter/polymorphic_test.rb +0 -220
- data/test/adapter_test.rb +0 -69
- data/test/array_serializer_test.rb +0 -24
- data/test/benchmark/app.rb +0 -67
- data/test/benchmark/benchmarking_support.rb +0 -69
- data/test/benchmark/bm_active_record.rb +0 -83
- data/test/benchmark/bm_adapter.rb +0 -40
- data/test/benchmark/bm_caching.rb +0 -121
- data/test/benchmark/bm_lookup_chain.rb +0 -85
- data/test/benchmark/bm_transform.rb +0 -47
- data/test/benchmark/config.ru +0 -3
- data/test/benchmark/controllers.rb +0 -85
- data/test/benchmark/fixtures.rb +0 -221
- data/test/cache_test.rb +0 -717
- data/test/collection_serializer_test.rb +0 -129
- data/test/fixtures/active_record.rb +0 -115
- data/test/fixtures/poro.rb +0 -227
- data/test/generators/scaffold_controller_generator_test.rb +0 -26
- data/test/generators/serializer_generator_test.rb +0 -77
- data/test/grape_test.rb +0 -198
- data/test/lint_test.rb +0 -51
- data/test/logger_test.rb +0 -22
- data/test/poro_test.rb +0 -11
- data/test/serializable_resource_test.rb +0 -81
- data/test/serializers/association_macros_test.rb +0 -39
- data/test/serializers/associations_test.rb +0 -520
- data/test/serializers/attribute_test.rb +0 -155
- data/test/serializers/attributes_test.rb +0 -54
- data/test/serializers/caching_configuration_test_isolated.rb +0 -172
- data/test/serializers/configuration_test.rb +0 -34
- data/test/serializers/fieldset_test.rb +0 -16
- data/test/serializers/meta_test.rb +0 -204
- data/test/serializers/options_test.rb +0 -34
- data/test/serializers/read_attribute_for_serialization_test.rb +0 -81
- data/test/serializers/reflection_test.rb +0 -481
- data/test/serializers/root_test.rb +0 -23
- data/test/serializers/serialization_test.rb +0 -57
- data/test/serializers/serializer_for_test.rb +0 -138
- data/test/serializers/serializer_for_with_namespace_test.rb +0 -90
- data/test/support/custom_schemas/active_model_serializers/test/schema_test/my/index.json +0 -6
- data/test/support/isolated_unit.rb +0 -86
- data/test/support/rails5_shims.rb +0 -55
- data/test/support/rails_app.rb +0 -40
- data/test/support/schemas/active_model_serializers/test/schema_test/my/index.json +0 -6
- data/test/support/schemas/active_model_serializers/test/schema_test/my/show.json +0 -6
- data/test/support/schemas/custom/show.json +0 -7
- data/test/support/schemas/hyper_schema.json +0 -93
- data/test/support/schemas/render_using_json_api.json +0 -43
- data/test/support/schemas/simple_json_pointers.json +0 -10
- data/test/support/serialization_testing.rb +0 -81
- data/test/test_helper.rb +0 -72
data/.github/ISSUE_TEMPLATE.md
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
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
|
-
|
data/.gitignore
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
*.gem
|
|
2
|
-
*.rbc
|
|
3
|
-
.bundle
|
|
4
|
-
.config
|
|
5
|
-
.yardoc
|
|
6
|
-
Gemfile.lock
|
|
7
|
-
Gemfile.local
|
|
8
|
-
InstalledFiles
|
|
9
|
-
_yardoc
|
|
10
|
-
coverage
|
|
11
|
-
doc/
|
|
12
|
-
lib/bundler/man
|
|
13
|
-
pkg
|
|
14
|
-
Vagrantfile
|
|
15
|
-
.vagrant
|
|
16
|
-
rdoc
|
|
17
|
-
spec/reports
|
|
18
|
-
test/tmp
|
|
19
|
-
test/version_tmp
|
|
20
|
-
tmp
|
|
21
|
-
*.swp
|
|
22
|
-
.ruby-version
|
|
23
|
-
.ruby-gemset
|
|
24
|
-
vendor/bundle
|
|
25
|
-
tags
|
|
26
|
-
|
|
27
|
-
# silly macs
|
|
28
|
-
.DS_Store
|
|
29
|
-
.DS_Store?
|
|
30
|
-
._*
|
|
31
|
-
.Spotlight-V100
|
|
32
|
-
.Trashes
|
|
33
|
-
Icon?
|
|
34
|
-
ehthumbs.db
|
|
35
|
-
Thumbs.db
|
data/.rubocop.yml
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
AllCops:
|
|
2
|
-
TargetRubyVersion: 2.1
|
|
3
|
-
Exclude:
|
|
4
|
-
- !ruby/regexp /(vendor|bundle|bin|db|tmp)\/.*/
|
|
5
|
-
DisplayCopNames: true
|
|
6
|
-
DisplayStyleGuide: true
|
|
7
|
-
# https://github.com/bbatsov/rubocop/blob/master/manual/caching.md
|
|
8
|
-
# https://github.com/bbatsov/rubocop/blob/e8680418b351491e111a18cf5b453fc07a3c5239/config/default.yml#L60-L77
|
|
9
|
-
UseCache: true
|
|
10
|
-
CacheRootDirectory: tmp
|
|
11
|
-
|
|
12
|
-
Rails:
|
|
13
|
-
Enabled: true
|
|
14
|
-
|
|
15
|
-
Lint/NestedMethodDefinition:
|
|
16
|
-
Enabled: false
|
|
17
|
-
Exclude:
|
|
18
|
-
- test/action_controller/serialization_test.rb
|
|
19
|
-
|
|
20
|
-
Style/Alias:
|
|
21
|
-
EnforcedStyle: prefer_alias
|
|
22
|
-
|
|
23
|
-
Style/StringLiterals:
|
|
24
|
-
EnforcedStyle: single_quotes
|
|
25
|
-
|
|
26
|
-
Metrics/AbcSize:
|
|
27
|
-
Max: 35 # TODO: Lower to 15
|
|
28
|
-
|
|
29
|
-
Metrics/ClassLength:
|
|
30
|
-
Max: 261 # TODO: Lower to 100
|
|
31
|
-
Exclude:
|
|
32
|
-
- test/**/*.rb
|
|
33
|
-
|
|
34
|
-
Metrics/CyclomaticComplexity:
|
|
35
|
-
Max: 7 # TODO: Lower to 6
|
|
36
|
-
|
|
37
|
-
Metrics/LineLength:
|
|
38
|
-
Max: 251 # TODO: Lower to 80
|
|
39
|
-
|
|
40
|
-
Metrics/MethodLength:
|
|
41
|
-
Max: 106 # TODO: Lower to 10
|
|
42
|
-
|
|
43
|
-
Metrics/PerceivedComplexity:
|
|
44
|
-
Max: 9 # TODO: Lower to 7
|
|
45
|
-
|
|
46
|
-
Style/AlignParameters:
|
|
47
|
-
EnforcedStyle: with_fixed_indentation
|
|
48
|
-
|
|
49
|
-
Style/ClassAndModuleChildren:
|
|
50
|
-
EnforcedStyle: nested
|
|
51
|
-
|
|
52
|
-
Style/Documentation:
|
|
53
|
-
Enabled: false
|
|
54
|
-
|
|
55
|
-
Style/MissingElse:
|
|
56
|
-
Enabled: true
|
|
57
|
-
EnforcedStyle: case
|
|
58
|
-
|
|
59
|
-
Style/EmptyElse:
|
|
60
|
-
EnforcedStyle: empty
|
|
61
|
-
|
|
62
|
-
Style/FrozenStringLiteralComment:
|
|
63
|
-
Enabled: true
|
|
64
|
-
EnforcedStyle: always
|
|
65
|
-
|
|
66
|
-
Style/MultilineOperationIndentation:
|
|
67
|
-
EnforcedStyle: indented
|
|
68
|
-
|
|
69
|
-
Style/BlockDelimiters:
|
|
70
|
-
Enabled: true
|
|
71
|
-
EnforcedStyle: line_count_based
|
|
72
|
-
|
|
73
|
-
Style/SignalException:
|
|
74
|
-
EnforcedStyle: semantic
|
|
75
|
-
|
|
76
|
-
Style/TrailingCommaInLiteral:
|
|
77
|
-
EnforcedStyleForMultiline: no_comma
|
|
78
|
-
|
|
79
|
-
Style/ConditionalAssignment:
|
|
80
|
-
Enabled: false
|
|
81
|
-
|
|
82
|
-
Style/DotPosition:
|
|
83
|
-
EnforcedStyle: leading
|
|
84
|
-
|
|
85
|
-
########## test_helper.rb sanity
|
|
86
|
-
Style/EndBlock:
|
|
87
|
-
Exclude:
|
|
88
|
-
- test/test_helper.rb
|
|
89
|
-
|
|
90
|
-
Style/SpecialGlobalVars:
|
|
91
|
-
Exclude:
|
|
92
|
-
- test/test_helper.rb
|
|
93
|
-
|
|
94
|
-
Style/GlobalVars:
|
|
95
|
-
Exclude:
|
|
96
|
-
- test/test_helper.rb
|
|
97
|
-
|
|
98
|
-
Style/AndOr:
|
|
99
|
-
Exclude:
|
|
100
|
-
- test/test_helper.rb
|
|
101
|
-
- 'lib/active_model/serializer/lint.rb'
|
|
102
|
-
|
|
103
|
-
Style/Not:
|
|
104
|
-
Exclude:
|
|
105
|
-
- test/test_helper.rb
|
|
106
|
-
|
|
107
|
-
Style/ClassCheck:
|
|
108
|
-
Exclude:
|
|
109
|
-
- test/test_helper.rb
|
data/.simplecov
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
# https://github.com/colszowka/simplecov#using-simplecov-for-centralized-config
|
|
2
|
-
# see https://github.com/colszowka/simplecov/blob/master/lib/simplecov/defaults.rb
|
|
3
|
-
# vim: set ft=ruby
|
|
4
|
-
|
|
5
|
-
## DEFINE VARIABLES
|
|
6
|
-
@minimum_coverage = ENV.fetch('COVERAGE_MINIMUM') {
|
|
7
|
-
case (defined?(RUBY_ENGINE) && RUBY_ENGINE) || "ruby"
|
|
8
|
-
when 'jruby', 'rbx'
|
|
9
|
-
96.0
|
|
10
|
-
else
|
|
11
|
-
98.1
|
|
12
|
-
end
|
|
13
|
-
}.to_f.round(2)
|
|
14
|
-
# rubocop:disable Style/DoubleNegation
|
|
15
|
-
ENV['FULL_BUILD'] ||= ENV['CI']
|
|
16
|
-
@running_ci = !!(ENV['FULL_BUILD'] =~ /\Atrue\z/i)
|
|
17
|
-
@generate_report = @running_ci || !!(ENV['COVERAGE'] =~ /\Atrue\z/i)
|
|
18
|
-
@output = STDOUT
|
|
19
|
-
# rubocop:enable Style/DoubleNegation
|
|
20
|
-
|
|
21
|
-
## CONFIGURE SIMPLECOV
|
|
22
|
-
|
|
23
|
-
SimpleCov.profiles.define 'app' do
|
|
24
|
-
coverage_dir 'coverage'
|
|
25
|
-
load_profile 'test_frameworks'
|
|
26
|
-
|
|
27
|
-
add_group 'Libraries', 'lib'
|
|
28
|
-
|
|
29
|
-
add_group 'Long files' do |src_file|
|
|
30
|
-
src_file.lines.count > 100
|
|
31
|
-
end
|
|
32
|
-
class MaxLinesFilter < SimpleCov::Filter
|
|
33
|
-
def matches?(source_file)
|
|
34
|
-
source_file.lines.count < filter_argument
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
add_group 'Short files', MaxLinesFilter.new(5)
|
|
38
|
-
|
|
39
|
-
# Exclude these paths from analysis
|
|
40
|
-
add_filter '/config/'
|
|
41
|
-
add_filter '/db/'
|
|
42
|
-
add_filter 'tasks'
|
|
43
|
-
add_filter '/.bundle/'
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
## START TRACKING COVERAGE (before activating SimpleCov)
|
|
47
|
-
require 'coverage'
|
|
48
|
-
Coverage.start
|
|
49
|
-
|
|
50
|
-
## ADD SOME CUSTOM REPORTING AT EXIT
|
|
51
|
-
SimpleCov.at_exit do
|
|
52
|
-
next if $! and not ($!.kind_of? SystemExit and $!.success?)
|
|
53
|
-
|
|
54
|
-
header = "#{'*' * 20} SimpleCov Results #{'*' * 20}"
|
|
55
|
-
results = SimpleCov.result.format!.join("\n")
|
|
56
|
-
exit_message = <<-EOF
|
|
57
|
-
|
|
58
|
-
#{header}
|
|
59
|
-
{{RESULTS}}
|
|
60
|
-
{{FAILURE_MESSAGE}}
|
|
61
|
-
|
|
62
|
-
#{'*' * header.size}
|
|
63
|
-
EOF
|
|
64
|
-
percent = Float(SimpleCov.result.covered_percent)
|
|
65
|
-
if percent < @minimum_coverage
|
|
66
|
-
failure_message = <<-EOF
|
|
67
|
-
Spec coverage was not high enough: #{percent.round(2)}% is < #{@minimum_coverage}%
|
|
68
|
-
EOF
|
|
69
|
-
exit_message.sub!('{{RESULTS}}', results).sub!('{{FAILURE_MESSAGE}}', failure_message)
|
|
70
|
-
@output.puts exit_message
|
|
71
|
-
abort(failure_message) if @generate_report
|
|
72
|
-
elsif @running_ci
|
|
73
|
-
exit_message.sub!('{{RESULTS}}', results).sub!('{{FAILURE_MESSAGE}}', <<-EOF)
|
|
74
|
-
Nice job! Spec coverage (#{percent.round(2)}%) is still at or above #{@minimum_coverage}%
|
|
75
|
-
EOF
|
|
76
|
-
@output.puts exit_message
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
## CAPTURE CONFIG IN CLOSURE 'AppCoverage.start'
|
|
81
|
-
## to defer running until test/test_helper.rb is loaded.
|
|
82
|
-
# rubocop:disable Style/MultilineBlockChain
|
|
83
|
-
AppCoverage = Class.new do
|
|
84
|
-
def initialize(&block)
|
|
85
|
-
@block = block
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
def start
|
|
89
|
-
@block.call
|
|
90
|
-
end
|
|
91
|
-
end.new do
|
|
92
|
-
SimpleCov.start 'app'
|
|
93
|
-
if @generate_report
|
|
94
|
-
if @running_ci
|
|
95
|
-
require 'codeclimate-test-reporter'
|
|
96
|
-
@output.puts '[COVERAGE] Running with SimpleCov Simple Formatter and CodeClimate Test Reporter'
|
|
97
|
-
formatters = [
|
|
98
|
-
SimpleCov::Formatter::SimpleFormatter,
|
|
99
|
-
CodeClimate::TestReporter::Formatter
|
|
100
|
-
]
|
|
101
|
-
else
|
|
102
|
-
@output.puts '[COVERAGE] Running with SimpleCov HTML Formatter'
|
|
103
|
-
formatters = [SimpleCov::Formatter::HTMLFormatter]
|
|
104
|
-
end
|
|
105
|
-
else
|
|
106
|
-
formatters = []
|
|
107
|
-
end
|
|
108
|
-
SimpleCov.formatters = formatters
|
|
109
|
-
end
|
|
110
|
-
# rubocop:enable Style/MultilineBlockChain
|
data/.travis.yml
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
language: ruby
|
|
2
|
-
sudo: false
|
|
3
|
-
|
|
4
|
-
cache:
|
|
5
|
-
directories:
|
|
6
|
-
- vendor/bundle
|
|
7
|
-
|
|
8
|
-
before_install:
|
|
9
|
-
- "travis_retry gem update --system 2.7.8"
|
|
10
|
-
- "travis_retry gem install bundler -v '1.17.3'"
|
|
11
|
-
install: BUNDLER_VERSION=1.17.3 bundle install --path=vendor/bundle --retry=3 --jobs=3
|
|
12
|
-
|
|
13
|
-
script:
|
|
14
|
-
- bundle exec rake ci
|
|
15
|
-
after_success:
|
|
16
|
-
- codeclimate-test-reporter
|
|
17
|
-
|
|
18
|
-
env:
|
|
19
|
-
matrix:
|
|
20
|
-
- "RAILS_VERSION=4.1"
|
|
21
|
-
- "RAILS_VERSION=4.2"
|
|
22
|
-
- "RAILS_VERSION=5.0"
|
|
23
|
-
- "RAILS_VERSION=5.1"
|
|
24
|
-
- "RAILS_VERSION=5.2"
|
|
25
|
-
- "RAILS_VERSION=master"
|
|
26
|
-
|
|
27
|
-
rvm:
|
|
28
|
-
- 2.1.10
|
|
29
|
-
- 2.2.8
|
|
30
|
-
- 2.3.5
|
|
31
|
-
- 2.4.2
|
|
32
|
-
- 2.5.3
|
|
33
|
-
- ruby-head
|
|
34
|
-
|
|
35
|
-
branches:
|
|
36
|
-
only:
|
|
37
|
-
- 0-10-stable
|
|
38
|
-
|
|
39
|
-
matrix:
|
|
40
|
-
include:
|
|
41
|
-
- { rvm: jruby-9.1.13.0, jdk: oraclejdk8, env: "RAILS_VERSION=4.1 JRUBY_OPTS='--dev -J-Xmx1024M --debug'" }
|
|
42
|
-
- { rvm: jruby-9.1.13.0, jdk: oraclejdk8, env: "RAILS_VERSION=4.2 JRUBY_OPTS='--dev -J-Xmx1024M --debug'" }
|
|
43
|
-
- { rvm: jruby-9.1.13.0, jdk: oraclejdk8, env: "RAILS_VERSION=5.1 JRUBY_OPTS='--dev -J-Xmx1024M --debug'" }
|
|
44
|
-
# See JRuby currently failing on Rails 5+ https://github.com/jruby/activerecord-jdbc-adapter/issues/708
|
|
45
|
-
# - { rvm: jruby-9.1.13.0, jdk: oraclejdk8, env: "RAILS_VERSION=5.0 JRUBY_OPTS='--dev -J-Xmx1024M --debug'" }
|
|
46
|
-
# - { rvm: jruby-head, jdk: oraclejdk8, env: "RAILS_VERSION=5.1 JRUBY_OPTS='--dev -J-Xmx1024M --debug'" }
|
|
47
|
-
exclude:
|
|
48
|
-
- { rvm: 2.1.10, env: RAILS_VERSION=master }
|
|
49
|
-
- { rvm: 2.2.8, env: RAILS_VERSION=master }
|
|
50
|
-
- { rvm: 2.3.5, env: RAILS_VERSION=master }
|
|
51
|
-
- { rvm: 2.4.2, env: RAILS_VERSION=master }
|
|
52
|
-
- { rvm: 2.1.10, env: RAILS_VERSION=5.0 }
|
|
53
|
-
- { rvm: 2.1.10, env: RAILS_VERSION=5.1 }
|
|
54
|
-
- { rvm: 2.1.10, env: RAILS_VERSION=5.2 }
|
|
55
|
-
- { rvm: 2.4.2, env: RAILS_VERSION=4.1 }
|
|
56
|
-
- { rvm: 2.5.3, env: RAILS_VERSION=4.1 }
|
|
57
|
-
- { rvm: ruby-head, env: RAILS_VERSION=4.1 }
|
|
58
|
-
allow_failures:
|
|
59
|
-
- rvm: ruby-head
|
|
60
|
-
- rvm: jruby-head
|
|
61
|
-
# See JRuby currently failing on Rails 5+ https://github.com/jruby/activerecord-jdbc-adapter/issues/708
|
|
62
|
-
- { rvm: jruby-9.1.13.0, jdk: oraclejdk8, env: "RAILS_VERSION=5.1 JRUBY_OPTS='--dev -J-Xmx1024M --debug'" }
|
|
63
|
-
fast_finish: true
|
data/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
|
2
|
-
|
|
3
|
-
## Our Pledge
|
|
4
|
-
|
|
5
|
-
In the interest of fostering an open and welcoming environment, we as
|
|
6
|
-
contributors and maintainers pledge to making participation in our project and
|
|
7
|
-
our community a harassment-free experience for everyone, regardless of age, body
|
|
8
|
-
size, disability, ethnicity, gender identity and expression, level of experience,
|
|
9
|
-
nationality, personal appearance, race, religion, or sexual identity and
|
|
10
|
-
orientation.
|
|
11
|
-
|
|
12
|
-
## Our Standards
|
|
13
|
-
|
|
14
|
-
Examples of behavior that contributes to creating a positive environment
|
|
15
|
-
include:
|
|
16
|
-
|
|
17
|
-
* Using welcoming and inclusive language
|
|
18
|
-
* Being respectful of differing viewpoints and experiences
|
|
19
|
-
* Gracefully accepting constructive criticism
|
|
20
|
-
* Focusing on what is best for the community
|
|
21
|
-
* Showing empathy towards other community members
|
|
22
|
-
|
|
23
|
-
Examples of unacceptable behavior by participants include:
|
|
24
|
-
|
|
25
|
-
* The use of sexualized language or imagery and unwelcome sexual attention or
|
|
26
|
-
advances
|
|
27
|
-
* Trolling, insulting/derogatory comments, and personal or political attacks
|
|
28
|
-
* Public or private harassment
|
|
29
|
-
* Publishing others' private information, such as a physical or electronic
|
|
30
|
-
address, without explicit permission
|
|
31
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
|
32
|
-
professional setting
|
|
33
|
-
|
|
34
|
-
## Our Responsibilities
|
|
35
|
-
|
|
36
|
-
Project maintainers are responsible for clarifying the standards of acceptable
|
|
37
|
-
behavior and are expected to take appropriate and fair corrective action in
|
|
38
|
-
response to any instances of unacceptable behavior.
|
|
39
|
-
|
|
40
|
-
Project maintainers have the right and responsibility to remove, edit, or
|
|
41
|
-
reject comments, commits, code, wiki edits, issues, and other contributions
|
|
42
|
-
that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
43
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
|
44
|
-
threatening, offensive, or harmful.
|
|
45
|
-
|
|
46
|
-
## Scope
|
|
47
|
-
|
|
48
|
-
This Code of Conduct applies both within project spaces and in public spaces
|
|
49
|
-
when an individual is representing the project or its community. Examples of
|
|
50
|
-
representing a project or community include using an official project e-mail
|
|
51
|
-
address, posting via an official social media account, or acting as an appointed
|
|
52
|
-
representative at an online or offline event. Representation of a project may be
|
|
53
|
-
further defined and clarified by project maintainers.
|
|
54
|
-
|
|
55
|
-
## Enforcement
|
|
56
|
-
|
|
57
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
58
|
-
reported by contacting one of the owners listed at https://rubygems.org/gems/active_model_serializers. All
|
|
59
|
-
complaints will be reviewed and investigated and will result in a response that
|
|
60
|
-
is deemed necessary and appropriate to the circumstances. The project team is
|
|
61
|
-
obligated to maintain confidentiality with regard to the reporter of an incident.
|
|
62
|
-
Further details of specific enforcement policies may be posted separately.
|
|
63
|
-
|
|
64
|
-
Project maintainers who do not follow or enforce the Code of Conduct in good
|
|
65
|
-
faith may face temporary or permanent repercussions as determined by other
|
|
66
|
-
members of the project's leadership.
|
|
67
|
-
|
|
68
|
-
## Attribution
|
|
69
|
-
|
|
70
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
|
71
|
-
available at [http://contributor-covenant.org/version/1/4][version]
|
|
72
|
-
|
|
73
|
-
[homepage]: http://contributor-covenant.org
|
|
74
|
-
[version]: http://contributor-covenant.org/version/1/4/
|
data/CONTRIBUTING.md
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
## Have an issue?
|
|
2
|
-
|
|
3
|
-
Before opening an issue, try the following:
|
|
4
|
-
|
|
5
|
-
##### Consult the documentation
|
|
6
|
-
|
|
7
|
-
See if your issue can be resolved by information in the documentation.
|
|
8
|
-
|
|
9
|
-
- [0.10 (master) Documentation](https://github.com/rails-api/active_model_serializers/tree/master/docs)
|
|
10
|
-
- [](http://www.rubydoc.info/github/rails-api/active_model_serializers/v0.10.0)
|
|
11
|
-
- [Guides](docs)
|
|
12
|
-
- [0.9 (0-9-stable) Documentation](https://github.com/rails-api/active_model_serializers/tree/0-9-stable)
|
|
13
|
-
- [0.8 (0-8-stable) Documentation](https://github.com/rails-api/active_model_serializers/tree/0-8-stable)
|
|
14
|
-
|
|
15
|
-
##### Check for an existing issue
|
|
16
|
-
|
|
17
|
-
Take a look at the issues to see if a similar one has already been created. If
|
|
18
|
-
one exists, please add any additional information that might expedite
|
|
19
|
-
resolution.
|
|
20
|
-
|
|
21
|
-
#### Open an issue
|
|
22
|
-
|
|
23
|
-
If the documentation wasn't able to help resolve the issue and no issue already
|
|
24
|
-
exists, please open a new issue with the following in mind:
|
|
25
|
-
|
|
26
|
-
- Please make sure only to include one issue per report. If you encounter
|
|
27
|
-
multiple, unrelated issues, please report them as such.
|
|
28
|
-
- Be detailed. Provide backtraces and example code when possible. Provide
|
|
29
|
-
information about your environment. e.g., Ruby version, rails version, etc.
|
|
30
|
-
- Own your issue. Actively participate in the discussion and help drive the
|
|
31
|
-
issue to closure.
|
|
32
|
-
- If you resolve your own issue, please share the details on the issue and close
|
|
33
|
-
it out. Others might have the same issue and sharing solutions is helpful.
|
|
34
|
-
|
|
35
|
-
## Contributing
|
|
36
|
-
|
|
37
|
-
Contributing can be done in many ways and is not exclusive to code. If you have
|
|
38
|
-
thoughts on a particular issue or feature, we encourage you to open new issues
|
|
39
|
-
for discussion or add your comments to existing ones.
|
|
40
|
-
|
|
41
|
-
#### Pull requests
|
|
42
|
-
|
|
43
|
-
We also gladly welcome pull requests. When preparing to work on pull request,
|
|
44
|
-
please adhere to these standards:
|
|
45
|
-
|
|
46
|
-
- Base work on the master branch unless fixing an issue with
|
|
47
|
-
[0.9-stable](https://github.com/rails-api/active_model_serializers/tree/0-9-stable)
|
|
48
|
-
or
|
|
49
|
-
[0.8-stable](https://github.com/rails-api/active_model_serializers/tree/0-8-stable)
|
|
50
|
-
- Squash your commits and regularly rebase off master.
|
|
51
|
-
- Provide a description of the changes contained in the pull request.
|
|
52
|
-
- Note any specific areas that should be reviewed.
|
|
53
|
-
- Include tests.
|
|
54
|
-
- The test suite must pass on [supported Ruby versions](.travis.yml)
|
|
55
|
-
- Include updates to the [documentation](https://github.com/rails-api/active_model_serializers/tree/master/docs)
|
|
56
|
-
where applicable.
|
|
57
|
-
- Update the
|
|
58
|
-
[CHANGELOG](https://github.com/rails-api/active_model_serializers/blob/master/CHANGELOG.md)
|
|
59
|
-
to the appropriate sections with a brief description of the changes.
|
|
60
|
-
- Do not change the VERSION file.
|
|
61
|
-
|
|
62
|
-
#### Running tests
|
|
63
|
-
|
|
64
|
-
Run all tests
|
|
65
|
-
|
|
66
|
-
`$ rake test`
|
|
67
|
-
|
|
68
|
-
Run a single test suite
|
|
69
|
-
|
|
70
|
-
`$ rake test TEST=path/to/test.rb`
|
|
71
|
-
|
|
72
|
-
Run a single test
|
|
73
|
-
|
|
74
|
-
`$ rake test TEST=path/to/test.rb TESTOPTS="--name=test_something"`
|
|
75
|
-
|
|
76
|
-
Run tests against different Rails versions by setting the RAILS_VERSION variable
|
|
77
|
-
and bundling gems. (save this script somewhere executable and run from top of AMS repository)
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
#!/usr/bin/env bash
|
|
81
|
-
|
|
82
|
-
rcommand='puts YAML.load_file("./.travis.yml")["env"]["matrix"].join(" ").gsub("RAILS_VERSION=", "")'
|
|
83
|
-
versions=$(ruby -ryaml -e "$rcommand")
|
|
84
|
-
|
|
85
|
-
for version in ${versions[@]}; do
|
|
86
|
-
export RAILS_VERSION="$version"
|
|
87
|
-
rm -f Gemfile.lock
|
|
88
|
-
bundle check || bundle --local || bundle
|
|
89
|
-
bundle exec rake test
|
|
90
|
-
if [ "$?" -eq 0 ]; then
|
|
91
|
-
# green in ANSI
|
|
92
|
-
echo -e "\033[32m **** Tests passed against Rails ${RAILS_VERSION} **** \033[0m"
|
|
93
|
-
else
|
|
94
|
-
# red in ANSI
|
|
95
|
-
echo -e "\033[31m **** Tests failed against Rails ${RAILS_VERSION} **** \033[0m"
|
|
96
|
-
read -p '[Enter] any key to continue, [q] to quit...' prompt
|
|
97
|
-
if [ "$prompt" = 'q' ]; then
|
|
98
|
-
unset RAILS_VERSION
|
|
99
|
-
exit 1
|
|
100
|
-
fi
|
|
101
|
-
fi
|
|
102
|
-
unset RAILS_VERSION
|
|
103
|
-
done
|
|
104
|
-
```
|
|
105
|
-
|