pnote_client 1.2.1 → 1.2.2
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c38c92f08772113345894b177d60fae00480bc42c330723081a416d8e036bf2
|
4
|
+
data.tar.gz: 06c3e22850c81051f78ebc8e38ad758b3026b87bee13014d5556d0528aaeb140
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c9a2570889da67ee48e8332c3e2cfa3b6b314eb1413f9825cac3498f615dca8abc1ba4957e31c45e19dc777baf4f7d61ec27758c7fc7a762165368aa807b539
|
7
|
+
data.tar.gz: 3788db78f6979dcd8dfe4a6bf063f60d53261d473579dfeca3c888dc92b7ced1bf08fceebd13011fdeaee2a168a0135ea658a24e29758e6ca7bd71384a7998eb
|
@@ -1,17 +1,16 @@
|
|
1
1
|
module PnoteClient
|
2
2
|
module Documents
|
3
3
|
class Hml
|
4
|
-
class
|
4
|
+
class EmbeddingBinaryItem
|
5
5
|
attr_reader :id, :raw_data, :format, :size
|
6
6
|
|
7
|
-
def initialize(bin_item_tag, doc)
|
7
|
+
def initialize(bin_item_id, bin_item_tag, doc)
|
8
8
|
bin_data_id = bin_item_tag['BinData']
|
9
|
-
bin_item = doc.at_xpath("//BINITEM[@BinData=#{bin_data_id}]")
|
10
9
|
bin_data = doc.at_xpath("//BINDATA[@Id=#{bin_data_id}]")
|
11
10
|
|
12
|
-
@id =
|
11
|
+
@id = bin_item_id
|
13
12
|
@raw_data = bin_data.content
|
14
|
-
@format =
|
13
|
+
@format = bin_item_tag['Format']
|
15
14
|
@size = bin_data['Size'].to_i
|
16
15
|
end
|
17
16
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'nokogiri'
|
2
2
|
require 'pnote_client/documents/hml/style'
|
3
3
|
require 'pnote_client/documents/hml/paragraph'
|
4
|
-
require 'pnote_client/documents/hml/
|
4
|
+
require 'pnote_client/documents/hml/embedding_binary_item'
|
5
5
|
|
6
6
|
class InvalidXMLError < StandardError; end
|
7
7
|
|
@@ -42,9 +42,12 @@ module PnoteClient
|
|
42
42
|
paragraphs << Paragraph.from_tag(pg_tag)
|
43
43
|
end
|
44
44
|
|
45
|
-
bin_item_tags = doc.xpath("//BINITEM
|
46
|
-
bin_item_tags.
|
47
|
-
|
45
|
+
bin_item_tags = doc.xpath("//BINITEM")
|
46
|
+
bin_item_tags.each_with_index do |bin_item_tag, index|
|
47
|
+
bin_item_id = index + 1
|
48
|
+
if bin_item_tag['Type'] == 'Embedding'
|
49
|
+
bin_items << EmbeddingBinaryItem.new(bin_item_id, bin_item_tag, doc)
|
50
|
+
end
|
48
51
|
end
|
49
52
|
|
50
53
|
return self.new(styles: styles, paragraphs: paragraphs, bin_items: bin_items)
|
data/lib/pnote_client/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pnote_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bluesh55
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -104,8 +104,8 @@ files:
|
|
104
104
|
- lib/pnote_client/converters/pnote_to_json_converter.rb
|
105
105
|
- lib/pnote_client/display/console_display.rb
|
106
106
|
- lib/pnote_client/documents/hml.rb
|
107
|
-
- lib/pnote_client/documents/hml/binary_item.rb
|
108
107
|
- lib/pnote_client/documents/hml/char.rb
|
108
|
+
- lib/pnote_client/documents/hml/embedding_binary_item.rb
|
109
109
|
- lib/pnote_client/documents/hml/equation.rb
|
110
110
|
- lib/pnote_client/documents/hml/image.rb
|
111
111
|
- lib/pnote_client/documents/hml/paragraph.rb
|