officex2str 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +2 -0
- data/fixtures/sample.xlsx +0 -0
- data/lib/officex2str/version.rb +1 -1
- data/lib/officex2str.rb +11 -2
- data/officex2str.gemspec +1 -1
- data/spec/officex2str_spec.rb +2 -0
- metadata +4 -10
data/.gitignore
CHANGED
data/fixtures/sample.xlsx
CHANGED
Binary file
|
data/lib/officex2str/version.rb
CHANGED
data/lib/officex2str.rb
CHANGED
@@ -56,9 +56,18 @@ private
|
|
56
56
|
xml_text
|
57
57
|
end
|
58
58
|
|
59
|
-
def xml_to_str
|
59
|
+
def xml_to_str xmls
|
60
60
|
text = ""
|
61
|
-
|
61
|
+
unless xmls.empty?
|
62
|
+
if content_type == XLSX_CONTENT_TYPE
|
63
|
+
xmls.map do |xml|
|
64
|
+
doc = Nokogiri.XML(xml.toutf8)
|
65
|
+
text += doc.search("t").map{|node| node.children.to_s}.join(' ')
|
66
|
+
end
|
67
|
+
else
|
68
|
+
xmls.each{|xml| text << Nokogiri.XML(xml.toutf8, nil, 'utf8').to_str }
|
69
|
+
end
|
70
|
+
end
|
62
71
|
text
|
63
72
|
end
|
64
73
|
end
|
data/officex2str.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |gem|
|
|
17
17
|
|
18
18
|
gem.add_development_dependency "rake", ["= 0.9.2"]
|
19
19
|
gem.add_development_dependency "rspec", ["= 2.10.0"]
|
20
|
-
gem.add_runtime_dependency "nokogiri", [">= 1.
|
20
|
+
gem.add_runtime_dependency "nokogiri", [">= 1.4.7"]
|
21
21
|
gem.add_runtime_dependency "zipruby", ["= 0.3.6"]
|
22
22
|
gem.add_runtime_dependency "mime-types", [">= 1.17.2"]
|
23
23
|
|
data/spec/officex2str_spec.rb
CHANGED
@@ -58,6 +58,8 @@ describe Officex2str do
|
|
58
58
|
subject.should include("SONICGARDEN")
|
59
59
|
subject.should include("株式会社")
|
60
60
|
subject.should include("コメント")
|
61
|
+
subject.should include("STG001")
|
62
|
+
subject.should include("STG003")
|
61
63
|
subject.should_not include("sonicgarden")
|
62
64
|
subject.should_not include("sheet")
|
63
65
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: officex2str
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-07-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ! '>='
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 1.
|
53
|
+
version: 1.4.7
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ! '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
61
|
+
version: 1.4.7
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: zipruby
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
@@ -124,18 +124,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
124
124
|
- - ! '>='
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: '0'
|
127
|
-
segments:
|
128
|
-
- 0
|
129
|
-
hash: -2240468863005458128
|
130
127
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
128
|
none: false
|
132
129
|
requirements:
|
133
130
|
- - ! '>='
|
134
131
|
- !ruby/object:Gem::Version
|
135
132
|
version: '0'
|
136
|
-
segments:
|
137
|
-
- 0
|
138
|
-
hash: -2240468863005458128
|
139
133
|
requirements: []
|
140
134
|
rubyforge_project:
|
141
135
|
rubygems_version: 1.8.23
|