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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b9cac89eff3246661bafa03c4f92d365caa3dabd66c9bd76eb827c80e9a4502
4
- data.tar.gz: 6ee0d9c9f5f91b3176c94b3078043431372471e072ad78dbc759610e4fa43283
3
+ metadata.gz: 8972bbff95653e51cad82966d1fefd8424457ca1fa947014cdacc72533568a5f
4
+ data.tar.gz: 256eda8b6ff12254b3c470323818946d6f4047ea0b2eaf55cb9c54af0b86838f
5
5
  SHA512:
6
- metadata.gz: 23cd2684cefb9f0d81373af864a93b9f77d67ed24794565854bc6a36c8cbeecc501775a82f5ea4fa32aa5d6db8dd48c217a6cf6ced405030fdce6d9d0ac8f321
7
- data.tar.gz: '0197fea7c9a3fda8f2bbdfebaf99b4b26e4518bc7212ac35b2b147253b1d00a291c81d6cb8eb2691349af68c50738dcaa7a660507a1475171901946e6ab01c9d'
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 regexp_split_to_array(regexp_replace(version, '\.[^0-9.]+$', ''), '[^0-9]+') :: bigint[]) as version_point
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
@@ -1,3 +1,3 @@
1
1
  module GemCollector
2
- VERSION = '1.3.0'
2
+ VERSION = '1.3.1'
3
3
  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.0
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: 2019-11-27 00:00:00.000000000 Z
11
+ date: 2020-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord-import