lens_protocol 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +13 -11
- data/lib/lens_protocol/oma.rb +4 -0
- data/lib/lens_protocol/version.rb +1 -1
- 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: f52440ba4cb5aa106d20f5e2dec603fd8f75508d00a07002e5194dc0117d1ffa
|
4
|
+
data.tar.gz: 686003127105da31fd7c098f9503080436e6dbffb59cc4ea8acd57e15b858d08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37e3d839004b895a670aeb2ca292f78c11489fcf0d24173b16d563222d645a374722289a53300848ffe5fba4b93d19d59ad07d71a637276fc35441b5b6864b1f
|
7
|
+
data.tar.gz: f70bc9f019573762fced363a312eaa72ee9ba35a173dc385abe76a04757f444b33deb3b862723e34ebd6c382e0655d67f500a6fcc5265317b1283a40f1febed9
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -8,20 +8,10 @@ Furthermore, it allows you to generate a SVG representation of the tracing datas
|
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
11
|
-
Add this line to your application's Gemfile:
|
12
|
-
|
13
11
|
```ruby
|
14
12
|
gem 'lens_protocol'
|
15
13
|
```
|
16
14
|
|
17
|
-
And then execute:
|
18
|
-
|
19
|
-
$ bundle
|
20
|
-
|
21
|
-
Or install it yourself as:
|
22
|
-
|
23
|
-
$ gem install lens_protocol
|
24
|
-
|
25
15
|
## Usage
|
26
16
|
|
27
17
|
### Parsing an OMA file
|
@@ -32,7 +22,19 @@ message = LensProtocol::OMA.parse(File.read('examples/oma/R360_1.oma'))
|
|
32
22
|
message.values_of('SPH') # => [1.25, -0.5]
|
33
23
|
```
|
34
24
|
|
35
|
-
### Generating
|
25
|
+
### Generating an OMA file
|
26
|
+
```ruby
|
27
|
+
message = LensProtocol::OMA.generate(
|
28
|
+
'JOB' => 42,
|
29
|
+
'SPH' => [1.25, -0.5]
|
30
|
+
)
|
31
|
+
puts message
|
32
|
+
# =>
|
33
|
+
# JOB=42
|
34
|
+
# SPH=1.25;-0.50
|
35
|
+
```
|
36
|
+
|
37
|
+
### Generating the Tracing SVG
|
36
38
|
|
37
39
|
The `message.to_svg` method returns an array of SVG strings, one for each side, which can be used directly in an ERB template, like this:
|
38
40
|
|
data/lib/lens_protocol/oma.rb
CHANGED