rbvmomi 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -10,9 +10,9 @@ begin
10
10
  gem.add_dependency 'nokogiri', '>= 1.4.1'
11
11
  gem.add_dependency 'builder'
12
12
  gem.add_dependency 'trollop'
13
- gem.add_dependency 'tokyocabinet'
13
+ gem.add_dependency 'cdb-full'
14
14
  gem.required_ruby_version = '>= 1.9.1'
15
- gem.files.include 'vmodl.tc'
15
+ gem.files.include 'vmodl.cdb'
16
16
  end
17
17
  rescue LoadError
18
18
  puts "Jeweler not available. Install it with: gem install jeweler"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.1
1
+ 1.0.2
@@ -1,8 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'nokogiri'
3
- require 'tokyocabinet'
4
-
5
- include TokyoCabinet
3
+ require 'cdb'
6
4
 
7
5
  # usage: analyze-vim-declarations.rb vim-declarations.xml foo-declarations.xml vmodl.db
8
6
 
@@ -14,11 +12,6 @@ XML_FNS.each do |x|
14
12
  abort "XML file #{x} does not exist" unless File.exists? x
15
13
  end
16
14
 
17
- db = HDB.new
18
- if !db.open(OUT_FN, HDB::OWRITER | HDB::OCREAT | HDB::OTRUNC | HDB::TDEFLATE)
19
- abort "VMODL db open error: #{db.errmsg(db.ecode)}"
20
- end
21
-
22
15
  TYPES = {}
23
16
  VERSIONS = []
24
17
 
@@ -182,6 +175,8 @@ TYPES.each do |k,t|
182
175
  end
183
176
  end
184
177
 
178
+ db = CDBMake.new(OUT_FN)
179
+
185
180
  TYPES.each do |k,t|
186
181
  db[k] = Marshal.dump t
187
182
  end
@@ -189,7 +184,7 @@ end
189
184
  db['_typenames'] = Marshal.dump TYPES.keys
190
185
  db['_versions'] = Marshal.dump VERSIONS
191
186
 
192
- db.close
187
+ db.finish
193
188
 
194
189
  if filename = ENV['VERSION_GRAPH']
195
190
  File.open(filename, 'w') do |io|
data/lib/rbvmomi.rb CHANGED
@@ -277,7 +277,7 @@ end
277
277
  end
278
278
 
279
279
  require 'rbvmomi/types'
280
- vmodl_fn = ENV['VMODL'] || File.join(File.dirname(__FILE__), "../vmodl.tc")
280
+ vmodl_fn = ENV['VMODL'] || File.join(File.dirname(__FILE__), "../vmodl.cdb")
281
281
  RbVmomi::VIM.load vmodl_fn
282
282
 
283
283
  require 'rbvmomi/extensions'
@@ -24,6 +24,6 @@ class Trollop::Parser
24
24
  end
25
25
 
26
26
  def rbvmomi_datastore_opt
27
- opt :datastore, "Datastore", short: 's', default: (ENV['RBVMOMI_DATASTORE'] || 'datstore1')
27
+ opt :datastore, "Datastore", short: 's', default: (ENV['RBVMOMI_DATASTORE'] || 'datastore1')
28
28
  end
29
29
  end
data/lib/rbvmomi/types.rb CHANGED
@@ -1,10 +1,8 @@
1
1
  # Copyright (c) 2010 VMware, Inc. All Rights Reserved.
2
- require 'tokyocabinet'
2
+ require 'cdb'
3
3
  require 'pp'
4
4
  require 'set'
5
5
 
6
- include TokyoCabinet
7
-
8
6
  class Class
9
7
  def wsdl_name
10
8
  self.class.name
@@ -18,10 +16,7 @@ module VIM
18
16
  BUILTIN_TYPES = %w(ManagedObject TypeName PropertyPath ManagedObjectReference MethodName MethodFault LocalizedMethodFault)
19
17
 
20
18
  def self.load fn
21
- @db = HDB.new
22
- if !@db.open(fn, HDB::OREADER | HDB::ONOLCK)
23
- raise "VMODL db open error: #{@db.errmsg(@db.ecode)}"
24
- end
19
+ @db = CDB.new fn
25
20
  @vmodl = Hash.new { |h,k| if e = @db[k] then h[k] = Marshal.load(e) end }
26
21
  @typenames = Marshal.load(@db['_typenames']) + BUILTIN_TYPES
27
22
  Object.constants.select { |x| @typenames.member? x.to_s }.each { |x| load_type x }
data/vmodl.cdb ADDED
Binary file
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbvmomi
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 1
10
- version: 1.0.1
9
+ - 2
10
+ version: 1.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Rich Lane
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-09 00:00:00 -08:00
18
+ date: 2010-11-11 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -63,7 +63,7 @@ dependencies:
63
63
  type: :runtime
64
64
  version_requirements: *id003
65
65
  - !ruby/object:Gem::Dependency
66
- name: tokyocabinet
66
+ name: cdb-full
67
67
  prerelease: false
68
68
  requirement: &id004 !ruby/object:Gem::Requirement
69
69
  none: false
@@ -105,7 +105,7 @@ files:
105
105
  - test/test_emit_request.rb
106
106
  - test/test_parse_response.rb
107
107
  - test/test_serialization.rb
108
- - vmodl.tc
108
+ - vmodl.cdb
109
109
  has_rdoc: true
110
110
  homepage: https://github.com/rlane/rbvmomi
111
111
  licenses: []
data/vmodl.tc DELETED
Binary file