eip_validator 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 900be4319d32d39e6b13ef7c8440d133b6baf23a
4
- data.tar.gz: 0e0e7c7d700b9eb3e3bf296c518e8f02b57bbb7f
3
+ metadata.gz: 99b0ebd57647d998cf7bfae72ce8e59b0f0b5f78
4
+ data.tar.gz: c69ae34ba4030b678c9118b805db883ac8889a97
5
5
  SHA512:
6
- metadata.gz: 97a01f9439e6db80ef2b2f6b89ddfd84e6e0ed65ea8b5dd57a98d5d36c69c689879fa19ea86e23e5eb24caecab2f432147a3e3760ea58a04cf61a76d49668f9a
7
- data.tar.gz: 5b406e48a9a56f2912910bce686d533c4bcbada78035d67f003bc5b6d0c1bf65addf123506512f1ab25956e539500db786ad8cdfc4aba0796e19492662f49512
6
+ metadata.gz: 761be5c47dde0690f6e4cc2985d5fd0041662d35a1b9655b54cd2bf687db406200d2987132d10b5706f5805db0cca4d1ca7817c05e571b7b4825ed57c8280d26
7
+ data.tar.gz: 6f2cbc5d6b76e4479b13636e8d29a1a3f2f1cd5838697998f1d6cec45531f9e3fd2cb734da1b6322b39db4483757e00cec9db77ed1f509ac1881a9018c85bced
data/lib/eip_validator.rb CHANGED
@@ -16,10 +16,11 @@ module EipValidator
16
16
  categories = []
17
17
  layers = []
18
18
  file_names.map do |file_name|
19
- unless file_name.match(/.*eip-\d+.md$/)
20
- puts "Warning: #{file_name} does not match eip file format"
21
- next
22
- end
19
+ # Disable file check
20
+ # unless file_name.match(/.*eip-\d+.md$/)
21
+ # puts "Warning: #{file_name} does not match eip file format"
22
+ # next
23
+ # end
23
24
  attributes = Loader.load(file_name)
24
25
  total+=1
25
26
  begin
@@ -2,9 +2,24 @@ require 'active_model'
2
2
 
3
3
  module EipValidator
4
4
  class Validator
5
+ def initialize(opts = {})
6
+ # ruby does not allow method with -
7
+ # replaces - with _
8
+ opts.keys.each do |key|
9
+ raise("#{key} incude _ which is not allowed") if key.to_s.match(/_/)
10
+ if key.to_s.match(/-/)
11
+ new_key = opts.keys.last.to_s.gsub('-','_')
12
+ opts[new_key] = opts.delete key
13
+ end
14
+ end
15
+ super(opts)
16
+ end
17
+
5
18
  include ActiveModel::Model
6
19
  attr_accessor :eip, :title, :author, :type, :category, :status, :created
7
20
  attr_accessor :replaces, :requires, :layer
21
+ # replace - with _
22
+ attr_accessor :discussions_to
8
23
  validates_presence_of :eip, :title, :author, :type, :status, :created
9
24
  validates_inclusion_of :category,
10
25
  in: %w(Core Networking Interface ERC),
@@ -13,3 +28,4 @@ module EipValidator
13
28
  validates_inclusion_of :status, in: %w(Draft Active Accepted Final Deferred)
14
29
  end
15
30
  end
31
+
@@ -1,3 +1,3 @@
1
1
  module EipValidator
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.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.6.0
4
+ version: 0.7.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-04-15 00:00:00.000000000 Z
11
+ date: 2018-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler