textmood 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/bin/textmood +12 -3
  2. 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
- if ARGV[0]
103
+ def do_main(text, options)
104
104
  scorer = TextMood.new(options)
105
- puts scorer.score_text(ARGV[0])
105
+ puts scorer.score_text(text)
106
+ end
107
+
108
+ if ARGV[0]
109
+ do_main(ARGV[0], options)
106
110
  else
107
- mini_usage(usage, true)
111
+ text = $stdin.read
112
+ if text
113
+ do_main(text, options)
114
+ else
115
+ mini_usage(usage, true)
116
+ end
108
117
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: textmood
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: