twords 0.1.3 → 0.1.4

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: 0d9a3acb581e8d88cccecaa1f81755b24ccae3d8
4
- data.tar.gz: e537d3ea87fec86ae57d06f3902b9b27a2ddfa89
3
+ metadata.gz: 27f1c65684b3af0b7d96a2987c5d597e1a3e2049
4
+ data.tar.gz: 332a52d200691a188ec34d8e902e71c033f64e3f
5
5
  SHA512:
6
- metadata.gz: c4adc74dfeb9c6aae7897aca0a8daf5eb519d3ac53cb826fee954b3ead3a38c462a5fc010c88ca28199012456759739ca0f3c1c544137e0558ca349b19fad53d
7
- data.tar.gz: 2838be4f9d6f6a83fb8aab1cdee4c201d1665a545c595cd64e3fddde6a7c2e53bc263a44544ada42b531caaa12f94f8b5c1772d4f8d72cd13f8f89c3bdffad07
6
+ metadata.gz: 1419af30473aa0c1dd9f831515c1a5f1a1c8e37cb9f18cdb482fc18bbd7a86d7144fc5e9e01a5d6c2d5b80c586dfc8b64bec18bc8a69f692c0e3520ec7118c6c
7
+ data.tar.gz: 4418803ab8a1ba929f274e0897bcdf22a2266757aff02e7b63e6bc55fc62a08f28e2d05c1b50a8c83563669eb438efa4be73542fdcdae75cff5a81c50e8d675c
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ![twords](https://msimonborg.com/twords/twords.png)
1
+ ![twords](http://msimonborg.com/twords/twords.png)
2
2
 
3
3
  ## Twitter word clouds
4
4
 
@@ -24,9 +24,14 @@ Or install it yourself as:
24
24
 
25
25
  ```ruby
26
26
  Twords.config do |config|
27
- config.rejects = %w[the for and a i of if]
28
- config.range = 14
29
- config.up_to { Time.now } # A time object to be lazy evaluated. The range is counted backward from here.
27
+ config.rejects = %w[are this is from be on the for to and at our of in rt a with &] # these words will not be counted (example, not a default; you must provide your own list)
28
+ config.range = 14 # number of days to check, no default
29
+
30
+ config.include_hashtags = false # default, excludes words beginning with '#'
31
+ config.include_uris = false # default, uses URI#regexp to match
32
+ config.include_mentions = false # default, excludes words beginning with '@'
33
+
34
+ config.up_to { Time.now } # The block must return an object that responds to #to_time. The time is lazy evaluated and the range is counted backward from here.
30
35
 
31
36
  config.twitter_client do |twitter|
32
37
  twitter.consumer_key = YOUR_TWITTER_CONSUMER_KEY
data/lib/twords.rb CHANGED
@@ -101,7 +101,7 @@ class Twords
101
101
 
102
102
  def hashtag?(word)
103
103
  return false if self.class.include_hashtags
104
- word.match?(/#/)
104
+ word.match?(/#(\w+)/)
105
105
  end
106
106
 
107
107
  def uri?(word)
@@ -111,7 +111,7 @@ class Twords
111
111
 
112
112
  def mention?(word)
113
113
  return false if self.class.include_mentions
114
- word.match?(/@/)
114
+ word.match?(/@(\w+)/)
115
115
  end
116
116
 
117
117
  def hashtags
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Twords
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
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.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - M. Simon Borg