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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6dfdf158420e74f4a2810c18e46cab065aa2dcce
4
- data.tar.gz: 51357a2974422d2e9c4c0bb7b961d08ee43297bd
3
+ metadata.gz: 338508b7de32e5872cb8d7c2d84ccbee8f2af484
4
+ data.tar.gz: 9995ea758dd641965ada299c49c2d46837bfbf03
5
5
  SHA512:
6
- metadata.gz: 7388e0646b07392b35ad13ea738c440b49f37cca283b4abf380071069ce48ef22bbe2d9fe293e266056ee1c7c386c92547740bb84a74cf3c03651a1f48ac48b2
7
- data.tar.gz: 4ffbc0a84814db71694e6f0d750c7269916ae30f46a64ca79679976de222e06cbb63918b73b47c679ef8b92fa4fc9abce86f2cc3128903c1e2c8da634cfd96e2
6
+ metadata.gz: 34904326c8d6ba4461fe2e76b2f6708a4b539ccb2d1f08eb702013b4146f4f71d958894dc314d6b7d49e202fa59ddd701a8cd32fa4f5c7b926453219e4ad6682
7
+ data.tar.gz: 82506b15eef45965858b73fc151b52a0b63f09764ec076e4dc1bef740f03e92e1d0bb0a40bb6bb2f7419738bec52887f4e6036a689871b75b399b1efb7f90c85
@@ -108,8 +108,9 @@ end # method update_traffic
108
108
 
109
109
 
110
110
  def update( repo,
111
- commits: nil,
112
- topics: nil ) ## update stats / fetch data from github via api
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
- pp @data
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
@@ -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/3] - fetching repo..."
31
- repo = gh.repo( full_name )
32
- puts "update >#{full_name}< [2/3] - fetching repo commits ..."
33
- commits = gh.repo_commits( full_name )
34
- puts "update >#{full_name}< [3/3] - fetching repo topics ..."
35
- topics = gh.repo_topics( full_name )
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: commits,
39
- topics: topics )
40
+ commits: commits,
41
+ topics: topics,
42
+ languages: languages )
40
43
  stats.write
41
44
  end
42
45
  end
@@ -1,6 +1,6 @@
1
1
  module Hubba
2
- MAJOR = 0 ## todo: namespace inside version or something - why? why not??
3
- MINOR = 7
2
+ MAJOR = 1 ## todo: namespace inside version or something - why? why not??
3
+ MINOR = 0
4
4
  PATCH = 0
5
5
  VERSION = [MAJOR,MINOR,PATCH].join('.')
6
6
 
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.7.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-14 00:00:00.000000000 Z
11
+ date: 2020-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: webclient