twords 0.1.1 → 0.1.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: 8c61f756b270c5705f4c3ca17a75e6bed5c8e7af
4
- data.tar.gz: 95137999f02c5f1b1193c66f6095362e68e42715
3
+ metadata.gz: 3bd960588a5adf41656a50a83db3a70a527bd128
4
+ data.tar.gz: da855462537cc299c03e662223b073c528fb2263
5
5
  SHA512:
6
- metadata.gz: b75f30b0d3a93ff8341d05e5a68c88f295a9f8cdf6bf32ff2b05399244896f83ded2afbae890556abed01d62562f097260aa09d50e285ab6dbeac121a0a973f6
7
- data.tar.gz: '0805b16be099bbc59975105f02635d7dc052da1e0195957c847d5b0658f7a1bd019af42a13ffbc678bc2cf6a6023d8b7ded6f14dfff332656802d9cbd59969e5'
6
+ metadata.gz: 35a78833f558014514f74e06f9ae744add07bc16c0e109adfd6370cfe4bab07e189b2a45e08461e539ba501af3c39a7b26275f0294805f4589ca8f73b1de8f43
7
+ data.tar.gz: 98ea7895c7cec6745d498aa6b2ffb0164096801628d08589a3889732eb3ce54cec4e3c408fb79c248c5bfabf3232f464026fb1e95a3411f7ba6fe250176105c9
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ![twords](http://msimonborg.com/twords/twords.png)
1
+ ![twords](https://msimonborg.com/twords/twords.png)
2
2
 
3
3
  ## Twitter word clouds
4
4
 
@@ -24,7 +24,7 @@ Or install it yourself as:
24
24
 
25
25
  ```ruby
26
26
  Twords.config do |config|
27
- config.throw_aways = %w[the for and a i of if]
27
+ config.rejects = %w[the for and a i of if]
28
28
  config.range = 14
29
29
  config.up_to { Time.now } # A time object to be lazy evaluated. The range is counted backward from here.
30
30
 
data/lib/twords.rb CHANGED
@@ -6,7 +6,7 @@ require 'twitter'
6
6
  require 'twords/version'
7
7
 
8
8
  # Twords.config do |config|
9
- # config.throw_aways = %w[the for and a i of if]
9
+ # config.rejects = %w[the for and a i of if]
10
10
  # config.max_age = 14
11
11
  # config.up_to { Time.now }
12
12
  #
@@ -27,7 +27,7 @@ require 'twords/version'
27
27
  # # => { "butts"=>35, "poo"=>32, "pups"=>28, ... }
28
28
  class Twords
29
29
  class << self
30
- attr_reader :throw_aways, :range, :client, :up_to_block
30
+ attr_reader :rejects, :range, :client, :up_to_block
31
31
 
32
32
  def config(&block)
33
33
  class_eval(&block)
@@ -37,8 +37,8 @@ class Twords
37
37
  @client = Twitter::REST::Client.new(&block)
38
38
  end
39
39
 
40
- def throw_aways=(*args)
41
- @throw_aways = args.flatten
40
+ def rejects=(*args)
41
+ @rejects = args.flatten
42
42
  end
43
43
 
44
44
  def range=(integer)
@@ -93,9 +93,9 @@ class Twords
93
93
  return timeline if age_of_tweet_in_days(timeline.last) > range
94
94
  @requests += 1
95
95
  timeline += client.user_timeline(
96
- screen_name,
97
- max_id: timeline.last.id - 1,
98
- count: 200
96
+ screen_name,
97
+ max_id: timeline.last.id - 1,
98
+ count: 200
99
99
  )
100
100
  fetch_older_tweets(timeline, screen_name)
101
101
  end
@@ -115,7 +115,7 @@ class Twords
115
115
  tweet_with_full_text = fetch_tweet_with_full_text(tweet)
116
116
  words_array = tweet_with_full_text.attrs[:full_text].downcase.split(' ')
117
117
  words_array.each do |word|
118
- next if self.class.throw_aways.include?(word)
118
+ next if self.class.rejects.include?(word)
119
119
  if words.has_key?(word)
120
120
  words[word] += 1
121
121
  else
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Twords
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twords
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - M. Simon Borg