Teamocil::Layout#initialize now takes a layout, not a file
This commit is contained in:
parent
514a13a35d
commit
e6b5f04396
@ -24,7 +24,8 @@ module Teamocil
|
|||||||
system("$EDITOR \"#{file}\"")
|
system("$EDITOR \"#{file}\"")
|
||||||
else
|
else
|
||||||
bail "There is no file \"#{file}\"" unless File.exists?(file)
|
bail "There is no file \"#{file}\"" unless File.exists?(file)
|
||||||
layout = Teamocil::Layout.new(file, @options)
|
parsed_layout = YAML.load_file(file)
|
||||||
|
layout = Teamocil::Layout.new(parsed_layout, @options)
|
||||||
layout.to_tmux
|
layout.to_tmux
|
||||||
end
|
end
|
||||||
end # }}}
|
end # }}}
|
||||||
|
@ -2,12 +2,12 @@ module Teamocil
|
|||||||
# This class act as a wrapper around a tmux YAML layout file.
|
# This class act as a wrapper around a tmux YAML layout file.
|
||||||
class Layout
|
class Layout
|
||||||
|
|
||||||
# Initialize a new layout from a file
|
# Initialize a new layout from a hash
|
||||||
#
|
#
|
||||||
# @param file [String] the complete layout file path
|
# @param layout [Hash] the parsed layout
|
||||||
# @param options [Hash]
|
# @param options [Hash] some options
|
||||||
def initialize(file, options) # {{{
|
def initialize(layout, options) # {{{
|
||||||
@layout = YAML.load_file(file)
|
@layout = layout
|
||||||
@options = options
|
@options = options
|
||||||
end # }}}
|
end # }}}
|
||||||
|
|
||||||
@ -18,6 +18,8 @@ module Teamocil
|
|||||||
end # }}}
|
end # }}}
|
||||||
|
|
||||||
# Generate tmux commands based on the data found in the layout file
|
# Generate tmux commands based on the data found in the layout file
|
||||||
|
#
|
||||||
|
# @return [Array] an array of shell commands to send
|
||||||
def generate_commands # {{{
|
def generate_commands # {{{
|
||||||
output = []
|
output = []
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user