vimgolf 0.4.5 → 0.4.6

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 245e3a61f0627829065d771884195716aaa714ec
4
+ data.tar.gz: e8439584ea6e438dbe76b55cff4feea1c9412dd1
5
+ SHA512:
6
+ metadata.gz: 11fb7f11d157e664c09101f8496247a3d928126a88397954680271968705d4e1592e5a4609a5889e29dbc0e3b1b059acefc33935ba5de3f6fe2f413773ef4c02
7
+ data.tar.gz: 10733f77b5228a25ba7f8ed0d3288dbf54b48b94be89d6a7dfb36f594287d1865e55111b97965d558cb9dd4edd1b4c052cf3af483998cd29e7beaf76d42babb8
@@ -0,0 +1,58 @@
1
+ ## 0.10.0
2
+
3
+ 2014-08-12 Siddhanathan Shanmugam <siddhanathan@gmail.com>
4
+
5
+ * vimgolf.el (vimgolf-setup): Enable JSON parsing
6
+ - Allow Emacs to parse JSON content from the site
7
+ - Replace yaml parser with json parser
8
+ - Use 'identitiy' accept encoding header to get uncompressed data from server
9
+
10
+ * vimgolf.el (vimgolf-get-text): Add function
11
+ - Extracts input and output text, used in vimgolf-setup
12
+
13
+ * vimgolf.el (vimgolf-retrieve-challenge): Add function
14
+ - Gets JSON data from server and reads it using a buffer
15
+
16
+ * vimgolf.el (vimgolf-read-next-data-chunk): Removed function
17
+
18
+ ## 0.9.3
19
+
20
+ 2012-07-29 Brian Zwahr (github: @echosa)
21
+
22
+ * vimgolf.el
23
+ - Added challenge browser
24
+ - Better description
25
+ - Truncated titles
26
+ - Basic handling of HTML entities
27
+ - Fixed showing browse list after url-retrieve
28
+
29
+ * features/*
30
+ - Added documentation
31
+
32
+ * util/*
33
+ - Added tests via ecukes
34
+
35
+ ## 0.9.2
36
+
37
+ 2012-02-28 Steve Purcell (@sanityinc)
38
+
39
+ * vimgolf.el
40
+ - changes for adding to melpa
41
+
42
+ ## 0.9.1
43
+
44
+ 2012-02-27 Tim Visher (@timvisher)
45
+
46
+ * vimgolf.el
47
+ - Use vimgolf-continue to get messages when buffers are setup
48
+ - Correct indentation and add local valiables
49
+ - Updating notes and adding a contributors section
50
+
51
+ 2012-01-08 Adam Collard (@acollard)
52
+
53
+ * vimgolf.el
54
+ - Simplify vimgolf-solution-correct-p to use buffer-string
55
+
56
+ ## 0.9.0 and earlier
57
+
58
+ Lots of changes by Tim Visher and Steve Purcell
@@ -4,7 +4,7 @@
4
4
  ;;; Author: Tim Visher <tim.visher@gmail.com>
5
5
  ;;; Maintainer: Tim Visher <tim.visher@gmail.com>
6
6
  ;;; Created: 2011-11-02
7
- ;;; Version: 0.9.3
7
+ ;;; Version: 0.10.0
8
8
  ;;; Keywords: games vimgolf vim
9
9
 
10
10
  ;; This file is not part of GNU Emacs
@@ -45,9 +45,12 @@
45
45
  ;; Tim Visher (@timvisher)
46
46
  ;; Steve Purcell (@sanityinc)
47
47
  ;; Adam Collard (@acollard)
48
+ ;; Siddhanathan Shanmugam (@siddhanathan)
48
49
 
49
50
  ;;; Code:
50
51
 
52
+ (require 'json)
53
+
51
54
  (defgroup vimgolf nil
52
55
  "Compete on VimGolf with the One True Editor."
53
56
  :prefix "vimgolf-"
@@ -268,7 +271,7 @@ unknown key sequence was entered).")
268
271
  ;; HTML to Haml ID: 4d3c51f1aabf526ed6000030
269
272
  ;; Assignment Allignment: 4d2c9d06eda6262e4e00007a
270
273
 
271
- (defvar vimgolf-challenge-extension ".yaml")
274
+ (defvar vimgolf-challenge-extension ".json")
272
275
 
273
276
  (defun vimgolf-challenge-path (challenge-id)
274
277
  (concat "challenges/" challenge-id))
@@ -292,26 +295,27 @@ unknown key sequence was entered).")
292
295
  (when (get-buffer buf)
293
296
  (kill-buffer buf))))
294
297
 
295
- (defun vimgolf-read-next-data-chunk ()
296
- "Return the next chunk of data as a string, leaving the point at the end of that chunk."
297
- (let ((data-start-regexp " data: |\\+\\{0,1\\}\n")
298
- (data-end-regexp "\\([ ]\\{4\\}\\|[ ]\\{0\\}\\)\n type: [-a-z]+"))
299
- (unless (re-search-forward data-start-regexp nil t)
300
- (error "Can't find data in response from vimgolf"))
301
- (let ((start (point)))
302
- (unless (re-search-forward data-end-regexp nil t)
303
- (error "Unclosed data section in response from vimgolf"))
304
- (let ((str (buffer-substring-no-properties start (match-beginning 0))))
305
- (replace-regexp-in-string "^ " "" str)))))
298
+ (defun vimgolf-get-text (var response)
299
+ (format "%s" (assoc-default 'data (assq var response))))
300
+
301
+ (defun vimgolf-retrieve-challenge (challenge-id)
302
+ (interactive)
303
+ (with-current-buffer
304
+ (url-retrieve-synchronously (vimgolf-challenge-url challenge-id))
305
+ (goto-char url-http-end-of-headers)
306
+ (json-read)))
306
307
 
307
308
  (defun vimgolf-setup (status challenge-id)
309
+ (let ((url-mime-encoding-string "identity"))
310
+ (setq vimgolf-response (vimgolf-retrieve-challenge challenge-id)))
311
+
308
312
  (vimgolf-clear-keystrokes)
309
313
  (setq vimgolf-prior-window-configuration (current-window-configuration)
310
314
  vimgolf-challenge challenge-id)
311
315
  (goto-char (point-min))
312
- (let* ((start-text (vimgolf-read-next-data-chunk))
313
- (end-text (vimgolf-read-next-data-chunk)))
314
316
 
317
+ (let* ((start-text (vimgolf-get-text 'in vimgolf-response))
318
+ (end-text (vimgolf-get-text 'out vimgolf-response)))
315
319
  (vimgolf-kill-existing-session)
316
320
 
317
321
  (let ((vimgolf-start-buffer (get-buffer-create vimgolf-start-buffer-name))
@@ -1,7 +1,7 @@
1
1
  module VimGolf
2
2
 
3
3
  GOLFDEBUG = ENV['GOLFDEBUG'].to_sym rescue false
4
- GOLFHOST = ENV['GOLFHOST'] || "http://vimgolf.com"
4
+ GOLFHOST = ENV['GOLFHOST'] || "http://www.vimgolf.com"
5
5
  GOLFDIFF = ENV['GOLFDIFF'] || 'diff'
6
6
  GOLFSHOWDIFF = ENV['GOLFSHOWDIFF'] || 'vim -d -n'
7
7
  GOLFVIM = ENV['GOLFVIM'] || 'vim'
@@ -139,8 +139,9 @@ module VimGolf
139
139
 
140
140
  else
141
141
  error = <<-MSG
142
- Uh oh, Vim did not exit properly. If the problem persists, please
143
- report the error on github.com/igrigorik/vimgolf
142
+ Uh oh, Vim did not exit properly.
143
+ Please ensure you can execute 'Vim' from the commandline.
144
+ If the problem persists, please report the error on github.com/igrigorik/vimgolf
144
145
  MSG
145
146
 
146
147
  VimGolf.ui.error error
@@ -1,3 +1,3 @@
1
1
  module Vimgolf
2
- VERSION = "0.4.5"
2
+ VERSION = "0.4.6"
3
3
  end
metadata CHANGED
@@ -1,94 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vimgolf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
5
- prerelease:
4
+ version: 0.4.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - Ilya Grigorik
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-06-29 00:00:00.000000000 Z
11
+ date: 2014-08-14 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: thor
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 0.14.6
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: 0.14.6
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: json_pure
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: highline
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rspec
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rake
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - '>='
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - '>='
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  description: CLI client for vimgolf.com
@@ -107,6 +96,7 @@ files:
107
96
  - README.md
108
97
  - Rakefile
109
98
  - bin/vimgolf
99
+ - emacs/CHANGELOG.md
110
100
  - emacs/README.md
111
101
  - emacs/ROADMAP.md
112
102
  - emacs/features/emacs.feature
@@ -133,50 +123,39 @@ files:
133
123
  - vimgolf.gemspec
134
124
  homepage: http://github.com/igrigorik/vimgolf
135
125
  licenses: []
136
- post_install_message: ! '
126
+ metadata: {}
127
+ post_install_message: |2
137
128
 
138
129
  ------------------------------------------------------------------------------
139
-
140
- Thank you for installing vimgolf-0.4.5.
141
-
130
+ Thank you for installing vimgolf-0.4.6.
142
131
 
143
132
  0.1.3: custom vimgolf .vimrc file to help level the playing field
144
-
145
133
  0.2.0: proxy support, custom diffs + proper vimscript parser/scoring
146
-
147
134
  0.3.0: improve windows support, switch to YAML to remove c-ext dependency
148
-
149
135
  0.4.0: improved diff/retry CLI, emacs support: http://bit.ly/yHgOPF
150
136
 
151
-
152
137
  *NOTE*: please re-run "vimgolf setup" prior to playing!
153
138
 
154
-
155
139
  For more information, rules & updates: http://vimgolf.com/about
156
-
157
140
  ------------------------------------------------------------------------------
158
-
159
- '
160
141
  rdoc_options: []
161
142
  require_paths:
162
143
  - lib
163
144
  required_ruby_version: !ruby/object:Gem::Requirement
164
- none: false
165
145
  requirements:
166
- - - ! '>='
146
+ - - '>='
167
147
  - !ruby/object:Gem::Version
168
148
  version: '0'
169
149
  required_rubygems_version: !ruby/object:Gem::Requirement
170
- none: false
171
150
  requirements:
172
- - - ! '>='
151
+ - - '>='
173
152
  - !ruby/object:Gem::Version
174
153
  version: '0'
175
154
  requirements: []
176
155
  rubyforge_project: vimgolf
177
- rubygems_version: 1.8.24
156
+ rubygems_version: 2.0.14
178
157
  signing_key:
179
- specification_version: 3
158
+ specification_version: 4
180
159
  summary: CLI client for vimgolf.com
181
160
  test_files:
182
161
  - spec/challenge_spec.rb
@@ -188,4 +167,3 @@ test_files:
188
167
  - spec/fixtures/4d1a34ccfa85f32065000004.log
189
168
  - spec/helper.rb
190
169
  - spec/keylog_spec.rb
191
- has_rdoc: