vimgolf 0.1.1 → 0.1.2
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/Gemfile.lock +6 -3
- data/lib/vimgolf/cli.rb +6 -8
- data/lib/vimgolf/version.rb +1 -1
- data/spec/cli_spec.rb +1 -1
- metadata +2 -2
data/Gemfile.lock
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
vimgolf (0.1.
|
|
4
|
+
vimgolf (0.1.1)
|
|
5
|
+
highline
|
|
5
6
|
json
|
|
6
|
-
thor
|
|
7
|
+
thor (>= 0.14.6)
|
|
7
8
|
|
|
8
9
|
GEM
|
|
9
10
|
remote: http://rubygems.org/
|
|
10
11
|
specs:
|
|
11
12
|
diff-lcs (1.1.2)
|
|
13
|
+
highline (1.6.1)
|
|
12
14
|
json (1.4.6)
|
|
13
15
|
rspec (2.3.0)
|
|
14
16
|
rspec-core (~> 2.3.0)
|
|
@@ -24,7 +26,8 @@ PLATFORMS
|
|
|
24
26
|
ruby
|
|
25
27
|
|
|
26
28
|
DEPENDENCIES
|
|
29
|
+
highline
|
|
27
30
|
json
|
|
28
31
|
rspec
|
|
29
|
-
thor
|
|
32
|
+
thor (>= 0.14.6)
|
|
30
33
|
vimgolf!
|
data/lib/vimgolf/cli.rb
CHANGED
|
@@ -124,7 +124,7 @@ module VimGolf
|
|
|
124
124
|
if data['client'] != Vimgolf::VERSION
|
|
125
125
|
VimGolf.ui.error "Client version mismatch. Installed: #{Vimgolf::VERSION}, Required: #{data['client']}."
|
|
126
126
|
VimGolf.ui.error "\t gem install vimgolf"
|
|
127
|
-
raise
|
|
127
|
+
raise "Bad Version"
|
|
128
128
|
end
|
|
129
129
|
|
|
130
130
|
File.open(Config.put_path + "/#{id}.#{data['in']['type']}", "w") {|f| f.puts data['in']['data']}
|
|
@@ -142,14 +142,12 @@ module VimGolf
|
|
|
142
142
|
begin
|
|
143
143
|
url = URI.parse("#{GOLFHOST}/entry.json")
|
|
144
144
|
http = Net::HTTP.new(url.host, url.port)
|
|
145
|
-
res = http.start do |conn|
|
|
146
|
-
key = Config.load['key']
|
|
147
|
-
data = "challenge_id=#{id}&entry=#{IO.read(log(id))}&apikey=#{key}"
|
|
148
|
-
head = {'Accept' => 'application/json'}
|
|
149
145
|
|
|
150
|
-
|
|
151
|
-
|
|
146
|
+
request = Net::HTTP::Post.new(url.request_uri)
|
|
147
|
+
request.set_form_data({"challenge_id" => id, "apikey" => Config.load['key'], "entry" => IO.read(log(id))})
|
|
148
|
+
request["Accept"] = "application/json"
|
|
152
149
|
|
|
150
|
+
res = http.request(request)
|
|
153
151
|
JSON.parse(res.body)['status'].to_sym
|
|
154
152
|
|
|
155
153
|
rescue Exception => e
|
|
@@ -172,4 +170,4 @@ module VimGolf
|
|
|
172
170
|
p [caller.first, msg] if GOLFDEBUG
|
|
173
171
|
end
|
|
174
172
|
end
|
|
175
|
-
end
|
|
173
|
+
end
|
data/lib/vimgolf/version.rb
CHANGED
data/spec/cli_spec.rb
CHANGED