obf 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/obf.rb +6 -6
  3. data/lib/obf/external.rb +10 -31
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 65fdbd5291f1daf48d1d5699e7d9509b0ca9fdd9
4
- data.tar.gz: 7daf99c0f9f09572a401c9482f154a4609414341
3
+ metadata.gz: 3f63706c374446dc89b390e990f6fece72dca9d2
4
+ data.tar.gz: 4c09d0f858322855b2093e0cfc5d48ba94dba4be
5
5
  SHA512:
6
- metadata.gz: 141e74853490736882aa1f4105cac797359cfd5f48cdca07618f3c760fed9e07cb015521f467a4c8fe9d44bfce08e69c9065e378e5332d467ff83ecf7edbbc3d
7
- data.tar.gz: 0bc263d9575d1d972a9231c109060a6579e6879ac520798fd3a0756b2d6c8448995c44d9779edd883dcbb6bff420fdb7e4cbd6add064d232a3533564d42a2ed2
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 './lib/obf/external'
10
- require './lib/obf/obf'
11
- require './lib/obf/obz'
12
- require './lib/obf/pdf'
13
- require './lib/obf/png'
14
- require './lib/obf/utils'
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'] #board.global_id
5
- res['name'] = hash['name'] #board.settings['name']
6
- res['default_layout'] = hash['default_layout'] || 'landscape' #'landscape'
7
- res['url'] = hash['url'] #"#{JsonApi::Json.current_host}/#{board.key}"
8
- res['data_url'] = hash['data_url'] #"#{JsonApi::Json.current_host}/api/v1/boards/#{board.key}"
9
- res['description_html'] = hash['description_html'] #board.settings['description']
10
- res['license'] = OBF::Utils.parse_license(hash['license']) #board.settings['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']), #!board.public,
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'], #"#{JsonApi::Json.current_host}/#{original_button['load_board']['key']}",
122
- 'data_url' => original_button['load_board']['data_url'] #"#{JsonApi::Json.current_host}/api/v1/boards/#{original_button['load_board']['key']}"
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"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: obf
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Whitmer