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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/rmate +35 -37
  3. data/lib/rmate.rb +35 -37
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a35cd85520fd713589268e5dfd6ae96ce687e2b
4
- data.tar.gz: 79522d8ddc974740ee10e97512f91c403014bd2e
3
+ metadata.gz: cb01149adffb982c59add526c2f37ff360eb6dfe
4
+ data.tar.gz: 00fecc43b47a622770630f875e507d80488bc762
5
5
  SHA512:
6
- metadata.gz: ac30238d09636d8a2313b1484c2ea3a2fdd6e8fc2354d8310b96ddd13326e23811959d19d52aee061fc44d7d4c0df856675f3f32f4ab4e7ca7d8047c2863c62a
7
- data.tar.gz: 876dc96fb47785af45fa3ac014eb6d5f142d43dbe518bca98efe68a06cf953b2309a36421f5015d6bc30749ce4edc885e3f58297dd0fe17e8c8d63c48bb26dd2
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 = "2013-08-02"
15
- VERSION = "1.5.6"
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
- if __FILE__ == $PROGRAM_NAME
173
- $settings = Rmate::Settings.new
172
+ $settings = Rmate::Settings.new
174
173
 
175
- ## Parse arguments.
176
- cmds = []
174
+ ## Parse arguments.
175
+ cmds = []
177
176
 
178
- ARGV << '-' if ARGV.empty? and (!$stdin.tty? or $settings.wait)
177
+ ARGV << '-' if ARGV.empty? and (!$stdin.tty? or $settings.wait)
179
178
 
180
- ARGV.each_index do |idx|
181
- path = ARGV[idx]
182
- if path == '-'
183
- $stderr.puts "Reading from stdin, press ^D to stop" if $stdin.tty?
184
- else
185
- abort "'#{path}' is a directory! Aborting." if File.directory? path
186
- abort "File #{path} is not writable! Use -f/--force to open anyway." unless $settings.force or File.writable? path or not File.exist? path
187
- $stderr.puts "File #{path} is not writable. Opening anyway." if not File.writable? path and File.exist? path and $settings.verbose
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
- unless $settings.wait
207
- pid = fork do
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
@@ -11,8 +11,8 @@ require 'yaml'
11
11
  require 'fileutils'
12
12
 
13
13
  module Rmate
14
- DATE = "2013-08-02"
15
- VERSION = "1.5.6"
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
- if __FILE__ == $PROGRAM_NAME
173
- $settings = Rmate::Settings.new
172
+ $settings = Rmate::Settings.new
174
173
 
175
- ## Parse arguments.
176
- cmds = []
174
+ ## Parse arguments.
175
+ cmds = []
177
176
 
178
- ARGV << '-' if ARGV.empty? and (!$stdin.tty? or $settings.wait)
177
+ ARGV << '-' if ARGV.empty? and (!$stdin.tty? or $settings.wait)
179
178
 
180
- ARGV.each_index do |idx|
181
- path = ARGV[idx]
182
- if path == '-'
183
- $stderr.puts "Reading from stdin, press ^D to stop" if $stdin.tty?
184
- else
185
- abort "'#{path}' is a directory! Aborting." if File.directory? path
186
- abort "File #{path} is not writable! Use -f/--force to open anyway." unless $settings.force or File.writable? path or not File.exist? path
187
- $stderr.puts "File #{path} is not writable. Opening anyway." if not File.writable? path and File.exist? path and $settings.verbose
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
- unless $settings.wait
207
- pid = fork do
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.6
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: 2013-08-02 00:00:00.000000000 Z
24
+ date: 2014-02-06 00:00:00.000000000 Z
25
25
  dependencies: []
26
26
  description: Remote TextMate
27
27
  email: