lib/relaton_ietf.rb in relaton-ietf-0.6.10 vs lib/relaton_ietf.rb in relaton-ietf-0.7.0
- old
+ new
@@ -10,5 +10,16 @@
# require_relative "relaton_ietf/processor"
# Relaton::Registry.instance.register(RelatonIetf::Processor)
# end
require "relaton/provider_ietf"
+
+module RelatonIetf
+ # Returns hash of XML reammar
+ # @return [String]
+ def self.grammar_hash
+ gem_path = File.expand_path "..", __dir__
+ grammars_path = File.join gem_path, "grammars", "*"
+ grammars = Dir[grammars_path].sort.map { |gp| File.read gp }.join
+ Digest::MD5.hexdigest grammars
+ end
+end
\ No newline at end of file