openwsman 2.3.4 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/ext/ruby/helpers.h CHANGED
@@ -113,9 +113,9 @@ static int
113
113
  _add_str( VALUE key, VALUE value, hash_t *h )
114
114
  {
115
115
  if (key != Qundef) {
116
- const char *k = as_string( key );
116
+ const char *k = strdup( as_string( key ) );
117
117
  if (!hash_lookup( h, k ) ) {
118
- const char *v = as_string( value );
118
+ const char *v = strdup( as_string( value ) );
119
119
  if ( !hash_alloc_insert( h, k, v ) ) {
120
120
  rb_raise( rb_eException, "hash_alloc_insert failed" );
121
121
  }
@@ -132,11 +132,16 @@ static int
132
132
  _add_selector( VALUE key, VALUE value, hash_t *h )
133
133
  {
134
134
  if (key != Qundef) {
135
- const char *k = as_string( key );
135
+ const char *k = strdup( as_string( key ) );
136
136
  if (!hash_lookup( h, k ) ) {
137
137
  selector_entry *entry = u_malloc(sizeof(selector_entry));
138
138
  entry->type = 0;
139
- entry->entry.text = strdup(as_string( value ));
139
+ if (TYPE(value) == T_ARRAY) {
140
+ rb_raise( rb_eException, "Passing array parameter via invoke() still unsupported" );
141
+ }
142
+ else {
143
+ entry->entry.text = strdup(as_string( value ));
144
+ }
140
145
  if ( !hash_alloc_insert( h, k, entry ) ) {
141
146
  rb_raise( rb_eException, "hash_alloc_insert failed" );
142
147
  }
@@ -163,7 +168,7 @@ value2hash( hash_t *h, VALUE v, int valuetype )
163
168
 
164
169
  Check_Type( v, T_HASH );
165
170
 
166
- if (!h) h = hash_create(HASHCOUNT_T_MAX, 0, 0);
171
+ if (!h) h = hash_create3(HASHCOUNT_T_MAX, 0, 0);
167
172
 
168
173
  rb_hash_foreach( v, (valuetype==0)?_add_str:_add_selector, (unsigned long)h );
169
174
 
@@ -15,6 +15,28 @@ require 'openwsman/xmlnode'
15
15
  # this extends Openwsman::XmlDoc with method_missing
16
16
  require 'openwsman/xmldoc'
17
17
 
18
+ # = About openwsman
19
+ # Openwsman (http://www.openwsman.org) is a project intended to provide an open-source
20
+ # implementation of the Web Services Management specification
21
+ # (WS-Management) and to expose system management information on the
22
+ # Linux operating system using the WS-Management protocol. WS-Management
23
+ # is based on a suite of web services specifications and usage
24
+ # requirements that exposes a set of operations focused on and covers
25
+ # all system management aspects.
26
+ #
27
+ # = Using the bindings
28
+ # The bindings provide access to the client-side API of openwsman.
29
+ # You start by creating a Client instance and set up ClientOptions
30
+ # to control the communication.
31
+ #
32
+ # The Client instance now provides the WS-Management operations, like
33
+ # enumerate, get, invoke, etc.
34
+ #
35
+ # All client operations return a XmlDoc representing the SOAP response
36
+ # from the system.
37
+ # # You can then use XmlDoc methods to extract SOAP elements from the
38
+ # response and dig down through its XmlNode and XmlAttr objects.
39
+
18
40
  module Openwsman
19
41
  class Transport
20
42
  # called when authentication credentials missing or wrong
@@ -32,7 +54,9 @@ module Openwsman
32
54
  #
33
55
  # ==== Examples
34
56
  # prefix = Openwsman.epr_prefix_for "CIM_Managed_Element"
57
+ # => "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2"
35
58
  # prefix = Openwsman.epr_prefix_for "Win32_Foo", "root/cimv2"
59
+ # => "http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2"
36
60
  #
37
61
  def self.epr_prefix_for classname, namespace = nil
38
62
  prefix = Openwsman::uri_prefix classname
@@ -41,16 +65,21 @@ module Openwsman
41
65
  end
42
66
 
43
67
  # create full endpoint reference URI for namespace and classname
68
+ #
69
+ # * +classname+ - classname (using the <schema>_<name> format)
70
+ # * +namespace+ - optional namespace, required for Windows WMI which embeds the namespace in the EPR
71
+ #
72
+ # ==== Examples
73
+ # Openwsman.epr_uri_for "root/cimv2", "Win32_Foo"
74
+ # => "http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Foo"
44
75
  def self.epr_uri_for namespace, classname
45
76
  raise "Namespace must not be nil" unless namespace
46
77
  raise "Classname must not be nil" unless classname
47
- epr = "#{self.epr_prefix_for(classname)}"
48
- epr << "/#{namespace}" unless namespace.empty?
49
- epr << "/#{classname}"
78
+ epr = epr_prefix_for(classname,namespace) + "/#{classname}"
50
79
  end
51
80
 
52
81
  class EndPointReference
53
- def method_missing name, *args
82
+ def method_missing name, *args # :nodoc:
54
83
  selector(name)
55
84
  end
56
85
  end
@@ -1,9 +1,8 @@
1
- #
2
- # Assume XmlDoc.foo means XmlDoc.body.foo
3
- #
4
-
5
1
  module Openwsman
6
2
  class XmlDoc
3
+ #
4
+ # Assume XmlDoc.foo means XmlDoc.body.foo
5
+ #
7
6
  def method_missing method, *args
8
7
  self.body.send method,*args
9
8
  end
metadata CHANGED
@@ -1,82 +1,76 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: openwsman
3
- version: !ruby/object:Gem::Version
4
- hash: 11
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.4.0
5
5
  prerelease:
6
- segments:
7
- - 2
8
- - 3
9
- - 4
10
- version: 2.3.4
11
6
  platform: ruby
12
- authors:
13
- - "Klaus K\xC3\xA4mpf"
7
+ authors:
8
+ - Klaus Kämpf
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-05-28 00:00:00 +02:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
12
+ date: 2013-09-05 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
22
15
  name: rake-compiler
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
25
17
  none: false
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- hash: 3
30
- segments:
31
- - 0
32
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
33
22
  type: :development
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: mocha
37
23
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: mocha
32
+ requirement: !ruby/object:Gem::Requirement
39
33
  none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- hash: 25
44
- segments:
45
- - 0
46
- - 9
47
- version: "0.9"
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0.9'
48
38
  type: :development
49
- version_requirements: *id002
50
- - !ruby/object:Gem::Dependency
51
- name: yard
52
39
  prerelease: false
53
- requirement: &id003 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0.9'
46
+ - !ruby/object:Gem::Dependency
47
+ name: yard
48
+ requirement: !ruby/object:Gem::Requirement
54
49
  none: false
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- hash: 1
59
- segments:
60
- - 0
61
- - 5
62
- version: "0.5"
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0.5'
63
54
  type: :development
64
- version_requirements: *id003
65
- description: |-
66
- The openwsman gem provides a Ruby API to manage
67
- systems using the WS-Management protocol.
68
- email:
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0.5'
62
+ description: ! 'The openwsman gem provides a Ruby API to manage
63
+
64
+ systems using the WS-Management protocol.'
65
+ email:
69
66
  - kkaempf@suse.de
70
67
  executables: []
71
-
72
- extensions:
68
+ extensions:
73
69
  - ext/openwsman/extconf.rb
74
70
  extra_rdoc_files: []
75
-
76
- files:
71
+ files:
77
72
  - lib/openwsman.rb
78
73
  - lib/openwsman/openwsman.rb
79
- - lib/openwsman/version.rb
80
74
  - lib/openwsman/xmlnode.rb
81
75
  - lib/openwsman/xmldoc.rb
82
76
  - ext/ruby/helpers.h
@@ -84,43 +78,30 @@ files:
84
78
  - ext/openwsman/openwsman_wrap.c
85
79
  - ext/openwsman/openwsman.c
86
80
  - ext/openwsman/extconf.rb
87
- has_rdoc: true
88
81
  homepage: http://www.github.com/openwsman/openwsman
89
82
  licenses: []
90
-
91
- post_install_message: " ____\n\
92
- /@ ~-.\n\
93
- / __ .- | remember to have fun! \n // // @ \n\n"
83
+ post_install_message: ! " ____\n/@ ~-.\n/ __ .- | remember to have fun! \n //
84
+ // @ \n\n"
94
85
  rdoc_options: []
95
-
96
- require_paths:
86
+ require_paths:
97
87
  - lib
98
- required_ruby_version: !ruby/object:Gem::Requirement
88
+ required_ruby_version: !ruby/object:Gem::Requirement
99
89
  none: false
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- hash: 3
104
- segments:
105
- - 0
106
- version: "0"
107
- required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
95
  none: false
109
- requirements:
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- hash: 23
113
- segments:
114
- - 1
115
- - 3
116
- - 6
96
+ requirements:
97
+ - - ! '>='
98
+ - !ruby/object:Gem::Version
117
99
  version: 1.3.6
118
100
  requirements: []
119
-
120
101
  rubyforge_project:
121
- rubygems_version: 1.5.0
102
+ rubygems_version: 1.8.23
122
103
  signing_key:
123
104
  specification_version: 3
124
105
  summary: Ruby client bindings for Openwsman
125
106
  test_files: []
126
-
107
+ has_rdoc:
@@ -1,10 +0,0 @@
1
- # openwsman/version.rb
2
-
3
- module Openwsman
4
- require 'rbconfig'
5
- OPENWSMAN_RUBY_VERSION = "1.9"
6
- SYSTEM_RUBY_VERSION = "#{RbConfig::CONFIG['MAJOR']}.#{RbConfig::CONFIG['MINOR']}"
7
- if SYSTEM_RUBY_VERSION != OPENWSMAN_RUBY_VERSION
8
- STDERR.puts "** Warning: Ruby version mismatch: Openwsman Ruby #{OPENWSMAN_RUBY_VERSION}, Runtime Ruby #{SYSTEM_RUBY_VERSION}"
9
- end
10
- end