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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ee9475f465b154698dcc46377e814504166d0dba
4
- data.tar.gz: 4342e14f9cb0f5b9be23ce6c890135531632a6e3
3
+ metadata.gz: 9fb783f65cc9b415f3295d3ab78355932deb7f7d
4
+ data.tar.gz: 8c3303d5184af091e03a1e34612e7ff69a1f05cd
5
5
  SHA512:
6
- metadata.gz: 2c537f9e18e03e126a9ce07681d0880432cbfd3272f180953d1fca966e249b87b7c5f7d973bc383b04b6fec95ceca3de8c229c121f0a6d418b44def7789c94fc
7
- data.tar.gz: 2a4529dfd4013e89115e575c7ff2996fd2317660c0ca534c2d1c6c1e93e0544a1cfee1e73e512fcb98703ce4dfca0d870c037bab5128ae41c0a5bd976703d892
6
+ metadata.gz: 5cffb90d164db6f824864eb6d1d3f74f5fa05643ba3f03dd70ad61af7c9047a0ed43b670b5141df9864ebad4164216fff3acb1acb01aa1d067be3055729007e2
7
+ data.tar.gz: 5395f1095dcf332c2fbbc1062c30f712929f053bf20b761ed2fd4ee1bf4ed19979d187281d443b807d10bc7421e386f2eb65e158e4248e4d30fd39616572ac60
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vimdo (1.0.2.20130407152509)
4
+ vimdo (1.2.0.20130421112816)
5
5
  autocompletion (~> 0.0.3)
6
6
  thor (~> 0.18.0)
7
- vimrunner (~> 0.2.2)
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 (3.12.2)
23
+ rdoc (4.0.1)
24
24
  json (~> 1.4)
25
25
  thor (0.18.1)
26
- vimrunner (0.2.2)
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 (~> 3.10)
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', '~> 0.18.0']
19
- extra_deps << ['autocompletion', '~> 0.0.3']
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']
@@ -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
- :type => :string,
12
- :banner => "servername to connect",
13
- :default => 'VIM',
14
- :aliases => ["--servername","-s" ]
12
+ :type => :string,
13
+ :banner => "servername to connect",
14
+ :default => 'VIM',
15
+ :aliases => ["--servername","-s" ]
15
16
  class_option :executable,
16
- :type => :string,
17
- :banner => "specifiy vim executable",
18
- :aliases => "-e"
17
+ :type => :string,
18
+ :banner => "specifiy vim executable",
19
+ :aliases => "-e"
19
20
  class_option :foreground,
20
- :type => :boolean,
21
- :banner => "Foreground: Don't fork when starting GUI",
22
- :default => false,
23
- :aliases => "-f"
21
+ :type => :boolean,
22
+ :banner => "Foreground: Don't fork when starting GUI",
23
+ :default => false,
24
+ :aliases => "-f"
24
25
  class_option :vimrc,
25
- :type => :string,
26
- :default => File.expand_path("~/.vimrc"),
27
- :banner => "path to vimrc",
28
- :aliases => "-u"
26
+ :type => :string,
27
+ :default => File.expand_path("~/.vimrc"),
28
+ :banner => "path to vimrc",
29
+ :aliases => "-u"
29
30
  class_option :vimdorc,
30
- :type => :string,
31
- :default => File.expand_path("~/.vimdorc"),
32
- :banner => "path to vimdo rc",
33
- :aliases => "-c"
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
- :type => :boolean,
36
- :banner => "disable colorization in output"
36
+ :type => :boolean,
37
+ :banner => "disable colorization in output"
37
38
  class_option :verbose,
38
- :type => :boolean,
39
- :banner => "enable verbose output mode",
40
- :aliases => "-v"
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
- vim.edit(File.expand_path(filename))
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('tabnew', 'edit '+vim.escape_filename(from), 'diffsplit '+vim.escape_filename(to))
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
- 'tabnew<Bar>edit ' + vim.escape_filename(local) +
94
- '<Bar>diffsplit ' + vim.escape_filename(merge) +
95
- '<Bar>diffsplit ' + vim.escape_filename(remote)
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
- "<Bar>diffsplit #{vim.escape_filename(File.expand_path(base))}<Bar>wincmd J"
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
- private
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
@@ -1,4 +1,4 @@
1
1
  module Vimremote
2
- VERSION = '1.2.0'
2
+ VERSION = '1.2.1'
3
3
  end
4
4
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "vimdo"
5
- s.version = "1.2.0.20130421112816"
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>, ["~> 0.18.0"])
31
- s.add_runtime_dependency(%q<autocompletion>, ["~> 0.0.3"])
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>, ["~> 0.18.0"])
42
- s.add_dependency(%q<autocompletion>, ["~> 0.0.3"])
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>, ["~> 0.18.0"])
54
- s.add_dependency(%q<autocompletion>, ["~> 0.0.3"])
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.0
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-04-21 00:00:00.000000000 Z
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