gem_collector 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/gem_collector/repository.rb +5 -5
- data/lib/gem_collector/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8972bbff95653e51cad82966d1fefd8424457ca1fa947014cdacc72533568a5f
|
4
|
+
data.tar.gz: 256eda8b6ff12254b3c470323818946d6f4047ea0b2eaf55cb9c54af0b86838f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95de22abffce1065fb3029bad8c15234b5c3f4c6fe0a9a2284448e26a0f8acb9eddc293fa753d15bb51d86d9a58efb0f5af1a9482b08198f5f07cc34b22e73d8
|
7
|
+
data.tar.gz: e0e523eef349df8fe8cb50d168d7cde02068595509dd6cd5f6bcbeacf91ea89ebf18c36ee740ce47b58c96b33435a11647b50924b2c030c7c90dccbcd6a2796b
|
@@ -14,10 +14,14 @@ class GemCollector::Repository < GemCollector::ApplicationRecord
|
|
14
14
|
"#{site}/#{full_name}"
|
15
15
|
end
|
16
16
|
|
17
|
+
private_class_method def self.build_version_exp(column_or_exp)
|
18
|
+
"(regexp_split_to_array(regexp_replace(#{column_or_exp}, '\\.?[^0-9.]+$', ''), '[^0-9]+') :: bigint[])"
|
19
|
+
end
|
20
|
+
|
17
21
|
POINTS_FOR_GEMS_SQL = <<-SQL.strip_heredoc
|
18
22
|
select
|
19
23
|
gems.repository_id, gems.path, gems.name, gems.version
|
20
|
-
, cume_dist() over (partition by gems.name order by
|
24
|
+
, cume_dist() over (partition by gems.name order by #{build_version_exp('version')}) as version_point
|
21
25
|
from
|
22
26
|
#{GemCollector::RepositoryGem.table_name} gems
|
23
27
|
SQL
|
@@ -77,8 +81,4 @@ class GemCollector::Repository < GemCollector::ApplicationRecord
|
|
77
81
|
, gems.path
|
78
82
|
SQL
|
79
83
|
end
|
80
|
-
|
81
|
-
private_class_method def self.build_version_exp(column_or_exp)
|
82
|
-
"(regexp_split_to_array(regexp_replace(#{column_or_exp}, '\.[^0-9.]+$', ''), '[^0-9]+') :: bigint[])"
|
83
|
-
end
|
84
84
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gem_collector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kohei Suzuki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord-import
|