termup 1.2.2 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +2 -9
- data/Gemfile.lock +10 -22
- data/{LICENSE.txt → LICENSE} +4 -2
- data/Rakefile +2 -34
- data/bin/termup +6 -2
- data/lib/termup/base.rb +11 -11
- data/lib/termup/version.rb +3 -0
- data/lib/termup.rb +4 -4
- data/termup.gemspec +15 -67
- metadata +22 -58
- data/.document +0 -5
- data/.rspec +0 -1
- data/README.rdoc +0 -19
- data/VERSION +0 -1
- data/images/split_panes.png +0 -0
- data/spec/spec_helper.rb +0 -12
- data/spec/termup_spec.rb +0 -4
data/.gitignore
ADDED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,30 +1,18 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
termup (1.3.0)
|
5
|
+
rb-appscript (~> 0.6.1)
|
6
|
+
thor (~> 0.16.0)
|
7
|
+
|
1
8
|
GEM
|
2
|
-
remote:
|
9
|
+
remote: https://rubygems.org/
|
3
10
|
specs:
|
4
|
-
diff-lcs (1.1.2)
|
5
|
-
git (1.2.5)
|
6
|
-
jeweler (1.6.4)
|
7
|
-
bundler (~> 1.0)
|
8
|
-
git (>= 1.2.5)
|
9
|
-
rake
|
10
|
-
rake (0.9.2)
|
11
11
|
rb-appscript (0.6.1)
|
12
|
-
|
13
|
-
rspec-core (~> 2.6.0)
|
14
|
-
rspec-expectations (~> 2.6.0)
|
15
|
-
rspec-mocks (~> 2.6.0)
|
16
|
-
rspec-core (2.6.4)
|
17
|
-
rspec-expectations (2.6.0)
|
18
|
-
diff-lcs (~> 1.1.2)
|
19
|
-
rspec-mocks (2.6.0)
|
20
|
-
thor (0.14.6)
|
12
|
+
thor (0.16.0)
|
21
13
|
|
22
14
|
PLATFORMS
|
23
15
|
ruby
|
24
16
|
|
25
17
|
DEPENDENCIES
|
26
|
-
|
27
|
-
jeweler (~> 1.6.0)
|
28
|
-
rb-appscript (~> 0.6.1)
|
29
|
-
rspec (~> 2.6.0)
|
30
|
-
thor (~> 0.14.6)
|
18
|
+
termup!
|
data/{LICENSE.txt → LICENSE}
RENAMED
@@ -1,4 +1,6 @@
|
|
1
|
-
Copyright (c)
|
1
|
+
Copyright (c) 2012 Kenn Ejima
|
2
|
+
|
3
|
+
MIT License
|
2
4
|
|
3
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
4
6
|
a copy of this software and associated documentation files (the
|
@@ -17,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
19
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
20
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
21
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
CHANGED
@@ -1,34 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require 'rubygems'
|
4
|
-
require 'bundler'
|
5
|
-
begin
|
6
|
-
Bundler.setup(:default, :development)
|
7
|
-
rescue Bundler::BundlerError => e
|
8
|
-
$stderr.puts e.message
|
9
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
-
exit e.status_code
|
11
|
-
end
|
12
|
-
require 'rake'
|
13
|
-
|
14
|
-
require 'jeweler'
|
15
|
-
Jeweler::Tasks.new do |gem|
|
16
|
-
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
-
gem.name = "termup"
|
18
|
-
gem.homepage = "http://github.com/kenn/termup"
|
19
|
-
gem.license = "MIT"
|
20
|
-
gem.summary = "Initialize terminal tabs with preset commands"
|
21
|
-
gem.description = "Initialize terminal tabs with preset commands"
|
22
|
-
gem.email = "kenn.ejima@gmail.com"
|
23
|
-
gem.authors = ["Kenn Ejima"]
|
24
|
-
gem.executables = ["termup"]
|
25
|
-
end
|
26
|
-
Jeweler::RubygemsDotOrgTasks.new
|
27
|
-
|
28
|
-
require 'rspec/core'
|
29
|
-
require 'rspec/core/rake_task'
|
30
|
-
RSpec::Core::RakeTask.new(:spec) do |spec|
|
31
|
-
spec.pattern = FileList['spec/**/*_spec.rb']
|
32
|
-
end
|
33
|
-
|
34
|
-
task :default => :spec
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
require "bundler/gem_tasks"
|
data/bin/termup
CHANGED
data/lib/termup/base.rb
CHANGED
@@ -9,9 +9,9 @@ module Termup
|
|
9
9
|
include Appscript
|
10
10
|
|
11
11
|
def initialize(project)
|
12
|
-
@apps = app(
|
12
|
+
@apps = app('System Events').application_processes
|
13
13
|
@frontmost = @apps.get.select{|i| i.frontmost.get }.map{|i| i.name.get }.first
|
14
|
-
return unless [
|
14
|
+
return unless ['Terminal', 'iTerm'].include?(@frontmost)
|
15
15
|
@terminal = app(@frontmost)
|
16
16
|
|
17
17
|
@project = YAML.load(File.read("#{TERMUP_DIR}/#{project}.yml"))
|
@@ -37,9 +37,9 @@ module Termup
|
|
37
37
|
def new_tab
|
38
38
|
if @got_first_tab_already
|
39
39
|
if iterm2?
|
40
|
-
@apps[@frontmost].keystroke(
|
40
|
+
@apps[@frontmost].keystroke(']', :using => :command_down)
|
41
41
|
else
|
42
|
-
@apps[@frontmost].keystroke(
|
42
|
+
@apps[@frontmost].keystroke('t', :using => :command_down)
|
43
43
|
end
|
44
44
|
end
|
45
45
|
@got_first_tab_already = true
|
@@ -50,30 +50,30 @@ module Termup
|
|
50
50
|
def split_panes
|
51
51
|
# Virtical splits
|
52
52
|
(@project['options']['iterm']['width'] - 1).times do |i|
|
53
|
-
@apps[@frontmost].keystroke(
|
53
|
+
@apps[@frontmost].keystroke('d', :using => :command_down)
|
54
54
|
end
|
55
55
|
# Back to home
|
56
|
-
@apps[@frontmost].keystroke(
|
56
|
+
@apps[@frontmost].keystroke(']', :using => :command_down)
|
57
57
|
# Horizontal splits
|
58
58
|
@project['options']['iterm']['width'].times do |i|
|
59
59
|
(@project['options']['iterm']['height'] - 1).times do |i|
|
60
|
-
@apps[@frontmost].keystroke(
|
60
|
+
@apps[@frontmost].keystroke('d', :using => [ :command_down, :shift_down ])
|
61
61
|
end
|
62
62
|
# Move to the right
|
63
|
-
@apps[@frontmost].keystroke(
|
63
|
+
@apps[@frontmost].keystroke(']', :using => :command_down)
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
67
|
def terminal?
|
68
|
-
@frontmost ==
|
68
|
+
@frontmost == 'Terminal'
|
69
69
|
end
|
70
70
|
|
71
71
|
def iterm1?
|
72
|
-
@frontmost ==
|
72
|
+
@frontmost == 'iTerm' and @terminal.version.get =~ ITERM1
|
73
73
|
end
|
74
74
|
|
75
75
|
def iterm2?
|
76
|
-
@frontmost ==
|
76
|
+
@frontmost == 'iTerm' and @terminal.version.get =~ ITERM2
|
77
77
|
end
|
78
78
|
end
|
79
79
|
end
|
data/lib/termup.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
module Termup
|
2
|
+
autoload :Cli, 'termup/cli'
|
3
|
+
autoload :Base, 'termup/base'
|
4
|
+
end
|
data/termup.gemspec
CHANGED
@@ -1,72 +1,20 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/termup/version', __FILE__)
|
5
3
|
|
6
|
-
Gem::Specification.new do |
|
7
|
-
|
8
|
-
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Kenn Ejima"]
|
6
|
+
gem.email = ["kenn.ejima@gmail.com"]
|
7
|
+
gem.description = %q{Setup terminal tabs with preset commands for your projects}
|
8
|
+
gem.summary = %q{Setup terminal tabs with preset commands for your projects}
|
9
|
+
gem.homepage = "https://github.com/kenn/termup"
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
s.executables = ["termup"]
|
17
|
-
s.extra_rdoc_files = [
|
18
|
-
"LICENSE.txt",
|
19
|
-
"README.md",
|
20
|
-
"README.rdoc"
|
21
|
-
]
|
22
|
-
s.files = [
|
23
|
-
".document",
|
24
|
-
".rspec",
|
25
|
-
"Gemfile",
|
26
|
-
"Gemfile.lock",
|
27
|
-
"LICENSE.txt",
|
28
|
-
"README.md",
|
29
|
-
"README.rdoc",
|
30
|
-
"Rakefile",
|
31
|
-
"VERSION",
|
32
|
-
"bin/termup",
|
33
|
-
"images/split_panes.png",
|
34
|
-
"lib/templates/template.yml",
|
35
|
-
"lib/termup.rb",
|
36
|
-
"lib/termup/base.rb",
|
37
|
-
"lib/termup/cli.rb",
|
38
|
-
"spec/spec_helper.rb",
|
39
|
-
"spec/termup_spec.rb",
|
40
|
-
"termup.gemspec"
|
41
|
-
]
|
42
|
-
s.homepage = %q{http://github.com/kenn/termup}
|
43
|
-
s.licenses = ["MIT"]
|
44
|
-
s.require_paths = ["lib"]
|
45
|
-
s.rubygems_version = %q{1.6.2}
|
46
|
-
s.summary = %q{Initialize terminal tabs with preset commands}
|
11
|
+
gem.files = `git ls-files`.split($\).reject{|f| f =~ /^images/ } # Exclude images
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
+
gem.name = "termup"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = Termup::VERSION
|
47
17
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
52
|
-
s.add_runtime_dependency(%q<rb-appscript>, ["~> 0.6.1"])
|
53
|
-
s.add_runtime_dependency(%q<thor>, ["~> 0.14.6"])
|
54
|
-
s.add_development_dependency(%q<rspec>, ["~> 2.6.0"])
|
55
|
-
s.add_development_dependency(%q<bundler>, ["~> 1.0.13"])
|
56
|
-
s.add_development_dependency(%q<jeweler>, ["~> 1.6.0"])
|
57
|
-
else
|
58
|
-
s.add_dependency(%q<rb-appscript>, ["~> 0.6.1"])
|
59
|
-
s.add_dependency(%q<thor>, ["~> 0.14.6"])
|
60
|
-
s.add_dependency(%q<rspec>, ["~> 2.6.0"])
|
61
|
-
s.add_dependency(%q<bundler>, ["~> 1.0.13"])
|
62
|
-
s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
|
63
|
-
end
|
64
|
-
else
|
65
|
-
s.add_dependency(%q<rb-appscript>, ["~> 0.6.1"])
|
66
|
-
s.add_dependency(%q<thor>, ["~> 0.14.6"])
|
67
|
-
s.add_dependency(%q<rspec>, ["~> 2.6.0"])
|
68
|
-
s.add_dependency(%q<bundler>, ["~> 1.0.13"])
|
69
|
-
s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
|
70
|
-
end
|
18
|
+
gem.add_runtime_dependency 'rb-appscript', '~> 0.6.1'
|
19
|
+
gem.add_runtime_dependency 'thor', '~> 0.16.0'
|
71
20
|
end
|
72
|
-
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: termup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,12 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
default_executable: termup
|
12
|
+
date: 2012-09-10 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: rb-appscript
|
17
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
18
17
|
none: false
|
19
18
|
requirements:
|
20
19
|
- - ~>
|
@@ -22,83 +21,51 @@ dependencies:
|
|
22
21
|
version: 0.6.1
|
23
22
|
type: :runtime
|
24
23
|
prerelease: false
|
25
|
-
version_requirements:
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name: thor
|
28
|
-
requirement: &2158677420 !ruby/object:Gem::Requirement
|
29
|
-
none: false
|
30
|
-
requirements:
|
31
|
-
- - ~>
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 0.14.6
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: *2158677420
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: rspec
|
39
|
-
requirement: &2158676060 !ruby/object:Gem::Requirement
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
25
|
none: false
|
41
26
|
requirements:
|
42
27
|
- - ~>
|
43
28
|
- !ruby/object:Gem::Version
|
44
|
-
version:
|
45
|
-
type: :development
|
46
|
-
prerelease: false
|
47
|
-
version_requirements: *2158676060
|
29
|
+
version: 0.6.1
|
48
30
|
- !ruby/object:Gem::Dependency
|
49
|
-
name:
|
50
|
-
requirement:
|
31
|
+
name: thor
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
51
33
|
none: false
|
52
34
|
requirements:
|
53
35
|
- - ~>
|
54
36
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
56
|
-
type: :
|
37
|
+
version: 0.16.0
|
38
|
+
type: :runtime
|
57
39
|
prerelease: false
|
58
|
-
version_requirements:
|
59
|
-
- !ruby/object:Gem::Dependency
|
60
|
-
name: jeweler
|
61
|
-
requirement: &2158673440 !ruby/object:Gem::Requirement
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
62
41
|
none: false
|
63
42
|
requirements:
|
64
43
|
- - ~>
|
65
44
|
- !ruby/object:Gem::Version
|
66
|
-
version:
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
description: Initialize terminal tabs with preset commands
|
71
|
-
email: kenn.ejima@gmail.com
|
45
|
+
version: 0.16.0
|
46
|
+
description: Setup terminal tabs with preset commands for your projects
|
47
|
+
email:
|
48
|
+
- kenn.ejima@gmail.com
|
72
49
|
executables:
|
73
50
|
- termup
|
74
51
|
extensions: []
|
75
|
-
extra_rdoc_files:
|
76
|
-
- LICENSE.txt
|
77
|
-
- README.md
|
78
|
-
- README.rdoc
|
52
|
+
extra_rdoc_files: []
|
79
53
|
files:
|
80
|
-
- .
|
81
|
-
- .rspec
|
54
|
+
- .gitignore
|
82
55
|
- Gemfile
|
83
56
|
- Gemfile.lock
|
84
|
-
- LICENSE
|
57
|
+
- LICENSE
|
85
58
|
- README.md
|
86
|
-
- README.rdoc
|
87
59
|
- Rakefile
|
88
|
-
- VERSION
|
89
60
|
- bin/termup
|
90
|
-
- images/split_panes.png
|
91
61
|
- lib/templates/template.yml
|
92
62
|
- lib/termup.rb
|
93
63
|
- lib/termup/base.rb
|
94
64
|
- lib/termup/cli.rb
|
95
|
-
-
|
96
|
-
- spec/termup_spec.rb
|
65
|
+
- lib/termup/version.rb
|
97
66
|
- termup.gemspec
|
98
|
-
|
99
|
-
|
100
|
-
licenses:
|
101
|
-
- MIT
|
67
|
+
homepage: https://github.com/kenn/termup
|
68
|
+
licenses: []
|
102
69
|
post_install_message:
|
103
70
|
rdoc_options: []
|
104
71
|
require_paths:
|
@@ -109,9 +76,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
109
76
|
- - ! '>='
|
110
77
|
- !ruby/object:Gem::Version
|
111
78
|
version: '0'
|
112
|
-
segments:
|
113
|
-
- 0
|
114
|
-
hash: 2719946919007627959
|
115
79
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
80
|
none: false
|
117
81
|
requirements:
|
@@ -120,8 +84,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
84
|
version: '0'
|
121
85
|
requirements: []
|
122
86
|
rubyforge_project:
|
123
|
-
rubygems_version: 1.
|
87
|
+
rubygems_version: 1.8.24
|
124
88
|
signing_key:
|
125
89
|
specification_version: 3
|
126
|
-
summary:
|
90
|
+
summary: Setup terminal tabs with preset commands for your projects
|
127
91
|
test_files: []
|
data/.document
DELETED
data/.rspec
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--color
|
data/README.rdoc
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
= termup
|
2
|
-
|
3
|
-
Description goes here.
|
4
|
-
|
5
|
-
== Contributing to termup
|
6
|
-
|
7
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
8
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
9
|
-
* Fork the project
|
10
|
-
* Start a feature/bugfix branch
|
11
|
-
* Commit and push until you are happy with your contribution
|
12
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
13
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
14
|
-
|
15
|
-
== Copyright
|
16
|
-
|
17
|
-
Copyright (c) 2011 Kenn Ejima. See LICENSE.txt for
|
18
|
-
further details.
|
19
|
-
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.2.2
|
data/images/split_panes.png
DELETED
Binary file
|
data/spec/spec_helper.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
-
require 'rspec'
|
4
|
-
require 'termup'
|
5
|
-
|
6
|
-
# Requires supporting files with custom matchers and macros, etc,
|
7
|
-
# in ./support/ and its subdirectories.
|
8
|
-
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
9
|
-
|
10
|
-
RSpec.configure do |config|
|
11
|
-
|
12
|
-
end
|
data/spec/termup_spec.rb
DELETED