cucumber-vimscript 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +5 -0
- data/README.md +6 -0
- data/lib/cucumber/vimscript.rb +59 -0
- metadata +88 -0
data/LICENSE
ADDED
@@ -0,0 +1,5 @@
|
|
1
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
2
|
+
|
3
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
4
|
+
|
5
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
This project contains step definitions that can be used to spawn a Vim instance
|
2
|
+
and control it through code. The actual work is done by the
|
3
|
+
[vimrunner gem](https://github.com/AndrewRadev/vimrunner).
|
4
|
+
|
5
|
+
The steps are still only a few and will be updated as I use them in my own vim
|
6
|
+
projects, but of course, any contributions are more than welcome.
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'tmpdir'
|
2
|
+
require 'tempfile'
|
3
|
+
require 'fileutils'
|
4
|
+
require 'vimrunner/runner'
|
5
|
+
|
6
|
+
Before do
|
7
|
+
@tmpdir = Dir.mktmpdir
|
8
|
+
@original_dir = FileUtils.getwd
|
9
|
+
FileUtils.cd @tmpdir
|
10
|
+
end
|
11
|
+
|
12
|
+
After do
|
13
|
+
FileUtils.cd @original_dir
|
14
|
+
@vim.kill if @vim
|
15
|
+
end
|
16
|
+
|
17
|
+
Given /^Vim is running$/ do
|
18
|
+
@vim = Vimrunner::Runner.start_gvim
|
19
|
+
end
|
20
|
+
|
21
|
+
Given /^I'm editing a file named "([^"]*)"$/ do |filename|
|
22
|
+
@vim.edit filename
|
23
|
+
end
|
24
|
+
|
25
|
+
Given /^I'm editing a file named "([^"]*)" with the following contents:$/ do |filename, text|
|
26
|
+
File.open(filename, 'w') { |f| f.write(text) }
|
27
|
+
@vim.edit filename
|
28
|
+
end
|
29
|
+
|
30
|
+
Given /^"([^"]*)" is set$/ do |boolean_setting|
|
31
|
+
@vim.set boolean_setting
|
32
|
+
end
|
33
|
+
|
34
|
+
Given /^"([^"]*)" is set to "([^"]*)"$/ do |setting, value|
|
35
|
+
@vim.set setting, value
|
36
|
+
end
|
37
|
+
|
38
|
+
When /^I insert the text "([^"]*)"$/ do |text|
|
39
|
+
@vim.insert text
|
40
|
+
end
|
41
|
+
|
42
|
+
When /^I save$/ do
|
43
|
+
@vim.write
|
44
|
+
@vim.wait_until_ready
|
45
|
+
end
|
46
|
+
|
47
|
+
Then /^the file "([^"]*)" should contain "([^"]*)"$/ do |filename, text|
|
48
|
+
File.exists?(filename).should be_true
|
49
|
+
File.read(filename).should include text
|
50
|
+
end
|
51
|
+
|
52
|
+
Then /^the file "([^"]*)" should contain the following text:$/ do |filename, text|
|
53
|
+
File.exists?(filename).should be_true
|
54
|
+
File.read(filename).should include text
|
55
|
+
end
|
56
|
+
|
57
|
+
Given /^the cursor is positioned on "([^"]*)"$/ do |text|
|
58
|
+
@vim.search text
|
59
|
+
end
|
metadata
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cucumber-vimscript
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Andrew Radev
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-10-28 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: cucumber
|
16
|
+
requirement: &7464100 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.0.2
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *7464100
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: vimrunner
|
27
|
+
requirement: &7463700 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *7463700
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rake
|
38
|
+
requirement: &7463240 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *7463240
|
47
|
+
description: Provides step definitions to spawn and command a vim instance
|
48
|
+
email:
|
49
|
+
- andrey.radev@gmail.com
|
50
|
+
executables: []
|
51
|
+
extensions: []
|
52
|
+
extra_rdoc_files: []
|
53
|
+
files:
|
54
|
+
- lib/cucumber/vimscript.rb
|
55
|
+
- LICENSE
|
56
|
+
- README.md
|
57
|
+
homepage: http://github.com/AndrewRadev/cucumber-vimscript
|
58
|
+
licenses: []
|
59
|
+
post_install_message:
|
60
|
+
rdoc_options:
|
61
|
+
- --charset=UTF-8
|
62
|
+
require_paths:
|
63
|
+
- lib
|
64
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
segments:
|
71
|
+
- 0
|
72
|
+
hash: -3761319605953647252
|
73
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ! '>='
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: '0'
|
79
|
+
segments:
|
80
|
+
- 0
|
81
|
+
hash: -3761319605953647252
|
82
|
+
requirements: []
|
83
|
+
rubyforge_project:
|
84
|
+
rubygems_version: 1.8.11
|
85
|
+
signing_key:
|
86
|
+
specification_version: 3
|
87
|
+
summary: A vimscript driver for cucumber
|
88
|
+
test_files: []
|