multiterm 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c91f850676427c37e644cc97c1a053d80885dfd4
4
+ data.tar.gz: bf7e79b289b52770c0dc9e0a20838f71d1bd9553
5
+ SHA512:
6
+ metadata.gz: 740e51dd236fefa9186ffa79a00b28a660f2a89cdea74210230900c76110e96469f814d35035b885739d18e44aad4687c065edbc962acb657e532ed76085fdd9
7
+ data.tar.gz: 1b022cc38b237ee0eb2c6cb8859fb55a09014aecfd5b62e6b078a35704519d35563efbb575021f42eaefd0fed50ec5b1f5a506b41b77e85c0fb10d7efdc11f6d
data/CHANGELOG ADDED
@@ -0,0 +1,3 @@
1
+ == 0.1.0
2
+
3
+ * initial release
data/Gemfile ADDED
@@ -0,0 +1,15 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'osaka'
4
+
5
+ group :development do
6
+ gem 'launchy', '>= 2.1.1'
7
+ gem 'yard'
8
+ gem 'kramdown'
9
+ end
10
+
11
+ group :test, :development do
12
+ gem 'rake', '>= 0.9.0'
13
+ gem 'rspec', '>= 2.11.0'
14
+ gem 'rcov', '>= 0.9.9', :platform => :mri_18
15
+ end
data/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
data/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # MultiTerm
2
+
3
+ <dl>
4
+ <dt>Homepage</dt><dd><a href="https://multiterm.github.io/">MultiTerm</a></dd>
5
+ <dt>Author</dt><dd><a href="mailto:bob@sporkmonger.com">Bob Aman</a></dd>
6
+ <dt>Copyright</dt><dd>Copyright © 2014 Bob Aman</dd>
7
+ <dt>License</dt><dd>Apache 2.0</dd>
8
+ </dl>
9
+
10
+ # Description
11
+
12
+ MultiTerm is a rudimentary terminal multiplexer for OS X that uses the built-in Terminal.app tabs.
13
+
14
+ # Features
15
+
16
+ * A feature list goes here.
17
+
18
+ # Example Usage
19
+
20
+ # Some code goes here.
21
+
22
+ # Install
23
+
24
+ * sudo gem install multiterm
data/Rakefile ADDED
@@ -0,0 +1,42 @@
1
+ lib_dir = File.expand_path(File.join(File.dirname(__FILE__), 'lib'))
2
+ $:.unshift(lib_dir)
3
+ $:.uniq!
4
+
5
+ require 'rubygems'
6
+ require 'rake'
7
+
8
+ require File.join(File.dirname(__FILE__), 'lib/multiterm', 'version')
9
+
10
+ PKG_DISPLAY_NAME = 'MultiTerm'
11
+ PKG_NAME = PKG_DISPLAY_NAME.downcase
12
+ PKG_VERSION = MultiTerm::VERSION::STRING
13
+ PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
14
+
15
+ RELEASE_NAME = "REL #{PKG_VERSION}"
16
+ GIT_HUB_URL = "https://github.com/sporkmonger/multiterm"
17
+
18
+ PKG_AUTHOR = 'Bob Aman'
19
+ PKG_AUTHOR_EMAIL = 'bob@sporkmonger.com'
20
+ PKG_HOMEPAGE = GIT_HUB_URL
21
+ PKG_SUMMARY = 'Package Summary'
22
+ PKG_DESCRIPTION = <<-TEXT
23
+ MultiTerm is a rudimentary terminal multiplexer for OS X that uses the built-in Terminal.app tabs.
24
+ TEXT
25
+
26
+ PKG_FILES = FileList[
27
+ 'lib/**/*', 'spec/**/*', 'vendor/**/*',
28
+ 'tasks/**/*', 'website/**/*',
29
+ '[A-Z]*', 'Rakefile'
30
+ ].exclude(/database\.yml/).exclude(/[_\.]git$/).exclude(/Gemfile\.lock/)
31
+
32
+ RCOV_ENABLED = (RUBY_PLATFORM != 'java' && RUBY_VERSION =~ /^1\.8/)
33
+ if RCOV_ENABLED
34
+ task :default => 'spec:verify'
35
+ else
36
+ task :default => 'spec'
37
+ end
38
+
39
+ WINDOWS = (RUBY_PLATFORM =~ /mswin|win32|mingw|bccwin|cygwin/) rescue false
40
+ SUDO = WINDOWS ? '' : ('sudo' unless ENV['SUDOLESS'])
41
+
42
+ Dir['tasks/**/*.rake'].each { |rake| load rake }
data/lib/multiterm.rb ADDED
@@ -0,0 +1,61 @@
1
+ # Copyright 2014 Bob Aman
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'multiterm/version'
16
+ require 'multiterm/terminal'
17
+
18
+ module MultiTerm
19
+ ##
20
+ # Memoized copy of the default configuration.
21
+ def self.configuration
22
+ @@configuration ||= read_configuration
23
+ end
24
+
25
+ ##
26
+ # Loads the configuration file for the current path.
27
+ def self.read_configuration(path=nil)
28
+ if path != nil && File.exists?(path) && File.directory?(path)
29
+ current_path = path
30
+ elsif path != nil && File.exists?(path) && !File.directory?(path)
31
+ current_path = File.dirname(path)
32
+ else
33
+ current_path = File.expand_path('.')
34
+ end
35
+ home_path = File.expand_path('~')
36
+ search_path = current_path
37
+ while search_path != '/' && search_path != home_path
38
+ if File.exists?(File.join(search_path, '.multiterm.yml'))
39
+ settings = YAML.load(File.read(File.join(search_path, '.multiterm.yml')))
40
+ return settings if settings
41
+ end
42
+ search_path = File.expand_path(File.join(search_path, '..'))
43
+ end
44
+ return nil
45
+ end
46
+
47
+ def self.execute
48
+ if configuration
49
+ app = Osaka::Terminal.new
50
+ app.activate
51
+ for tab_config in configuration[:tabs]
52
+ app.new_tab(
53
+ script: tab_config[:script],
54
+ name: tab_config[:name]
55
+ )
56
+ end
57
+ else
58
+ puts "Missing '.multiterm.yml' configuration."
59
+ end
60
+ end
61
+ end
@@ -0,0 +1,35 @@
1
+ require 'osaka'
2
+
3
+ module Osaka
4
+ class Terminal < TypicalApplication
5
+ def initialize
6
+ super "Terminal"
7
+ end
8
+
9
+ def new_tab(options={})
10
+ tab_name = options[:name]
11
+ script = options[:script]
12
+ control.keystroke('t', :command)
13
+ if tab_name != nil
14
+ tab_name.gsub!(/[^a-zA-Z0-9 \_\-\.]/, '')
15
+
16
+ # This low-level block is needed because Osaka naively splits
17
+ # on ';' character, which we need to use mid-script.
18
+ script_commands = [
19
+ 'tell application "Terminal"',
20
+ 'do script "printf \'\\\\\e]1;' + tab_name.to_s + '\\\\\a\'; clear" in front window',
21
+ 'end tell'
22
+ ].map { |c| c.gsub("\"", "\\\"") }
23
+ escaped_commands = ""
24
+ script_commands.each { |l| escaped_commands += " -e \"#{l.strip}\"" }
25
+ new_tab_output = `osascript#{escaped_commands} 2>&1`
26
+ end
27
+ if script != nil
28
+ # LOL, yes, we need to triple-escape for double quotes.
29
+ # Single quotes should Just Work.
30
+ control.tell('do script "' + script.gsub("\"", "\\\\\\\"") + '" in front window')
31
+ end
32
+ return nil
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,26 @@
1
+ # Copyright 2014 Bob Aman
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ # Used to prevent the class/module from being loaded more than once
16
+ unless defined? MultiTerm::VERSION
17
+ module MultiTerm
18
+ module VERSION
19
+ MAJOR = 0
20
+ MINOR = 0
21
+ TINY = 1
22
+
23
+ STRING = [MAJOR, MINOR, TINY].join('.')
24
+ end
25
+ end
26
+ end
data/spec/spec.opts ADDED
@@ -0,0 +1,2 @@
1
+ --colour
2
+ --format specdoc
@@ -0,0 +1,7 @@
1
+ spec_dir = File.expand_path(File.dirname(__FILE__))
2
+ lib_dir = File.expand_path(File.join(spec_dir, '../lib'))
3
+
4
+ $:.unshift(lib_dir)
5
+ $:.uniq!
6
+
7
+ require 'multiterm'
@@ -0,0 +1,2 @@
1
+ desc 'Remove all build products'
2
+ task 'clobber'
data/tasks/gem.rake ADDED
@@ -0,0 +1,85 @@
1
+ require "rubygems/package_task"
2
+
3
+ namespace :gem do
4
+ GEM_SPEC = Gem::Specification.new do |s|
5
+ s.name = PKG_NAME
6
+ s.version = PKG_VERSION
7
+ s.summary = PKG_SUMMARY
8
+ s.description = PKG_DESCRIPTION
9
+
10
+ s.files = PKG_FILES.to_a
11
+
12
+ s.has_rdoc = false
13
+ s.extra_rdoc_files = %w( README.md )
14
+ s.rdoc_options.concat ["--main", "README.md"]
15
+
16
+ if !s.respond_to?(:add_development_dependency)
17
+ puts "Cannot build Gem with this version of RubyGems."
18
+ exit(1)
19
+ end
20
+
21
+ s.add_development_dependency("rake", ">= 0.7.3")
22
+ s.add_development_dependency("rspec", ">= 2.9.0")
23
+ s.add_development_dependency("launchy", ">= 0.3.2")
24
+
25
+ s.require_path = "lib"
26
+
27
+ s.author = "Bob Aman"
28
+ s.email = "bob@sporkmonger.com"
29
+ s.homepage = PKG_HOMEPAGE
30
+ s.license = "Apache License 2.0"
31
+ end
32
+
33
+ Gem::PackageTask.new(GEM_SPEC) do |p|
34
+ p.gem_spec = GEM_SPEC
35
+ p.need_tar = true
36
+ p.need_zip = true
37
+ end
38
+
39
+ desc "Generates .gemspec file"
40
+ task :gemspec do
41
+ spec_string = GEM_SPEC.to_ruby
42
+
43
+ begin
44
+ Thread.new { eval("$SAFE = 3\n#{spec_string}", binding) }.join
45
+ rescue
46
+ abort "unsafe gemspec: #{$!}"
47
+ else
48
+ File.open("#{GEM_SPEC.name}.gemspec", 'w') do |file|
49
+ file.write spec_string
50
+ end
51
+ end
52
+ end
53
+
54
+ desc "Show information about the gem"
55
+ task :debug do
56
+ puts GEM_SPEC.to_ruby
57
+ end
58
+
59
+ desc "Install the gem"
60
+ task :install => ["clobber", "gem:package"] do
61
+ sh "#{SUDO} gem install --local pkg/#{GEM_SPEC.full_name}"
62
+ end
63
+
64
+ desc "Uninstall the gem"
65
+ task :uninstall do
66
+ installed_list = Gem.source_index.find_name(PKG_NAME)
67
+ if installed_list &&
68
+ (installed_list.collect { |s| s.version.to_s}.include?(PKG_VERSION))
69
+ sh(
70
+ "#{SUDO} gem uninstall --version '#{PKG_VERSION}' " +
71
+ "--ignore-dependencies --executables #{PKG_NAME}"
72
+ )
73
+ end
74
+ end
75
+
76
+ desc "Reinstall the gem"
77
+ task :reinstall => [:uninstall, :install]
78
+ end
79
+
80
+ desc "Alias to gem:package"
81
+ task "gem" => "gem:package"
82
+
83
+ task "gem:release" => "gem:gemspec"
84
+
85
+ task "clobber" => ["gem:clobber_package"]
data/tasks/git.rake ADDED
@@ -0,0 +1,40 @@
1
+ namespace :git do
2
+ namespace :tag do
3
+ desc 'List tags from the Git repository'
4
+ task :list do
5
+ tags = `git tag -l`
6
+ tags.gsub!("\r", '')
7
+ tags = tags.split("\n").sort {|a, b| b <=> a }
8
+ puts tags.join("\n")
9
+ end
10
+
11
+ desc 'Create a new tag in the Git repository'
12
+ task :create do
13
+ changelog = File.open('CHANGELOG', 'r') { |file| file.read }
14
+ puts '-' * 80
15
+ puts changelog
16
+ puts '-' * 80
17
+ puts
18
+
19
+ v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z'
20
+ abort "Versions don't match #{v} vs #{PKG_VERSION}" if v != PKG_VERSION
21
+
22
+ tag = "#{PKG_NAME}-#{PKG_VERSION}"
23
+ msg = "Release #{PKG_NAME}-#{PKG_VERSION}"
24
+
25
+ existing_tags = `git tag -l #{PKG_NAME}-*`.split("\n")
26
+ if existing_tags.include?(tag)
27
+ warn('Tag already exists, deleting...')
28
+ unless system "git tag -d #{tag}"
29
+ abort 'Tag deletion failed.'
30
+ end
31
+ end
32
+ puts "Creating git tag '#{tag}'..."
33
+ unless system "git tag -a -m \"#{msg}\" #{tag}"
34
+ abort 'Tag creation failed.'
35
+ end
36
+ end
37
+ end
38
+ end
39
+
40
+ task 'gem:release' => 'git:tag:create'
@@ -0,0 +1,22 @@
1
+ namespace :metrics do
2
+ task :lines do
3
+ lines, codelines, total_lines, total_codelines = 0, 0, 0, 0
4
+ for file_name in FileList['lib/**/*.rb']
5
+ f = File.open(file_name)
6
+ while line = f.gets
7
+ lines += 1
8
+ next if line =~ /^\s*$/
9
+ next if line =~ /^\s*#/
10
+ codelines += 1
11
+ end
12
+ puts "L: #{sprintf('%4d', lines)}, " +
13
+ "LOC #{sprintf('%4d', codelines)} | #{file_name}"
14
+ total_lines += lines
15
+ total_codelines += codelines
16
+
17
+ lines, codelines = 0, 0
18
+ end
19
+
20
+ puts "Total: Lines #{total_lines}, LOC #{total_codelines}"
21
+ end
22
+ end
data/tasks/spec.rake ADDED
@@ -0,0 +1,57 @@
1
+ require "rspec/core/rake_task"
2
+
3
+ namespace :spec do
4
+ RSpec::Core::RakeTask.new(:rcov) do |t|
5
+ t.pattern = FileList['spec/**/*_spec.rb']
6
+ t.rspec_opts = ['--color', '--format', 'documentation']
7
+
8
+ t.rcov = RCOV_ENABLED
9
+ t.rcov_opts = [
10
+ '--exclude', 'lib\\/compat',
11
+ '--exclude', 'spec',
12
+ '--exclude', '\\.rvm\\/gems',
13
+ '--exclude', '1\\.8\\/gems',
14
+ '--exclude', '1\\.9\\/gems',
15
+ '--exclude', '\\.rvm',
16
+ '--exclude', '\\/Library\\/Ruby',
17
+ ]
18
+ end
19
+
20
+ RSpec::Core::RakeTask.new(:normal) do |t|
21
+ t.pattern = FileList['spec/**/*_spec.rb'].exclude(/compat/)
22
+ t.rspec_opts = ['--color', '--format', 'documentation']
23
+ t.rcov = false
24
+ end
25
+
26
+ RSpec::Core::RakeTask.new(:all) do |t|
27
+ t.pattern = FileList['spec/**/*_spec.rb']
28
+ t.rspec_opts = ['--color', '--format', 'documentation']
29
+ t.rcov = false
30
+ end
31
+
32
+ desc "Generate HTML Specdocs for all specs"
33
+ RSpec::Core::RakeTask.new(:specdoc) do |t|
34
+ specdoc_path = File.expand_path(
35
+ File.join(File.dirname(__FILE__), '..', 'documentation')
36
+ )
37
+ Dir.mkdir(specdoc_path) if !File.exist?(specdoc_path)
38
+
39
+ output_file = File.join(specdoc_path, 'index.html')
40
+ t.pattern = FileList['spec/**/*_spec.rb']
41
+ t.rspec_opts = ["--format", "\"html:#{output_file}\"", "--diff"]
42
+ t.fail_on_error = false
43
+ end
44
+
45
+ namespace :rcov do
46
+ desc "Browse the code coverage report."
47
+ task :browse => "spec:rcov" do
48
+ require "launchy"
49
+ Launchy::Browser.run("coverage/index.html")
50
+ end
51
+ end
52
+ end
53
+
54
+ desc "Alias to spec:normal"
55
+ task "spec" => "spec:normal"
56
+
57
+ task "clobber" => ["spec:clobber_rcov"]
data/tasks/yard.rake ADDED
@@ -0,0 +1,26 @@
1
+ require 'rake'
2
+
3
+ begin
4
+ require 'yard'
5
+ require 'yard/rake/yardoc_task'
6
+
7
+ namespace :doc do
8
+ desc 'Generate Yardoc documentation'
9
+ YARD::Rake::YardocTask.new do |yardoc|
10
+ yardoc.name = 'yard'
11
+ yardoc.options = ['--verbose']
12
+ yardoc.files = [
13
+ 'lib/**/*.rb', 'ext/**/*.c', 'README', 'CHANGELOG', 'LICENSE'
14
+ ]
15
+ end
16
+ end
17
+
18
+ task 'clobber' => ['doc:clobber_yard']
19
+
20
+ desc 'Alias to doc:yard'
21
+ task 'doc' => 'doc:yard'
22
+ rescue LoadError
23
+ # If yard isn't available, it's not the end of the world
24
+ desc 'Alias to doc:rdoc'
25
+ task 'doc' => 'doc:rdoc'
26
+ end
@@ -0,0 +1,95 @@
1
+ <!DOCTYPE html>
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3
+ <head>
4
+ <meta charset="utf-8"/>
5
+ <title>MultiTerm</title>
6
+ <style type="text/css">
7
+ * {
8
+ font-size: 100%;
9
+ margin: 0;
10
+ padding: 0;
11
+ }
12
+
13
+ body {
14
+ font-family: "Lucida Grande", Verdana, sans-serif;
15
+ margin: 1em;
16
+ }
17
+
18
+ a {
19
+ color: #880000;
20
+ }
21
+
22
+ a:visited {
23
+ color: #333333;
24
+ }
25
+
26
+ h1 {
27
+ font-size: 2em;
28
+ margin: 0 0 0.8em 0;
29
+ text-align: center;
30
+ }
31
+
32
+ h2 {
33
+ font-size: 1em;
34
+ margin: 0.8em 0;
35
+ }
36
+
37
+ p {
38
+ margin: 0.8em 0;
39
+ }
40
+
41
+ ul {
42
+ font-size: 0.9em;
43
+ margin: 0 0 0 1.5em;
44
+ }
45
+
46
+ div {
47
+ width: 50%;
48
+ margin: 0 auto;
49
+ padding: 0.8em;
50
+ background-color: #AA5852;
51
+ border: 2px solid #C2645D;
52
+ }
53
+
54
+ @media print {
55
+ body {
56
+ font-size: 0.9em;
57
+ }
58
+
59
+ a {
60
+ text-decoration: none;
61
+ color: #000;
62
+ }
63
+ }
64
+ </style>
65
+ </head>
66
+ <body>
67
+ <h1>MultiTerm</h1>
68
+ <div>
69
+ <p>
70
+ MultiTerm is a rudimentary terminal multiplexer for OS X that uses the built-in Terminal.app tabs.
71
+ </p>
72
+ <ul>
73
+ <li>
74
+ <a href="https://multiterm.github.io/">
75
+ Project Page
76
+ </a>
77
+ </li>
78
+ <li>
79
+ <a href="https://github.com/sporkmonger/multiterm/tree/">
80
+ GitHub Page
81
+ </a>
82
+ </li>
83
+ <li><a href="/api/">API</a></li>
84
+ <li><a href="/specdoc/">Specifications</a></li>
85
+ <li><a href="/coverage/">Code Coverage</a></li>
86
+ </ul>
87
+ <p>
88
+ You know what to do:
89
+ </p>
90
+ <p>
91
+ <code>sudo gem install multiterm</code>
92
+ </p>
93
+ </div>
94
+ </body>
95
+ </html>
metadata ADDED
@@ -0,0 +1,106 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: multiterm
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Bob Aman
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-06-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.7.3
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 0.7.3
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 2.9.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 2.9.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: launchy
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 0.3.2
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 0.3.2
55
+ description: |
56
+ MultiTerm is a rudimentary terminal multiplexer for OS X that uses the built-in Terminal.app tabs.
57
+ email: bob@sporkmonger.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files:
61
+ - README.md
62
+ files:
63
+ - CHANGELOG
64
+ - Gemfile
65
+ - LICENSE
66
+ - README.md
67
+ - Rakefile
68
+ - lib/multiterm.rb
69
+ - lib/multiterm/terminal.rb
70
+ - lib/multiterm/version.rb
71
+ - spec/spec.opts
72
+ - spec/spec_helper.rb
73
+ - tasks/clobber.rake
74
+ - tasks/gem.rake
75
+ - tasks/git.rake
76
+ - tasks/metrics.rake
77
+ - tasks/spec.rake
78
+ - tasks/yard.rake
79
+ - website/index.html
80
+ homepage: https://github.com/sporkmonger/multiterm
81
+ licenses:
82
+ - Apache License 2.0
83
+ metadata: {}
84
+ post_install_message:
85
+ rdoc_options:
86
+ - "--main"
87
+ - README.md
88
+ require_paths:
89
+ - lib
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ requirements: []
101
+ rubyforge_project:
102
+ rubygems_version: 2.2.2
103
+ signing_key:
104
+ specification_version: 4
105
+ summary: Package Summary
106
+ test_files: []