codewars 0.2.0 → 0.2.1

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: 7c03b3de953031420795b6493fe73da7595a4691
4
- data.tar.gz: 49cbaf916607644186555aad111a1efb5d4c7a75
3
+ metadata.gz: c4f5e4e5fc5d3914c287de427edddb75aae6ceb5
4
+ data.tar.gz: 9c311240e76d668cfaa22901db04bcddd147db19
5
5
  SHA512:
6
- metadata.gz: c384ca882f3eb1afdc75d83725491823dc0694900e3ee36402ac9c516f253108bf8dbf9135af3f776739a639b226318311102e587898555cb9df79904272b603
7
- data.tar.gz: f67a86c1deaa96cbf9bbd2406a286a28273eb5b3ae10aa6b60ed7afd2fadb90e1b91b49a2ea6308f53c342067ef2feb307423c66321d1cbba35e920fc99fa289
6
+ metadata.gz: f65727fe081d5e766eb370fb19d6b3be6a413d6a2ded9f765d3bd778052b5cb87a7266d877d517efed90dbe12b633641012f248355a715f04429fa44b70233ad
7
+ data.tar.gz: 827374254b2bafee4bc1a871311af3c3c4487fc30d45cddf7462c61c6e99b5731709b1b5834f7f1853960e82336465e3359a57b27a4671533f69078d7535104b
data/README.md CHANGED
@@ -20,12 +20,17 @@ Execute `codewars help` to see all available commands.
20
20
  10. If there are no mistakes finalize the previously attempted solution `codewars finalize`
21
21
  11. Look at results of other people, rest and pick up another kata or the same kata but using another language
22
22
 
23
+ ### Problems
24
+
25
+ Not sure for purpose or not but API sometimes caches a request for the next kata. To solve the problem go to the link http://www.codewars.com/dashboard in your browser.
26
+
23
27
  ## Development
24
28
 
25
29
  ### TO-DO
26
30
 
27
31
  - [ ] Refactor anything you can
28
32
  - [ ] Add travis, coveralls, etc
33
+ - [ ] After `codewars finalize` show a link with the language of submission
29
34
  - [ ] Change the name of commands: attempt and finalize (join them to one command?)
30
35
  - [ ] Rename 'config' command? Maybe to 'set'?
31
36
  - [ ] Add options to commands that can be added: --strategy=something, --language=something, etc.
@@ -33,6 +38,7 @@ Execute `codewars help` to see all available commands.
33
38
  - [ ] Write RSpec module tests
34
39
  - [ ] Divide description.md to task.md + info.yml?
35
40
  - [ ] Refactor features so stubbing (mocking) become more obvious
41
+ - [ ] Make a bug report "Author's name in an API response is yours name"
36
42
 
37
43
  ## Contributing
38
44
 
@@ -5,8 +5,8 @@ module Codewars
5
5
  fail Thor::Error, 'You should set an api-key to use this command' unless api_key
6
6
 
7
7
  desc = Description.new
8
- project_id = desc.take_value_from_file(/Project ID: (\w+)/, 'Project ID')
9
- solution_id = desc.take_value_from_file(/Solution ID: (\w+)/, 'Solution ID')
8
+ project_id = desc.take_value_from_file(/Project ID: (.+)/, 'Project ID')
9
+ solution_id = desc.take_value_from_file(/Solution ID: (.+)/, 'Solution ID')
10
10
  solution = read_solution_file
11
11
 
12
12
  client = CodewarsApi::Client.new(api_key: api_key)
@@ -5,9 +5,9 @@ module Codewars
5
5
  fail Thor::Error, 'You should set an api-key to use this command' unless api_key
6
6
 
7
7
  desc = Description.new
8
- slug = desc.take_value_from_file(/Slug: ([a-zA-Z_-]+)/, 'Slug')
9
- project_id = desc.take_value_from_file(/Project ID: (\w+)/, 'Project ID')
10
- solution_id = desc.take_value_from_file(/Solution ID: (\w+)/, 'Solution ID')
8
+ slug = desc.take_value_from_file(/Slug: (.+)/, 'Slug')
9
+ project_id = desc.take_value_from_file(/Project ID: (.+)/, 'Project ID')
10
+ solution_id = desc.take_value_from_file(/Solution ID: (.+)/, 'Solution ID')
11
11
 
12
12
  client = CodewarsApi::Client.new(api_key: api_key)
13
13
  result = client.finalize_solution(
@@ -1,4 +1,5 @@
1
1
  require 'erb'
2
+ require 'fileutils'
2
3
 
3
4
  module Codewars
4
5
  class TrainSpecific < Thor
@@ -33,8 +34,7 @@ module Codewars
33
34
 
34
35
  def write_kata(slug, language, file_name, content)
35
36
  dir_to_write = File.expand_path(slug)
36
- Dir.mkdir dir_to_write unless File.directory?(dir_to_write)
37
- Dir.mkdir "#{dir_to_write}/#{language}" unless File.directory?("#{dir_to_write}/#{language}")
37
+ FileUtils.mkdir_p "#{dir_to_write}/#{language}"
38
38
  file_path = File.expand_path("#{dir_to_write}/#{language}/#{file_name}")
39
39
  relative_path = "./#{slug}/#{language}/#{file_name}"
40
40
  fail Thor::Error, "'#{relative_path}' already exists." if File.exist? file_path
@@ -1,3 +1,3 @@
1
1
  module Codewars
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codewars
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
  - Evgeny Morozov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-07 00:00:00.000000000 Z
11
+ date: 2015-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler