Class: GamesAndRpgParadise::Lpc::Geas::ForumCompacter
- Inherits:
-
Base
- Object
- Base
- GamesAndRpgParadise::Lpc::Geas::ForumCompacter
show all
- Defined in:
- lib/games_and_rpg_paradise/lpc/geas/forum_compacter.rb
Overview
GamesAndRpgParadise::Lpc::Geas::ForumCompacter
Constant Summary
Base::Extensions::Colours::ARRAY_AVAILABLE_KONSOLE_COLOURS
CommonExtensions::CONTROL_C_CODE, CommonExtensions::N
Instance Method Summary
collapse
ecomment, #efancy, #eparse, #forestgreen, #gold, #grey, #lightblue, #mediumseagreen, #mediumslateblue, #peru, #rev, sdir, sfancy, #sfile, simp, #teal, #yellow
#commandline_arguments?, #filter_away_commandline_arguments, #first_argument?, #first_non_hyphened_argument?, #set_commandline_arguments
#cat, #cd, #cliner, #copy_file, #delete, #dirname_but_retains_the_trailing_slash, #disable_colours, #ensure_that_the_log_directory_exists, #esystem, #get_user_input, #infer_the_namespace, #is_on_roebe?, #log_dir?, #mkdir, #mkdir_then_cd_into_it, #mv, #namespace?, #opne, #opnn, #project_base_directory?, #project_image_directory?, #project_yaml_directory?, #rds, #register_sigint, #remove_this_directory, #rename_file, #reset_the_internal_hash, #return_pwd, #return_today, #touch_file, #wrap, #write_what_into
Constructor Details
#initialize(i, run_already = true) ⇒ ForumCompacter
28
29
30
31
32
33
34
|
# File 'lib/games_and_rpg_paradise/lpc/geas/forum_compacter.rb', line 28
def initialize(
i, run_already = true
)
reset
set_input(i)
run if run_already
end
|
Instance Method Details
77
78
79
80
81
|
# File 'lib/games_and_rpg_paradise/lpc/geas/forum_compacter.rb', line 77
def parse_input
day = @input.first.split(' ').first.delete(',')
array_all_names = @input.map {|entry| entry.split(' ').last.delete('.') }.uniq
report_result(day, array_all_names)
end
|
#report_result(day, array_all_names) ⇒ Object
86
87
88
|
# File 'lib/games_and_rpg_paradise/lpc/geas/forum_compacter.rb', line 86
def report_result(day, array_all_names)
e day+' '+array_all_names.join(', ')+'.'
end
|
#reset ⇒ Object
39
40
41
|
# File 'lib/games_and_rpg_paradise/lpc/geas/forum_compacter.rb', line 39
def reset
super()
end
|
#run ⇒ Object
93
94
95
96
|
# File 'lib/games_and_rpg_paradise/lpc/geas/forum_compacter.rb', line 93
def run
sanitize_input
parse_input
end
|
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
# File 'lib/games_and_rpg_paradise/lpc/geas/forum_compacter.rb', line 57
def sanitize_input
if @input and @input.is_a?(Array)
@input.map! {|entry|
entry.delete!('`')
entry.chop! if entry.end_with? '.'
entry
}
@input.reject! {|entry| entry.empty? }
end
end
|
46
47
48
49
50
51
52
|
# File 'lib/games_and_rpg_paradise/lpc/geas/forum_compacter.rb', line 46
def set_input(i)
i = i.first if i.is_a? Array
if i.include? "\n"
i = i.split("\n")
end if i.is_a? String
@input = i
end
|