ossert 0.1.1 → 0.1.2

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: 735f019d49a5287407273613b8913695c22e3e41
4
- data.tar.gz: c6a957555e05972f93b9afba4b041dbe74e6e5f8
3
+ metadata.gz: a4e29de62f6e9596fc97c192a45328e74fed6f9d
4
+ data.tar.gz: 602c662db9da13d33f484f2138e7d48a86e08c10
5
5
  SHA512:
6
- metadata.gz: da4312414552626de8d2bd3db1531b9d0d85f155ae2f89b04aa58fac953a6a03bffd5a024076ea46153ccd40fd0bbaad74071d0fb9896353f55caf5772bc0176
7
- data.tar.gz: ee60c373f1e73f81256508c2948f12d8107ac682f75d2f9acd7a8c1f574f27f6da792baf3c6e67bcb86bedf018497ba32f6431d755f04560428bf88ee719dfcd
6
+ metadata.gz: fcef17070653b339a372bf87367a3d3f4e3269d2da872eaafaea76d39dc78509ddeb03abb2b83f319428c557e033dc8b3e80448b6c247646f65c3ac41c2a0602
7
+ data.tar.gz: be8911bfed8303443826cbfbbc55e0fd62bb2d40ec70f65301595f387bacbf0345c3f2b2e459b6dac6be9be6adb22f079bb74fcd6678486676a79599bd88c113
@@ -64,9 +64,9 @@ classifiers:
64
64
  forks_count: 3
65
65
  users_involved_count: 3
66
66
  users_involved_no_stars_count: 3
67
- total_downloads_count: 3
67
+ total_downloads_count: 8
68
68
  total:
69
- dependants_count: 4
69
+ dependants_count: 6
70
70
  users_creating_issues_count: 1
71
71
  users_commenting_issues_count: 1
72
72
  users_creating_pr_count: 1
@@ -75,7 +75,7 @@ classifiers:
75
75
  watchers_count: 1
76
76
  forks_count: 1
77
77
  users_involved_no_stars_count: 1
78
- total_downloads_count: 1
78
+ total_downloads_count: 8
79
79
  maintenance:
80
80
  last_year:
81
81
  issues_processed_in_avg: 1
@@ -106,20 +106,20 @@ module Ossert
106
106
 
107
107
  def grade
108
108
  max = GRADES.count
109
- sum = -0.6
109
+ sum = -0.2
110
110
  check.sort.reverse.each do |(_, gain)|
111
111
  sum += gain
112
- sum += 0.1 if gain > trusted_probability
112
+ sum -= 0.1 if gain < trusted_probability
113
113
  end
114
114
  GRADES[(max - sum).to_i]
115
115
  end
116
116
 
117
117
  def grade_as_hash
118
118
  max = GRADES.count
119
- sum = -0.6
119
+ sum = -0.2
120
120
  check.sort.reverse.each do |(_, gain)|
121
121
  sum += gain
122
- sum += 0.1 if gain > trusted_probability
122
+ sum -= 0.2 if gain < trusted_probability
123
123
  end
124
124
  { gain: sum, mark: GRADES[(max - sum).to_i] }
125
125
  end
@@ -63,10 +63,10 @@ module Ossert
63
63
  end
64
64
  end),
65
65
  /period/ => (lambda do |value|
66
- if (years = value.to_i / 365).positive?
66
+ if (years = value.to_i / 1.year).positive?
67
67
  "#{years}+ years"
68
- 'Less than a year'
69
68
  else
69
+ 'Less than a year'
70
70
  end
71
71
  end),
72
72
  /downloads/ => ->(value) { value.ceil.to_s.reverse.gsub(/(\d{3})(?=\d)/, '\\1,').reverse }
@@ -50,13 +50,13 @@ module Ossert
50
50
  end
51
51
 
52
52
  def life_period
53
- last_change = [last_pr_date.presence, last_issue_date.presence].compact.max
53
+ last_change = ([last_pr_date, last_issue_date] - [0]).max
54
54
  return 0 unless last_change
55
55
 
56
- first_change = [first_pr_date, first_issue_date].compact.min
56
+ first_change = ([first_pr_date, first_issue_date] - [0]).min
57
57
  return 0 unless first_change
58
58
 
59
- (last_change - first_change).to_i
59
+ (Time.at(last_change) - Time.at(first_change)).to_i
60
60
  end
61
61
 
62
62
  def life_period_months
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Ossert
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.2'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ossert
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Dolganov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-11 00:00:00.000000000 Z
11
+ date: 2016-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octokit