codewars 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 +4 -4
- data/README.md +6 -0
- data/lib/codewars/attempt.rb +2 -2
- data/lib/codewars/finalize.rb +3 -3
- data/lib/codewars/train_specific.rb +2 -2
- data/lib/codewars/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4f5e4e5fc5d3914c287de427edddb75aae6ceb5
|
4
|
+
data.tar.gz: 9c311240e76d668cfaa22901db04bcddd147db19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/codewars/attempt.rb
CHANGED
@@ -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: (
|
9
|
-
solution_id = desc.take_value_from_file(/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)
|
data/lib/codewars/finalize.rb
CHANGED
@@ -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: (
|
9
|
-
project_id = desc.take_value_from_file(/Project ID: (
|
10
|
-
solution_id = desc.take_value_from_file(/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
|
-
|
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
|
data/lib/codewars/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|