omf_common 6.0.0.pre.1 → 6.0.0.pre.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,7 @@
1
1
  require 'omf_common/dsl/xmpp_blather'
2
2
 
3
3
  module OmfCommon
4
+ # PubSub communication class, can be extended with different implementations
4
5
  class Comm
5
6
  def initialize(pubsub_implementation)
6
7
  self.extend("OmfCommon::DSL::#{pubsub_implementation.to_s.camelcase}".constant)
@@ -5,7 +5,7 @@ module OmfCommon::Command
5
5
  #
6
6
  # @example
7
7
  #
8
- # OmfRc::Command.execute("uname -a")
8
+ # OmfCommon::Command.execute("uname -a")
9
9
  def self.execute(*cmd, &block)
10
10
  result = nil
11
11
  begin
@@ -38,6 +38,8 @@ module OmfCommon
38
38
  end
39
39
  end
40
40
 
41
+ # Construct a property node
42
+ #
41
43
  def property(key, value = nil, &block)
42
44
  key_node = Message.new('property')
43
45
  key_node.write_attr('key', key)
@@ -58,6 +60,8 @@ module OmfCommon
58
60
  self
59
61
  end
60
62
 
63
+ # Validate against relaxng schema
64
+ #
61
65
  def valid?
62
66
  validation = Nokogiri::XML::RelaxNG(File.open(SCHEMA_FILE)).validate(document)
63
67
  if validation.empty?
@@ -68,6 +72,8 @@ module OmfCommon
68
72
  end
69
73
  end
70
74
 
75
+ # Short cut for adding xml node
76
+ #
71
77
  def element(key, value)
72
78
  key_node = Niceogiri::XML::Node.new(key)
73
79
  key_node.content = value
@@ -80,6 +86,7 @@ module OmfCommon
80
86
  element_name.to_sym
81
87
  end
82
88
 
89
+ # Short cut for grabbing a group of nodes using xpath, but with default namespace
83
90
  def element_by_xpath_with_default_namespace(xpath_without_ns)
84
91
  xpath(xpath_without_ns.gsub(/(\/+)(\w+)/, '\1xmlns:\2'), :xmlns => OMF_NAMESPACE)
85
92
  end
@@ -1,4 +1,4 @@
1
1
  module OmfCommon
2
- VERSION = "6.0.0.pre.1"
2
+ VERSION = "6.0.0.pre.2"
3
3
  PROTOCOL_VERSION = "6.0"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omf_common
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0.pre.1
4
+ version: 6.0.0.pre.2
5
5
  prerelease: 6
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: 2012-05-28 00:00:00.000000000 Z
12
+ date: 2012-05-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest