codewars 0.1.0 → 0.1.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/lib/codewars/description.rb +19 -17
- data/lib/codewars/train_next.rb +1 -1
- data/lib/codewars/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15aa0750a5b5deb1d3c29958e1fffc0b72cd5249
|
4
|
+
data.tar.gz: 763c2b53f345365d0e1039ed36c18197a4e1b555
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 179c627c436f46ca53fef8ea591b2b0c24f9d8dcfd42f7bd9c201418731f3eaa80f16b19c98554d0a5a1e698572d170956fac385f094a6ef20a47278c5e5599b
|
7
|
+
data.tar.gz: 9450c2a6c6b8bb1eefe1bbecc0abf33a39d97d98d35c2031feb56b64b5a48082438280d05f1033eebb9a66f31ab949bdf2246560f1849ec09b023893733d95ce
|
data/lib/codewars/description.rb
CHANGED
@@ -1,25 +1,27 @@
|
|
1
1
|
module Codewars
|
2
|
-
class Description < Thor
|
2
|
+
class Description < Thor
|
3
3
|
DESCRIPTION_FILE_NAME = 'description.md'
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
no_commands do
|
6
|
+
def take_value_from_file(regex_with_group, param_key)
|
7
|
+
@data ||= read_file(DESCRIPTION_FILE_NAME)
|
8
|
+
param = @data.match(regex_with_group)
|
9
|
+
unless param
|
10
|
+
fail Thor::Error, "'#{param_key}' has not been found in the 'description.md' file."
|
11
|
+
end
|
12
|
+
param[1]
|
10
13
|
end
|
11
|
-
param[1]
|
12
|
-
end
|
13
14
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
15
|
+
def print_kata_desc(kata)
|
16
|
+
print_parameter('Name', kata.name)
|
17
|
+
print_parameter('Link', "#{CODEWARS_URL}#{kata.href}")
|
18
|
+
print_parameter('Description', kata.description)
|
19
|
+
print_parameter('Tags', kata.tags.join(', ')) if kata.tags
|
20
|
+
print_parameter('Rank', kata.rank.to_s) if kata.rank
|
21
|
+
say ''
|
22
|
+
print_parameter('Type to start this kata',
|
23
|
+
"codewars train #{kata.slug}", :blue, true)
|
24
|
+
end
|
23
25
|
end
|
24
26
|
|
25
27
|
private
|
data/lib/codewars/train_next.rb
CHANGED
data/lib/codewars/version.rb
CHANGED