codewars_api 0.2.1 → 0.3.0

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: b0d50013fa7b3be16d2e5b8761306ba17566fd27
4
- data.tar.gz: ffda58c75b54c0bd3eb783a5fdcc23591347bef8
3
+ metadata.gz: c31a61ef6b89ac543fab501370416a3261d4fed0
4
+ data.tar.gz: 5ff59fe70dd05db40722220981ffe4bea473645f
5
5
  SHA512:
6
- metadata.gz: 77924b541c9bd1e4bd72778d7a6afd336f4e0c7651f2b1bb987c401de7ed57123dc77483928945613875ffeddf38e3b3b35c6e58c9f41fed4130fb734a4e51a6
7
- data.tar.gz: d38ed424d7d2c6310a73ff8b3aeaeb005acc191e1b832a6ecae962f63d5df77b2871bdab07d531e6e4385251bc0df9934fee698acda964f84fa043b98e6538a5
6
+ metadata.gz: 5724f7693ee7618f08af73d8519627f24bcc84faf45388661d519444f8abc5daf7feb75f9ba08ef36ce5bf6bf551ff5010c9578a2d75ae48a698d4b4bca46650
7
+ data.tar.gz: 946e364ef13e02e5891fd6ad95711d48185312f4a9d96b86509f9fb88e30141a56520adb1397281f92513d9e4182cb9bd09fd7136e4f22f65de342aadee20a53
@@ -16,6 +16,7 @@ module CodewarsApi
16
16
  "/code-challenges/projects/#{project_id}/solutions/#{solution_id}/attempt",
17
17
  request_options
18
18
  )
19
+ fail @response.message if @response.code == 500
19
20
  end
20
21
 
21
22
  def dmid
@@ -10,6 +10,7 @@ module CodewarsApi
10
10
  request_options = RequestHelper.add_api_key(request_options, api_key)
11
11
 
12
12
  @response = RequestHelper.get("#{CodewarsApi::API_URL}/deferred/#{dmid}", request_options)
13
+ fail @response.message if @response.code == 500
13
14
  end
14
15
 
15
16
  def dmid
@@ -15,6 +15,7 @@ module CodewarsApi
15
15
  "/code-challenges/projects/#{project_id}/solutions/#{solution_id}/finalize",
16
16
  request_options
17
17
  )
18
+ fail @response.message if @response.code == 500
18
19
  end
19
20
  end
20
21
  end
@@ -4,6 +4,7 @@ module CodewarsApi
4
4
 
5
5
  def initialize(id)
6
6
  @response = RequestHelper.get("#{CodewarsApi::API_URL}/code-challenges/#{id}")
7
+ fail @response.message if @response.code == 500
7
8
  end
8
9
 
9
10
  def id
@@ -14,6 +14,7 @@ module CodewarsApi
14
14
  "#{CodewarsApi::API_URL}/code-challenges/#{language}/train",
15
15
  request_options
16
16
  )
17
+ fail @response.message if @response.code == 500
17
18
  end
18
19
 
19
20
  def name
@@ -14,6 +14,7 @@ module CodewarsApi
14
14
  "#{CodewarsApi::API_URL}/code-challenges/#{id_or_slug}/#{language}/train",
15
15
  request_options
16
16
  )
17
+ fail @response.message if @response.code == 500
17
18
  end
18
19
 
19
20
  def name
@@ -5,6 +5,7 @@ module CodewarsApi
5
5
  def initialize(id_or_username)
6
6
  fail 'Username or id is not set' unless id_or_username
7
7
  @response = RequestHelper.get("#{CodewarsApi::API_URL}/users/#{id_or_username}")
8
+ fail @response.message if @response.code == 500
8
9
  end
9
10
 
10
11
  def username
@@ -1,3 +1,3 @@
1
1
  module CodewarsApi
2
- VERSION = '0.2.1'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codewars_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeny Morozov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-17 00:00:00.000000000 Z
11
+ date: 2015-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler