tmuxinator 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/.rspec +1 -1
  4. data/.travis.yml +5 -0
  5. data/CHANGELOG.md +36 -0
  6. data/CONTRIBUTING.md +29 -0
  7. data/Gemfile +4 -7
  8. data/{LICENSE.txt → LICENSE} +1 -1
  9. data/README.md +128 -118
  10. data/Rakefile +1 -72
  11. data/bin/mux +8 -3
  12. data/bin/tmuxinator +8 -3
  13. data/completion/tmuxinator.bash +18 -0
  14. data/completion/tmuxinator.zsh +20 -0
  15. data/lib/tmuxinator.rb +13 -7
  16. data/lib/tmuxinator/assets/sample.yml +24 -11
  17. data/lib/tmuxinator/assets/template.erb +47 -0
  18. data/lib/tmuxinator/cli.rb +121 -145
  19. data/lib/tmuxinator/config.rb +92 -0
  20. data/lib/tmuxinator/deprecations.rb +19 -0
  21. data/lib/tmuxinator/pane.rb +36 -0
  22. data/lib/tmuxinator/project.rb +142 -0
  23. data/lib/tmuxinator/util.rb +14 -0
  24. data/lib/tmuxinator/version.rb +3 -0
  25. data/lib/tmuxinator/window.rb +76 -0
  26. data/spec/factories/projects.rb +17 -0
  27. data/spec/fixtures/sample.deprecations.yml +35 -0
  28. data/spec/fixtures/sample.yml +35 -0
  29. data/spec/lib/tmuxinator/cli_spec.rb +230 -0
  30. data/spec/lib/tmuxinator/config_spec.rb +121 -0
  31. data/spec/lib/tmuxinator/pane_spec.rb +7 -0
  32. data/spec/lib/tmuxinator/project_spec.rb +209 -0
  33. data/spec/lib/tmuxinator/util_spec.rb +4 -0
  34. data/spec/lib/tmuxinator/window_spec.rb +62 -0
  35. data/spec/spec_helper.rb +28 -8
  36. data/tmuxinator.gemspec +47 -65
  37. metadata +186 -62
  38. data/.document +0 -5
  39. data/Gemfile.lock +0 -28
  40. data/TODO +0 -4
  41. data/VERSION +0 -1
  42. data/bin/tmuxinator_completion +0 -29
  43. data/lib/tmuxinator/assets/tmux_config.tmux +0 -37
  44. data/lib/tmuxinator/config_writer.rb +0 -104
  45. data/lib/tmuxinator/helper.rb +0 -19
  46. data/spec/tmuxinator_spec.rb +0 -54
@@ -0,0 +1,4 @@
1
+ require "spec_helper"
2
+
3
+ describe Tmuxinator::Util do
4
+ end
@@ -0,0 +1,62 @@
1
+ require "spec_helper"
2
+
3
+ describe Tmuxinator::Window do
4
+ let(:yaml) do
5
+ {
6
+ "editor" => {
7
+ "pre" => ["echo 'I get run in each pane. Before each pane command!'", nil],
8
+ "layout" => "main-vertical",
9
+ "panes" => ["vim", nil, "top"]
10
+ }
11
+ }
12
+ end
13
+
14
+ let(:window) { Tmuxinator::Window.new(yaml, 0, nil) }
15
+
16
+ describe "#initialize" do
17
+ it "creates an instance" do
18
+ expect(window).to be_a(Tmuxinator::Window)
19
+ end
20
+ end
21
+
22
+ describe "#build_panes" do
23
+ it "creates the list of panes" do
24
+ expect(window.panes).to_not be_empty
25
+ end
26
+ end
27
+
28
+ describe "#pre" do
29
+ context "pre is a string" do
30
+ before do
31
+ yaml["editor"]["pre"] = "vim"
32
+ end
33
+
34
+ it "returns the pre command" do
35
+ expect(window.pre).to eq "vim"
36
+ end
37
+ end
38
+
39
+
40
+ context "pre is not present" do
41
+ before do
42
+ yaml["editor"].delete("pre")
43
+ end
44
+
45
+ it "returns an empty string" do
46
+ expect(window.pre).to eq ""
47
+ end
48
+ end
49
+ end
50
+
51
+ describe "#build_panes" do
52
+ context "no panes" do
53
+ before do
54
+ yaml["editor"]["panes"] = "vim"
55
+ end
56
+
57
+ it "creates one pane" do
58
+ expect(window.panes).to be_a(Tmuxinator::Pane)
59
+ end
60
+ end
61
+ end
62
+ end
data/spec/spec_helper.rb CHANGED
@@ -1,14 +1,34 @@
1
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
- $LOAD_PATH.unshift(File.dirname(__FILE__))
3
- require 'rspec'
4
- require 'tmuxinator'
1
+ require "coveralls"
2
+ require "simplecov"
3
+ require "pry"
5
4
 
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}
5
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
6
+ SimpleCov::Formatter::HTMLFormatter,
7
+ Coveralls::SimpleCov::Formatter
8
+ ]
9
+ SimpleCov.start
9
10
 
10
- SAMPLE_CONFIG = File.join(File.dirname(__FILE__), '..', 'lib', 'tmuxinator', 'assets', 'sample.yml')
11
+ require "tmuxinator"
12
+ require "factory_girl"
13
+
14
+ FactoryGirl.find_definitions
11
15
 
12
16
  RSpec.configure do |config|
17
+ config.order = "random"
18
+ end
19
+
20
+ # Copied from minitest.
21
+ def capture_io
22
+ require 'stringio'
23
+
24
+ orig_stdout, orig_stderr = $stdout, $stderr
25
+ captured_stdout, captured_stderr = StringIO.new, StringIO.new
26
+ $stdout, $stderr = captured_stdout, captured_stderr
27
+
28
+ yield
13
29
 
30
+ return captured_stdout.string, captured_stderr.string
31
+ ensure
32
+ $stdout = orig_stdout
33
+ $stderr = orig_stderr
14
34
  end
data/tmuxinator.gemspec CHANGED
@@ -1,71 +1,53 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
- # -*- encoding: utf-8 -*-
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "tmuxinator/version"
5
5
 
6
- Gem::Specification.new do |s|
7
- s.name = "tmuxinator"
8
- s.version = "0.5.0"
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "tmuxinator"
8
+ spec.version = Tmuxinator::VERSION
9
+ spec.authors = ["Allen Bargi"]
10
+ spec.email = ["allen.bargi@gmail.com"]
11
+ spec.description = %q{Create and manage complex tmux sessions easily.}
12
+ spec.summary = %q{Create and manage complex tmux sessions easily.}
13
+ spec.homepage = "https://github.com/aziz/tmuxinator"
14
+ spec.license = "MIT"
9
15
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Allen Bargi"]
12
- s.date = "2011-10-10"
13
- s.description = "Create and manage complex tmux sessions easily."
14
- s.email = "allen.bargi@gmail.com"
15
- s.executables = ["mux", "tmuxinator", "tmuxinator_completion"]
16
- s.extra_rdoc_files = [
17
- "LICENSE.txt",
18
- "README.md",
19
- "TODO"
20
- ]
21
- s.files = [
22
- ".document",
23
- ".rspec",
24
- "Gemfile",
25
- "Gemfile.lock",
26
- "LICENSE.txt",
27
- "README.md",
28
- "Rakefile",
29
- "VERSION",
30
- "bin/mux",
31
- "bin/tmuxinator",
32
- "bin/tmuxinator_completion",
33
- "lib/tmuxinator.rb",
34
- "lib/tmuxinator/assets/sample.yml",
35
- "lib/tmuxinator/assets/tmux_config.tmux",
36
- "lib/tmuxinator/cli.rb",
37
- "lib/tmuxinator/config_writer.rb",
38
- "lib/tmuxinator/helper.rb",
39
- "spec/spec_helper.rb",
40
- "spec/tmuxinator_spec.rb",
41
- "tmuxinator.gemspec"
42
- ]
43
- s.homepage = "http://github.com/aziz/tmuxinator"
44
- s.licenses = ["MIT"]
45
- s.post_install_message = "\n __________________________________________________________\n ..........................................................\n\n Thank you for installing tmuxinator\n Please be sure to to drop a line in your ~/.bashrc file, similar \n to RVM if you've used that before:\n\n [[ -s $HOME/.tmuxinator/scripts/tmuxinator ]] && source $HOME/.tmuxinator/scripts/tmuxinator\n \n also ensure that you've set these variables in your ENV:\n \n $EDITOR, $SHELL\n \n you can run `tmuxinator doctor` to make sure everything is set.\n happy tmuxing with tmuxinator!\n\n ..........................................................\n __________________________________________________________\n \n "
46
- s.require_paths = ["lib"]
47
- s.rubygems_version = "1.8.11"
48
- s.summary = "Create and manage complex tmux sessions easily."
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
49
20
 
50
- if s.respond_to? :specification_version then
51
- s.specification_version = 3
21
+ spec.post_install_message = %q{
22
+ __________________________________________________________
23
+ ..........................................................
52
24
 
53
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
54
- s.add_development_dependency(%q<rspec>, ["~> 2.6.0"])
55
- s.add_development_dependency(%q<bundler>, ["~> 1.0.18"])
56
- s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
57
- s.add_development_dependency(%q<rcov>, ["~> 0.9.10"])
58
- else
59
- s.add_dependency(%q<rspec>, ["~> 2.6.0"])
60
- s.add_dependency(%q<bundler>, ["~> 1.0.18"])
61
- s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
62
- s.add_dependency(%q<rcov>, ["~> 0.9.10"])
63
- end
64
- else
65
- s.add_dependency(%q<rspec>, ["~> 2.6.0"])
66
- s.add_dependency(%q<bundler>, ["~> 1.0.18"])
67
- s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
68
- s.add_dependency(%q<rcov>, ["~> 0.9.10"])
69
- end
25
+ Thank you for installing tmuxinator.
26
+
27
+ Make sure that you've set these variables in your ENV:
28
+
29
+ $EDITOR, $SHELL
30
+
31
+ You can run `tmuxinator doctor` to make sure everything is set.
32
+ Happy tmuxing with tmuxinator!
33
+
34
+ ..........................................................
35
+ __________________________________________________________
36
+ }
37
+
38
+ spec.required_rubygems_version = ">= 1.8.23"
39
+
40
+ spec.add_dependency "thor"
41
+ spec.add_dependency "activesupport"
42
+ spec.add_dependency "erubis"
43
+
44
+ spec.add_development_dependency "bundler", "~> 1.3"
45
+ spec.add_development_dependency "rspec", ">= 2.14.0"
46
+ spec.add_development_dependency "simplecov"
47
+ spec.add_development_dependency "coveralls"
48
+ spec.add_development_dependency "awesome_print"
49
+ spec.add_development_dependency "pry"
50
+ spec.add_development_dependency "pry-nav"
51
+ spec.add_development_dependency "factory_girl"
70
52
  end
71
53
 
metadata CHANGED
@@ -1,126 +1,250 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tmuxinator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
5
- prerelease:
4
+ version: 0.6.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Allen Bargi
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2011-10-10 00:00:00.000000000Z
11
+ date: 2013-07-26 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- name: rspec
16
- requirement: &70349397703380 !ruby/object:Gem::Requirement
17
- none: false
14
+ name: thor
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ~>
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
- version: 2.6.0
22
- type: :development
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: activesupport
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
23
35
  prerelease: false
24
- version_requirements: *70349397703380
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: erubis
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
25
55
  - !ruby/object:Gem::Dependency
26
56
  name: bundler
27
- requirement: &70349397702580 !ruby/object:Gem::Requirement
28
- none: false
57
+ requirement: !ruby/object:Gem::Requirement
29
58
  requirements:
30
59
  - - ~>
31
60
  - !ruby/object:Gem::Version
32
- version: 1.0.18
61
+ version: '1.3'
33
62
  type: :development
34
63
  prerelease: false
35
- version_requirements: *70349397702580
36
- - !ruby/object:Gem::Dependency
37
- name: jeweler
38
- requirement: &70349397701780 !ruby/object:Gem::Requirement
39
- none: false
64
+ version_requirements: !ruby/object:Gem::Requirement
40
65
  requirements:
41
66
  - - ~>
42
67
  - !ruby/object:Gem::Version
43
- version: 1.6.4
68
+ version: '1.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: 2.14.0
44
76
  type: :development
45
77
  prerelease: false
46
- version_requirements: *70349397701780
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: 2.14.0
47
83
  - !ruby/object:Gem::Dependency
48
- name: rcov
49
- requirement: &70349397701040 !ruby/object:Gem::Requirement
50
- none: false
84
+ name: simplecov
85
+ requirement: !ruby/object:Gem::Requirement
51
86
  requirements:
52
- - - ~>
87
+ - - '>='
53
88
  - !ruby/object:Gem::Version
54
- version: 0.9.10
89
+ version: '0'
55
90
  type: :development
56
91
  prerelease: false
57
- version_requirements: *70349397701040
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: coveralls
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: awesome_print
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: pry
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '>='
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: pry-nav
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - '>='
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: factory_girl
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
58
167
  description: Create and manage complex tmux sessions easily.
59
- email: allen.bargi@gmail.com
168
+ email:
169
+ - allen.bargi@gmail.com
60
170
  executables:
61
171
  - mux
62
172
  - tmuxinator
63
- - tmuxinator_completion
64
173
  extensions: []
65
- extra_rdoc_files:
66
- - LICENSE.txt
67
- - README.md
68
- - TODO
174
+ extra_rdoc_files: []
69
175
  files:
70
- - .document
176
+ - .gitignore
71
177
  - .rspec
178
+ - .travis.yml
179
+ - CHANGELOG.md
180
+ - CONTRIBUTING.md
72
181
  - Gemfile
73
- - Gemfile.lock
74
- - LICENSE.txt
182
+ - LICENSE
75
183
  - README.md
76
184
  - Rakefile
77
- - VERSION
78
185
  - bin/mux
79
186
  - bin/tmuxinator
80
- - bin/tmuxinator_completion
187
+ - completion/tmuxinator.bash
188
+ - completion/tmuxinator.zsh
81
189
  - lib/tmuxinator.rb
82
190
  - lib/tmuxinator/assets/sample.yml
83
- - lib/tmuxinator/assets/tmux_config.tmux
191
+ - lib/tmuxinator/assets/template.erb
84
192
  - lib/tmuxinator/cli.rb
85
- - lib/tmuxinator/config_writer.rb
86
- - lib/tmuxinator/helper.rb
193
+ - lib/tmuxinator/config.rb
194
+ - lib/tmuxinator/deprecations.rb
195
+ - lib/tmuxinator/pane.rb
196
+ - lib/tmuxinator/project.rb
197
+ - lib/tmuxinator/util.rb
198
+ - lib/tmuxinator/version.rb
199
+ - lib/tmuxinator/window.rb
200
+ - spec/factories/projects.rb
201
+ - spec/fixtures/sample.deprecations.yml
202
+ - spec/fixtures/sample.yml
203
+ - spec/lib/tmuxinator/cli_spec.rb
204
+ - spec/lib/tmuxinator/config_spec.rb
205
+ - spec/lib/tmuxinator/pane_spec.rb
206
+ - spec/lib/tmuxinator/project_spec.rb
207
+ - spec/lib/tmuxinator/util_spec.rb
208
+ - spec/lib/tmuxinator/window_spec.rb
87
209
  - spec/spec_helper.rb
88
- - spec/tmuxinator_spec.rb
89
210
  - tmuxinator.gemspec
90
- - TODO
91
- homepage: http://github.com/aziz/tmuxinator
211
+ homepage: https://github.com/aziz/tmuxinator
92
212
  licenses:
93
213
  - MIT
94
- post_install_message: ! "\n __________________________________________________________\n
95
- \ ..........................................................\n\n Thank you for
96
- installing tmuxinator\n Please be sure to to drop a line in your ~/.bashrc file,
97
- similar \n to RVM if you've used that before:\n\n [[ -s $HOME/.tmuxinator/scripts/tmuxinator
98
- ]] && source $HOME/.tmuxinator/scripts/tmuxinator\n \n also ensure that you've
99
- set these variables in your ENV:\n \n $EDITOR, $SHELL\n \n you can run `tmuxinator
100
- doctor` to make sure everything is set.\n happy tmuxing with tmuxinator!\n\n ..........................................................\n
101
- \ __________________________________________________________\n \n "
214
+ metadata: {}
215
+ post_install_message: "\n __________________________________________________________\n
216
+ \ ..........................................................\n\n Thank you
217
+ for installing tmuxinator.\n\n Make sure that you've set these variables in your
218
+ ENV:\n\n $EDITOR, $SHELL\n\n You can run `tmuxinator doctor` to make sure
219
+ everything is set.\n Happy tmuxing with tmuxinator!\n\n ..........................................................\n
220
+ \ __________________________________________________________\n "
102
221
  rdoc_options: []
103
222
  require_paths:
104
223
  - lib
105
224
  required_ruby_version: !ruby/object:Gem::Requirement
106
- none: false
107
225
  requirements:
108
- - - ! '>='
226
+ - - '>='
109
227
  - !ruby/object:Gem::Version
110
228
  version: '0'
111
- segments:
112
- - 0
113
- hash: -770502179952499709
114
229
  required_rubygems_version: !ruby/object:Gem::Requirement
115
- none: false
116
230
  requirements:
117
- - - ! '>='
231
+ - - '>='
118
232
  - !ruby/object:Gem::Version
119
- version: '0'
233
+ version: 1.8.23
120
234
  requirements: []
121
235
  rubyforge_project:
122
- rubygems_version: 1.8.11
236
+ rubygems_version: 2.0.3
123
237
  signing_key:
124
- specification_version: 3
238
+ specification_version: 4
125
239
  summary: Create and manage complex tmux sessions easily.
126
- test_files: []
240
+ test_files:
241
+ - spec/factories/projects.rb
242
+ - spec/fixtures/sample.deprecations.yml
243
+ - spec/fixtures/sample.yml
244
+ - spec/lib/tmuxinator/cli_spec.rb
245
+ - spec/lib/tmuxinator/config_spec.rb
246
+ - spec/lib/tmuxinator/pane_spec.rb
247
+ - spec/lib/tmuxinator/project_spec.rb
248
+ - spec/lib/tmuxinator/util_spec.rb
249
+ - spec/lib/tmuxinator/window_spec.rb
250
+ - spec/spec_helper.rb