vimgolf 0.4.4 → 0.4.9

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/vimgolf/ui.rb CHANGED
@@ -40,6 +40,18 @@ module VimGolf
40
40
  end
41
41
  end
42
42
 
43
+ # Take list of keystrokes, pretty-print them
44
+ def print_log(strokes)
45
+ strokes.each do |stroke|
46
+ if stroke.length == 1 # not a special character
47
+ say stroke, color=nil, force_new_line=false
48
+ else
49
+ say stroke, color=:red, force_new_line=false
50
+ end
51
+ end
52
+ say
53
+ end
54
+
43
55
  def debug(name, message = nil)
44
56
  return unless ENV["DEBUG"]
45
57
 
@@ -127,7 +139,7 @@ module VimGolf
127
139
  print_table(table, :ident => 2, :truncate => true, :colwidth => 20)
128
140
  end
129
141
 
130
- def set_color(string, color, bold=false)
142
+ def set_color(string, *colors)
131
143
  ($stdout.tty? || ENV['THOR_SHELL']) ? super : string
132
144
  end
133
145
 
@@ -1,3 +1,3 @@
1
1
  module Vimgolf
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.9"
3
3
  end
@@ -0,0 +1,28 @@
1
+ " http://vimdoc.sourceforge.net/htmldoc/starting.html#vimrc
2
+
3
+ set nocompatible " use vim defaults
4
+ set scrolloff=3 " keep 3 lines when scrolling
5
+ set ai " set auto-indenting on for programming
6
+
7
+ set showcmd " display incomplete commands
8
+ set nobackup " do not keep a backup file
9
+ set number " show line numbers
10
+ set ruler " show the current row and column
11
+
12
+ set hlsearch " highlight searches
13
+ set incsearch " do incremental searching
14
+ set showmatch " jump to matches when entering regexp
15
+ set ignorecase " ignore case when searching
16
+ set smartcase " no ignorecase if Uppercase char present
17
+
18
+ set visualbell t_vb= " turn off error beep/flash
19
+ set novisualbell " turn off visual bell
20
+
21
+ set backspace=indent,eol,start " make that backspace key work the way it should
22
+ set runtimepath=$VIMRUNTIME " turn off user scripts, https://github.com/igrigorik/vimgolf/issues/129
23
+
24
+ syntax on " turn syntax highlighting on by default
25
+ filetype on " detect type of file
26
+ filetype indent on " load indent file for specific file type
27
+
28
+ set t_RV= " http://bugs.debian.org/608242, http://groups.google.com/group/vim_dev/browse_thread/thread/9770ea844cec3282
metadata CHANGED
@@ -1,97 +1,117 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vimgolf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
5
- prerelease:
4
+ version: 0.4.9
6
5
  platform: ruby
7
6
  authors:
8
7
  - Ilya Grigorik
9
- autorequire:
8
+ autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-06-29 00:00:00.000000000 Z
11
+ date: 2021-03-22 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
- version: 0.14.6
19
+ version: '1.0'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.0.1
22
23
  type: :runtime
23
24
  prerelease: false
24
25
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
26
  requirements:
27
- - - ! '>='
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '1.0'
30
+ - - ">="
28
31
  - !ruby/object:Gem::Version
29
- version: 0.14.6
32
+ version: 1.0.1
30
33
  - !ruby/object:Gem::Dependency
31
34
  name: json_pure
32
35
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
36
  requirements:
35
- - - ! '>='
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '2.3'
40
+ - - ">="
36
41
  - !ruby/object:Gem::Version
37
- version: '0'
42
+ version: 2.3.1
38
43
  type: :runtime
39
44
  prerelease: false
40
45
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
46
  requirements:
43
- - - ! '>='
47
+ - - "~>"
44
48
  - !ruby/object:Gem::Version
45
- version: '0'
49
+ version: '2.3'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 2.3.1
46
53
  - !ruby/object:Gem::Dependency
47
54
  name: highline
48
55
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
56
  requirements:
51
- - - ! '>='
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '2.0'
60
+ - - ">="
52
61
  - !ruby/object:Gem::Version
53
- version: '0'
62
+ version: 2.0.3
54
63
  type: :runtime
55
64
  prerelease: false
56
65
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
66
  requirements:
59
- - - ! '>='
67
+ - - "~>"
60
68
  - !ruby/object:Gem::Version
61
- version: '0'
69
+ version: '2.0'
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: 2.0.3
62
73
  - !ruby/object:Gem::Dependency
63
74
  name: rspec
64
75
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
76
  requirements:
67
- - - ! '>='
77
+ - - "~>"
78
+ - !ruby/object:Gem::Version
79
+ version: '3.7'
80
+ - - ">="
68
81
  - !ruby/object:Gem::Version
69
- version: '0'
82
+ version: 3.7.0
70
83
  type: :development
71
84
  prerelease: false
72
85
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
86
  requirements:
75
- - - ! '>='
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.7'
90
+ - - ">="
76
91
  - !ruby/object:Gem::Version
77
- version: '0'
92
+ version: 3.7.0
78
93
  - !ruby/object:Gem::Dependency
79
94
  name: rake
80
95
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
96
  requirements:
83
- - - ! '>='
97
+ - - "~>"
84
98
  - !ruby/object:Gem::Version
85
- version: '0'
99
+ version: '12.3'
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: 12.3.1
86
103
  type: :development
87
104
  prerelease: false
88
105
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
106
  requirements:
91
- - - ! '>='
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '12.3'
110
+ - - ">="
92
111
  - !ruby/object:Gem::Version
93
- version: '0'
94
- description: CLI client for vimgolf.com
112
+ version: 12.3.1
113
+ description: Real Vim ninjas count every keystroke - do you? Pick a challenge on vimgolf.com,
114
+ fire up Vim, and show us what you got.
95
115
  email:
96
116
  - ilya@igvita.com
97
117
  executables:
@@ -99,21 +119,8 @@ executables:
99
119
  extensions: []
100
120
  extra_rdoc_files: []
101
121
  files:
102
- - .gitignore
103
- - .gitmodules
104
- - .rspec
105
- - Gemfile
106
- - Gemfile.lock
107
122
  - README.md
108
- - Rakefile
109
123
  - bin/vimgolf
110
- - emacs/README.md
111
- - emacs/ROADMAP.md
112
- - emacs/features/emacs.feature
113
- - emacs/features/step-definitions/emacs-steps.el
114
- - emacs/features/support/env.el
115
- - emacs/todo.org
116
- - emacs/vimgolf.el
117
124
  - lib/vimgolf.rb
118
125
  - lib/vimgolf/challenge.rb
119
126
  - lib/vimgolf/cli.rb
@@ -121,71 +128,42 @@ files:
121
128
  - lib/vimgolf/keylog.rb
122
129
  - lib/vimgolf/ui.rb
123
130
  - lib/vimgolf/version.rb
124
- - spec/challenge_spec.rb
125
- - spec/cli_spec.rb
126
- - spec/fixtures/4d19832d8ae121365c00000b.log
127
- - spec/fixtures/4d1a1c36567bac34a9000002.log
128
- - spec/fixtures/4d1a1c69567bac34a9000004.log
129
- - spec/fixtures/4d1a21e88ae121365c00000e.log
130
- - spec/fixtures/4d1a34ccfa85f32065000004.log
131
- - spec/helper.rb
132
- - spec/keylog_spec.rb
133
- - vimgolf.gemspec
131
+ - lib/vimgolf/vimgolf.vimrc
134
132
  homepage: http://github.com/igrigorik/vimgolf
135
- licenses: []
136
- post_install_message: ! '
133
+ licenses:
134
+ - MIT
135
+ metadata: {}
136
+ post_install_message: |2
137
137
 
138
138
  ------------------------------------------------------------------------------
139
-
140
- Thank you for installing vimgolf-0.4.4.
141
-
139
+ Thank you for installing vimgolf-0.4.9.
142
140
 
143
141
  0.1.3: custom vimgolf .vimrc file to help level the playing field
144
-
145
142
  0.2.0: proxy support, custom diffs + proper vimscript parser/scoring
146
-
147
143
  0.3.0: improve windows support, switch to YAML to remove c-ext dependency
148
-
149
144
  0.4.0: improved diff/retry CLI, emacs support: http://bit.ly/yHgOPF
150
145
 
151
-
152
146
  *NOTE*: please re-run "vimgolf setup" prior to playing!
153
147
 
154
-
155
148
  For more information, rules & updates: http://vimgolf.com/about
156
-
157
149
  ------------------------------------------------------------------------------
158
-
159
- '
160
150
  rdoc_options: []
161
151
  require_paths:
162
152
  - lib
163
153
  required_ruby_version: !ruby/object:Gem::Requirement
164
- none: false
165
154
  requirements:
166
- - - ! '>='
155
+ - - ">="
167
156
  - !ruby/object:Gem::Version
168
157
  version: '0'
169
158
  required_rubygems_version: !ruby/object:Gem::Requirement
170
- none: false
171
159
  requirements:
172
- - - ! '>='
160
+ - - ">="
173
161
  - !ruby/object:Gem::Version
174
162
  version: '0'
175
163
  requirements: []
176
164
  rubyforge_project: vimgolf
177
- rubygems_version: 1.8.24
178
- signing_key:
179
- specification_version: 3
165
+ rubygems_version: 2.6.11
166
+ signing_key:
167
+ specification_version: 4
180
168
  summary: CLI client for vimgolf.com
181
- test_files:
182
- - spec/challenge_spec.rb
183
- - spec/cli_spec.rb
184
- - spec/fixtures/4d19832d8ae121365c00000b.log
185
- - spec/fixtures/4d1a1c36567bac34a9000002.log
186
- - spec/fixtures/4d1a1c69567bac34a9000004.log
187
- - spec/fixtures/4d1a21e88ae121365c00000e.log
188
- - spec/fixtures/4d1a34ccfa85f32065000004.log
189
- - spec/helper.rb
190
- - spec/keylog_spec.rb
191
- has_rdoc:
169
+ test_files: []
data/.gitignore DELETED
@@ -1,4 +0,0 @@
1
- pkg/*
2
- *.gem
3
- .bundle
4
- /emacs/*.elc
data/.gitmodules DELETED
@@ -1,3 +0,0 @@
1
- [submodule "emacs/util/espuds"]
2
- path = emacs/util/espuds
3
- url = https://github.com/rejeep/espuds
data/.rspec DELETED
File without changes
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- # Specify your gem's dependencies in vimgolf.gemspec
4
- gemspec
data/Gemfile.lock DELETED
@@ -1,30 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- vimgolf (0.4.0)
5
- highline
6
- thor (>= 0.14.6)
7
-
8
- GEM
9
- remote: http://rubygems.org/
10
- specs:
11
- diff-lcs (1.1.3)
12
- highline (1.6.11)
13
- rake (0.9.2.2)
14
- rspec (2.9.0)
15
- rspec-core (~> 2.9.0)
16
- rspec-expectations (~> 2.9.0)
17
- rspec-mocks (~> 2.9.0)
18
- rspec-core (2.9.0)
19
- rspec-expectations (2.9.0)
20
- diff-lcs (~> 1.1.3)
21
- rspec-mocks (2.9.0)
22
- thor (0.14.6)
23
-
24
- PLATFORMS
25
- ruby
26
-
27
- DEPENDENCIES
28
- rake
29
- rspec
30
- vimgolf!
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
- require 'bundler'
2
- Bundler::GemHelper.install_tasks
3
-
4
- require 'rspec/core/rake_task'
5
-
6
- desc "Run all RSpec tests"
7
- RSpec::Core::RakeTask.new(:spec)
8
-
9
- task :default => :spec
10
- task :test => [:spec]
data/emacs/README.md DELETED
@@ -1,69 +0,0 @@
1
- # VimGolf Minor Mode Roadmap
2
-
3
- ## Features
4
-
5
- 1. Completing read of challenges by title rather than by challenge id
6
-
7
- 2. `M-x vimgolf-browse`: Dired/Ibuffer/Magit-like interface to VimGolf challenges.
8
-
9
- Bindings:
10
-
11
- - Bindings should mimic Dired/Ibuffer wherever possible. Magit is listed primarily because I want TAB to open up the long description of the challenge.
12
-
13
- At least:
14
-
15
- - n/p
16
- - ENTER/o: launch `vimgolf` with the correct arg.
17
-
18
- Interface Mockup:
19
-
20
- VimGolf in Emacs! Compete on vimgolf with the One True Editor.
21
-
22
- Sort entries based on date - Sort some entries in a Ledger-file based on date.
23
- PHP Array Syntax -> MailChimp Merge Syntax - I recently needed to send an e-m...
24
- Refactor to Helpers
25
- This Rails partial is almost all template escapes. Put it into a helper,
26
- and refactor each case to methods so we can build out the controls for
27
- each. (I've converted to tabs - fighting with Vimgolf's default config
28
- shouldn't be part of the challenge.)
29
-
30
- Alphabetize the directory - Put the contacts and their information in alphabe...
31
- PHP <--> Java class conversion Part 2 - Same class but reverse!
32
- PHP <--> Java class conversion Part 1 - Convert this tiny php class to adequa...
33
- Multiplication table. - Create a multiplication table.
34
- Complete the hex array data (Part II) - Do not use external tools(e.g. tac, s...
35
- Interweave two blocks of text - Suppose you've got data on a list of things f...
36
- .
37
- .
38
- .
39
-
40
- --------------------------------------------------------------------------------
41
-
42
- Commentary:
43
-
44
- - Tab has been pressed on the Refactor to Helpers line and thus it's been expanded.
45
-
46
- - The challenges `formatted text to markdown` and `Line Zipper` have both been completed and thus are hidden. Could provide a customization setting that turns this off completely, as well as an `M-x vimgolf-show-all` function to toggle the hiding.
47
-
48
- - Fill column has been set to 80
49
-
50
- - It would be fun if a local cache of the vimgolf data could be kept together so that you could record solutions or at least play offline.
51
-
52
- 3. Real submission to vimgolf.
53
-
54
- This could look like:
55
-
56
- Pop-open buffer
57
-
58
- You solved the formatted text to markdown challenge in 25 keystrokes! The best entry for this challenge was 23.
59
-
60
- M-x qrr ;; query-replace-regexp
61
- SPC*2 ;; self-insert-command
62
- dummy ;; self-insert-command * 5
63
- .
64
- .
65
- .
66
-
67
- Mini-buffer
68
-
69
- Submit to your solution to vimgolf? <y-or-n-predicate>