repocrawler 0.1.13 → 0.1.14

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: 7145007155d708adada6c293c80f59bb85d99352
4
- data.tar.gz: 7d78dd81ffc80edfce18b95302b57ea3bd8f830b
3
+ metadata.gz: 64b653f8ff7c4732d69a44bc05907fa5b407df15
4
+ data.tar.gz: dca87868f84e2fbb5d6a65eadc475d9fed3dbdda
5
5
  SHA512:
6
- metadata.gz: 38afe58e103e57490fbe2da77bab6ebb8eed94a3cf5095b1c7b369cc590ffe306ec1acbe27c9465428c486be723efb9de07de50af47f684fcddf5572ceea636e
7
- data.tar.gz: 7c6aeb85391ed0137380a01dce86aa9f9a59a3a4a4e4953bcc92d24667f62a72bb89bf3d2106021d1bcd834c5878fd462e8a61e8d219ed6eb590a6cee922f7ad
6
+ metadata.gz: 5aba49c693e6aaf9453f5bda5f2bb58efd8e1c882647059ba14a5f6cac818647fed89da5c40ff93ec01afae3600ca65f065fe639a41e800087858296e5cc63a4
7
+ data.tar.gz: 342cffeb3436c2ffd15bb4598a25e673449ae3a327055d8de8e0fcccbf575f837299b8c915714f0e7d7134eb7ed992a55537731338c8f4039af209d75c307ccb
@@ -139,10 +139,11 @@ module Repos
139
139
 
140
140
  # get the date of the last commit
141
141
  def get_last_commits_days
142
- github = Github.new basic_auth: "#{@github_account}:#{@github_password}"
143
-
144
- commit = github.repos.commits.list(@repo_user, @repo_name).to_ary[0].to_hash['commit']['author']['date']
145
- last_commit = (Date.today - Date.parse(commit)).to_i
142
+ commits_fetch = HTTParty.get(@GITHUB_API_BASE_URL + "/commits?access_token=#{@access_token}", headers: {
143
+ "User-Agent" => @user_agent
144
+ })
145
+ last_commit_date = commits_fetch.first['commit']['comitter']['date']
146
+ last_commit = (Date.today - Date.parse(last_commit_date)).to_i
146
147
 
147
148
  last_commit
148
149
  end
@@ -1,4 +1,4 @@
1
1
  # Versioning
2
2
  module Repos
3
- VERSION = '0.1.13'
3
+ VERSION = '0.1.14'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: repocrawler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Chen