ctws 0.2.1.beta → 0.2.2.beta

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7c2e36b52ac2c13db809f7c2e5a78b0f958e1010
4
- data.tar.gz: 9594e2b4248c424f7fc5f2ce87e40223f10fca7a
3
+ metadata.gz: '083ac80582de8e764c98b760ea9ffb4c3b7a5aa8'
4
+ data.tar.gz: ddc0b98596ebde39a03d3ecd4a65de15ada9d526
5
5
  SHA512:
6
- metadata.gz: 95004fef551479d5bae047cf41f8f65e88a40a4099410e0ee7a4345bc301aaabec4727048d15c2d39ae713b6d7c4ce19bd5968405373097a572747b94db6c3b6
7
- data.tar.gz: 0d0e236475f8253d0dade3b21e1d429536ffbac643929d34b51a3bc7955309dbf851e6b1d3816980202e0b6fe746bd00ccb11d892db70f4ccbd4d7c5faa152bb
6
+ metadata.gz: 32695b8f7a7cdcf786914fab6b50ffe3c1c897ac323c6ef9e88b7596a67126705ad411094358165d398cdff95efeb7e8ab7b8d862101a5334770e8f60ce25e04
7
+ data.tar.gz: 02a035082f6809803755b25ca1649ec6d0bb6e5777dd38a108996b496f5fabdb0d0e2227c41791fc3dd385ddef1c07a7bea245f0523b5dbd0f2a037a0f9b8101
data/README.md CHANGED
@@ -4,7 +4,10 @@
4
4
 
5
5
  Rails gem to be used as Webservice RESTful JSON API with Rails 5.
6
6
 
7
- With `MinAppVersion` and `User` resources, with token based authentication [JSON Web Tokens](https://jwt.io/).
7
+ Features:
8
+ - `MinAppVersion` and `User` resources
9
+ - token based authentication [JSON Web Tokens](https://jwt.io/).
10
+ - Json Api
8
11
 
9
12
  ## Installation
10
13
  Add this line to your application's Gemfile:
@@ -40,26 +40,26 @@ module Ctws
40
40
 
41
41
  # JSON response with message; Status code 401 - Unauthorized
42
42
  def unauthorized_request(e)
43
- json_response([{ message: e.message, error_code: "401"}], :unauthorized)
43
+ json_response([{ message: e.message, error_code: 401}], :unauthorized)
44
44
  end
45
45
 
46
46
  # JSON response with message; Status code 404 - Not Found
47
47
  def not_found(e)
48
- json_response([{ message: e.message, error_code: "404" }], :not_found)
48
+ json_response([{ message: e.message, error_code: 404 }], :not_found)
49
49
  end
50
50
 
51
51
  def not_confirmed(e)
52
- json_response([{ message: e.message, error_code: "403" }], :unauthorized)
52
+ json_response([{ message: e.message, error_code: 403 }], :unauthorized)
53
53
  end
54
54
 
55
55
  # JSON response with message; Status code 422 - unprocessable entity
56
56
  def four_twenty_two(e)
57
- json_response([{ message: e.message, error_code: "422" }], :unprocessable_entity)
57
+ json_response([{ message: e.message, error_code: 422 }], :unprocessable_entity)
58
58
  end
59
59
 
60
60
  # JSON response with message; Status code 498 - Invalid Token
61
61
  def four_ninety_eight(e)
62
- json_response([{ message: e.message, error_code: "498" }], :invalid_token)
62
+ json_response([{ message: e.message, error_code: 498 }], :invalid_token)
63
63
  end
64
64
 
65
65
  end
@@ -0,0 +1,15 @@
1
+ fr:
2
+ ctws:
3
+ authenticated_user_success: "%{resource} authentifiée avec succès."
4
+ expired_token: "Désolé, votre token a expiré. Veuillez vous connecter pour continuer."
5
+ invalid_credentials: "Identifiants invalides."
6
+ invalid_token: "Token invalide."
7
+ missing_token: "Token manquant."
8
+ not_found: "%{record} non trouvé."
9
+ record_not_confirmed: "%{record} non confirmé."
10
+ resource_created: "%{resource} créée avec succès."
11
+ resource_doesnt_exist: "%{resource} n'existe pas."
12
+ resource_not_created: "%{resource} n'a pas pu être créée."
13
+ resource_updated: "%{resource} créée avec succès."
14
+ unauthorized: "Requête non autorisée."
15
+ unmatched_route: "Aucune route ne coïncide avec %{route}."
data/lib/ctws/version.rb CHANGED
@@ -1,7 +1,12 @@
1
1
  module Ctws
2
2
  # Under development: BETA
3
3
 
4
- VERSION = '0.2.1.beta'
5
- # PATCH - 0.2.1.beta - 6/4/2018
4
+ VERSION = '0.2.2.beta'
5
+
6
+ # PATCH - 0.2.2.beta - 14/5/2018
7
+ # [ADDED] Add fr locale.
8
+ # [REFACTOR] Return error_codes as integers instead of strings.
9
+
10
+ # PATCH - 0.2.1.beta - 06/4/2018
6
11
  # [FEATURE] Add exception handler for ArgumentError.
7
12
  end
Binary file