hub_store 0.7.0 → 0.8.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
  SHA256:
3
- metadata.gz: 1cc3b407432b8cd4c42e64b8ac908390e089860cc3c5f9295fc5efe26e394c95
4
- data.tar.gz: 20f89a14ad08ca38b31542dfe5eda2fe9e1d71225c55111951163b9d27e46b7d
3
+ metadata.gz: e94f7a163956956655855bc7d7d7cb90a4116b510d03affca8a9e35091190481
4
+ data.tar.gz: cf16acb2db55a399c8361a04086726cf8fd3fa9bbf82e01c768792d5333b815d
5
5
  SHA512:
6
- metadata.gz: 701b35231adb89cbf9e8288d56b06b7d5169180f4538b938c9ab2ad04a2d85ad68818d9778c4d6245135ad3ec1fd13b2342db5940460a033c51ea8cdfcbc29dc
7
- data.tar.gz: 4d013553b140680a3aac53d6d145646196cdda99713757f0fcdd3b70a4bfeb69e091cf517f19900ed09a9eb6d2399d5189ab8c8d31803569877b044f3d7bb3d5
6
+ metadata.gz: db58b28dffa87b781b3e7c4624f69d4f35ac86dacc739b723b83b3940b950814d5f08e01de0aa7539d67310c572eb59c1210b4bb8e0d819718da822367f079cc
7
+ data.tar.gz: f0f21d5dbfdda2441fb25f88f7a4c3a9e43bbfa4af3d8d585ce1f634c75debffbb4576fb1695e01451705e311386236b055257ac1ccd1c10582b065d2e3f6c5d
data/README.md CHANGED
@@ -5,7 +5,7 @@ analysis etc.
5
5
 
6
6
  ## Usage
7
7
 
8
- Running the following will export 2 years worth of PRs/Reviews to CSV
8
+ Running the following will export all PR/Review metadata in a repo to CSV
9
9
  files.
10
10
 
11
11
  The gem will use an sqlite db as interim storage to allow resuming and
data/hub_store.gemspec CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
 
32
32
  spec.add_dependency "activerecord"
33
33
  spec.add_dependency "dotenv"
34
- spec.add_dependency "hub_link", ">= 0.7"
34
+ spec.add_dependency "hub_link", ">= 0.8"
35
35
  spec.add_dependency "sqlite3"
36
36
  spec.add_dependency "tty-spinner"
37
37
  end
data/lib/hub_store.rb CHANGED
@@ -27,27 +27,23 @@ module HubStore
27
27
  t.boolean "straight_approval"
28
28
  t.datetime "closed_at"
29
29
  t.datetime "created_at", null: false
30
- t.datetime "updated_at", null: false
31
30
  end
32
31
  end
33
32
 
34
33
  unless ActiveRecord::Base.connection.table_exists?("reviews")
35
34
  create_table "reviews", force: :cascade do |t|
36
35
  t.bigint "pull_request_id"
37
- t.datetime "submitted_at"
36
+ t.datetime "submitted_at", null: false
38
37
  t.string "reviewer"
39
38
  t.boolean "approval"
40
- t.datetime "created_at", null: false
41
- t.datetime "updated_at", null: false
42
39
  end
43
40
  end
44
41
 
45
42
  unless ActiveRecord::Base.connection.table_exists?("review_requests")
46
43
  create_table "review_requests", force: :cascade do |t|
47
- t.string "user"
44
+ t.string "requester"
48
45
  t.string "reviewer"
49
46
  t.datetime "created_at", null: false
50
- t.datetime "updated_at", null: false
51
47
  end
52
48
  end
53
49
  end
data/lib/hub_store/cli.rb CHANGED
@@ -26,7 +26,7 @@ module HubStore
26
26
  end
27
27
 
28
28
  def export_csv
29
- [PullRequest, Review].each do |resource|
29
+ [PullRequest, Review, ReviewRequest].each do |resource|
30
30
  Exporter.new(resource: resource).run
31
31
  end
32
32
  end
@@ -5,17 +5,20 @@ require "hub_store/review"
5
5
 
6
6
  module HubStore
7
7
  class Exporter
8
- def initialize(resource:)
8
+ def initialize(resource:, ui: Ui.new)
9
9
  @resource = resource
10
+ @ui = ui
10
11
  end
11
12
 
12
13
  def run
14
+ ui.start("Exporting #{csv_file_name}")
13
15
  export_csv
16
+ ui.stop("Done.")
14
17
  end
15
18
 
16
19
  private
17
20
 
18
- attr_reader :resource
21
+ attr_reader :resource, :ui
19
22
 
20
23
  def export_csv
21
24
  CSV.open(csv_file_name, "w", write_headers: true, headers: columns) do |csv|
@@ -1,3 +1,3 @@
1
1
  module HubStore
2
- VERSION = "0.7.0"
2
+ VERSION = "0.8.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hub_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Balvig
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-17 00:00:00.000000000 Z
11
+ date: 2019-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: '0.7'
131
+ version: '0.8'
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
- version: '0.7'
138
+ version: '0.8'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: sqlite3
141
141
  requirement: !ruby/object:Gem::Requirement