benatkin-vimilicious 0.1.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.
@@ -0,0 +1,51 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe Vimilicious, '#map' do
4
+
5
+ # #map_commands_for will do whatever it can to get your
6
+ # mapping(s) working, even if it had to map too additional modes.
7
+ #
8
+ # first, it should look for one that contains all of the
9
+ # modes we want (*only* those modes).
10
+ #
11
+ # after that, it should see if it can find a way to *just*
12
+ # include the modes you want.
13
+ #
14
+ # if it can't find a way to *just* include the modes you want,
15
+ # it will select whichever alternative includes the least other modes.
16
+ #
17
+ # map:: Normal, Visual, Operator-pending
18
+ # map!:: Insert, Command-line
19
+ # nmap:: Normal
20
+ # vmap:: Visual
21
+ # omap:: Operator-pending
22
+ # cmap:: Command-line
23
+ # imap:: Insert
24
+ # lmap:: Insert, Command-line, Lang-Arg
25
+ #
26
+ it 'should be able to figure out which vim mapping command to use' do
27
+ map_commands_for('visual').should == [:vmap]
28
+ map_commands_for('ViSuaL').should == [:vmap]
29
+ map_commands_for(:visual).should == [:vmap]
30
+
31
+ map_commands_for(:command).should == [:cmap]
32
+ map_commands_for(:lang).should == [:lmap] # it has to, because it's the only option with lmap
33
+ map_commands_for(:insert).should == [:imap]
34
+ map_commands_for(:operator).should == [:omap]
35
+ map_commands_for(:normal).should == [:nmap]
36
+
37
+ # ok, now multiple ...
38
+ map_commands_for(:normal, :visual, :operator).should == [:map]
39
+ map_commands_for(:insert, :command).should == [:map!]
40
+ map_commands_for(:normal, :visual).should == [:nmap, :vmap]
41
+
42
+ map_commands_for(:normal, :command).length.should == 2
43
+ map_commands_for(:normal, :command).should include(:nmap)
44
+ map_commands_for(:normal, :command).should include(:cmap)
45
+
46
+ map_commands_for(:normal, :operator).length.should == 2
47
+ map_commands_for(:normal, :operator).should include(:nmap)
48
+ map_commands_for(:normal, :operator).should include(:omap)
49
+ end
50
+
51
+ end
data/spec/spec.opts ADDED
@@ -0,0 +1,3 @@
1
+ --color
2
+ --format specdoc
3
+ --loadby mtime
@@ -0,0 +1,12 @@
1
+ #
2
+ # mock of the VIM class so our specs pass
3
+ #
4
+ class VIM
5
+ class << self
6
+ %w( cmd command ).each do |valid_method_name|
7
+ define_method(valid_method_name){|*args| }
8
+ end
9
+ end
10
+ end
11
+
12
+ require File.dirname(__FILE__) + '/../lib/vimilicious'
@@ -0,0 +1,7 @@
1
+ require File.dirname(__FILE__) + '/spec_helper'
2
+
3
+ describe Vimilicious do
4
+
5
+ it 'should spec out some of the basic commands?'
6
+
7
+ end
@@ -0,0 +1,16 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "vimilicious"
3
+ s.version = "0.1.5"
4
+ s.date = "2009-05-31"
5
+ s.summary = "vim-ruby library for making vim easy"
6
+ s.email = "remi@remitaylor.com"
7
+ s.homepage = "http://github.com/remi/vimilicious"
8
+ s.description = "vim-ruby library making it easier to work with vim via ruby"
9
+ s.has_rdoc = true
10
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Sinatra", "--main", "README.rdoc"]
11
+ s.extra_rdoc_files = ['README.rdoc']
12
+ s.authors = ["remi Taylor"]
13
+
14
+ # generate using: $ ruby -e "puts Dir['**/**'].select{|x| File.file?x}.inspect"
15
+ s.files = ["COPYING", "examples/vikir.rb", "examples/vikir.vim", "lib/vimilicious.rb", "LICENSE", "Rakefile", "README.rdoc", "spec/mapping_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "spec/vimilicious_spec.rb", "vimilicious.gemspec"]
16
+ end
metadata ADDED
@@ -0,0 +1,69 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: benatkin-vimilicious
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.5
5
+ platform: ruby
6
+ authors:
7
+ - remi Taylor
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-05-31 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies: []
15
+
16
+ description: vim-ruby library making it easier to work with vim via ruby
17
+ email: remi@remitaylor.com
18
+ executables: []
19
+
20
+ extensions: []
21
+
22
+ extra_rdoc_files:
23
+ - README.rdoc
24
+ files:
25
+ - COPYING
26
+ - examples/vikir.rb
27
+ - examples/vikir.vim
28
+ - lib/vimilicious.rb
29
+ - LICENSE
30
+ - Rakefile
31
+ - README.rdoc
32
+ - spec/mapping_spec.rb
33
+ - spec/spec.opts
34
+ - spec/spec_helper.rb
35
+ - spec/vimilicious_spec.rb
36
+ - vimilicious.gemspec
37
+ has_rdoc: true
38
+ homepage: http://github.com/remi/vimilicious
39
+ post_install_message:
40
+ rdoc_options:
41
+ - --line-numbers
42
+ - --inline-source
43
+ - --title
44
+ - Sinatra
45
+ - --main
46
+ - README.rdoc
47
+ require_paths:
48
+ - lib
49
+ required_ruby_version: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: "0"
54
+ version:
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: "0"
60
+ version:
61
+ requirements: []
62
+
63
+ rubyforge_project:
64
+ rubygems_version: 1.2.0
65
+ signing_key:
66
+ specification_version: 2
67
+ summary: vim-ruby library for making vim easy
68
+ test_files: []
69
+