Skip to content

Commit 38307c3

Browse files
committed
Move the requires and constants for validation.
Should be where they are used really.
1 parent e6a3cca commit 38307c3

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/cff.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
require 'json'
1919
require 'yaml'
2020

21-
require 'json_schema'
2221
require 'language_list'
2322

2423
# This library provides a Ruby interface to manipulate CITATION.cff files. The
@@ -29,7 +28,6 @@
2928
module CFF
3029
SCHEMA_PATH = ::File.join(__dir__, 'schema', '1.2.0.json') # :nodoc:
3130
SCHEMA_FILE = JSON.parse(::File.read(SCHEMA_PATH)) # :nodoc:
32-
SCHEMA = JsonSchema.parse!(SCHEMA_FILE) # :nodoc:
3331
end
3432

3533
require 'cff/version'

lib/cff/validatable.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17+
require 'json_schema'
18+
1719
##
1820
module CFF
1921

2022
# Methods to validate CFF files/models against a formal schema.
2123
module Validatable
2224

25+
# :nodoc:
26+
SCHEMA = JsonSchema.parse!(SCHEMA_FILE)
27+
2328
# :call-seq:
2429
# validate!(fail_fast: false)
2530
#

0 commit comments

Comments
 (0)