lita-onewheel-snowcrash 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/README.md +1 -1
- data/lib/lita/handlers/onewheel_snowcrash.rb +11 -14
- data/lita-onewheel-template.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2abb5252d2bf386ba1227509d657d122424c879
|
4
|
+
data.tar.gz: b1894b65b97ed4a2956365de3407e10598042047
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1653c6f16f6f02c6eefe75041a511450919e19b6a0f6b9e8a99f2599a49f84135d0efd4fd4c5f6c1a9a7bb81ac0fad743973faefb5a65b7850272c7a091ac4bf
|
7
|
+
data.tar.gz: 7f6950d80d1b1548aa3045b2a53b21602ab2fbe0f672b05f5496a7a51a18aeaf777a16cdd06d2aa7c2ffa92012da7dacb01d7f5111c7099455a28d498ce6ad06
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -16,6 +16,10 @@ module Lita
|
|
16
16
|
:generate_words_by_number,
|
17
17
|
command: true
|
18
18
|
|
19
|
+
Markov = MarkyMarkov::Dictionary.new('dict/snowcrash')
|
20
|
+
Markov.parse_file(File.expand_path('../../dict/snowcrash.txt',
|
21
|
+
File.dirname(__FILE__)))
|
22
|
+
|
19
23
|
def generate_random_sentence(response)
|
20
24
|
response.reply return_sentence_chain(1)
|
21
25
|
end
|
@@ -32,26 +36,19 @@ module Lita
|
|
32
36
|
response.reply return_word_chain(response.matches[0][0])
|
33
37
|
end
|
34
38
|
|
35
|
-
def get_markov
|
36
|
-
puts File.join(File.dirname(File.expand_path(__FILE__)), '../../dict/snowcrash')
|
37
|
-
# MarkyMarkov::Dictionary.new(File.join(File.dirname(File.expand_path(__FILE__)), 'dict/snowcrash'))
|
38
|
-
MarkyMarkov::Dictionary.new('dict/snowcrash')
|
39
|
-
end
|
40
|
-
|
41
39
|
def return_word_chain(number)
|
42
40
|
Lita.logger.info "Generating #{number} words."
|
43
|
-
|
44
|
-
words = markov.generate_n_words(number.to_i)
|
45
|
-
Lita.logger.info words
|
46
|
-
words
|
41
|
+
log_and_return Markov.generate_n_words(number.to_i)
|
47
42
|
end
|
48
43
|
|
49
44
|
def return_sentence_chain(number)
|
50
45
|
Lita.logger.info "Generating #{number} sentences."
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
46
|
+
log_and_return Markov.generate_n_sentences(number.to_i)
|
47
|
+
end
|
48
|
+
|
49
|
+
def log_and_return(message)
|
50
|
+
Lita.logger.info message
|
51
|
+
message
|
55
52
|
end
|
56
53
|
|
57
54
|
Lita.register_handler(self)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-onewheel-snowcrash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kreps
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
177
|
version: '0'
|
178
178
|
requirements: []
|
179
179
|
rubyforge_project:
|
180
|
-
rubygems_version: 2.
|
180
|
+
rubygems_version: 2.6.11
|
181
181
|
signing_key:
|
182
182
|
specification_version: 4
|
183
183
|
summary: See above.
|