ruby-ole 1.2.11.3 → 1.2.11.4

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,11 @@
1
+ == 1.2.11.4 / 2012-07-03
2
+
3
+ - Embed PropertySet meta data GUIDs and field lists, to avoid hitting the
4
+ filesystem and remove dependency on YAML.
5
+ - Update Rakefile to avoid warnings about both deprecated tasks and space
6
+ before parentheses.
7
+ - Remove Dirent#children=.
8
+
1
9
  == 1.2.11.3 / 2012-02-25
2
10
 
3
11
  - Various fixes for ruby 1.9.3 - handle iconv deprecation and
data/Rakefile CHANGED
@@ -1,8 +1,5 @@
1
1
  require 'rubygems'
2
- require 'rake/rdoctask'
3
2
  require 'rake/testtask'
4
- require 'rake/packagetask'
5
- require 'rake/gempackagetask'
6
3
 
7
4
  require 'rbconfig'
8
5
  require 'fileutils'
@@ -31,20 +28,29 @@ rescue LoadError
31
28
  # Rcov not available
32
29
  end
33
30
 
34
- Rake::RDocTask.new do |t|
35
- t.rdoc_dir = 'doc'
36
- t.rdoc_files.include 'lib/**/*.rb'
37
- t.rdoc_files.include 'README', 'ChangeLog'
38
- t.title = "#{PKG_NAME} documentation"
39
- t.options += %w[--line-numbers --inline-source --tab-width 2]
40
- t.main = 'README'
31
+ begin
32
+ require 'rdoc/task'
33
+ RDoc::Task.new do |t|
34
+ t.rdoc_dir = 'doc'
35
+ t.rdoc_files.include 'lib/**/*.rb'
36
+ t.rdoc_files.include 'README', 'ChangeLog'
37
+ t.title = "#{PKG_NAME} documentation"
38
+ t.options += %w[--line-numbers --inline-source --tab-width 2]
39
+ t.main = 'README'
40
+ end
41
+ rescue LoadError
42
+ # RDoc not available or too old (<2.4.2)
41
43
  end
42
44
 
43
- Rake::GemPackageTask.new(spec) do |t|
44
- t.gem_spec = spec
45
- t.need_tar = true
46
- t.need_zip = false
47
- t.package_dir = 'build'
45
+ begin
46
+ require 'rubygems/package_task'
47
+ Gem::PackageTask.new(spec) do |t|
48
+ t.need_tar = true
49
+ t.need_zip = false
50
+ t.package_dir = 'build'
51
+ end
52
+ rescue LoadError
53
+ # RubyGems too old (<1.3.2)
48
54
  end
49
55
 
50
56
  desc 'Run various benchmarks'
@@ -135,7 +135,7 @@ module Ole # :nodoc:
135
135
  def to_tree idx=0
136
136
  return [] if idx == Dirent::EOT
137
137
  d = self[idx]
138
- d.children = to_tree d.child
138
+ to_tree(d.child).each { |child| d << child }
139
139
  raise FormatError, "directory #{d.inspect} used twice" if d.idx
140
140
  d.idx = idx
141
141
  to_tree(d.prev) + [d] + to_tree(d.next)
@@ -786,14 +786,6 @@ module Ole # :nodoc:
786
786
  @name = name
787
787
  end
788
788
 
789
- # needed to add reset of @name_lookup here. might be better to just
790
- # remove this method as its only used in one place anyway.
791
- def children= children
792
- @children = []
793
- @name_lookup = {}
794
- children.each { |child| self << child }
795
- end
796
-
797
789
  def open mode='r'
798
790
  raise Errno::EISDIR unless file?
799
791
  io = RangesIOMigrateable.new self, mode
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Ole # :nodoc:
4
4
  class Storage
5
- VERSION = '1.2.11.3'
5
+ VERSION = '1.2.11.4'
6
6
  end
7
7
  end
8
8
 
@@ -1,7 +1,5 @@
1
1
  # encoding: ASCII-8BIT
2
2
 
3
- require 'yaml'
4
-
5
3
  module Ole
6
4
  module Types
7
5
  #
@@ -24,8 +22,45 @@ module Ole
24
22
  }
25
23
 
26
24
  # define a smattering of the property set guids.
27
- DATA = YAML.load_file(File.dirname(__FILE__) + '/../../../data/propids.yaml').
28
- inject({}) { |hash, (key, value)| hash.update Clsid.parse(key) => value }
25
+ DATA = {
26
+ Clsid.parse('{f29f85e0-4ff9-1068-ab91-08002b27b3d9}') => ['FMTID_SummaryInformation', {
27
+ 2 => 'doc_title',
28
+ 3 => 'doc_subject',
29
+ 4 => 'doc_author',
30
+ 5 => 'doc_keywords',
31
+ 6 => 'doc_comments',
32
+ 7 => 'doc_template',
33
+ 8 => 'doc_last_author',
34
+ 9 => 'doc_rev_number',
35
+ 10 => 'doc_edit_time',
36
+ 11 => 'doc_last_printed',
37
+ 12 => 'doc_created_time',
38
+ 13 => 'doc_last_saved_time',
39
+ 14 => 'doc_page_count',
40
+ 15 => 'doc_word_count',
41
+ 16 => 'doc_char_count',
42
+ 18 => 'doc_app_name',
43
+ 19 => 'security'
44
+ }],
45
+ Clsid.parse('{d5cdd502-2e9c-101b-9397-08002b2cf9ae}') => ['FMTID_DocSummaryInfo', {
46
+ 2 => 'doc_category',
47
+ 3 => 'doc_presentation_target',
48
+ 4 => 'doc_byte_count',
49
+ 5 => 'doc_line_count',
50
+ 6 => 'doc_para_count',
51
+ 7 => 'doc_slide_count',
52
+ 8 => 'doc_note_count',
53
+ 9 => 'doc_hidden_count',
54
+ 10 => 'mmclips',
55
+ 11 => 'scale_crop',
56
+ 12 => 'heading_pairs',
57
+ 13 => 'doc_part_titles',
58
+ 14 => 'doc_manager',
59
+ 15 => 'doc_company',
60
+ 16 => 'links_up_to_date'
61
+ }],
62
+ Clsid.parse('{d5cdd505-2e9c-101b-9397-08002b2cf9ae}') => ['FMTID_UserDefinedProperties', {}]
63
+ }
29
64
 
30
65
  # create an inverted map of names to guid/key pairs
31
66
  PROPERTY_MAP = DATA.inject({}) do |h1, (guid, data)|
data/ruby-ole.gemspec CHANGED
@@ -1,4 +1,4 @@
1
- $:.unshift (File.dirname(__FILE__) + '/lib')
1
+ $:.unshift File.dirname(__FILE__) + '/lib'
2
2
  require 'ole/storage/version'
3
3
 
4
4
  PKG_NAME = 'ruby-ole'
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.rubyforge_project = %q{ruby-ole}
16
16
 
17
17
  s.executables = ['oletool']
18
- s.files = ['README', 'COPYING', 'Rakefile', 'ChangeLog', 'ruby-ole.gemspec', 'data/propids.yaml']
18
+ s.files = ['README', 'COPYING', 'Rakefile', 'ChangeLog', 'ruby-ole.gemspec']
19
19
  s.files += Dir.glob('lib/**/*.rb')
20
20
  s.files += Dir.glob('test/{test_*.rb,*.doc,oleWithDirs.ole,test_SummaryInformation}')
21
21
  s.files += Dir.glob('bin/*')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-ole
3
3
  version: !ruby/object:Gem::Version
4
- hash: 101
4
+ hash: 107
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
9
  - 11
10
- - 3
11
- version: 1.2.11.3
10
+ - 4
11
+ version: 1.2.11.4
12
12
  platform: ruby
13
13
  authors:
14
14
  - Charles Lowe
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-02-25 00:00:00 -05:00
19
+ date: 2012-07-03 00:00:00 +10:00
20
20
  default_executable:
21
21
  dependencies: []
22
22
 
@@ -35,7 +35,6 @@ files:
35
35
  - Rakefile
36
36
  - ChangeLog
37
37
  - ruby-ole.gemspec
38
- - data/propids.yaml
39
38
  - bin/oletool
40
39
  - lib/ole/storage.rb
41
40
  - lib/ole/storage/file_system.rb
data/data/propids.yaml DELETED
@@ -1,56 +0,0 @@
1
- "{f29f85e0-4ff9-1068-ab91-08002b27b3d9}":
2
- - FMTID_SummaryInformation
3
- - 2: doc_title
4
- 3: doc_subject
5
- 4: doc_author
6
- 5: doc_keywords
7
- 6: doc_comments
8
- 7: doc_template
9
- 8: doc_last_author
10
- 9: doc_rev_number
11
- 10: doc_edit_time
12
- 11: doc_last_printed
13
- 12: doc_created_time
14
- 13: doc_last_saved_time
15
- 14: doc_page_count
16
- 15: doc_word_count
17
- 16: doc_char_count
18
- 18: doc_app_name
19
- 19: security
20
-
21
- "{d5cdd502-2e9c-101b-9397-08002b2cf9ae}":
22
- - FMTID_DocSummaryInfo
23
- - 2: doc_category
24
- 3: doc_presentation_target
25
- 4: doc_byte_count
26
- 5: doc_line_count
27
- 6: doc_para_count
28
- 7: doc_slide_count
29
- 8: doc_note_count
30
- 9: doc_hidden_count
31
- 10: mmclips
32
- 11: scale_crop
33
- 12: heading_pairs
34
- 13: doc_part_titles
35
- 14: doc_manager
36
- 15: doc_company
37
- 16: links_up_to_date
38
-
39
- "{d5cdd505-2e9c-101b-9397-08002b2cf9ae}":
40
- - FMTID_UserDefinedProperties
41
- - {}
42
-
43
- # just dumped these all here. if i can confirm any of these
44
- # better, i can update this file so they're recognized.
45
- #0b63e343-9ccc-11d0-bcdb-00805fccce04
46
- #0b63e350-9ccc-11d0-bcdb-00805fccce04 NetLibrary propset?
47
- #31f400a0-fd07-11cf-b9bd-00aa003db18e ScriptInfo propset?
48
- #49691c90-7e17-101a-a91c-08002b2ecda9 Query propset?
49
- #560c36c0-503a-11cf-baa1-00004c752a9a
50
- #70eb7a10-55d9-11cf-b75b-00aa0051fe20 HTMLInfo propset
51
- #85ac0960-1819-11d1-896f-00805f053bab message propset?
52
- #aa568eec-e0e5-11cf-8fda-00aa00a14f93 NNTP SummaryInformation propset?
53
- #b725f130-47ef-101a-a5f1-02608c9eebac Storage propset
54
- #c82bf596-b831-11d0-b733-00aa00a1ebd2 NetLibraryInfo propset
55
- #c82bf597-b831-11d0-b733-00aa00a1ebd2 LinkInformation propset?
56
- #d1b5d3f0-c0b3-11cf-9a92-00a0c908dbf1 LinkInformation propset?