error_response 0.2.0 → 0.2.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: bfd7efb20d85b835e242e64e7fee3d633522eefbe1834aedf30295b84b2cfea8
4
- data.tar.gz: 9e9013875242b545811ce64585d3cf8f58a33775d773b507125e7cd8934bbaca
3
+ metadata.gz: 49fd3944b8d8d387a0d8894b4200f587e53778d1c30fa72b60c11525efebf8b7
4
+ data.tar.gz: 7bd468da83c09e2bfe9bde84f3021e5e5757c5943c0c570fc321f50fcfeae622
5
5
  SHA512:
6
- metadata.gz: ba3d15d0cd86e5fea18fba693fef5b75fae6b8ba409a73b4d377cfa85e45e70d4cf87b116c6c3e78238cb16c047b8da10943b09abe33ece451a24aa83b462deb
7
- data.tar.gz: 0aafe71739e97cd17b3fadb3614cf7c3e9fc6a221d77bab5a6bc4960d6e2374c3f9f881756153d333e59078049560268df4e290891d1ba1e4a9276bc263f1df1
6
+ metadata.gz: 6827910973f2459448fb5e6a864f786ff7a797c80871e1452239f72d9deb95ec4287a980892ad9c0651ff85824186cfbedaa10c352ce42f3b6a711b87f7a6f62
7
+ data.tar.gz: bbbce4540ca67c69bab4e0318d35a9e5d892de689061861ccb4de958490986f1c7ad90cc335b6ebcebca7cff320e2e64107ed5ad085d8514cc97ff4f6c8f2cd0
@@ -1,8 +1,6 @@
1
1
  require 'yaml'
2
2
  class ErrorResponse
3
- GEM_ROOT = File.expand_path("../..", __FILE__)
4
- YAML_PATH = 'lib/error_response.yml'
5
- EXTEND_DIR = 'lib/error_response/*.yml'
3
+ YAML_PATH = 'config/error_response.yml'
6
4
 
7
5
  def self.to_api(key, message=nil)
8
6
  err_json = yaml_hash[key.to_s] || {'error_code' => 500000, 'error_message' => message}
@@ -24,14 +22,6 @@ class ErrorResponse
24
22
 
25
23
  private
26
24
  def self.yaml_hash
27
- return @hash unless @hash.nil?
28
-
29
- @hash = YAML.load_file(File.join(GEM_ROOT,YAML_PATH))
30
- Dir.glob(EXTEND_DIR).each do |file|
31
- extend_yml = YAML.load_file(file)
32
- @hash.merge!(extend_yml)
33
- end
34
-
35
- @hash
25
+ @hash ||= YAML.load_file(YAML_PATH)
36
26
  end
37
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: error_response
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - jameslee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-19 00:00:00.000000000 Z
11
+ date: 2019-08-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: use for error_response
14
14
  email: jameslee@kdanmobile.com
@@ -17,7 +17,6 @@ extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
19
  - lib/error_response.rb
20
- - lib/error_response.yml
21
20
  homepage: https://github.com/kdan-mobile-software-ltd/error_response
22
21
  licenses:
23
22
  - MIT
@@ -1,45 +0,0 @@
1
- wrong_email:
2
- error_code: 400_001
3
- error_message: user email not correct
4
- wrong_password:
5
- error_code: 400_002
6
- error_message: user password not correct
7
- verify_receipt_failed:
8
- error_code: 400_003
9
- error_message: receipt verify failed
10
- resend_confirmation_failed:
11
- error_code: 400_004
12
- error_message: confirmation mail resend failed
13
- reset_password_failed:
14
- error_code: 400_005
15
- error_message: reset password failed
16
- upload_video_failed:
17
- error_code: 400_060
18
- error_message: upload video failed
19
- theme_not_found:
20
- error_code: 400_061
21
- error_message: current theme is not found
22
- client_not_found:
23
- error_code: 403_001
24
- error_message: door_keeper client not found
25
- access_token_invalid:
26
- error_code: 403_002
27
- error_message: door_keeper access_token invalid
28
- user_forbidden:
29
- error_code: 403_003
30
- error_message: not enough privilege to access data
31
- provider_not_allow:
32
- error_code: 403_004
33
- error_message: third-party provider is not allow
34
- third_party_missing_email:
35
- error_code: 403_005
36
- error_message: third party login is missing email
37
- email_existed:
38
- error_code: 409_001
39
- error_message: email already existed
40
- email_confirmed:
41
- error_code: 409_002
42
- error_message: email already confirmed
43
- preview_processing:
44
- error_code: 418_001
45
- error_message: preview processing, please try it later