obf 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/obf.rb +6 -6
- data/lib/obf/external.rb +10 -31
- 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: 3f63706c374446dc89b390e990f6fece72dca9d2
|
4
|
+
data.tar.gz: 4c09d0f858322855b2093e0cfc5d48ba94dba4be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17a5e56e9eb06b34ac9c5c57d5343a80afac3863e2f2bf064b0725ca80ec0abc9dfbf3fd974a2fa089c6f6ea258f77ee3ce5fdd73217d187a817320f8fdb4c62
|
7
|
+
data.tar.gz: 551537ce747367b3b8f4ec516cff4b5fc7287bb0742ee9be490450f5a61221c827c46672b6816a90bb4f5266a663bd5be0e69508d785059ce11ab1685f041247
|
data/lib/obf.rb
CHANGED
@@ -6,10 +6,10 @@ require 'tempfile'
|
|
6
6
|
require 'prawn'
|
7
7
|
|
8
8
|
module OBF
|
9
|
-
require '
|
10
|
-
require '
|
11
|
-
require '
|
12
|
-
require '
|
13
|
-
require '
|
14
|
-
require '
|
9
|
+
require 'obf/external'
|
10
|
+
require 'obf/obf'
|
11
|
+
require 'obf/obz'
|
12
|
+
require 'obf/pdf'
|
13
|
+
require 'obf/png'
|
14
|
+
require 'obf/utils'
|
15
15
|
end
|
data/lib/obf/external.rb
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
module OBF::External
|
2
2
|
def self.to_obf(hash, dest_path, path_hash=nil)
|
3
3
|
res = OBF::Utils.obf_shell
|
4
|
-
res['id'] = hash['id']
|
5
|
-
res['name'] = hash['name']
|
6
|
-
res['default_layout'] = hash['default_layout'] || 'landscape'
|
7
|
-
res['url'] = hash['url']
|
8
|
-
res['data_url'] = hash['data_url']
|
9
|
-
res['description_html'] = hash['description_html']
|
10
|
-
res['license'] = OBF::Utils.parse_license(hash['license'])
|
4
|
+
res['id'] = hash['id']
|
5
|
+
res['name'] = hash['name']
|
6
|
+
res['default_layout'] = hash['default_layout'] || 'landscape'
|
7
|
+
res['url'] = hash['url']
|
8
|
+
res['data_url'] = hash['data_url']
|
9
|
+
res['description_html'] = hash['description_html']
|
10
|
+
res['license'] = OBF::Utils.parse_license(hash['license'])
|
11
11
|
res['settings'] = {
|
12
|
-
'private' => !!(hash['settings'] && hash['settings']['private'])
|
13
|
-
'key' => hash['key'] #board.key.split(/\//, 2)[1]
|
12
|
+
'private' => !!(hash['settings'] && hash['settings']['private'])
|
14
13
|
}
|
15
14
|
grid = []
|
16
15
|
|
@@ -44,16 +43,6 @@ module OBF::External
|
|
44
43
|
end
|
45
44
|
end
|
46
45
|
res['images'] << image
|
47
|
-
# image = board.button_images.detect{|i| i.global_id == original_button['image_id'] }
|
48
|
-
# image = {
|
49
|
-
# 'id' => image.global_id,
|
50
|
-
# 'width' => image.settings['width'],
|
51
|
-
# 'height' => image.settings['height'],
|
52
|
-
# 'license' => OBF::Utils.parse_license(image.settings['license']),
|
53
|
-
# 'url' => image.url,
|
54
|
-
# 'data_url' => "#{JsonApi::Json.current_host}/api/v1/images/#{image.global_id}",
|
55
|
-
# 'content_type' => image.settings['content_type']
|
56
|
-
# }
|
57
46
|
end
|
58
47
|
|
59
48
|
res['sounds'] = []
|
@@ -87,16 +76,6 @@ module OBF::External
|
|
87
76
|
end
|
88
77
|
|
89
78
|
res['sounds'] << sound
|
90
|
-
|
91
|
-
# sound = board.button_sounds.detect{|i| i.global_id == original_button['sound_id'] }
|
92
|
-
# sound = {
|
93
|
-
# 'id' => sound.global_id,
|
94
|
-
# 'duration' => sound.settings['duration'],
|
95
|
-
# 'license' => OBF::Utils.parse_license(sound.settings['license']),
|
96
|
-
# 'url' => sound.url,
|
97
|
-
# 'data_url' => "#{JsonApi::Json.current_host}/api/v1/sounds/#{sound.global_id}",
|
98
|
-
# 'content_type' => sound.settings['content_type']
|
99
|
-
# }
|
100
79
|
end
|
101
80
|
|
102
81
|
res['buttons'] = []
|
@@ -118,8 +97,8 @@ module OBF::External
|
|
118
97
|
if original_button['load_board']
|
119
98
|
button['load_board'] = {
|
120
99
|
'id' => original_button['load_board']['id'],
|
121
|
-
'url' => original_button['load_board']['url'],
|
122
|
-
'data_url' => original_button['load_board']['data_url']
|
100
|
+
'url' => original_button['load_board']['url'],
|
101
|
+
'data_url' => original_button['load_board']['data_url']
|
123
102
|
}
|
124
103
|
if path_hash && path_hash['included_boards'][original_button['load_board']['id']]
|
125
104
|
button['load_board']['path'] = "board_#{original_button['load_board']['id']}.obf"
|