tlux 0.0.5 → 0.0.6
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 +6 -0
- data/lib/tlux/commands/base.rb +1 -5
- data/lib/tlux/commands/run_command.rb +0 -12
- data/lib/tlux/version.rb +1 -1
- data/spec/commands/base_spec.rb +2 -13
- data/spec/config/parser_spec.rb +1 -1
- data/spec/session_spec.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae09a41d10ba3b8694e8f2cbe719b1a36bdbf49f
|
4
|
+
data.tar.gz: 135fcfa7092d132d64cc1cbb98237554d961916e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2c1fe25703bb9c5971fe0bb9579667f5011e33fece3349d81c3872adb03771cedf1580056ac755c9f97d42d3e0e91a99c746fb3937b8647907059446c549f04
|
7
|
+
data.tar.gz: 3a92d0621a6dc0b3f5a8afcd16510c5ea6ad1f9c2f6e26b4c7d29b451e4c5170767983ceca9c6acea581b2cb8bb6de3f3aac89b7a1db1c2329d829a388675cd8
|
data/bin/tlux
CHANGED
@@ -10,6 +10,8 @@ program :name, 'tlux'
|
|
10
10
|
program :version, Tlux::VERSION
|
11
11
|
program :description, 'Luxurious tmux configuration'
|
12
12
|
|
13
|
+
default_command :help
|
14
|
+
|
13
15
|
command :run do |c|
|
14
16
|
c.syntax = 'tlux run <config>'
|
15
17
|
c.summary = 'Start a tmux session with the given config'
|
@@ -40,3 +42,7 @@ command :open do |c|
|
|
40
42
|
end
|
41
43
|
end
|
42
44
|
|
45
|
+
alias_command :r, :run
|
46
|
+
alias_command :ls, :list
|
47
|
+
alias_command :l, :list
|
48
|
+
alias_command :o, :open
|
data/lib/tlux/commands/base.rb
CHANGED
@@ -2,16 +2,12 @@ module Tlux
|
|
2
2
|
module Commands
|
3
3
|
class Base
|
4
4
|
def setup
|
5
|
-
FileUtils.mkdir_p(File.join(Dir.home, '.tlux'
|
5
|
+
FileUtils.mkdir_p(File.join(Dir.home, '.tlux'))
|
6
6
|
end
|
7
7
|
|
8
8
|
def config_path
|
9
9
|
File.join(Dir.home, '.tlux')
|
10
10
|
end
|
11
|
-
|
12
|
-
def generated_path
|
13
|
-
File.join(Dir.home, '.tlux', 'generated')
|
14
|
-
end
|
15
11
|
end
|
16
12
|
end
|
17
13
|
end
|
@@ -27,18 +27,6 @@ module Tlux
|
|
27
27
|
def config_file_path
|
28
28
|
File.join(config_path, config_name)
|
29
29
|
end
|
30
|
-
|
31
|
-
def output_path
|
32
|
-
File.join(generated_path, session_name)
|
33
|
-
end
|
34
|
-
|
35
|
-
def write_output(output)
|
36
|
-
File.delete(output_path) if File.exists?(output_path)
|
37
|
-
|
38
|
-
file = File.open(output_path, 'w')
|
39
|
-
file.write output
|
40
|
-
file.close
|
41
|
-
end
|
42
30
|
end
|
43
31
|
end
|
44
32
|
end
|
data/lib/tlux/version.rb
CHANGED
data/spec/commands/base_spec.rb
CHANGED
@@ -17,29 +17,26 @@ describe Tlux::Commands::Base do
|
|
17
17
|
subject.setup
|
18
18
|
|
19
19
|
Dir.exists?(File.join(Dir.home, '.tlux')).should be_true
|
20
|
-
Dir.exists?(File.join(Dir.home, '.tlux', 'generated')).should be_true
|
21
20
|
end
|
22
21
|
end
|
23
22
|
|
24
23
|
context "tlux directory already present" do
|
25
24
|
before :each do
|
26
|
-
FileUtils.mkdir_p(File.join(Dir.home, '.tlux'
|
25
|
+
FileUtils.mkdir_p(File.join(Dir.home, '.tlux'))
|
27
26
|
FileUtils.touch(File.join(Dir.home, '.tlux', 'test'))
|
28
|
-
FileUtils.touch(File.join(Dir.home, '.tlux', 'generated', 'test'))
|
29
27
|
end
|
30
28
|
|
31
29
|
it "should not re-create the directory structure" do
|
32
30
|
subject.setup
|
33
31
|
|
34
32
|
Dir.exists?(File.join(Dir.home, '.tlux')).should be_true
|
35
|
-
Dir.exists?(File.join(Dir.home, '.tlux'
|
33
|
+
Dir.exists?(File.join(Dir.home, '.tlux')).should be_true
|
36
34
|
end
|
37
35
|
|
38
36
|
it "should not loose the existing files" do
|
39
37
|
subject.setup
|
40
38
|
|
41
39
|
File.exists?(File.join(Dir.home, '.tlux', 'test')).should be_true
|
42
|
-
File.exists?(File.join(Dir.home, '.tlux', 'generated', 'test')).should be_true
|
43
40
|
end
|
44
41
|
end
|
45
42
|
end
|
@@ -51,12 +48,4 @@ describe Tlux::Commands::Base do
|
|
51
48
|
subject.config_path.should == File.join(Dir.home, '.tlux')
|
52
49
|
end
|
53
50
|
end
|
54
|
-
|
55
|
-
describe "generated_path" do
|
56
|
-
subject { Tlux::Commands::Base.new }
|
57
|
-
|
58
|
-
it "should return the path to the generated files" do
|
59
|
-
subject.generated_path.should == File.join(Dir.home, '.tlux', 'generated')
|
60
|
-
end
|
61
|
-
end
|
62
51
|
end
|
data/spec/config/parser_spec.rb
CHANGED
@@ -37,7 +37,7 @@ describe Tlux::Config::Parser do
|
|
37
37
|
subject { Tlux::Config::Parser.new config }
|
38
38
|
|
39
39
|
before :each do
|
40
|
-
Tlux::Session.stub
|
40
|
+
Tlux::Session.stub(:new).and_return(session)
|
41
41
|
end
|
42
42
|
|
43
43
|
it "should instance eval the config with the new session" do
|
data/spec/session_spec.rb
CHANGED
@@ -5,7 +5,7 @@ describe Tlux::Session do
|
|
5
5
|
|
6
6
|
describe "#name" do
|
7
7
|
context "default" do
|
8
|
-
before { Dir.stub
|
8
|
+
before { Dir.stub(:pwd).and_return('/path/to/project.js') }
|
9
9
|
|
10
10
|
subject { session.name }
|
11
11
|
|
@@ -21,7 +21,7 @@ describe Tlux::Session do
|
|
21
21
|
end
|
22
22
|
|
23
23
|
describe "#dir" do
|
24
|
-
before { Dir.stub
|
24
|
+
before { Dir.stub(:pwd).and_return(:pwd) }
|
25
25
|
subject { session }
|
26
26
|
|
27
27
|
context "default" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oliver Nightingale
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
114
|
version: '0'
|
115
115
|
requirements: []
|
116
116
|
rubyforge_project:
|
117
|
-
rubygems_version: 2.0.
|
117
|
+
rubygems_version: 2.0.3
|
118
118
|
signing_key:
|
119
119
|
specification_version: 4
|
120
120
|
summary: Luxurious tmux configuration
|