codersdojo 1.5.13 → 1.5.14
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.
- data/lib/upload/encoding_adjuster.rb +11 -0
- data/lib/upload/uploader.rb +4 -1
- metadata +4 -3
data/lib/upload/uploader.rb
CHANGED
@@ -2,6 +2,7 @@ require 'json'
|
|
2
2
|
require 'state'
|
3
3
|
require 'state_reader'
|
4
4
|
require 'upload/xml_element_extractor'
|
5
|
+
require 'upload/encoding_adjuster'
|
5
6
|
require 'shellutils/progress'
|
6
7
|
require 'filename_formatter'
|
7
8
|
require 'rest_client'
|
@@ -46,9 +47,11 @@ class Uploader
|
|
46
47
|
end
|
47
48
|
|
48
49
|
def upload_kata
|
50
|
+
adjuster = EncodingAdjuster.new
|
49
51
|
kata_data = {:framework => @framework}
|
50
52
|
states_data = states.each_with_index do |state,index|
|
51
|
-
kata_data["states[#{index}]"] = {:code => state.file_contents
|
53
|
+
kata_data["states[#{index}]"] = {:code => state.file_contents.collect{|content| adjuster.adjust(content)},
|
54
|
+
:result => adjuster.adjust(state.result), :green => state.green?,
|
52
55
|
:created_at => state.time}
|
53
56
|
end
|
54
57
|
RestClient.post "#{@hostname}#{@@kata_path}", kata_data
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 5
|
8
|
-
-
|
9
|
-
version: 1.5.
|
8
|
+
- 14
|
9
|
+
version: 1.5.14
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- CodersDojo-Team
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-01-
|
17
|
+
date: 2012-01-27 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -122,6 +122,7 @@ files:
|
|
122
122
|
- lib/scaffold/text_template_machine.rb
|
123
123
|
- lib/state.rb
|
124
124
|
- lib/state_reader.rb
|
125
|
+
- lib/upload/encoding_adjuster.rb
|
125
126
|
- lib/upload/uploader.rb
|
126
127
|
- lib/upload/xml_element_extractor.rb
|
127
128
|
- templates/any/README
|