tlux 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/tlux +1 -1
- data/lib/tlux/version.rb +1 -1
- data/spec/commands/base_spec.rb +6 -7
- data/spec/commands/list_command_spec.rb +5 -5
- data/spec/commands/open_command_spec.rb +2 -2
- data/spec/config/generator_spec.rb +1 -1
- data/spec/config/parser_spec.rb +5 -5
- data/spec/pane_spec.rb +6 -6
- data/spec/session_spec.rb +16 -9
- data/spec/spec_helper.rb +16 -1
- data/spec/support/commandable.rb +1 -1
- data/spec/support/splitable.rb +3 -3
- data/spec/window_spec.rb +1 -1
- data/tlux.gemspec +1 -1
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0fe8fcc9f8b1a49b698dcb8f63c7cd91f12e4ff8
|
4
|
+
data.tar.gz: 804762cf108ff8b9f41123eed1a9041fffdf0f0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dc12d340479b2d3d80a69038ae661af2afc7f1a1468925c8407e0b5ef635dd8d1f6d76de3890c4f41fb61b15553acec354bc24858ba3344e37c968cf86ae9b39
|
7
|
+
data.tar.gz: 05b5e7abf9c48950c520ca76c016ba108e57aa9db4b73c9941d015d06da1bd683a930733423b318b2281ef3606f14afbe55227a4629b0678ab47a498356df77a
|
data/bin/tlux
CHANGED
data/lib/tlux/version.rb
CHANGED
data/spec/commands/base_spec.rb
CHANGED
@@ -16,27 +16,26 @@ describe Tlux::Commands::Base do
|
|
16
16
|
it "should create the tlux directory structure" do
|
17
17
|
subject.setup
|
18
18
|
|
19
|
-
Dir.exists?
|
19
|
+
expect(Dir.exists? tlux_config_file).to eq true
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
23
|
context "tlux directory already present" do
|
24
24
|
before :each do
|
25
|
-
|
26
|
-
FileUtils.touch
|
25
|
+
subject.setup
|
26
|
+
FileUtils.touch tlux_config_test_file
|
27
27
|
end
|
28
28
|
|
29
29
|
it "should not re-create the directory structure" do
|
30
30
|
subject.setup
|
31
31
|
|
32
|
-
Dir.exists?
|
33
|
-
Dir.exists?(File.join(Dir.home, '.tlux')).should be_true
|
32
|
+
expect(Dir.exists? tlux_config_file).to eq true
|
34
33
|
end
|
35
34
|
|
36
35
|
it "should not loose the existing files" do
|
37
36
|
subject.setup
|
38
37
|
|
39
|
-
File.exists?
|
38
|
+
expect(File.exists? tlux_config_test_file).to eq true
|
40
39
|
end
|
41
40
|
end
|
42
41
|
end
|
@@ -45,7 +44,7 @@ describe Tlux::Commands::Base do
|
|
45
44
|
subject { Tlux::Commands::Base.new }
|
46
45
|
|
47
46
|
it "should return the path to the config files" do
|
48
|
-
subject.config_path.
|
47
|
+
expect(subject.config_path).to eq tlux_config_file
|
49
48
|
end
|
50
49
|
end
|
51
50
|
end
|
@@ -16,7 +16,7 @@ describe Tlux::Commands::ListCommand do
|
|
16
16
|
context "tlux dir not set up" do
|
17
17
|
it "should set up the tlux dir" do
|
18
18
|
subject.run
|
19
|
-
Dir.exists?(File.join(Dir.home, '.tlux')).
|
19
|
+
expect(Dir.exists?(File.join(Dir.home, '.tlux'))).to eq true
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -24,8 +24,8 @@ describe Tlux::Commands::ListCommand do
|
|
24
24
|
let(:list) { subject.run }
|
25
25
|
|
26
26
|
it "should return an empty array" do
|
27
|
-
list.
|
28
|
-
list.
|
27
|
+
expect(list).to be_kind_of Array
|
28
|
+
expect(list).to be_empty
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -38,7 +38,7 @@ describe Tlux::Commands::ListCommand do
|
|
38
38
|
end
|
39
39
|
|
40
40
|
it "should return an array with the name of the config" do
|
41
|
-
list.include
|
41
|
+
expect(list).to include config_name
|
42
42
|
end
|
43
43
|
end
|
44
44
|
|
@@ -54,7 +54,7 @@ describe Tlux::Commands::ListCommand do
|
|
54
54
|
|
55
55
|
it "should return an array with all the names of the config" do
|
56
56
|
config_names.each do |config_name|
|
57
|
-
list.include
|
57
|
+
expect(list).to include config_name
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -19,13 +19,13 @@ describe Tlux::Commands::OpenCommand do
|
|
19
19
|
context "tlux dir doesn't exist" do
|
20
20
|
it "should create the tlux dir" do
|
21
21
|
subject.run(false)
|
22
|
-
Dir.exists?
|
22
|
+
expect(Dir.exists? tlux_config_file).to eq true
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should create the config file" do
|
27
27
|
subject.run(false)
|
28
|
-
File.exists?
|
28
|
+
expect(File.exists? File.join(tlux_config_file, config_name)).to eq true
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
data/spec/config/parser_spec.rb
CHANGED
@@ -13,7 +13,7 @@ describe Tlux::Config::Parser do
|
|
13
13
|
context "config file does exist" do
|
14
14
|
it "should return a new instance of Tlux::Config::Parser" do
|
15
15
|
parser = Tlux::Config::Parser.from_file(File.join('spec', 'fixtures', 'sample_config.rb'))
|
16
|
-
parser.
|
16
|
+
expect(parser).to be_kind_of Tlux::Config::Parser
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -23,11 +23,11 @@ describe Tlux::Config::Parser do
|
|
23
23
|
subject { Tlux::Config::Parser.new config }
|
24
24
|
|
25
25
|
it "should have a config string" do
|
26
|
-
subject.config.
|
26
|
+
expect(subject.config).to eq config
|
27
27
|
end
|
28
28
|
|
29
29
|
it "should have a new session object" do
|
30
|
-
subject.session.
|
30
|
+
expect(subject.session).to be_kind_of Tlux::Session
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -37,11 +37,11 @@ describe Tlux::Config::Parser do
|
|
37
37
|
subject { Tlux::Config::Parser.new config }
|
38
38
|
|
39
39
|
before :each do
|
40
|
-
Tlux::Session.
|
40
|
+
allow(Tlux::Session).to receive(:new).and_return(session)
|
41
41
|
end
|
42
42
|
|
43
43
|
it "should instance eval the config with the new session" do
|
44
|
-
session.
|
44
|
+
allow(session).to receive(:instance_eval).with(config)
|
45
45
|
subject.parse!
|
46
46
|
end
|
47
47
|
end
|
data/spec/pane_spec.rb
CHANGED
@@ -14,7 +14,7 @@ describe Tlux::Pane do
|
|
14
14
|
subject { Tlux::Pane.new(:vertical) }
|
15
15
|
|
16
16
|
it "should be v" do
|
17
|
-
subject.orientation.
|
17
|
+
expect(subject.orientation).to eq '-v'
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
@@ -22,7 +22,7 @@ describe Tlux::Pane do
|
|
22
22
|
subject { Tlux::Pane.new(:horizontal) }
|
23
23
|
|
24
24
|
it "should be h" do
|
25
|
-
subject.orientation.
|
25
|
+
expect(subject.orientation).to eq '-h'
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -30,7 +30,7 @@ describe Tlux::Pane do
|
|
30
30
|
subject { Tlux::Pane.new }
|
31
31
|
|
32
32
|
it "should be v" do
|
33
|
-
subject.orientation.
|
33
|
+
expect(subject.orientation).to eq '-v'
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
@@ -40,7 +40,7 @@ describe Tlux::Pane do
|
|
40
40
|
subject { Tlux::Pane.new }
|
41
41
|
|
42
42
|
it "should be nil" do
|
43
|
-
subject.size.
|
43
|
+
expect(subject.size).to be_nil
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
@@ -48,7 +48,7 @@ describe Tlux::Pane do
|
|
48
48
|
subject { Tlux::Pane.new(:vertical, lines: 20) }
|
49
49
|
|
50
50
|
it "should be -l 20" do
|
51
|
-
subject.size.
|
51
|
+
expect(subject.size).to eq "-l 20"
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -56,7 +56,7 @@ describe Tlux::Pane do
|
|
56
56
|
subject { Tlux::Pane.new(:vertical, percentage: 20) }
|
57
57
|
|
58
58
|
it "should be -p 20" do
|
59
|
-
subject.size.
|
59
|
+
expect(subject.size).to eq "-p 20"
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
data/spec/session_spec.rb
CHANGED
@@ -5,32 +5,39 @@ describe Tlux::Session do
|
|
5
5
|
|
6
6
|
describe "#name" do
|
7
7
|
context "default" do
|
8
|
-
before { Dir.
|
8
|
+
before { allow(Dir).to receive(:pwd).and_return('/path/to/project.js') }
|
9
9
|
|
10
10
|
subject { session.name }
|
11
11
|
|
12
|
-
it
|
12
|
+
it 'should have the correct project name' do
|
13
|
+
expect(subject).to eq 'project-js'
|
14
|
+
end
|
13
15
|
end
|
14
16
|
|
15
17
|
context "settable" do
|
16
18
|
it "should have a name" do
|
17
19
|
session.name("foo")
|
18
|
-
session.name.
|
20
|
+
expect(session.name).to eq 'foo'
|
19
21
|
end
|
20
22
|
end
|
21
23
|
end
|
22
24
|
|
23
25
|
describe "#dir" do
|
24
|
-
before { Dir.
|
26
|
+
before { allow(Dir).to receive(:pwd).and_return(:pwd) }
|
25
27
|
subject { session }
|
26
28
|
|
27
29
|
context "default" do
|
28
|
-
|
30
|
+
it 'should return the correct working directory' do
|
31
|
+
expect(subject.dir).to eq :pwd
|
32
|
+
end
|
29
33
|
end
|
30
34
|
|
31
35
|
context "settable" do
|
32
36
|
before { session.dir(:foo) }
|
33
|
-
|
37
|
+
|
38
|
+
it 'should be settable' do
|
39
|
+
expect(subject.dir).to eq :foo
|
40
|
+
end
|
34
41
|
end
|
35
42
|
end
|
36
43
|
|
@@ -39,7 +46,7 @@ describe Tlux::Session do
|
|
39
46
|
let(:opts) { {:baz => true} }
|
40
47
|
|
41
48
|
it "should create a new window" do
|
42
|
-
Tlux::Window.
|
49
|
+
allow(Tlux::Window).to receive(:new).with(name, opts)
|
43
50
|
session.window name, opts
|
44
51
|
end
|
45
52
|
|
@@ -56,8 +63,8 @@ describe Tlux::Session do
|
|
56
63
|
window = self
|
57
64
|
end
|
58
65
|
|
59
|
-
window.
|
60
|
-
window.name.
|
66
|
+
expect(window).to be_kind_of Tlux::Window
|
67
|
+
expect(window.name).to eq 'foo'
|
61
68
|
end
|
62
69
|
end
|
63
70
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -16,7 +16,6 @@ Dir[File.expand_path('../support/**/*.rb', __FILE__)].each do |file|
|
|
16
16
|
end
|
17
17
|
|
18
18
|
RSpec.configure do |config|
|
19
|
-
config.treat_symbols_as_metadata_keys_with_true_values = true
|
20
19
|
config.run_all_when_everything_filtered = true
|
21
20
|
config.filter_run :focus
|
22
21
|
|
@@ -34,3 +33,19 @@ def empty_tlux_dir!
|
|
34
33
|
Dir.foreach(path) { |filename| File.delete(File.join(path, filename)) if File.exists?(File.join(path, filename)) }
|
35
34
|
end
|
36
35
|
end
|
36
|
+
|
37
|
+
def tlux_generated_dir
|
38
|
+
File.join(Dir.home, '.tlux', 'generated')
|
39
|
+
end
|
40
|
+
|
41
|
+
def tlux_generated_file(file_name)
|
42
|
+
File.join(tlux_generated_dir, file_name)
|
43
|
+
end
|
44
|
+
|
45
|
+
def tlux_config_file
|
46
|
+
File.join(Dir.home, '.tlux')
|
47
|
+
end
|
48
|
+
|
49
|
+
def tlux_config_test_file
|
50
|
+
File.join(tlux_config_file, 'test')
|
51
|
+
end
|
data/spec/support/commandable.rb
CHANGED
data/spec/support/splitable.rb
CHANGED
@@ -5,7 +5,7 @@ shared_examples_for Tlux::Splitable do
|
|
5
5
|
|
6
6
|
it "should create a new pane" do
|
7
7
|
splitable.split(orientation, opts)
|
8
|
-
splitable.panes.first.
|
8
|
+
expect(splitable.panes.first).to be_kind_of Tlux::Pane
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should add the new pane to the list of panes" do
|
@@ -21,8 +21,8 @@ shared_examples_for Tlux::Splitable do
|
|
21
21
|
pane = self
|
22
22
|
end
|
23
23
|
|
24
|
-
pane.
|
25
|
-
pane.orientation.
|
24
|
+
expect(pane).to be_kind_of Tlux::Pane
|
25
|
+
expect(pane.orientation).to_not be_nil
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
data/spec/window_spec.rb
CHANGED
data/tlux.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
|
|
17
17
|
|
18
18
|
gem.add_dependency('commander')
|
19
19
|
|
20
|
-
gem.add_development_dependency('rspec')
|
20
|
+
gem.add_development_dependency('rspec', '~>3.0.0')
|
21
21
|
gem.add_development_dependency('rake')
|
22
22
|
#gem.add_development_dependency('fakefs')
|
23
23
|
end
|
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tlux
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oliver Nightingale
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 3.0.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 3.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
description: Luxurious tmux configuration
|
@@ -60,8 +60,8 @@ executables:
|
|
60
60
|
extensions: []
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
|
-
- .gitignore
|
64
|
-
- .rspec
|
63
|
+
- ".gitignore"
|
64
|
+
- ".rspec"
|
65
65
|
- Gemfile
|
66
66
|
- LICENSE
|
67
67
|
- README.md
|
@@ -104,17 +104,17 @@ require_paths:
|
|
104
104
|
- lib
|
105
105
|
required_ruby_version: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
|
-
- -
|
107
|
+
- - ">="
|
108
108
|
- !ruby/object:Gem::Version
|
109
109
|
version: '0'
|
110
110
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
111
|
requirements:
|
112
|
-
- -
|
112
|
+
- - ">="
|
113
113
|
- !ruby/object:Gem::Version
|
114
114
|
version: '0'
|
115
115
|
requirements: []
|
116
116
|
rubyforge_project:
|
117
|
-
rubygems_version: 2.
|
117
|
+
rubygems_version: 2.2.2
|
118
118
|
signing_key:
|
119
119
|
specification_version: 4
|
120
120
|
summary: Luxurious tmux configuration
|