termup 3.0.0 → 3.0.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
- SHA1:
3
- metadata.gz: 8702c31b85da161fafb1b949d630708e70502a61
4
- data.tar.gz: 750ecb147eafa0f15e370dd9fb0116f0dcd3451d
2
+ SHA256:
3
+ metadata.gz: b6882c8235d63c1f7fc4bc1d44149f92f15a94ebd85c069cbec281e902d51afe
4
+ data.tar.gz: 92761996fa77709d9d343a73557597542b6c0752f5b37e6825717653350d059e
5
5
  SHA512:
6
- metadata.gz: 95d9c08e02a3db81ecf7b6b220835b2a8271b889d501ff836b3f22181542547f554ad298f42fd6c2703779b0fb776728575b64e12d1a1b984b9437df19fdb87e
7
- data.tar.gz: 06d58b6a0a0576dadde3cc187385bdf269a4ee48f191cc300279d32ef690c5e41711307a3deb5756a853d2b58a84f6e34017acb359d0a2821a233a8b615773cb
6
+ metadata.gz: a708875300e867c5d34b54acd53fc49ece692325268a10fb73519f0388060c65e6726907eb8e3bc08980606c29007ca571f2f7763cdfc196435725d4206c6380
7
+ data.tar.gz: 4a1afc7e41190f05a0363195def5218611aa765eef3f85f57a9a992d0fa20738dd4eaa75e06b713e4e6344ae5d23d400959959032e060fecfdba8907303b1823
data/README.md CHANGED
@@ -9,8 +9,8 @@ Compatible with Terminal.app and iTerm2 v3 on OSX Yosemite or later.
9
9
 
10
10
  ![Split Panes](https://github.com/kenn/termup/raw/master/images/split_panes.png)
11
11
 
12
- **For iTerm2 v2 or earlier:** Termup 3.0 and up is not compatible with iTerm2 v2. Install Termup 2 by `gem install termup -v=2.0.3`
13
- **For iTerm 1:** Termup 2.0 and up is not compatible with iTerm 1. Install 1.3.1 by `gem install termup -v=1.3.1`
12
+ - **For iTerm2 v2 or earlier:** Termup 3.0 and up is not compatible with iTerm2 v2. Install Termup 2 by `gem install termup -v=2.0.3`
13
+ - **For iTerm 1:** Termup 2.0 and up is not compatible with iTerm 1. Install 1.3.1 by `gem install termup -v=1.3.1`
14
14
 
15
15
  Installation
16
16
  ------------
@@ -9,13 +9,20 @@ module Termup
9
9
  end
10
10
 
11
11
  def start
12
- script = <<-JS
12
+ script = <<-JS.gsub(/^\s+/, '')
13
13
  var app = Application(#{@process.pid});
14
14
  var se = Application('System Events');
15
15
  app.activate();
16
- #{@lines.join(';')}
16
+ #{@lines.join(";\n")}
17
17
  JS
18
18
  ExecJS.exec script
19
+
20
+ rescue ExecJS::RuntimeError => e
21
+ script.split("\n").each.with_index do |line, i|
22
+ index = (i+1).to_s.rjust(3)
23
+ puts "#{index}: #{line}"
24
+ end
25
+ puts e.message
19
26
  end
20
27
 
21
28
  protected
@@ -50,7 +50,8 @@ module Termup
50
50
  end
51
51
 
52
52
  def run(command)
53
- @lines << "app.currentWindow().currentSession().write({'text':'#{command}'})"
53
+ escaped_command = command.gsub("'", %q(\\\')) # Escape single quotes
54
+ @lines << "app.currentWindow().currentSession().write({'text':'#{escaped_command}'})"
54
55
  end
55
56
 
56
57
  def set_property(key, value)
@@ -1,3 +1,3 @@
1
1
  module Termup
2
- VERSION = '3.0.0'
2
+ VERSION = '3.0.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: termup
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenn Ejima
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-13 00:00:00.000000000 Z
11
+ date: 2018-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execjs-runtimes-jxa
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  version: '0'
83
83
  requirements: []
84
84
  rubyforge_project:
85
- rubygems_version: 2.5.1
85
+ rubygems_version: 2.7.6
86
86
  signing_key:
87
87
  specification_version: 4
88
88
  summary: Setup terminal tabs with preset commands for your projects