eip_validator 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eip_validator/loader.rb +6 -5
- data/lib/eip_validator/validator.rb +6 -2
- data/lib/eip_validator/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ed343cdc3475af191bc3f79e16bb7823e3fcc07
|
4
|
+
data.tar.gz: 6765d34d7a7cf052d3f3395945b1fb2d693434b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 569db5e6161267455f8323f85c0869c7a5a01b7bc4665f407481ab093d6dc96df0fcd6d5f703e69baea664abbc2aaaef846eab3f5e58f1b242f011c807d20c01
|
7
|
+
data.tar.gz: 0e35e7174c5e766848d3c7bdb51f0b3c79158aeb49a01bd313d8eabb814d56b3da51fcd9e8235aadd80207ad5b021af28df346e28926ec4960467f3517b921a0
|
data/lib/eip_validator/loader.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
require 'yaml'
|
2
2
|
require 'front_matter_parser'
|
3
3
|
|
4
|
+
module EipValidator
|
5
|
+
class Loader
|
6
|
+
UNSAFE_LOADER = ->(string) { YAML.load(string) }
|
4
7
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
def self.load(file_name)
|
9
|
-
FrontMatterParser::Parser.parse_file(file_name, loader: UNSAFE_LOADER).front_matter
|
8
|
+
def self.load(file_name)
|
9
|
+
FrontMatterParser::Parser.parse_file(file_name, loader: UNSAFE_LOADER).front_matter
|
10
|
+
end
|
10
11
|
end
|
11
12
|
end
|
@@ -3,9 +3,13 @@ require 'active_model'
|
|
3
3
|
module EipValidator
|
4
4
|
class Validator
|
5
5
|
include ActiveModel::Model
|
6
|
-
attr_accessor :eip, :title, :author, :type, :category, :status, :created
|
6
|
+
attr_accessor :eip, :title, :author, :type, :category, :status, :created
|
7
|
+
attr_accessor :replaces, :requires, :layer
|
7
8
|
validates_presence_of :eip, :title, :author, :type, :status, :created
|
8
|
-
|
9
|
+
validates_inclusion_of :category,
|
10
|
+
in: %w(Core Networking Interface ERC),
|
11
|
+
if: Proc.new { |v| v.type == 'Standards Track' }
|
12
|
+
|
9
13
|
validates_inclusion_of :status, in: %w(Draft Active Accepted Final Deferred)
|
10
14
|
end
|
11
15
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eip_validator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Makoto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|