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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 627040e85f3740aed85147c2fbb73c496f97af2a
4
- data.tar.gz: 1f630cb046dddd5f791be0e9b76773b53e4ed354
3
+ metadata.gz: 4ed343cdc3475af191bc3f79e16bb7823e3fcc07
4
+ data.tar.gz: 6765d34d7a7cf052d3f3395945b1fb2d693434b8
5
5
  SHA512:
6
- metadata.gz: 0ee64f96938fceaef1b61f91099926f4dba2111ff19b4800719ff6c95ff74ec1653f98a0650c8c566ef4a274a1da5f8eb91cc966b293c242b8750f2a38b79ecd
7
- data.tar.gz: d4998df012059d2e6d280b11ed36e830c6d4ec000fb97d5f6cea8c5192af383e12b161a5221d44768277e6473aceb37530b63d70f8b53a040ad0707c0365d60f
6
+ metadata.gz: 569db5e6161267455f8323f85c0869c7a5a01b7bc4665f407481ab093d6dc96df0fcd6d5f703e69baea664abbc2aaaef846eab3f5e58f1b242f011c807d20c01
7
+ data.tar.gz: 0e35e7174c5e766848d3c7bdb51f0b3c79158aeb49a01bd313d8eabb814d56b3da51fcd9e8235aadd80207ad5b021af28df346e28926ec4960467f3517b921a0
@@ -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
- class Loader
6
- UNSAFE_LOADER = ->(string) { YAML.load(string) }
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, :replaces, :requires, :layer
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
- validates_presence_of :category, if: Proc.new { |v| v.type == 'Standards Track' }
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
@@ -1,3 +1,3 @@
1
1
  module EipValidator
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  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.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-03-26 00:00:00.000000000 Z
11
+ date: 2018-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler