rmate 1.5.2 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +4 -0
- data/README.mdown +5 -3
- data/Rakefile +2 -0
- data/bin/rmate +16 -20
- data/lib/rmate.rb +5 -0
- data/lib/rmate/version.rb +4 -0
- data/rmate.gemspec +17 -0
- metadata +15 -7
data/Gemfile
ADDED
data/README.mdown
CHANGED
@@ -2,13 +2,15 @@
|
|
2
2
|
|
3
3
|
If you wish to activate TextMate from an ssh session you can do so by copying the `rmate` (ruby) script to the server you are logged into. The script will connect back to TextMate running on your Mac so you should setup an ssh tunnel (as your Mac is likely behind NAT):
|
4
4
|
|
5
|
-
ssh -R 52698:127.0.0.1:52698
|
5
|
+
ssh -R 52698:127.0.0.1:52698 user@example.org
|
6
6
|
|
7
7
|
# Usage
|
8
8
|
|
9
|
-
|
9
|
+
rmate [options] file
|
10
10
|
|
11
|
-
|
11
|
+
Call `rmate --help` for a list of options. Default options can be set in `/etc/rmate.rc` or `~/.rmate.rc`, e.g.:
|
12
|
+
|
13
|
+
host: auto # prefer host from SSH_CONNECTION over localhost
|
12
14
|
port: 52698
|
13
15
|
|
14
16
|
You can also set the `RMATE_HOST` and `RMATE_PORT` environment variables.
|
data/Rakefile
ADDED
data/bin/rmate
CHANGED
@@ -8,8 +8,10 @@ require 'optparse'
|
|
8
8
|
require 'socket'
|
9
9
|
require 'tempfile'
|
10
10
|
require 'yaml'
|
11
|
+
require 'fileutils'
|
12
|
+
require 'rmate'
|
11
13
|
|
12
|
-
VERSION_STRING = 'rmate version
|
14
|
+
VERSION_STRING = 'rmate version %s (%s)' % Rmate::VERSION, Rmate::DATE
|
13
15
|
|
14
16
|
class Settings
|
15
17
|
attr_accessor :host, :port, :wait, :force, :verbose, :lines, :names, :types
|
@@ -99,26 +101,20 @@ end
|
|
99
101
|
|
100
102
|
def handle_save(socket, variables, data)
|
101
103
|
path = variables["token"]
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
if File.
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
end
|
114
|
-
end
|
115
|
-
open(temp.path, 'wb') {|file| file << data }
|
116
|
-
File.rename(temp.path, path)
|
104
|
+
if File.writable? path
|
105
|
+
$stderr.puts "Saving #{path}" if $settings.verbose
|
106
|
+
begin
|
107
|
+
backup_path = "#{path}~"
|
108
|
+
backup_path = "#{backup_path}~" while File.exists? backup_path
|
109
|
+
FileUtils.cp(path, backup_path, :preserve => true) if File.exists?(path)
|
110
|
+
open(path, 'wb') { |file| file << data }
|
111
|
+
File.unlink(backup_path) if File.exist? backup_path
|
112
|
+
rescue
|
113
|
+
# TODO We probably want some way to notify the server app that the save failed
|
114
|
+
$stderr.puts "Save failed! #{$!}" if $settings.verbose
|
117
115
|
end
|
118
|
-
|
119
|
-
|
120
|
-
# TODO We probably want some way to notify the server app that the save failed
|
121
|
-
$stderr.puts "Save failed! #{$!}" if $settings.verbose
|
116
|
+
else
|
117
|
+
$stderr.puts "Skipping save, file not writable." if $settings.verbose
|
122
118
|
end
|
123
119
|
end
|
124
120
|
|
data/lib/rmate.rb
ADDED
data/rmate.gemspec
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/rmate/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.name = 'rmate'
|
6
|
+
gem.version = Rmate::VERSION
|
7
|
+
gem.date = Rmate::DATE
|
8
|
+
gem.description = %q{Remote TextMate}
|
9
|
+
gem.summary = %q{Edit files from anywhere in TextMate 2 on your local Mac.}
|
10
|
+
gem.email = ['rmate@textmate.org']
|
11
|
+
gem.homepage = 'https://github.com/textmate/rmate/'
|
12
|
+
|
13
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
14
|
+
gem.files = `git ls-files`.split("\n")
|
15
|
+
gem.authors = `git log --pretty="format:%an"|sort -u`.split("\n")
|
16
|
+
gem.require_paths = ['lib']
|
17
|
+
end
|
metadata
CHANGED
@@ -5,15 +5,17 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 5
|
8
|
-
-
|
9
|
-
version: 1.5.
|
8
|
+
- 3
|
9
|
+
version: 1.5.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Alex Ross
|
13
13
|
- Allan Odgaard
|
14
14
|
- "Ciar\xC3\xA1n Walsh"
|
15
|
+
- Curt Sellmer
|
15
16
|
- James Edward Gray II
|
16
17
|
- John St. John
|
18
|
+
- Michael Sheets
|
17
19
|
- Nicolas Ledez
|
18
20
|
- OZAWA Sakuro
|
19
21
|
- Timothy Andrew
|
@@ -26,8 +28,9 @@ date: 2013-03-16 00:00:00 +01:00
|
|
26
28
|
default_executable:
|
27
29
|
dependencies: []
|
28
30
|
|
29
|
-
description:
|
30
|
-
email:
|
31
|
+
description: Remote TextMate
|
32
|
+
email:
|
33
|
+
- rmate@textmate.org
|
31
34
|
executables:
|
32
35
|
- rmate
|
33
36
|
extensions: []
|
@@ -35,10 +38,15 @@ extensions: []
|
|
35
38
|
extra_rdoc_files: []
|
36
39
|
|
37
40
|
files:
|
38
|
-
-
|
41
|
+
- Gemfile
|
39
42
|
- README.mdown
|
43
|
+
- Rakefile
|
44
|
+
- bin/rmate
|
45
|
+
- lib/rmate.rb
|
46
|
+
- lib/rmate/version.rb
|
47
|
+
- rmate.gemspec
|
40
48
|
has_rdoc: true
|
41
|
-
homepage: https://github.com/textmate/rmate
|
49
|
+
homepage: https://github.com/textmate/rmate/
|
42
50
|
licenses: []
|
43
51
|
|
44
52
|
post_install_message:
|
@@ -66,6 +74,6 @@ rubyforge_project:
|
|
66
74
|
rubygems_version: 1.3.6
|
67
75
|
signing_key:
|
68
76
|
specification_version: 3
|
69
|
-
summary:
|
77
|
+
summary: Edit files from anywhere in TextMate 2 on your local Mac.
|
70
78
|
test_files: []
|
71
79
|
|