reddit_bag_of_words 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +5 -2
- data/coverage/.resultset.json +1 -1
- data/lib/reddit_bag_of_words/client.rb +4 -4
- data/lib/reddit_bag_of_words/version.rb +1 -1
- data/pkg/reddit_bag_of_words-0.0.2.gem +0 -0
- data/spec/reddit_bag_of_words/reddit_bag_of_words/client_spec.rb +4 -4
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2799343fa33722333f0f9165b12ad499d13e4bbb
|
4
|
+
data.tar.gz: 2e3c05779ef6b7b61bd0e34e62a8563932ca1d2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 633f29ce5ceb035e39bb22afa9b5fa6c50b0b577583ac76631a27163faae3da449748b928e43880b2b2f70abd92964b5be683271249fa75dc966b963227f4114
|
7
|
+
data.tar.gz: 3a2348028cc310cf0bd1bf5d3d93eb4dc68c2680d8658d5afed6cf671d1759aed2b68004d9a93e15cf0b35bba5f8a0ca0a1d78873d6c32ace300f3e1fb52cf33
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -23,10 +23,13 @@ Or install it yourself as:
|
|
23
23
|
|
24
24
|
```ruby
|
25
25
|
request = RedditBagOfWords.new('http://reddit.com/r/programming.json')
|
26
|
-
|
26
|
+
# returns bag of words hash
|
27
|
+
request.title_bag = { :a => 1,
|
27
28
|
:b => 2,
|
28
|
-
|
29
|
+
...
|
29
30
|
}
|
31
|
+
# returns string collection of words found
|
32
|
+
request.string_title_bag = { 'a', 'b', 'b', ...}
|
30
33
|
```
|
31
34
|
|
32
35
|
## Contributing
|
data/coverage/.resultset.json
CHANGED
@@ -18,15 +18,15 @@ module RedditBagOfWords
|
|
18
18
|
@subreddit_url += '.json' unless subreddit_url.include? '.json'
|
19
19
|
end
|
20
20
|
|
21
|
-
def
|
22
|
-
symbolize_keys = collection_transform(
|
21
|
+
def titles_bag
|
22
|
+
symbolize_keys = collection_transform(titles_string_bag)
|
23
23
|
multiset_data(symbolize_keys)
|
24
24
|
end
|
25
25
|
|
26
|
-
def
|
26
|
+
def titles_string_bag
|
27
27
|
hash_request = request.get
|
28
28
|
payload = payload_hash(hash_request)
|
29
|
-
|
29
|
+
payload_titles(payload[:data][:children])
|
30
30
|
end
|
31
31
|
|
32
32
|
private
|
Binary file
|
@@ -13,11 +13,11 @@ describe RedditBagOfWords::Client do
|
|
13
13
|
its(:subreddit_url) { is_expected.to eq "#{subreddit_url}.json" }
|
14
14
|
end
|
15
15
|
|
16
|
-
describe '#
|
17
|
-
its(:
|
16
|
+
describe '#titles_bag' do
|
17
|
+
its(:titles_bag) { is_expected.to be_a Multiset }
|
18
18
|
end
|
19
19
|
|
20
|
-
describe '#
|
21
|
-
its(:
|
20
|
+
describe '#titles_string_bag' do
|
21
|
+
its(:titles_string_bag) { is_expected.to be_a String }
|
22
22
|
end
|
23
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reddit_bag_of_words
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MichaelAChrisco
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: blanket_wrapper
|
@@ -199,6 +199,7 @@ files:
|
|
199
199
|
- lib/reddit_bag_of_words/client.rb
|
200
200
|
- lib/reddit_bag_of_words/version.rb
|
201
201
|
- pkg/reddit_bag_of_words-0.0.1.gem
|
202
|
+
- pkg/reddit_bag_of_words-0.0.2.gem
|
202
203
|
- reddit_bag_of_words.gemspec
|
203
204
|
- reddit_bag_of_words/.gitignore
|
204
205
|
- spec/reddit_bag_of_words/reddit_bag_of_words/client_spec.rb
|