vimgolf 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/lib/vimgolf/cli.rb CHANGED
@@ -63,11 +63,13 @@ module VimGolf
63
63
  type = download(id)
64
64
 
65
65
  # - n - no swap file, memory only editing
66
+ # - +0 - always start on line 0
66
67
  # - --noplugin - don't load any plugins, lets be fair!
67
- # -u NONE and -U none - don't load .vimrc or .gvimrc
68
68
  # -i NONE - don't load .viminfo (for saved macros and the like)
69
- # - +0 - always start on line 0
70
- system("vim -n --noplugin -i NONE +0 -W #{log(id)} #{input(id, type)}")
69
+ # - u - load vimgolf .vimrc to level the playing field
70
+ vimcmd = "vim -n --noplugin -i NONE +0 -u #{vimrc(id)} -W #{log(id)} #{input(id, type)}"
71
+ debug(vimcmd)
72
+ system(vimcmd)
71
73
 
72
74
  if $?.exitstatus.zero?
73
75
  diff = `diff --strip-trailing-cr #{input(id, type)} #{output(id)}`
@@ -129,6 +131,7 @@ module VimGolf
129
131
 
130
132
  File.open(Config.put_path + "/#{id}.#{data['in']['type']}", "w") {|f| f.puts data['in']['data']}
131
133
  File.open(Config.put_path + "/#{id}.output", "w") {|f| f.puts data['out']['data']}
134
+ File.open(Config.put_path + "/#{id}.golfrc", "w") {|f| f.puts data['vimrc']}
132
135
 
133
136
  data['in']['type']
134
137
 
@@ -160,7 +163,8 @@ module VimGolf
160
163
  private
161
164
  def input(id, type); challenge(id) + ".#{type}"; end
162
165
  def output(id); challenge(id) + ".output"; end
163
- def log(id); challenge(id) + ".log"; end
166
+ def log(id); challenge(id) + ".log"; end
167
+ def vimrc(id); challenge(id) + ".golfrc"; end
164
168
 
165
169
  def challenge(id)
166
170
  Config.put_path + "/#{id}"
@@ -1,3 +1,3 @@
1
1
  module Vimgolf
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
data/vimgolf.gemspec CHANGED
@@ -23,4 +23,13 @@ Gem::Specification.new do |s|
23
23
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
24
24
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
25
25
  s.require_paths = ["lib"]
26
+
27
+ s.post_install_message = %{
28
+ ------------------------------------------------------------------------------
29
+ Thank you for installing vimgolf-#{Vimgolf::VERSION}. As of 0.1.3, we are shipping a custom
30
+ vimgolf .vimrc file for each challenge to help level the playing field.
31
+
32
+ For more information, rules & updates: http://vimgolf.com/about
33
+ ------------------------------------------------------------------------------
34
+ }
26
35
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 2
9
- version: 0.1.2
8
+ - 3
9
+ version: 0.1.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ilya Grigorik
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-12-28 00:00:00 -05:00
17
+ date: 2010-12-30 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -100,7 +100,12 @@ has_rdoc: true
100
100
  homepage: http://github.com/igrigorik/vimgolf
101
101
  licenses: []
102
102
 
103
- post_install_message:
103
+ post_install_message: "\n\
104
+ ------------------------------------------------------------------------------\n\
105
+ Thank you for installing vimgolf-0.1.3. As of 0.1.3, we are shipping a custom\n\
106
+ vimgolf .vimrc file for each challenge to help level the playing field.\n\n\
107
+ For more information, rules & updates: http://vimgolf.com/about\n\
108
+ ------------------------------------------------------------------------------\n"
104
109
  rdoc_options: []
105
110
 
106
111
  require_paths: