Class: Sutty::Cli::Commands::Layout
- Inherits:
-
Sutty::Cli::Command
- Object
- Sutty::Cli::Command
- Sutty::Cli::Commands::Layout
- Defined in:
- lib/sutty/cli/commands/layout.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
- #execute(input: $stdin, output: $stdout) ⇒ Object
-
#initialize(name, options) ⇒ Layout
constructor
A new instance of Layout.
Methods inherited from Sutty::Cli::Command
#command, #cursor, #editor, #exec_exist?, #generator, #pager, #platform, #prompt, #screen, #which
Constructor Details
#initialize(name, options) ⇒ Layout
Returns a new instance of Layout.
13 14 15 16 |
# File 'lib/sutty/cli/commands/layout.rb', line 13 def initialize(name, ) @name = name @options = end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/sutty/cli/commands/layout.rb', line 11 def name @name end |
Class Method Details
.layouts ⇒ Object
23 24 25 26 27 |
# File 'lib/sutty/cli/commands/layout.rb', line 23 def self.layouts @@layouts ||= Dir.glob(File.join('_data', 'layouts') + '/*.yml').map do |d| File.basename d, '.yml' end end |
Instance Method Details
#execute(input: $stdin, output: $stdout) ⇒ Object
18 19 20 21 |
# File 'lib/sutty/cli/commands/layout.rb', line 18 def execute(input: $stdin, output: $stdout) TTY::File.create_file data_layout, YAML.dump(data_default_fields) TTY::File.create_file html_layout, "---\nlayout: default\n---\n\n" end |