lib/edge/message.rb in edge_framework-0.9.0 vs lib/edge/message.rb in edge_framework-0.9.9

- old
+ new

@@ -1,38 +1,41 @@ module Edge - require "edge/console" - require "edge/version" - @console = Edge::Console.new + class Message + require "edge/version" - AVAILABLE_TEMPLATE = -<<-EOF.lines.each {|line| line.strip!} - Currently these are the available templates: - html - Static HTML template - php - Standard PHP template -EOF + available_template = +%Q{Currently these are the available templates: + html - Static HTML template + php - Standard PHP template} - SYNTAX_CREATE = -<<-EOF.lines.each {|line| line.strip!} - #{ @console.cyan('edge create <project_type> <project_name>') } - #{ @console.yellow('project_type') } - #{ AVAILABLE_TEMPLATE } - #{ @console.magenta('project_name') } - (Optional) If not specified, current directory will be used -EOF + syntax_create = +%Q{edge create <project_type> [project_name] +project_type + #{ available_template } +[project_name] + directory name, if not specified will use current directory} - HELP = -<<-EOF.lines.each {|line| line.strip!} --------------------------------------------------------- + help = +%Q{-------------------------------------------------------- Welcome to Edge Framework v-#{ Edge::VERSION } (#{ Edge::CODENAME }) -------------------------------------------------------- -CREATE TEMPLATE -#{ SYNTAX_CREATE } -EOF +Creating Template + #{ syntax_create } } - CREATE_WRONG_SYNTAX = -<<-EOF.lines.each {|line| line.strip!} - -WRONG SYNTAX + create_wrong_syntax = +%Q{Wrong Syntax The correct syntax is: -#{ SYNTAX_CREATE } -EOF +#{ syntax_create } } + + MESSAGES = { + :available_template => available_template, + :syntax_create => syntax_create, + :help => help, + :create_wrong_syntax => create_wrong_syntax + } + + def get_message(key) + return MESSAGES[key.to_sym]; + end + + end end