jsonapi_errors_handler 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e90ab4d7f467391ce6573301ba495731e91bacd53d5b8411b187264f634d020
4
- data.tar.gz: 636457e3b271ef91cfd6e95fa2163fdd3bc781c4fce8dfc9cb504b37f13104c7
3
+ metadata.gz: 8b564d9bbd8895bf69bb4fe9529179adf982161ed5487b9ab25020aedc8f2156
4
+ data.tar.gz: faa8c8ceac35f80350aa3c0ec9a4388acf9896f80e492fdb5db8d120c14b0b13
5
5
  SHA512:
6
- metadata.gz: '059874df7053302d90ef11f19500705fbbac5225c40276771e791981f480040753677127190d3d1e4a242b8e1ca8550086cd3ff93ba8d3d75dbd02738b1a19b3'
7
- data.tar.gz: fe491f4940b164d5bb32573ca6fd453de9f7ea55e83d33f14ffd7255ec2e1310998afe7002bfb9cf1c60f09c836b95895f4a0c23a6e0593119a1fbcffc96a74f
6
+ metadata.gz: 8c60a80673165135c28ecb6b5c99321100702db140c90450c3db58a5e52d66c3369d7521f33a925263ec940d9a88c4d605d5ea111811d2d9283bce31d92c57ba
7
+ data.tar.gz: 84882a23b85bb539d8375bb651a019a27fcbff37eba86339b374e5e5a67ca2140361f2eba2cadf4af67cdc435556a35027490a6309a22116a873b99041c60e4a
@@ -0,0 +1,58 @@
1
+ # Ruby CircleCI 2.0 configuration file
2
+ #
3
+ # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
+ #
5
+ version: 2
6
+ jobs:
7
+ build:
8
+ docker:
9
+ # specify the version you desire here
10
+ - image: circleci/ruby:2.4.1
11
+
12
+ # Specify service dependencies here if necessary
13
+ # CircleCI maintains a library of pre-built images
14
+ # documented at https://circleci.com/docs/2.0/circleci-images/
15
+ # - image: circleci/postgres:9.4
16
+
17
+ working_directory: ~/repo
18
+
19
+ steps:
20
+ - checkout
21
+
22
+ # Download and cache dependencies
23
+ - restore_cache:
24
+ keys:
25
+ - v1-dependencies-{{ checksum "Gemfile.lock" }}
26
+ # fallback to using the latest cache if no exact match is found
27
+ - v1-dependencies-
28
+
29
+ - run:
30
+ name: install dependencies
31
+ command: |
32
+ bundle install --jobs=4 --retry=3 --path vendor/bundle
33
+
34
+ - save_cache:
35
+ paths:
36
+ - ./vendor/bundle
37
+ key: v1-dependencies-{{ checksum "Gemfile.lock" }}
38
+
39
+ # run tests!
40
+ - run:
41
+ name: run tests
42
+ command: |
43
+ mkdir /tmp/test-results
44
+ TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | \
45
+ circleci tests split --split-by=timings)"
46
+
47
+ bundle exec rspec \
48
+ --format progress \
49
+ --out /tmp/test-results/rspec.xml \
50
+ --format progress \
51
+ $TEST_FILES
52
+
53
+ # collect reports
54
+ - store_test_results:
55
+ path: /tmp/test-results
56
+ - store_artifacts:
57
+ path: /tmp/test-results
58
+ destination: test-results
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jsonapi_errors_handler (0.1.0)
4
+ jsonapi_errors_handler (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,3 +1,6 @@
1
+
2
+ [![CircleCI](https://circleci.com/gh/driggl/jsonapi_errors_handler/tree/master.svg?style=svg)](https://circleci.com/gh/driggl/jsonapi_errors_handler/tree/master)
3
+
1
4
  # JsonapiErrorsHandler
2
5
 
3
6
  A convienient way to serialize errors in JsonAPI format (https://jsonapi.org)
@@ -58,6 +61,15 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
58
61
 
59
62
  Bug reports and pull requests are welcome on GitHub at https://github.com/driggl/jsonapi_errors_handler.
60
63
 
64
+ **How to contribute:**
65
+
66
+ 1. Fork repository
67
+ 2. Commit changes
68
+ - Keep commits small and atomic
69
+ - Start commit message from keywords (Add/Remove/Change/Refactor/Move/Rename/Upgrade/Downgrade)
70
+ - Keep commits imperative style
71
+ 3. Create Pull Request
72
+
61
73
  ## License
62
74
 
63
75
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -1,11 +1,11 @@
1
1
  module JsonapiErrorsHandler
2
2
  class ErrorMapper
3
+ @@mapped_errors = {}
3
4
  def self.mapped_errors
4
5
  @@mapped_errors
5
6
  end
6
7
 
7
8
  def self.map_errors!(errors_hash={})
8
- @@mapped_errors ||= {}
9
9
  @@mapped_errors.merge!(errors_hash)
10
10
  end
11
11
 
@@ -8,7 +8,7 @@ module JsonapiErrorsHandler
8
8
  serializable_hash
9
9
  end
10
10
 
11
- def to_json(payload)
11
+ def to_json(_payload=nil)
12
12
  to_h.to_json
13
13
  end
14
14
 
@@ -4,8 +4,8 @@ module JsonapiErrorsHandler
4
4
  end
5
5
  end
6
6
 
7
- require_dependency 'jsonapi_errors_handler/errors/standard_error'
8
- require_dependency 'jsonapi_errors_handler/errors/forbidden'
9
- require_dependency 'jsonapi_errors_handler/errors/invalid'
10
- require_dependency 'jsonapi_errors_handler/errors/not_found'
11
- require_dependency 'jsonapi_errors_handler/errors/unauthorized'
7
+ require 'jsonapi_errors_handler/errors/standard_error'
8
+ require 'jsonapi_errors_handler/errors/forbidden'
9
+ require 'jsonapi_errors_handler/errors/invalid'
10
+ require 'jsonapi_errors_handler/errors/not_found'
11
+ require 'jsonapi_errors_handler/errors/unauthorized'
@@ -1,3 +1,3 @@
1
1
  module JsonapiErrorsHandler
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi_errors_handler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Wilgosz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-31 00:00:00.000000000 Z
11
+ date: 2019-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -60,6 +60,7 @@ executables: []
60
60
  extensions: []
61
61
  extra_rdoc_files: []
62
62
  files:
63
+ - ".circleci/config.yml"
63
64
  - ".gitignore"
64
65
  - ".rspec"
65
66
  - ".travis.yml"