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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a8ed94750ccdb61d0b311f0966fdfe42c8c724a8
4
- data.tar.gz: 5a790ce59fb876b6b37077e43e54e19761374e94
3
+ metadata.gz: 2799343fa33722333f0f9165b12ad499d13e4bbb
4
+ data.tar.gz: 2e3c05779ef6b7b61bd0e34e62a8563932ca1d2b
5
5
  SHA512:
6
- metadata.gz: 0bd4e7b877a8ff7dc1ed394211b0871b5be37c866ce38ba769d324bea608ccd64ce2260e0904fa86f74a071f14f83055e0951ba72b4be2d2c7bc65ba55e752cc
7
- data.tar.gz: a8bd530795467cd391682779e94bdc53913f5e1e005de4ef09c144511bebbbd9caafa91b83b6b49cc0c6ab7a4a99c96c4126c543b8f67d1a3d44e7930b7e2c03
6
+ metadata.gz: 633f29ce5ceb035e39bb22afa9b5fa6c50b0b577583ac76631a27163faae3da449748b928e43880b2b2f70abd92964b5be683271249fa75dc966b963227f4114
7
+ data.tar.gz: 3a2348028cc310cf0bd1bf5d3d93eb4dc68c2680d8658d5afed6cf671d1759aed2b68004d9a93e15cf0b35bba5f8a0ca0a1d78873d6c32ace300f3e1fb52cf33
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- reddit_bag_of_words (0.0.2)
4
+ reddit_bag_of_words (0.1.0)
5
5
  blanket_wrapper
6
6
  hashie
7
7
  multiset
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
- request.bag = { :a => 1,
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
@@ -42,6 +42,6 @@
42
42
  null
43
43
  ]
44
44
  },
45
- "timestamp": 1433795468
45
+ "timestamp": 1434648355
46
46
  }
47
47
  }
@@ -18,15 +18,15 @@ module RedditBagOfWords
18
18
  @subreddit_url += '.json' unless subreddit_url.include? '.json'
19
19
  end
20
20
 
21
- def bag
22
- symbolize_keys = collection_transform(string_bag)
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 string_bag
26
+ def titles_string_bag
27
27
  hash_request = request.get
28
28
  payload = payload_hash(hash_request)
29
- symbol_collection = payload_titles(payload[:data][:children])
29
+ payload_titles(payload[:data][:children])
30
30
  end
31
31
 
32
32
  private
@@ -1,4 +1,4 @@
1
1
  # +RedditBagOfWords::VERSION+
2
2
  module RedditBagOfWords
3
- VERSION = '0.0.2'
3
+ VERSION = '0.1.0'
4
4
  end
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 '#bag' do
17
- its(:bag) { is_expected.to be_a Multiset }
16
+ describe '#titles_bag' do
17
+ its(:titles_bag) { is_expected.to be_a Multiset }
18
18
  end
19
19
 
20
- describe '#string_bag' do
21
- its(:string_bag) { is_expected.to be_a String }
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.2
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-08 00:00:00.000000000 Z
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