tmux-ruby 0.0.2
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.
- data/.yardopts +1 -0
- data/LICENSE +22 -0
- data/README.md +23 -0
- data/lib/tmux.rb +56 -0
- data/lib/tmux/buffer.rb +131 -0
- data/lib/tmux/client.rb +193 -0
- data/lib/tmux/exception.rb +5 -0
- data/lib/tmux/exception/basic_exception.rb +6 -0
- data/lib/tmux/exception/in_tmux.rb +9 -0
- data/lib/tmux/exception/index_in_use.rb +9 -0
- data/lib/tmux/exception/unknown_command.rb +9 -0
- data/lib/tmux/exception/unsupported_version.rb +15 -0
- data/lib/tmux/filterable_hash.rb +15 -0
- data/lib/tmux/options.rb +109 -0
- data/lib/tmux/options/attr_option.rb +10 -0
- data/lib/tmux/options/bell_action_option.rb +19 -0
- data/lib/tmux/options/boolean_option.rb +26 -0
- data/lib/tmux/options/char_array_option.rb +26 -0
- data/lib/tmux/options/clock_mode_style_option.rb +27 -0
- data/lib/tmux/options/color_option.rb +23 -0
- data/lib/tmux/options/justification_option.rb +19 -0
- data/lib/tmux/options/keymap_option.rb +19 -0
- data/lib/tmux/options/number_option.rb +26 -0
- data/lib/tmux/options/option.rb +38 -0
- data/lib/tmux/options/string_option.rb +26 -0
- data/lib/tmux/options/symbol_option.rb +26 -0
- data/lib/tmux/options/word_array_option.rb +26 -0
- data/lib/tmux/options_list.rb +150 -0
- data/lib/tmux/pane.rb +496 -0
- data/lib/tmux/server.rb +217 -0
- data/lib/tmux/session.rb +312 -0
- data/lib/tmux/status_bar.rb +134 -0
- data/lib/tmux/status_bar/field.rb +129 -0
- data/lib/tmux/version.rb +4 -0
- data/lib/tmux/widget.rb +35 -0
- data/lib/tmux/widgets/progress_bar.rb +107 -0
- data/lib/tmux/window.rb +697 -0
- data/lib/tmux/window/status.rb +21 -0
- data/lib/tmux/window/status/state.rb +87 -0
- metadata +96 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
require "tmux/window/status/state"
|
2
|
+
|
3
|
+
module Tmux
|
4
|
+
class Window
|
5
|
+
# the "tab" in the statusbar
|
6
|
+
class Status
|
7
|
+
# @return [State]
|
8
|
+
attr_reader :normal
|
9
|
+
# @return [State]
|
10
|
+
attr_reader :current
|
11
|
+
# @return [State]
|
12
|
+
attr_reader :alert
|
13
|
+
def initialize(window)
|
14
|
+
@window = window
|
15
|
+
@normal = State.new(@window, :normal)
|
16
|
+
@current = State.new(@window, :current)
|
17
|
+
@alert = State.new(@window, :alert)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
module Tmux
|
2
|
+
class Window
|
3
|
+
class Status
|
4
|
+
# Each status can be in different states: normal, current and alert
|
5
|
+
class State
|
6
|
+
def initialize(window, state)
|
7
|
+
@window = window
|
8
|
+
@state = state
|
9
|
+
end
|
10
|
+
|
11
|
+
# @return [Symbol]
|
12
|
+
attr_accessor :background_color
|
13
|
+
undef_method "background_color"
|
14
|
+
undef_method "background_color="
|
15
|
+
def background_color
|
16
|
+
get_option "bg"
|
17
|
+
end
|
18
|
+
|
19
|
+
def background_color=(color)
|
20
|
+
set_option "fg", color
|
21
|
+
end
|
22
|
+
|
23
|
+
# @return [Symbol]
|
24
|
+
attr_accessor :foreground_color
|
25
|
+
undef_method "foreground_color"
|
26
|
+
undef_method "foreground_color="
|
27
|
+
def foreground_color
|
28
|
+
get_option "fg"
|
29
|
+
end
|
30
|
+
|
31
|
+
def foreground_color=(color)
|
32
|
+
set_option "fg", color
|
33
|
+
end
|
34
|
+
|
35
|
+
# The format in which the window is displayed in the status line window list.
|
36
|
+
#
|
37
|
+
# @return [String]
|
38
|
+
attr_accessor :format
|
39
|
+
undef_method "format"
|
40
|
+
undef_method "format="
|
41
|
+
def format
|
42
|
+
get_option "format"
|
43
|
+
end
|
44
|
+
|
45
|
+
def format=(value)
|
46
|
+
set_option "format"
|
47
|
+
end
|
48
|
+
|
49
|
+
# @return [Symbol]
|
50
|
+
attr_accessor :attributes
|
51
|
+
undef_method "attributes"
|
52
|
+
undef_method "attributes="
|
53
|
+
def attributes
|
54
|
+
get_option "attr"
|
55
|
+
end
|
56
|
+
|
57
|
+
def attributes=(value)
|
58
|
+
# FIXME string? array?
|
59
|
+
set_option "attr", value
|
60
|
+
end
|
61
|
+
|
62
|
+
def get_option(option)
|
63
|
+
@window.options.get option_name(option)
|
64
|
+
end
|
65
|
+
private :get_option
|
66
|
+
|
67
|
+
def set_option(option, value)
|
68
|
+
@window.options.set option_name(option), value
|
69
|
+
end
|
70
|
+
private :set_option
|
71
|
+
|
72
|
+
def option_name(option)
|
73
|
+
state = case @state
|
74
|
+
when :normal
|
75
|
+
""
|
76
|
+
when :current
|
77
|
+
"current-"
|
78
|
+
when :alert
|
79
|
+
"alert-"
|
80
|
+
end
|
81
|
+
"window-status-#{state}#{option}"
|
82
|
+
end
|
83
|
+
private :option_name
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
metadata
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tmux-ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Dominik Honnef
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-11-24 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: filesize
|
16
|
+
requirement: &10484240 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *10484240
|
25
|
+
description: Ruby library to control tmux
|
26
|
+
email: dominikh@fork-bomb.org
|
27
|
+
executables: []
|
28
|
+
extensions: []
|
29
|
+
extra_rdoc_files: []
|
30
|
+
files:
|
31
|
+
- lib/tmux/status_bar/field.rb
|
32
|
+
- lib/tmux/widget.rb
|
33
|
+
- lib/tmux/client.rb
|
34
|
+
- lib/tmux/options.rb
|
35
|
+
- lib/tmux/window/status/state.rb
|
36
|
+
- lib/tmux/window/status.rb
|
37
|
+
- lib/tmux/status_bar.rb
|
38
|
+
- lib/tmux/pane.rb
|
39
|
+
- lib/tmux/server.rb
|
40
|
+
- lib/tmux/widgets/progress_bar.rb
|
41
|
+
- lib/tmux/buffer.rb
|
42
|
+
- lib/tmux/version.rb
|
43
|
+
- lib/tmux/options/number_option.rb
|
44
|
+
- lib/tmux/options/clock_mode_style_option.rb
|
45
|
+
- lib/tmux/options/bell_action_option.rb
|
46
|
+
- lib/tmux/options/color_option.rb
|
47
|
+
- lib/tmux/options/boolean_option.rb
|
48
|
+
- lib/tmux/options/option.rb
|
49
|
+
- lib/tmux/options/keymap_option.rb
|
50
|
+
- lib/tmux/options/char_array_option.rb
|
51
|
+
- lib/tmux/options/symbol_option.rb
|
52
|
+
- lib/tmux/options/justification_option.rb
|
53
|
+
- lib/tmux/options/word_array_option.rb
|
54
|
+
- lib/tmux/options/attr_option.rb
|
55
|
+
- lib/tmux/options/string_option.rb
|
56
|
+
- lib/tmux/exception.rb
|
57
|
+
- lib/tmux/filterable_hash.rb
|
58
|
+
- lib/tmux/window.rb
|
59
|
+
- lib/tmux/session.rb
|
60
|
+
- lib/tmux/exception/in_tmux.rb
|
61
|
+
- lib/tmux/exception/unsupported_version.rb
|
62
|
+
- lib/tmux/exception/unknown_command.rb
|
63
|
+
- lib/tmux/exception/basic_exception.rb
|
64
|
+
- lib/tmux/exception/index_in_use.rb
|
65
|
+
- lib/tmux/options_list.rb
|
66
|
+
- lib/tmux.rb
|
67
|
+
- README.md
|
68
|
+
- LICENSE
|
69
|
+
- .yardopts
|
70
|
+
homepage: https://github.com/dominikh/tmux-ruby
|
71
|
+
licenses:
|
72
|
+
- MIT
|
73
|
+
post_install_message:
|
74
|
+
rdoc_options: []
|
75
|
+
require_paths:
|
76
|
+
- lib
|
77
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
none: false
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.9.1
|
83
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ! '>='
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
requirements: []
|
90
|
+
rubyforge_project:
|
91
|
+
rubygems_version: 1.8.15
|
92
|
+
signing_key:
|
93
|
+
specification_version: 3
|
94
|
+
summary: Ruby library to control tmux
|
95
|
+
test_files: []
|
96
|
+
has_rdoc: yard
|