vimrunner 0.3.4 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: a13724ca4ddab2cf77b6423a1b84ac1bdfd67800
4
- data.tar.gz: 43b6a014cdb49921e52de8948a7d9f4287dd3892
2
+ SHA256:
3
+ metadata.gz: 5ba5ff396953188583a9254d735dd16e1158c8a1bb5b2b7fe3c425201e4912e7
4
+ data.tar.gz: 4a01f7fa5ebcbd22e57b6331ef4cf900db8b611e6f3dacdf018141d3dec74f33
5
5
  SHA512:
6
- metadata.gz: da89ed2f8a5e3d2451a3df41f366a1f300b83dad8cb2ae0ec553d6f447a39d62ce8ee264d07a1d8e21e98f2bd97a9a9ccd972f1a413c2a27f79f6c0afc6bec77
7
- data.tar.gz: 5a6113a790ba5145fd71cccbbf3dd5e6311aa8c734d676b0e2045b6d30b9407cf3957681c28dc90c060ab0b3ce1529e7edb0e663c11b519cdd03d2e30cb0f27b
6
+ metadata.gz: beec82a73e8a2b503a1b0515b60fb8dc453898f8b5a8b11550b2b0127be0375908f2a79b1a110aaa0c61c26a7812b79f9733ecc92ed26d0af585c3f8d4c8da85
7
+ data.tar.gz: ec2651366b35ceeb5e871ecf82f933f49ab42bf09878719d385b89fb4e35204ef9ee615ef23d7831538e4d053910c357f7aeb89682cea899996f12738029beef
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Vimrunner [![Build Status](https://secure.travis-ci.org/AndrewRadev/vimrunner.png?branch=master)](http://travis-ci.org/AndrewRadev/vimrunner)
1
+ # Vimrunner [![Build Status](https://secure.travis-ci.org/AndrewRadev/vimrunner.svg?branch=master)](http://travis-ci.org/AndrewRadev/vimrunner)
2
2
 
3
3
  Using Vim's
4
4
  [client/server](http://vimdoc.sourceforge.net/htmldoc/remote.html#clientserver)
@@ -6,6 +6,8 @@ functionality, this library exposes a way to spawn a Vim instance and control
6
6
  it programatically. Apart from being a fun party trick, this can be used to do
7
7
  integration testing on Vimscript.
8
8
 
9
+ ![Demo](http://i.andrewradev.com/cb035fee68a149c09c3a252fed91b177.gif)
10
+
9
11
  The latest stable documentation can be found
10
12
  [on rubydoc.info](http://rubydoc.info/gems/vimrunner/frames).
11
13
 
@@ -56,7 +58,7 @@ If you require an even more specific version of Vim, you can pass the path to
56
58
  it by instantiating your own `Server` instance like so:
57
59
 
58
60
  ```ruby
59
- Vimrunner::Server.new("/path/to/my/specific/vim").start do |vim|
61
+ Vimrunner::Server.new(:executable => "/path/to/my/specific/vim").start do |vim|
60
62
  vim.edit "file.txt"
61
63
  end
62
64
  ```
@@ -1,5 +1,6 @@
1
1
  module Vimrunner
2
2
  class InvalidCommandError < RuntimeError; end
3
+ class ExecutionError < RuntimeError; end
3
4
 
4
5
  class NoSuitableVimError < RuntimeError
5
6
  def message
@@ -1,5 +1,6 @@
1
1
  require "timeout"
2
2
  require "pty"
3
+ require "open3"
3
4
 
4
5
  require "vimrunner/errors"
5
6
  require "vimrunner/client"
@@ -17,7 +18,7 @@ module Vimrunner
17
18
  # to use a Server directly to invoke --remote commands on its Vim instance.
18
19
  class Server
19
20
  VIMRC = File.expand_path("../../../vim/vimrc", __FILE__)
20
- VIMRUNNER_RC = File.expand_path("../../../vim/vimrunner_rc", __FILE__)
21
+ VIMRUNNER_RC = File.expand_path("../../../vim/vimrunner.vim", __FILE__)
21
22
 
22
23
  attr_reader :name, :executable, :vimrc, :gvimrc, :pid
23
24
 
@@ -168,7 +169,12 @@ module Vimrunner
168
169
  end
169
170
 
170
171
  def execute(command)
171
- IO.popen(command) { |io| io.read.chomp.gsub(/\A\n/, '') }
172
+ out, err, status = Open3.capture3(*command)
173
+ if not err.empty?
174
+ raise ExecutionError.new("Command failed (#{command}), output: #{err}")
175
+ end
176
+
177
+ out.chomp.gsub(/\A\n/, '')
172
178
  end
173
179
 
174
180
  def spawn
@@ -1,3 +1,3 @@
1
1
  module Vimrunner
2
- VERSION = '0.3.4'
2
+ VERSION = '0.3.6'
3
3
  end
data/vim/vimrc CHANGED
@@ -8,4 +8,6 @@ set noswapfile nobackup
8
8
 
9
9
  " remove default ~/.vim directories to avoid loading plugins
10
10
  set runtimepath-=~/.vim
11
+ set runtimepath-=~/.config/vim
11
12
  set runtimepath-=~/.vim/after
13
+ set runtimepath-=~/.config/vim/after
@@ -7,11 +7,15 @@ if has_error_handling_bugfix
7
7
  let output = ''
8
8
 
9
9
  try
10
- redir => output
11
- silent exe a:command
12
- redir END
13
-
14
- let output = s:StripSilencedErrors(output)
10
+ if exists('*execute')
11
+ let output = execute(a:command, 'silent')
12
+ else
13
+ redir => output
14
+ silent exe a:command
15
+ redir END
16
+
17
+ let output = s:StripSilencedErrors(output)
18
+ endif
15
19
  catch
16
20
  let output = v:exception
17
21
  endtry
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vimrunner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Radev
8
8
  - Paul Mucur
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-07-30 00:00:00.000000000 Z
12
+ date: 2024-12-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -59,14 +59,14 @@ dependencies:
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: '3.5'
62
+ version: '3.7'
63
63
  type: :development
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '3.5'
69
+ version: '3.7'
70
70
  description: |2
71
71
  Using Vim's client/server functionality, this library exposes a way to
72
72
  spawn a Vim instance and control it programatically. Apart from being a fun
@@ -92,11 +92,12 @@ files:
92
92
  - lib/vimrunner/testing.rb
93
93
  - lib/vimrunner/version.rb
94
94
  - vim/vimrc
95
- - vim/vimrunner_rc
95
+ - vim/vimrunner.vim
96
96
  homepage: http://github.com/AndrewRadev/vimrunner
97
- licenses: []
97
+ licenses:
98
+ - MIT
98
99
  metadata: {}
99
- post_install_message:
100
+ post_install_message:
100
101
  rdoc_options: []
101
102
  require_paths:
102
103
  - lib
@@ -111,9 +112,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
112
  - !ruby/object:Gem::Version
112
113
  version: 1.3.6
113
114
  requirements: []
114
- rubyforge_project: vimrunner
115
- rubygems_version: 2.6.11
116
- signing_key:
115
+ rubygems_version: 3.5.17
116
+ signing_key:
117
117
  specification_version: 4
118
118
  summary: Lets you control a Vim instance through Ruby
119
119
  test_files: []