xon 0.1.1 → 0.1.2
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 +4 -4
- data/lib/xon.rb +3 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c90a29f804634ff6c064d0028e2d077458f1f8a31bb84eb4b742fcdb8899703
|
4
|
+
data.tar.gz: 139f72d2c0bf5d9cc611194902ede0da8591ffedeb1e72762fe7b5057a1ceeae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4689f8ab00d4942a03f2689f7441bff32e51e9237715d6b2c0bab9ca4ce7a3ad1cd66c733b287f5e26f7eaf8d4e9c9d2d0c965548a4448288055281b0678aa1
|
7
|
+
data.tar.gz: 77ba300bee624ab1915e95c0a77ade02f3558de1184602ba356f3ed234abd15a4cfba329e7563361f2c82e94a16f79c7b5e2e54df192987f1e3e0c56163a5eac
|
data/lib/xon.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
require 'time'
|
2
|
+
require 'date'
|
2
3
|
require 'json'
|
3
4
|
|
4
5
|
module Xon
|
5
6
|
|
6
7
|
class ParserError < StandardError; end
|
7
8
|
|
8
|
-
VERSION = '0.1.
|
9
|
+
VERSION = '0.1.2'.freeze
|
9
10
|
PREAMBLE = '!:'.freeze
|
10
11
|
|
11
12
|
class << self
|
@@ -87,13 +88,11 @@ module Xon
|
|
87
88
|
end
|
88
89
|
|
89
90
|
# This initialization of constants is intentionally not done in the body
|
90
|
-
# of the module, to
|
91
|
+
# of the module, to check the existence of constants as late as possible.
|
91
92
|
@@inited = false
|
92
93
|
def init!
|
93
94
|
return if @@inited
|
94
95
|
@@inited = true
|
95
|
-
# Ignore DateTime gracefully if it is not loaded.
|
96
|
-
const_set(:DateTime, defined?(DateTime) ? DateTime : Class.new)
|
97
96
|
# Prefer MultiJson if it is loaded.
|
98
97
|
const_set(:JSON, defined?(MultiJson) ? MultiJson : JSON)
|
99
98
|
end
|