hub_store 0.2.0 → 0.3.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: 97df8ac363de159068fcaed6d97775965aac3b7a62e0d306df1d2535b3dd5e7d
4
- data.tar.gz: b89c4e5ebe4c0658f9fcfdf0f0de61bf585b070560f4e709817180ffc72b6fef
3
+ metadata.gz: 7d8ec203d46de7634c8300d108f465c8a31f2a7f849a54df76bdf486e2086b8c
4
+ data.tar.gz: 4427b681d40c533bbd234a34a3c216ee02dcc9de3d94ff5ee413ed861444de34
5
5
  SHA512:
6
- metadata.gz: a087117ba86485c70612ac5bf22a6c383976fb51c360b817803b063fa398673df1879e924b4cbadb24118d971e372d4fd26c308228ac729d907093b512124391
7
- data.tar.gz: b15235ea2df9efc3c7f4f445662fe6e6d03073a35e71ce8830dd0a2a606957dbaddc7121769ee57ec2e57ec887b42d7bcac366cec33b1381c68eb1e9e93e0426
6
+ metadata.gz: ad6cff429019cb4c7973c65496e0ca53bf3deee57934c10a5dc52be5261b54095ed4d7ecd7aea43ee689d66b32876bddfc7db0825b7dab8a3750f1be2755c15a
7
+ data.tar.gz: 72554368bfe5be80168ccee9f51c223613dafe672a99b68caca2055d66660a75a3b694098a3597495f1790170767a787cd4c262ef4b43cefff569014b13cd569
data/hub_store.gemspec CHANGED
@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency "bundler"
26
26
  spec.add_development_dependency "rake", "~> 10.0"
27
27
  spec.add_development_dependency "minitest", "~> 5.0"
28
+ spec.add_development_dependency "pry"
28
29
 
29
30
  spec.add_dependency "activerecord"
30
31
  spec.add_dependency "dotenv"
data/lib/hub_store.rb CHANGED
@@ -6,7 +6,7 @@ require "hub_store/exporter"
6
6
  module HubStore
7
7
  class Error < StandardError; end
8
8
 
9
- # Set up a database that resides in RAM
9
+ # Set up database
10
10
  ActiveRecord::Base.establish_connection(
11
11
  adapter: "sqlite3",
12
12
  database: "db/hub_store"
@@ -17,7 +17,15 @@ module HubStore
17
17
  unless ActiveRecord::Base.connection.table_exists?("pull_requests")
18
18
  create_table "pull_requests", force: :cascade do |t|
19
19
  t.string "submitter"
20
+ t.string "number"
20
21
  t.string "labels"
22
+ t.string "repo"
23
+ t.integer "approval_time"
24
+ t.integer "time_to_first_review"
25
+ t.integer "merge_time"
26
+ t.integer "additions"
27
+ t.integer "review_count"
28
+ t.boolean "straight_approval"
21
29
  t.datetime "closed_at"
22
30
  t.datetime "created_at", null: false
23
31
  t.datetime "updated_at", null: false
data/lib/hub_store/cli.rb CHANGED
@@ -18,7 +18,7 @@ module HubStore
18
18
  attr_reader :argv
19
19
 
20
20
  def start_date
21
- PullRequest.order(updated_at: :desc).limit(1).pluck(:updated_at).first
21
+ PullRequest.resume_date
22
22
  end
23
23
 
24
24
  def import_data
@@ -2,5 +2,8 @@ require "active_record"
2
2
 
3
3
  module HubStore
4
4
  class PullRequest < ActiveRecord::Base
5
+ def self.resume_date
6
+ group(:repo).order(updated_at: :asc).pluck(:updated_at).min
7
+ end
5
8
  end
6
9
  end
@@ -1,3 +1,3 @@
1
1
  module HubStore
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.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.2.0
4
+ version: 0.3.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-11 00:00:00.000000000 Z
11
+ date: 2019-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '5.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: pry
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: activerecord
57
71
  requirement: !ruby/object:Gem::Requirement