obf 0.6.0 → 0.6.1
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/obf/validator.rb +5 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e249a35931e0186e77d7891dd62ea793e590029
|
4
|
+
data.tar.gz: f5ac6ea76ef9258197bdc8668bfdc9eddbf4db6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10eaf3229ebf54f38d81524a72729885a8a95645f66179595cd47d1cf5f232f8524b0be4eaad15aaf1efe103c66daf1bfd66d9a009ce0de3490a53b251e41375
|
7
|
+
data.tar.gz: c34e9d79971e8aefba7de989d0bf45a861f37b30b4f796287d99456991d99627b4af4d4a6c98ffeaff56ac84682dc283bcac2d00852524c539e44f5e41111eb0
|
data/lib/obf/validator.rb
CHANGED
@@ -37,8 +37,11 @@ module OBF
|
|
37
37
|
|
38
38
|
def self.validate_obf(path)
|
39
39
|
v = self.new
|
40
|
+
fn = File.basename(path)
|
40
41
|
results = v.validate_obf(path)
|
41
42
|
{
|
43
|
+
:filename => fn,
|
44
|
+
:filesize => File.size(path),
|
42
45
|
:valid => v.errors == 0,
|
43
46
|
:errors => v.errors,
|
44
47
|
:warnings => v.warnings,
|
@@ -75,6 +78,7 @@ module OBF
|
|
75
78
|
err "Couldn't parse structure: #{e.message}", true
|
76
79
|
end
|
77
80
|
end
|
81
|
+
ext = json
|
78
82
|
|
79
83
|
add_check('format_version', "format version") do
|
80
84
|
if !ext['format']
|
@@ -101,7 +105,7 @@ module OBF
|
|
101
105
|
end
|
102
106
|
|
103
107
|
add_check('extras', "extra attributes") do
|
104
|
-
attrs = ['format', 'id', 'locale', 'url', 'data_url', 'name', 'description_html', 'buttons', '
|
108
|
+
attrs = ['format', 'id', 'locale', 'url', 'data_url', 'name', 'description_html', 'buttons', 'images', 'sounds', 'grid', 'license']
|
105
109
|
ext.keys.each do |key|
|
106
110
|
if !attrs.include?(key) && !key.match(/^ext_/)
|
107
111
|
warn "#{key} attribute is not defined in the spec, should be prefixed with ext_yourapp_"
|