vimrunner 0.3.4 → 0.3.5

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.
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: '053182acc5fa35793f7402da1a2a4662faeb6fe9720cc9adb6986177df24cd17'
4
+ data.tar.gz: 45e09ea1e10e2c8b9552afd61dcdb21f236b6f5e6c96add3526fd515a0172eae
5
5
  SHA512:
6
- metadata.gz: da89ed2f8a5e3d2451a3df41f366a1f300b83dad8cb2ae0ec553d6f447a39d62ce8ee264d07a1d8e21e98f2bd97a9a9ccd972f1a413c2a27f79f6c0afc6bec77
7
- data.tar.gz: 5a6113a790ba5145fd71cccbbf3dd5e6311aa8c734d676b0e2045b6d30b9407cf3957681c28dc90c060ab0b3ce1529e7edb0e663c11b519cdd03d2e30cb0f27b
6
+ metadata.gz: 8561ce79c6a82a5f0c5363268afb763a14b7133711f8565d07e007c5e83d570e2002be1a7aee2649d4e25c3eac9af05ce6c556c719f359f108efc8f6377ce156
7
+ data.tar.gz: 7632fb4c746ef5a9d0defd5484236d809533d33554f5a05802bd967271a1b9821f1ce833d3455e5daceba52004b1aa8aad796fa426a8b2e252b4fbf27204df3c
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.5'
3
3
  end
@@ -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.5
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: 2023-06-24 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,11 @@ 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
97
  licenses: []
98
98
  metadata: {}
99
- post_install_message:
99
+ post_install_message:
100
100
  rdoc_options: []
101
101
  require_paths:
102
102
  - lib
@@ -111,9 +111,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  - !ruby/object:Gem::Version
112
112
  version: 1.3.6
113
113
  requirements: []
114
- rubyforge_project: vimrunner
115
- rubygems_version: 2.6.11
116
- signing_key:
114
+ rubygems_version: 3.1.6
115
+ signing_key:
117
116
  specification_version: 4
118
117
  summary: Lets you control a Vim instance through Ruby
119
118
  test_files: []