textmood 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/textmood +12 -3
- metadata +1 -1
data/bin/textmood
CHANGED
@@ -100,9 +100,18 @@ opts_parser = OptionParser.new do |opts|
|
|
100
100
|
end
|
101
101
|
opts_parser.parse!
|
102
102
|
|
103
|
-
|
103
|
+
def do_main(text, options)
|
104
104
|
scorer = TextMood.new(options)
|
105
|
-
puts scorer.score_text(
|
105
|
+
puts scorer.score_text(text)
|
106
|
+
end
|
107
|
+
|
108
|
+
if ARGV[0]
|
109
|
+
do_main(ARGV[0], options)
|
106
110
|
else
|
107
|
-
|
111
|
+
text = $stdin.read
|
112
|
+
if text
|
113
|
+
do_main(text, options)
|
114
|
+
else
|
115
|
+
mini_usage(usage, true)
|
116
|
+
end
|
108
117
|
end
|