Class: Teepee::Commander
Instance Attribute Summary collapse
Instance Method Summary
collapse
#bookmarks_folder_id, #folder_id, #forum_id, #id_command_handler, #image, #keyword_id, #link, #link_id, #mailto, #note_id, #tag_id, #tb_href, #user
#%, #*, #**, #+, #-, #/, #acos, #acosh, #add_percentage, #asin, #asinh, #atan, #atanh, #ceiling, #cos, #cosh, #degrees2radians, #e, #ensure_numeric, #erf, #erfc, #floor, #gamma, #greater_than, #greater_than_or_equal, #hypot, #i, #ld, #ldexp, #less_than, #less_than_or_equal, #lgamma, #ln, #log, #log10, #mod, #non_numeric_error, #number_from_word, #numeric?, #percent_total, #pi, #radians2degrees, #round, #sin, #sinh, #sqrt, #subtract_percentage, #tan, #tanh, #to_numbers
#b, #big, #br, #del, #enumerate, #enumerate_lowercase, #enumerate_numeric, #enumerate_roman_lowercase, #enumerate_roman_uppercase, #enumerate_uppercase, #h1, #h2, #h3, #h4, #h5, #h6, #html_tag, #it, #item, #itemize, #itemize_circle, #itemize_disc, #itemize_none, #itemize_square, #nbsp, #small, #span_operator, #sub, #sup, #table, #table_data, #table_header, #table_row, #tt, #u
#case_operator, #comment, #cond_operator, #decrement, #define, #dotimes, #equal, #get_operator, #if_operator, #increment, #is_defined?, #not_equal, #prog1_operator, #progn_operator, #prognil, #undefine, #unless_operator, #when_operator
#boolean_and, #boolean_nand, #boolean_nor, #boolean_not, #boolean_or, #boolean_xnor, #boolean_xor, #ensure_boolean, #false_constant, #false_constant?, #true_constant, #true_constant?
Constructor Details
#initialize(params) ⇒ Commander
Returns a new instance of Commander.
54
55
56
|
# File 'lib/teepee/commander.rb', line 54
def initialize params
end
|
Instance Attribute Details
#parser ⇒ Object
Returns the value of attribute parser.
52
53
54
|
# File 'lib/teepee/commander.rb', line 52
def parser
@parser
end
|
Instance Method Details
#backquote ⇒ Object
102
103
104
|
# File 'lib/teepee/commander.rb', line 102
def backquote
"`"
end
|
#backslash ⇒ Object
106
107
108
|
# File 'lib/teepee/commander.rb', line 106
def backslash
"\\"
end
|
#command_error(message) ⇒ Object
64
65
66
|
# File 'lib/teepee/commander.rb', line 64
def command_error message
%{<span style="color: red">[#{message}]</span>}
end
|
#command_not_yet_implemented(command) ⇒ Object
68
69
70
|
# File 'lib/teepee/commander.rb', line 68
def command_not_yet_implemented command
command_error "The command #{command} is not yet implemented."
end
|
#dollar ⇒ Object
110
111
112
|
# File 'lib/teepee/commander.rb', line 110
def dollar
"$"
end
|
#left_brace ⇒ Object
114
115
116
|
# File 'lib/teepee/commander.rb', line 114
def left_brace
"{"
end
|
#left_bracket ⇒ Object
118
119
120
|
# File 'lib/teepee/commander.rb', line 118
def left_bracket
"["
end
|
#left_strip(expressions) ⇒ Object
76
77
78
79
80
81
|
# File 'lib/teepee/commander.rb', line 76
def left_strip expressions
while expressions.first.kind_of? WhitespaceToken
expressions.shift
end
expressions
end
|
#pipe ⇒ Object
122
123
124
|
# File 'lib/teepee/commander.rb', line 122
def pipe
"|"
end
|
#pipe?(expression) ⇒ Boolean
98
99
100
|
# File 'lib/teepee/commander.rb', line 98
def pipe? expression
expression.is_a? PipeToken
end
|
#right_brace ⇒ Object
126
127
128
|
# File 'lib/teepee/commander.rb', line 126
def right_brace
"}"
end
|
#right_bracket ⇒ Object
130
131
132
|
# File 'lib/teepee/commander.rb', line 130
def right_bracket
"]"
end
|
#right_strip(expressions) ⇒ Object
83
84
85
86
87
88
|
# File 'lib/teepee/commander.rb', line 83
def right_strip expressions
while expressions.last.kind_of? WhitespaceToken
expressions.pop
end
expressions
end
|
#space ⇒ Object
138
139
140
|
# File 'lib/teepee/commander.rb', line 138
def space
" "
end
|
#squiggle ⇒ Object
134
135
136
|
# File 'lib/teepee/commander.rb', line 134
def squiggle
"~"
end
|
#strip(expressions) ⇒ Object
90
91
92
|
# File 'lib/teepee/commander.rb', line 90
def strip expressions
left_strip right_strip expressions
end
|
#valid_email_address?(email_address) ⇒ Boolean
94
95
96
|
# File 'lib/teepee/commander.rb', line 94
def valid_email_address? email_address
email_address =~ /\A[[:graph:]]+@[\w._-]+\z/
end
|
#valid_uri?(uri) ⇒ Boolean
58
59
60
61
62
|
# File 'lib/teepee/commander.rb', line 58
def valid_uri? uri
(!! (u = URI.parse(uri))) and not u.scheme.nil?
rescue URI::InvalidURIError
false
end
|
#variable_not_defined_error(variable) ⇒ Object
72
73
74
|
# File 'lib/teepee/commander.rb', line 72
def variable_not_defined_error variable
command_error "The variable \"#{variable}\" is not defined."
end
|