vimdo 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Gemfile.lock +5 -5
- data/Rakefile +2 -2
- data/lib/vimdo/cli.rb +70 -34
- data/lib/vimdo/version.rb +1 -1
- data/vimdo.gemspec +7 -7
- metadata +7 -6
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fb783f65cc9b415f3295d3ab78355932deb7f7d
|
4
|
+
data.tar.gz: 8c3303d5184af091e03a1e34612e7ff69a1f05cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cffb90d164db6f824864eb6d1d3f74f5fa05643ba3f03dd70ad61af7c9047a0ed43b670b5141df9864ebad4164216fff3acb1acb01aa1d067be3055729007e2
|
7
|
+
data.tar.gz: 5395f1095dcf332c2fbbc1062c30f712929f053bf20b761ed2fd4ee1bf4ed19979d187281d443b807d10bc7421e386f2eb65e158e4248e4d30fd39616572ac60
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
vimdo (1.0.
|
4
|
+
vimdo (1.2.0.20130421112816)
|
5
5
|
autocompletion (~> 0.0.3)
|
6
6
|
thor (~> 0.18.0)
|
7
|
-
vimrunner (
|
7
|
+
vimrunner (>= 0.3.0)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
@@ -20,10 +20,10 @@ GEM
|
|
20
20
|
hoe-version (1.2.0)
|
21
21
|
json (1.7.7)
|
22
22
|
rake (10.0.4)
|
23
|
-
rdoc (
|
23
|
+
rdoc (4.0.1)
|
24
24
|
json (~> 1.4)
|
25
25
|
thor (0.18.1)
|
26
|
-
vimrunner (0.
|
26
|
+
vimrunner (0.3.0)
|
27
27
|
|
28
28
|
PLATFORMS
|
29
29
|
ruby
|
@@ -35,5 +35,5 @@ DEPENDENCIES
|
|
35
35
|
hoe-git
|
36
36
|
hoe-version
|
37
37
|
rake (>= 10.0.0)
|
38
|
-
rdoc (~>
|
38
|
+
rdoc (~> 4.0)
|
39
39
|
vimdo!
|
data/Rakefile
CHANGED
@@ -15,8 +15,8 @@ Hoe.spec 'vimdo' do
|
|
15
15
|
license 'GPL-3'
|
16
16
|
|
17
17
|
extra_deps << ['vimrunner', '>= 0.3.0']
|
18
|
-
extra_deps << ['thor', '
|
19
|
-
extra_deps << ['autocompletion', '
|
18
|
+
extra_deps << ['thor', '>= 0.18.0']
|
19
|
+
extra_deps << ['autocompletion', '>= 0.0.3']
|
20
20
|
|
21
21
|
extra_dev_deps << ['rake', '>= 10.0.0']
|
22
22
|
extra_dev_deps << ['hoe'] << ['hoe-gemspec'] << ['hoe-git'] << ['hoe-version']
|
data/lib/vimdo/cli.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'thor'
|
2
2
|
require "vimdo/ui"
|
3
|
+
require "vimrunner/path"
|
3
4
|
|
4
5
|
module VimDo
|
5
6
|
|
@@ -8,36 +9,36 @@ module VimDo
|
|
8
9
|
package_name "VimDo"
|
9
10
|
|
10
11
|
class_option :name,
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
:type => :string,
|
13
|
+
:banner => "servername to connect",
|
14
|
+
:default => 'VIM',
|
15
|
+
:aliases => ["--servername","-s" ]
|
15
16
|
class_option :executable,
|
16
|
-
|
17
|
-
|
18
|
-
|
17
|
+
:type => :string,
|
18
|
+
:banner => "specifiy vim executable",
|
19
|
+
:aliases => "-e"
|
19
20
|
class_option :foreground,
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
:type => :boolean,
|
22
|
+
:banner => "Foreground: Don't fork when starting GUI",
|
23
|
+
:default => false,
|
24
|
+
:aliases => "-f"
|
24
25
|
class_option :vimrc,
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
:type => :string,
|
27
|
+
:default => File.expand_path("~/.vimrc"),
|
28
|
+
:banner => "path to vimrc",
|
29
|
+
:aliases => "-u"
|
29
30
|
class_option :vimdorc,
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
:type => :string,
|
32
|
+
:default => File.expand_path("~/.vimdorc"),
|
33
|
+
:banner => "path to vimdo rc",
|
34
|
+
:aliases => "-c"
|
34
35
|
class_option "no-color",
|
35
|
-
|
36
|
-
|
36
|
+
:type => :boolean,
|
37
|
+
:banner => "disable colorization in output"
|
37
38
|
class_option :verbose,
|
38
|
-
|
39
|
-
|
40
|
-
|
39
|
+
:type => :boolean,
|
40
|
+
:banner => "enable verbose output mode",
|
41
|
+
:aliases => "-v"
|
41
42
|
|
42
43
|
def initialize(*)
|
43
44
|
super
|
@@ -57,9 +58,20 @@ module VimDo
|
|
57
58
|
end
|
58
59
|
|
59
60
|
|
60
|
-
desc "edit", "edit file +filename+ with Vim"
|
61
|
+
desc "edit", "edit file +filename[:line]+ with Vim"
|
61
62
|
def edit(filename)
|
62
|
-
|
63
|
+
linenr = nil
|
64
|
+
if /(.*):(\d+):?/.match(filename)
|
65
|
+
f = File.expand_path($1)
|
66
|
+
linenr = $2
|
67
|
+
else
|
68
|
+
f = File.expand_path(filename)
|
69
|
+
end
|
70
|
+
|
71
|
+
raise PathError "#{f} is not readable!" unless File.readable?(f)
|
72
|
+
vim.edit(f)
|
73
|
+
commands(linenr) if linenr
|
74
|
+
vim.foreground
|
63
75
|
end
|
64
76
|
|
65
77
|
desc "diff", "diff in vim"
|
@@ -67,13 +79,33 @@ module VimDo
|
|
67
79
|
[from, to].each do |f|
|
68
80
|
raise PathError "#{f} is not readable!" unless File.readable?(f)
|
69
81
|
end
|
70
|
-
from = File.expand_path(from)
|
71
|
-
to = File.expand_path(to)
|
72
82
|
from, to = [from, to].map {|f| File.expand_path(f) }
|
73
83
|
|
74
|
-
commands(
|
84
|
+
commands("tabedit #{path(from)}", "diffsplit #{path(to)}")
|
85
|
+
vim.foreground
|
86
|
+
end
|
87
|
+
|
88
|
+
desc "diffpatch", "diffpatch in vim"
|
89
|
+
method_option :patch,
|
90
|
+
:aliases => "-p" ,
|
91
|
+
:required => true ,
|
92
|
+
:type => :string ,
|
93
|
+
:desc => "patch file"
|
94
|
+
def diffpatch(file)
|
95
|
+
patch = options[:patch]
|
96
|
+
[file, patch].each do |f|
|
97
|
+
unless File.readable?(f)
|
98
|
+
raise PathError "#{f} is not readable!"
|
99
|
+
end
|
100
|
+
end
|
101
|
+
file, patch = [file, patch].map {|f| File.expand_path(f) }
|
102
|
+
|
103
|
+
commands("edit #{path(file)}", "vertical diffpatch #{path(patch)}")
|
104
|
+
vim.foreground
|
75
105
|
end
|
76
106
|
|
107
|
+
|
108
|
+
|
77
109
|
desc "merge", "LOCAL(= mine), MERGED(= yours), REMOTE(= merged output), [BASE(= common parent)]"
|
78
110
|
long_desc <<-LONGDESC
|
79
111
|
LOCAL(= mine), MERGED(= yours), REMOTE(= merged output), [BASE(= common parent)]
|
@@ -90,13 +122,13 @@ module VimDo
|
|
90
122
|
local, merge, remote = [local, merge, remote].map {|f| File.expand_path(f) }
|
91
123
|
|
92
124
|
merge_command =
|
93
|
-
|
94
|
-
|
95
|
-
|
125
|
+
"tabnew<Bar>edit #{path(local)}" +
|
126
|
+
"<Bar>diffsplit #{path(merge)}" +
|
127
|
+
"<Bar>diffsplit #{path(remote)}"
|
96
128
|
|
97
129
|
if base
|
98
130
|
base_split_command =
|
99
|
-
|
131
|
+
"<Bar>diffsplit #{path(File.expand_path(base))}<Bar>wincmd J"
|
100
132
|
else
|
101
133
|
base_split_command = ''
|
102
134
|
end
|
@@ -104,6 +136,7 @@ module VimDo
|
|
104
136
|
switch_command = "<Bar>2wincmd w"
|
105
137
|
|
106
138
|
commands(merge_command + base_split_command + switch_command)
|
139
|
+
vim.foreground
|
107
140
|
end
|
108
141
|
|
109
142
|
desc "autocomplete", "print subcommands for shell completion"
|
@@ -111,7 +144,10 @@ module VimDo
|
|
111
144
|
raise UndefinedCommandError, "autocomplete should be intercepted."
|
112
145
|
end
|
113
146
|
|
114
|
-
|
147
|
+
private
|
148
|
+
def path(p)
|
149
|
+
Vimrunner::Path.new(p)
|
150
|
+
end
|
115
151
|
def vim
|
116
152
|
@vim ||= VimDo.connect(options)
|
117
153
|
end
|
data/lib/vimdo/version.rb
CHANGED
data/vimdo.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "vimdo"
|
5
|
-
s.version = "1.2.0.
|
5
|
+
s.version = "1.2.0.20130421120240"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Zhao Cai"]
|
@@ -27,8 +27,8 @@ Gem::Specification.new do |s|
|
|
27
27
|
|
28
28
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
29
29
|
s.add_runtime_dependency(%q<vimrunner>, [">= 0.3.0"])
|
30
|
-
s.add_runtime_dependency(%q<thor>, ["
|
31
|
-
s.add_runtime_dependency(%q<autocompletion>, ["
|
30
|
+
s.add_runtime_dependency(%q<thor>, [">= 0.18.0"])
|
31
|
+
s.add_runtime_dependency(%q<autocompletion>, [">= 0.0.3"])
|
32
32
|
s.add_development_dependency(%q<rdoc>, ["~> 4.0"])
|
33
33
|
s.add_development_dependency(%q<rake>, [">= 10.0.0"])
|
34
34
|
s.add_development_dependency(%q<hoe>, [">= 0"])
|
@@ -38,8 +38,8 @@ Gem::Specification.new do |s|
|
|
38
38
|
s.add_development_dependency(%q<awesome_print>, [">= 0"])
|
39
39
|
else
|
40
40
|
s.add_dependency(%q<vimrunner>, [">= 0.3.0"])
|
41
|
-
s.add_dependency(%q<thor>, ["
|
42
|
-
s.add_dependency(%q<autocompletion>, ["
|
41
|
+
s.add_dependency(%q<thor>, [">= 0.18.0"])
|
42
|
+
s.add_dependency(%q<autocompletion>, [">= 0.0.3"])
|
43
43
|
s.add_dependency(%q<rdoc>, ["~> 4.0"])
|
44
44
|
s.add_dependency(%q<rake>, [">= 10.0.0"])
|
45
45
|
s.add_dependency(%q<hoe>, [">= 0"])
|
@@ -50,8 +50,8 @@ Gem::Specification.new do |s|
|
|
50
50
|
end
|
51
51
|
else
|
52
52
|
s.add_dependency(%q<vimrunner>, [">= 0.3.0"])
|
53
|
-
s.add_dependency(%q<thor>, ["
|
54
|
-
s.add_dependency(%q<autocompletion>, ["
|
53
|
+
s.add_dependency(%q<thor>, [">= 0.18.0"])
|
54
|
+
s.add_dependency(%q<autocompletion>, [">= 0.0.3"])
|
55
55
|
s.add_dependency(%q<rdoc>, ["~> 4.0"])
|
56
56
|
s.add_dependency(%q<rake>, [">= 10.0.0"])
|
57
57
|
s.add_dependency(%q<hoe>, [">= 0"])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vimdo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zhao Cai
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
eIuFwYbmfyt5/ObUtmp3BlaIStTiX9TBWeuTx6Zq6q6wDzcudbDRd+jLa2XG2AGB
|
31
31
|
S6w/KYMnbhUxfyEU1MX10sJv87WIrtgF
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2013-
|
33
|
+
date: 2013-10-29 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: vimrunner
|
@@ -50,28 +50,28 @@ dependencies:
|
|
50
50
|
name: thor
|
51
51
|
requirement: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - '>='
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: 0.18.0
|
56
56
|
type: :runtime
|
57
57
|
prerelease: false
|
58
58
|
version_requirements: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - '>='
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: 0.18.0
|
63
63
|
- !ruby/object:Gem::Dependency
|
64
64
|
name: autocompletion
|
65
65
|
requirement: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - '>='
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: 0.0.3
|
70
70
|
type: :runtime
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- -
|
74
|
+
- - '>='
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: 0.0.3
|
77
77
|
- !ruby/object:Gem::Dependency
|
@@ -207,6 +207,7 @@ extensions: []
|
|
207
207
|
extra_rdoc_files:
|
208
208
|
- History.txt
|
209
209
|
- Manifest.txt
|
210
|
+
- README.md
|
210
211
|
files:
|
211
212
|
- Gemfile
|
212
213
|
- Gemfile.lock
|
metadata.gz.sig
CHANGED
Binary file
|