rmate 1.5.6 → 1.5.7
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 +4 -4
- data/bin/rmate +35 -37
- data/lib/rmate.rb +35 -37
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb01149adffb982c59add526c2f37ff360eb6dfe
|
4
|
+
data.tar.gz: 00fecc43b47a622770630f875e507d80488bc762
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 363c38d9acc3897608acead4e1178bb500a386bbac8ad54ae91b45941d9c8fb47c901d878a456cf64cabe9651d0a57a20dbd8a0b07530663ba89fc1171e9dad6
|
7
|
+
data.tar.gz: 3dce272d71ad359a6bc1afd29d6b4f5e23550f29a63a1d64a0d0246144d2301dfaa411664e2001ee547a518e2e250423dd3052b49149ed60a9d2c36db97bd2c7
|
data/bin/rmate
CHANGED
@@ -11,8 +11,8 @@ require 'yaml'
|
|
11
11
|
require 'fileutils'
|
12
12
|
|
13
13
|
module Rmate
|
14
|
-
DATE = "
|
15
|
-
VERSION = "1.5.
|
14
|
+
DATE = "2014-02-06"
|
15
|
+
VERSION = "1.5.7"
|
16
16
|
VERSION_STRING = "rmate version #{Rmate::VERSION} (#{Rmate::DATE})"
|
17
17
|
|
18
18
|
class Settings
|
@@ -169,46 +169,44 @@ end
|
|
169
169
|
|
170
170
|
## MAIN
|
171
171
|
|
172
|
-
|
173
|
-
$settings = Rmate::Settings.new
|
172
|
+
$settings = Rmate::Settings.new
|
174
173
|
|
175
|
-
|
176
|
-
|
174
|
+
## Parse arguments.
|
175
|
+
cmds = []
|
177
176
|
|
178
|
-
|
177
|
+
ARGV << '-' if ARGV.empty? and (!$stdin.tty? or $settings.wait)
|
179
178
|
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
end
|
189
|
-
cmd = Rmate::Command.new("open")
|
190
|
-
cmd['display-name'] = "#{Socket.gethostname}:untitled (stdin)" if path == '-'
|
191
|
-
cmd['display-name'] = "#{Socket.gethostname}:#{path}" unless path == '-'
|
192
|
-
cmd['display-name'] = $settings.names[idx] if $settings.names.length > idx
|
193
|
-
cmd['real-path'] = File.expand_path(path) unless path == '-'
|
194
|
-
cmd['data-on-save'] = true
|
195
|
-
cmd['re-activate'] = true
|
196
|
-
cmd['token'] = path
|
197
|
-
cmd['selection'] = $settings.lines[idx] if $settings.lines.length > idx
|
198
|
-
cmd['file-type'] = 'txt' if path == '-'
|
199
|
-
cmd['file-type'] = $settings.types[idx] if $settings.types.length > idx
|
200
|
-
cmd.read_stdin if path == '-'
|
201
|
-
cmd.read_file(path) if path != '-' and File.exist? path
|
202
|
-
cmd['data'] = "0" unless path == '-' or File.exist? path
|
203
|
-
cmds << cmd
|
179
|
+
ARGV.each_index do |idx|
|
180
|
+
path = ARGV[idx]
|
181
|
+
if path == '-'
|
182
|
+
$stderr.puts "Reading from stdin, press ^D to stop" if $stdin.tty?
|
183
|
+
else
|
184
|
+
abort "'#{path}' is a directory! Aborting." if File.directory? path
|
185
|
+
abort "File #{path} is not writable! Use -f/--force to open anyway." unless $settings.force or File.writable? path or not File.exist? path
|
186
|
+
$stderr.puts "File #{path} is not writable. Opening anyway." if not File.writable? path and File.exist? path and $settings.verbose
|
204
187
|
end
|
188
|
+
cmd = Rmate::Command.new("open")
|
189
|
+
cmd['display-name'] = "#{Socket.gethostname}:untitled (stdin)" if path == '-'
|
190
|
+
cmd['display-name'] = "#{Socket.gethostname}:#{path}" unless path == '-'
|
191
|
+
cmd['display-name'] = $settings.names[idx] if $settings.names.length > idx
|
192
|
+
cmd['real-path'] = File.expand_path(path) unless path == '-'
|
193
|
+
cmd['data-on-save'] = true
|
194
|
+
cmd['re-activate'] = true
|
195
|
+
cmd['token'] = path
|
196
|
+
cmd['selection'] = $settings.lines[idx] if $settings.lines.length > idx
|
197
|
+
cmd['file-type'] = 'txt' if path == '-'
|
198
|
+
cmd['file-type'] = $settings.types[idx] if $settings.types.length > idx
|
199
|
+
cmd.read_stdin if path == '-'
|
200
|
+
cmd.read_file(path) if path != '-' and File.exist? path
|
201
|
+
cmd['data'] = "0" unless path == '-' or File.exist? path
|
202
|
+
cmds << cmd
|
203
|
+
end
|
205
204
|
|
206
|
-
|
207
|
-
|
208
|
-
Rmate::connect_and_handle_cmds($settings.host, $settings.port, cmds)
|
209
|
-
end
|
210
|
-
Process.detach(pid)
|
211
|
-
else
|
205
|
+
unless $settings.wait
|
206
|
+
pid = fork do
|
212
207
|
Rmate::connect_and_handle_cmds($settings.host, $settings.port, cmds)
|
213
208
|
end
|
209
|
+
Process.detach(pid)
|
210
|
+
else
|
211
|
+
Rmate::connect_and_handle_cmds($settings.host, $settings.port, cmds)
|
214
212
|
end
|
data/lib/rmate.rb
CHANGED
@@ -11,8 +11,8 @@ require 'yaml'
|
|
11
11
|
require 'fileutils'
|
12
12
|
|
13
13
|
module Rmate
|
14
|
-
DATE = "
|
15
|
-
VERSION = "1.5.
|
14
|
+
DATE = "2014-02-06"
|
15
|
+
VERSION = "1.5.7"
|
16
16
|
VERSION_STRING = "rmate version #{Rmate::VERSION} (#{Rmate::DATE})"
|
17
17
|
|
18
18
|
class Settings
|
@@ -169,46 +169,44 @@ end
|
|
169
169
|
|
170
170
|
## MAIN
|
171
171
|
|
172
|
-
|
173
|
-
$settings = Rmate::Settings.new
|
172
|
+
$settings = Rmate::Settings.new
|
174
173
|
|
175
|
-
|
176
|
-
|
174
|
+
## Parse arguments.
|
175
|
+
cmds = []
|
177
176
|
|
178
|
-
|
177
|
+
ARGV << '-' if ARGV.empty? and (!$stdin.tty? or $settings.wait)
|
179
178
|
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
end
|
189
|
-
cmd = Rmate::Command.new("open")
|
190
|
-
cmd['display-name'] = "#{Socket.gethostname}:untitled (stdin)" if path == '-'
|
191
|
-
cmd['display-name'] = "#{Socket.gethostname}:#{path}" unless path == '-'
|
192
|
-
cmd['display-name'] = $settings.names[idx] if $settings.names.length > idx
|
193
|
-
cmd['real-path'] = File.expand_path(path) unless path == '-'
|
194
|
-
cmd['data-on-save'] = true
|
195
|
-
cmd['re-activate'] = true
|
196
|
-
cmd['token'] = path
|
197
|
-
cmd['selection'] = $settings.lines[idx] if $settings.lines.length > idx
|
198
|
-
cmd['file-type'] = 'txt' if path == '-'
|
199
|
-
cmd['file-type'] = $settings.types[idx] if $settings.types.length > idx
|
200
|
-
cmd.read_stdin if path == '-'
|
201
|
-
cmd.read_file(path) if path != '-' and File.exist? path
|
202
|
-
cmd['data'] = "0" unless path == '-' or File.exist? path
|
203
|
-
cmds << cmd
|
179
|
+
ARGV.each_index do |idx|
|
180
|
+
path = ARGV[idx]
|
181
|
+
if path == '-'
|
182
|
+
$stderr.puts "Reading from stdin, press ^D to stop" if $stdin.tty?
|
183
|
+
else
|
184
|
+
abort "'#{path}' is a directory! Aborting." if File.directory? path
|
185
|
+
abort "File #{path} is not writable! Use -f/--force to open anyway." unless $settings.force or File.writable? path or not File.exist? path
|
186
|
+
$stderr.puts "File #{path} is not writable. Opening anyway." if not File.writable? path and File.exist? path and $settings.verbose
|
204
187
|
end
|
188
|
+
cmd = Rmate::Command.new("open")
|
189
|
+
cmd['display-name'] = "#{Socket.gethostname}:untitled (stdin)" if path == '-'
|
190
|
+
cmd['display-name'] = "#{Socket.gethostname}:#{path}" unless path == '-'
|
191
|
+
cmd['display-name'] = $settings.names[idx] if $settings.names.length > idx
|
192
|
+
cmd['real-path'] = File.expand_path(path) unless path == '-'
|
193
|
+
cmd['data-on-save'] = true
|
194
|
+
cmd['re-activate'] = true
|
195
|
+
cmd['token'] = path
|
196
|
+
cmd['selection'] = $settings.lines[idx] if $settings.lines.length > idx
|
197
|
+
cmd['file-type'] = 'txt' if path == '-'
|
198
|
+
cmd['file-type'] = $settings.types[idx] if $settings.types.length > idx
|
199
|
+
cmd.read_stdin if path == '-'
|
200
|
+
cmd.read_file(path) if path != '-' and File.exist? path
|
201
|
+
cmd['data'] = "0" unless path == '-' or File.exist? path
|
202
|
+
cmds << cmd
|
203
|
+
end
|
205
204
|
|
206
|
-
|
207
|
-
|
208
|
-
Rmate::connect_and_handle_cmds($settings.host, $settings.port, cmds)
|
209
|
-
end
|
210
|
-
Process.detach(pid)
|
211
|
-
else
|
205
|
+
unless $settings.wait
|
206
|
+
pid = fork do
|
212
207
|
Rmate::connect_and_handle_cmds($settings.host, $settings.port, cmds)
|
213
208
|
end
|
209
|
+
Process.detach(pid)
|
210
|
+
else
|
211
|
+
Rmate::connect_and_handle_cmds($settings.host, $settings.port, cmds)
|
214
212
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rmate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Strzelecki
|
@@ -21,7 +21,7 @@ authors:
|
|
21
21
|
autorequire:
|
22
22
|
bindir: bin
|
23
23
|
cert_chain: []
|
24
|
-
date:
|
24
|
+
date: 2014-02-06 00:00:00.000000000 Z
|
25
25
|
dependencies: []
|
26
26
|
description: Remote TextMate
|
27
27
|
email:
|