obf 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0c27601024bf7909871b16237383f37f1293e735
4
- data.tar.gz: dd85480dd2a3c0761e0822c7f7807c69d29695d4
3
+ metadata.gz: fef34ab3a181c76b6c107a31dce9afcc447cf739
4
+ data.tar.gz: 662acf486037c269ec73c1a412bab3602fb45028
5
5
  SHA512:
6
- metadata.gz: c6dc3bd80f1cb84236f42d527d676c3628e72d226c1eb67d142143f015c0a4616f7449679f0fb3ede3a583ae7c8acdd27077216d469fb8b769137834a028fff5
7
- data.tar.gz: 98d650f28f82ef7d93f6f97b8ec7da80a1b4e130209a39653faa0f806fd262e4f6b8f5d40465ae22eac6a0f6de80f73fc43cb14832eadb2fe04ec99f9991a5c6
6
+ metadata.gz: 7cb389f8925f8ce59b0d968bcf1518870a68aa24f7ad38c28a5e53b1c0857eb2940410a9e07d0da02bcf02f082d623280ce203191031409cb1cbb4d2a0853d24
7
+ data.tar.gz: 1e6423f85d4668b8fa3eb49d7855ae0d7824cb7d6d519b130b52eafd16f9c15bb4e34a4c4d9b08d60ac8313de6c1c5c3d94686ca5b22c80931d35978d85359ff
data/README.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # OBF Parser
2
2
 
3
- This ruby library is to make it easier to handle .obf and .obz files
3
+ [![Gem Version](https://badge.fury.io/rb/obf.svg)](http://badge.fury.io/rb/obf)
4
+
5
+ This ruby library is to make it easier to handle .obf and .obz files. These files
6
+ are part of the Open Board Format, an effort to standardize communication board layouts
7
+ for assistive technology and AAC users. The file format is JSON-structured and can
8
+ be completely self-contained or reference external URLs.
9
+
10
+ This library makes it easy to convert to and from .obf and .obz files for generating
11
+ images and pdfs, and supports converting some proprietary formats to .obf and .obz.
4
12
 
5
13
  ## Installation
6
14
  This is packaged as the `obf` rubygem, so you can just add the dependency to
@@ -11,12 +19,45 @@ your Gemfile or install the gem on your system:
11
19
  To require the library in your project:
12
20
 
13
21
  require 'obf'
22
+
23
+ External converters require node. PDF and PNG conversion require imagemagick and node.
24
+ PNG conversion also requires ghostscript.
14
25
 
15
26
  ## Usage
16
27
 
28
+ OBF supports multiple conversion schemes, the simplest of which are obf, obz, pdf and png
29
+
17
30
  ```ruby
18
- OBF::PDF.from_external(data, 'my.pdf')
31
+ # convert an .obf file to a .pdf
32
+ OBF::PDF.from_obf('path/to/input.obf', 'path/to/output.pdf')
33
+ # convert an .obz package to a .pdf
34
+ OBF::PDF.from_obf('path/to/input.obz', 'path/to/output.pdf')
35
+
36
+ # convert an .obf file to a .png image
37
+ OBF::PNG.from_obf('path/to/input.obf', 'path/to/output.png')
38
+ # convert an .obz package to a .png image
39
+ OBF::PNG.from_obf('path/to/input.obz', 'path/to/output.png')
19
40
  ```
20
41
 
21
- TODO...
42
+ The gem also supports converting some native packages into OBF files
43
+
44
+ ```ruby
45
+ content = OBF::Picto4Me.to_external('path/to/picto4mefile.zip')
46
+ OBF::OBZ.from_external(content, 'path/to/output.obz')
47
+ ```
48
+ ### External Imports
49
+
50
+ The <code>external</code> options are the most interesting. Once you understand the
51
+ makeup of these external resources, you can generate them from any other system and
52
+ easily convert a system's content to .obf, .obz, .pdf or .png.
53
+
54
+ The makeup of these files closely resembles the layout of an .obf file according to
55
+ the .obf spec. You can see an example generator in <code>lib/obf/picto4me.rb</code>,
56
+ or dig into the specifics yourself in <code>lib/obf/external.rb</code>.
57
+
58
+ ## Future Work
22
59
 
60
+ We've talked about including some utilities to make translation easier. Basically
61
+ something that would take an .obf or .obz file and spit out a set of translation strings,
62
+ and another something that would take an .obf or .obz file and a set of translation strings
63
+ and generate a new, translated result.
data/lib/obf/external.rb CHANGED
@@ -33,7 +33,7 @@ module OBF::External
33
33
  'top' => original_button['top'],
34
34
  'width' => original_button['width'],
35
35
  'height' => original_button['height'],
36
- 'border_color' => OFB::Utils.fix_color(original_button['border_color'] || "#aaa", 'rgb'),
36
+ 'border_color' => OBF::Utils.fix_color(original_button['border_color'] || "#aaa", 'rgb'),
37
37
  'background_color' => OBF::Utils.fix_color(original_button['background_color'] || "#fff", 'rgb')
38
38
  }
39
39
  if original_button['load_board']
@@ -969,5 +969,5 @@ var color = tiny(process.argv[2]);
969
969
  if(process.argv[3] == 'rgb') {
970
970
  console.log(color.toRgbString());
971
971
  } else {
972
- console.log(color.toHexg());
972
+ console.log(color.toHex());
973
973
  }
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.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Whitmer