csv2psql 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/csv2psql/analyzer/types/cidr.rb +22 -0
- data/lib/csv2psql/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d824881a6506c8361b6a86a03e3f72d15ff387e5
|
4
|
+
data.tar.gz: c2e7c53a7539087591393505d02891e1387fae93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 984b952b56b88a8e1a32a0f8bced16b05950f2cc38ea6214031b237b368b7302a51ab0d8b4ff7d315bf66d686794269d91b24e819bcc9855d7991915cb6d3ee9
|
7
|
+
data.tar.gz: 2951daad71c751420c59efec70a031ba3c5587f667ee8111491f87cc51f54044315e064a128a7f998b2de6bc63e526d4ee1428c0a8e9de53cb8b7f21bf738916
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require_relative 'base_analyzer'
|
4
|
+
|
5
|
+
module Csv2Psql
|
6
|
+
module Analyzers
|
7
|
+
# Bigint value matcher
|
8
|
+
class Cidr < BaseAnalyzer
|
9
|
+
TYPE = :cidr
|
10
|
+
CLASS = :special
|
11
|
+
WEIGHT = 4
|
12
|
+
|
13
|
+
RE = Regexp.new(/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$/)
|
14
|
+
|
15
|
+
class << self
|
16
|
+
def analyze(val)
|
17
|
+
val && RE.match(val)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/csv2psql/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: csv2psql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tomas Korcak
|
@@ -289,6 +289,7 @@ files:
|
|
289
289
|
- lib/csv2psql/analyzer/types/bigint.rb
|
290
290
|
- lib/csv2psql/analyzer/types/boolean.rb
|
291
291
|
- lib/csv2psql/analyzer/types/character.rb
|
292
|
+
- lib/csv2psql/analyzer/types/cidr.rb
|
292
293
|
- lib/csv2psql/analyzer/types/date.rb
|
293
294
|
- lib/csv2psql/analyzer/types/decimal.rb
|
294
295
|
- lib/csv2psql/analyzer/types/null.rb
|