Class: Wpgen::CommandLineInterface

Inherits:
Object
  • Object
show all
Defined in:
lib/wpgen/command_line_interface.rb

Instance Method Summary collapse

Constructor Details

#initializeCommandLineInterface

Returns a new instance of CommandLineInterface.



3
4
5
# File 'lib/wpgen/command_line_interface.rb', line 3

def initialize

end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object



31
32
33
# File 'lib/wpgen/command_line_interface.rb', line 31

def method_missing(m, *args, &block)
  help
end

Instance Method Details

#cssObject



23
24
25
# File 'lib/wpgen/command_line_interface.rb', line 23

def css
  FileWriter.write_css ARGV[1]
end

#helpObject



35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/wpgen/command_line_interface.rb', line 35

def help
  puts "WPGEN"
  puts "Version: #{Wpgen::VERSION}"
  puts "Author: Travis Luong"
  puts ""
  puts "Available commands:"
  puts "wpgen new my_theme"
  puts "wpgen post my_post"
  puts "wpgen page my_page"
  puts "wpgen sidebar my_sidebar"
  puts "wpgen css file_name"
  puts "wpgen stylesheet"
end

#newObject



7
8
9
# File 'lib/wpgen/command_line_interface.rb', line 7

def new
  FileWriter.new_theme ARGV[1]
end

#pageObject



15
16
17
# File 'lib/wpgen/command_line_interface.rb', line 15

def page
  FileWriter.write_page_template ARGV[1]
end

#postObject



11
12
13
# File 'lib/wpgen/command_line_interface.rb', line 11

def post
  FileWriter.write_custom_post_type ARGV[1]
end


19
20
21
# File 'lib/wpgen/command_line_interface.rb', line 19

def sidebar
  FileWriter.write_dynamic_sidebar ARGV[1]
end

#stylesheetObject



27
28
29
# File 'lib/wpgen/command_line_interface.rb', line 27

def stylesheet
  FileWriter.write_stylesheet
end