hub_link 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5e6efc4fccc71d1f41ee45331e82d0dfb4a22f0
4
- data.tar.gz: d203dadbde0c1aea2a507784d9dab1dc957c5f53
3
+ metadata.gz: 8aad7cd8013fbb914ec24690d5e7f39e72bd3d6a
4
+ data.tar.gz: 61149d5323fc6ddbfb0051e3e4113203a0015433
5
5
  SHA512:
6
- metadata.gz: f9095550877c1da56f5e13f088cd13692379f0928a1e9a168bf325c8ce1f0c52b5bd13cb50c904e3a3840f378052a06caff7d14121941b0afcd1438287ecd563
7
- data.tar.gz: 8b577988c40f4727074108a503bc308deb9ce70207826bf3bf080df09978a7f3b495e9a1f52fac3ed764fb6a205ddea2d4c32347fb36e89e9c857e1dd18d4a2b
6
+ metadata.gz: 590c8db368abe5b67324bcb8b83d051fa537c8d55214f461a55a9977cc6ff33e31746c3db6ca56752d3002438c615fa688b5c909413250e48b68369a5d3c0c30
7
+ data.tar.gz: 826fe2cff33c8dc037912b7feb6624ad2a7145a9f73732c857bb663ddea0c7dfb8a7f86398bfc3101b25afa9e4c519abdc9e9a41115f2f2f65e62f44eb9c3d07
data/README.md CHANGED
@@ -14,9 +14,7 @@ Add this line to your application's Gemfile:
14
14
  Then you can do:
15
15
 
16
16
  ```ruby
17
- REPOS = "balvig/hub_link,balvig/hub_store"
18
-
19
- stream = HubLink::Stream.new(REPOS, start_date: 3.months.ago)
17
+ stream = HubLink::Stream.new("balvig/hub_link", start_date: 3.months.ago)
20
18
 
21
19
  stream.in_batches do |batch|
22
20
  batch.prs # => [{ id: 34, merge_time: 6400, ... }]
@@ -5,8 +5,8 @@ module HubLink
5
5
  class Stream
6
6
  GITHUB_BATCH_SIZE = 14
7
7
 
8
- def initialize(repos, start_date: 2.years.ago)
9
- @repos = repos.split(",")
8
+ def initialize(repo, start_date: 2.years.ago)
9
+ @repo = repo
10
10
  @start_date = start_date.to_date
11
11
  end
12
12
 
@@ -18,26 +18,16 @@ module HubLink
18
18
 
19
19
  private
20
20
 
21
- attr_accessor :repos, :start_date
21
+ attr_accessor :repo, :start_date
22
22
 
23
23
  def queries
24
24
  start_date.step(end_date, GITHUB_BATCH_SIZE).map do |date|
25
- "type:pr updated:#{date}..#{date + GITHUB_BATCH_SIZE} #{repo_query}"
25
+ "type:pr updated:#{date}..#{date + GITHUB_BATCH_SIZE} repo:#{repo}"
26
26
  end
27
27
  end
28
28
 
29
29
  def end_date
30
30
  Date.tomorrow
31
31
  end
32
-
33
- def repo_query
34
- @_repo_query ||= build_repo_query
35
- end
36
-
37
- def build_repo_query
38
- repos.map do |r|
39
- "repo:#{r}"
40
- end.join(" ")
41
- end
42
32
  end
43
33
  end
@@ -1,3 +1,3 @@
1
1
  module HubLink
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hub_link
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Balvig