brutalismbot 0.6.0 → 0.6.1

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
  SHA256:
3
- metadata.gz: '090b1145444345aaf5209720d21d60ae747f5d0e7e7a3f4382762d957889692a'
4
- data.tar.gz: ac882dbc8e4371cb38904557fea4509a42aecfa3c9b66e41dbef6c07011e3dea
3
+ metadata.gz: 3f5d9a6bba9f8e46a8bfd482cc6342dc1f550fb37ac6cba15d425042b0d5cb59
4
+ data.tar.gz: b7018131ceaadba8f98322a7d2e110e1ecfedd67d442d75beca66aee00d27896
5
5
  SHA512:
6
- metadata.gz: 829046540898067f999c8aef859cd06058ccd503e2d8e9528fff0340d2897d94e77b6c56ddecbd8a6a2a24b84882ae6a0fd32cdee9c3e99bd34a0718a64291ba
7
- data.tar.gz: 477d74640589d39412e9b2ff109a73b1b8b8fcc1e32b99a77740050e4fbc939583df3d40b48517194bd7257e2a71f077bfc4bba795cc7288419740389e3fd988
6
+ metadata.gz: e752b362820e81a6ddfdaa7e9a4b8b3e4f3fce841dbe87de2bc34879eedc760dbac5dc7f5a0930408878dffd92cd5ff8174406a859f2e4eba4e7b76c55fe3254
7
+ data.tar.gz: 8d8b6780fe0d0f8de0e0c500cc87a4627477ccd9d73bb4705ff32c8e1cab719921be45efdd11f00e4663f9fab379c6feed74093fb1e7ae3b505d9b6f11a7c0c7
@@ -105,6 +105,10 @@ module Brutalismbot
105
105
  end.to_json
106
106
  }
107
107
  end
108
+
109
+ def subreddit(endpoint:nil, user_agent:nil)
110
+ R::Brutalism.new endpoint:endpoint, user_agent: user_agent
111
+ end
108
112
  end
109
113
 
110
114
  class Client < Prefix
@@ -117,10 +121,6 @@ module Brutalismbot
117
121
  prefix = File.join @prefix, "posts/"
118
122
  PostCollection.new bucket: @bucket, prefix: prefix, client: @client
119
123
  end
120
-
121
- def subreddit(endpoint:nil, user_agent:nil)
122
- R::Brutalism.new endpoint:endpoint, user_agent: user_agent
123
- end
124
124
  end
125
125
 
126
126
  class AuthCollection < Prefix
@@ -170,8 +170,8 @@ module Brutalismbot
170
170
  max_key.key.match(/(\d+).json\z/).to_a.last.to_i
171
171
  end
172
172
 
173
- def pull(min_time = nil, max_time = nil)
174
- posts = R::Brutalism.new.posts(:new)
173
+ def pull(min_time:nil, max_time:nil, endpoint:nil, user_agent:nil)
174
+ posts = subreddit(endpoint: endpoint, user_agent: user_agent).posts(:new)
175
175
  posts = posts.select{|x| x.created_between?(min_time, max_time) }
176
176
  posts = posts.sort{|a,b| a.created_utc <=> b.created_utc }
177
177
  posts.map{|x| put x }
@@ -1,3 +1,3 @@
1
1
  module Brutalismbot
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brutalismbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Mancevice
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-13 00:00:00.000000000 Z
11
+ date: 2019-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-s3