twitter_ebooks 2.3.1 → 2.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 88ce1252a7ecb18f0d8670a180528c65083e22cd
4
- data.tar.gz: 7af9ad8f5464571d0e3f9d394805fd4244910807
3
+ metadata.gz: 6c11c99337f28c765e0061e6e9a541ae3def2eb3
4
+ data.tar.gz: aeb8bf213b41972ea1257e3b5f4bba14a2df88c3
5
5
  SHA512:
6
- metadata.gz: ef1e74a136e604aa89bb0a792303b24c8b24b22bf74a9ad3a9971d7341f6f6df7c4db2961b394601f24ceb38e44452284d942915e94894f872b1f9ed9c6f852c
7
- data.tar.gz: 6d8dc5f5c3c98a5459424c4eb5c1eb6f60c161989d58b13e2e5702a0b3eb72d9dc9cfa5adf8117fb6cfab5040d67c5ad3f458cde614622f1fdb0300cc0d99964
6
+ metadata.gz: 07955ae0c6fb60549ad3fb48dc742ea6378e889c9ef9300bce7a78ef56ab11990c1a2d76f5046f62b1b75dca9dbb5165860d70d5db3dc6a7e5be28915a306f19
7
+ data.tar.gz: 3d4a3459c7fe881c92773fe3d0b40dc32e440aaa208cf95f010a8d541fa826760a86370adcbbda1a4f93e448ace3d3089fd454eb808c37cdbbcd0bdbd870dc04
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # twitter\_ebooks 2.3.1
1
+ # twitter\_ebooks 2.3.2
2
2
 
3
3
  Rewrite of my twitter\_ebooks code. While the original was solely a tweeting Markov generator, this framework helps you build any kind of interactive twitterbot which responds to mentions/DMs. See [ebooks\_example](https://github.com/mispy/ebooks_example) for an example of a full bot.
4
4
 
@@ -8,18 +8,22 @@ require 'csv'
8
8
 
9
9
  module Ebooks
10
10
  class Model
11
- attr_accessor :hash, :sentences, :mentions, :keywords
11
+ attr_accessor :hash, :tokens, :sentences, :mentions, :keywords
12
12
 
13
13
  def self.consume(txtpath)
14
14
  Model.new.consume(txtpath)
15
15
  end
16
16
 
17
17
  def self.load(path)
18
- props = Marshal.load(File.open(path, 'rb') { |f| f.read })
19
- @tokens = props[:tokens]
20
- @sentences = props[:sentences]
21
- @mentions = props[:mentions]
22
- @keywords = props[:keywords]
18
+ model = Model.new
19
+ model.instance_eval do
20
+ props = Marshal.load(File.open(path, 'rb') { |f| f.read })
21
+ @tokens = props[:tokens]
22
+ @sentences = props[:sentences]
23
+ @mentions = props[:mentions]
24
+ @keywords = props[:keywords]
25
+ end
26
+ model
23
27
  end
24
28
 
25
29
  def save(path)
@@ -1,3 +1,3 @@
1
1
  module Ebooks
2
- VERSION = "2.3.1"
2
+ VERSION = "2.3.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twitter_ebooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaiden Mispy