hubba 0.7.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hubba/stats.rb +19 -3
- data/lib/hubba/update.rb +11 -8
- data/lib/hubba/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 338508b7de32e5872cb8d7c2d84ccbee8f2af484
|
4
|
+
data.tar.gz: 9995ea758dd641965ada299c49c2d46837bfbf03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34904326c8d6ba4461fe2e76b2f6708a4b539ccb2d1f08eb702013b4146f4f71d958894dc314d6b7d49e202fa59ddd701a8cd32fa4f5c7b926453219e4ad6682
|
7
|
+
data.tar.gz: 82506b15eef45965858b73fc151b52a0b63f09764ec076e4dc1bef740f03e92e1d0bb0a40bb6bb2f7419738bec52887f4e6036a689871b75b399b1efb7f90c85
|
data/lib/hubba/stats.rb
CHANGED
@@ -108,8 +108,9 @@ end # method update_traffic
|
|
108
108
|
|
109
109
|
|
110
110
|
def update( repo,
|
111
|
-
commits:
|
112
|
-
topics:
|
111
|
+
commits: nil,
|
112
|
+
topics: nil,
|
113
|
+
languages: nil ) ## update stats / fetch data from github via api
|
113
114
|
raise ArgumentError, "Github::Resource expected; got #{repo.class.name}" unless repo.is_a?( Github::Resource )
|
114
115
|
|
115
116
|
## e.g. 2015-05-11T20:21:43Z
|
@@ -121,6 +122,8 @@ end # method update_traffic
|
|
121
122
|
@data['size'] = repo.data['size'] # note: size in kb (kilobyte)
|
122
123
|
|
123
124
|
@data['description'] = repo.data['description']
|
125
|
+
|
126
|
+
### todo/check - remove language (always use languages - see below) - why? why not?
|
124
127
|
@data['language'] = repo.data['language'] ## note: might be nil!!!
|
125
128
|
|
126
129
|
|
@@ -190,9 +193,22 @@ end # method update_traffic
|
|
190
193
|
end
|
191
194
|
|
192
195
|
|
193
|
-
|
196
|
+
if languages
|
197
|
+
raise ArgumentError, "Github::Resource expected; got #{languages.class.name}" unless languages.is_a?( Github::Resource )
|
198
|
+
|
199
|
+
puts "update - languages:"
|
194
200
|
|
195
201
|
|
202
|
+
## e.g.
|
203
|
+
## {"Ruby"=>1020599, "HTML"=>3219, "SCSS"=>508, "CSS"=>388}
|
204
|
+
## or might be empty
|
205
|
+
## {}
|
206
|
+
|
207
|
+
@data[ 'languages' ] = languages.data
|
208
|
+
end
|
209
|
+
|
210
|
+
pp @data
|
211
|
+
|
196
212
|
|
197
213
|
## reset (invalidate) cached values from data hash
|
198
214
|
## use after reading or fetching
|
data/lib/hubba/update.rb
CHANGED
@@ -27,16 +27,19 @@ def self.update_stats( hash_or_path='./repos.yml' ) ## move to reposet e.g. Rep
|
|
27
27
|
stats = Stats.new( full_name )
|
28
28
|
stats.read
|
29
29
|
|
30
|
-
puts "update >#{full_name}< [1/
|
31
|
-
repo
|
32
|
-
puts "update >#{full_name}< [2/
|
33
|
-
commits
|
34
|
-
puts "update >#{full_name}< [3/
|
35
|
-
topics
|
30
|
+
puts "update >#{full_name}< [1/4] - fetching repo..."
|
31
|
+
repo = gh.repo( full_name )
|
32
|
+
puts "update >#{full_name}< [2/4] - fetching repo commits ..."
|
33
|
+
commits = gh.repo_commits( full_name )
|
34
|
+
puts "update >#{full_name}< [3/4] - fetching repo topics ..."
|
35
|
+
topics = gh.repo_topics( full_name )
|
36
|
+
puts "update >#{full_name}< [4/4] - fetching repo languages ..."
|
37
|
+
languages = gh.repo_languages( full_name )
|
36
38
|
|
37
39
|
stats.update( repo,
|
38
|
-
commits:
|
39
|
-
topics:
|
40
|
+
commits: commits,
|
41
|
+
topics: topics,
|
42
|
+
languages: languages )
|
40
43
|
stats.write
|
41
44
|
end
|
42
45
|
end
|
data/lib/hubba/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hubba
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerald Bauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: webclient
|