vmonkey 0.6.0 → 0.6.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b6a4fb5821a83b57d952824592fec50acfe69280
4
- data.tar.gz: 5ae9d0b71dc950c01f753957cd8e889acb7fa894
3
+ metadata.gz: e70eff6ca91cea320ab02850bb495ea5379e43bf
4
+ data.tar.gz: 5be15a57203fd28ce38cb87808004a7da161c96b
5
5
  SHA512:
6
- metadata.gz: e466efcca5bc7a2a076790eef527f16b6e5fa4b3f8b0b6f8129bc8b066604b2fe30d4fdc5e85765b7631473f2fc421d8673a33fb707189733b05cadd9d0eef8a
7
- data.tar.gz: 73d417cf8c82bbf58aa58efff9cab4f855e79eea393cd0d9a0fe6992deeadf3d512914bdbec741af2eca48f27e65c1db4632620783174a57dfc9a548a01931b4
6
+ metadata.gz: 2bf1a23be2e66ff2b6a76b135c58d3c2599989a463cec4fe95ce0752c2139c7cde73efeb10cf2e8cd465953cee580ab70ef33422a8e56bb00fb88d8c5e3c107a
7
+ data.tar.gz: 1335dbd621d0b1e65c5d42a039889e4ec12f26fdfc3fe23f2c06aea1a16044a31ecc3ec3923a3c2420df89ff8248cbd6a073665a88c4c919bc716c715524afa9
@@ -1,3 +1,3 @@
1
1
  module Vmonkey
2
- VERSION = '0.6.0'
2
+ VERSION = '0.6.1'
3
3
  end
@@ -1,4 +1,4 @@
1
- using VMonkey
1
+ using VMonkey unless RUBY_VERSION.split('.')[0] == '1'
2
2
 
3
3
  class RbVmomi::VIM::VirtualApp
4
4
 
@@ -1,4 +1,4 @@
1
- using VMonkey
1
+ using VMonkey unless RUBY_VERSION.split('.')[0] == '1'
2
2
 
3
3
  class RbVmomi::VIM::VirtualMachine
4
4
 
data/lib/vmonkey.rb CHANGED
@@ -16,14 +16,34 @@ module VMonkey
16
16
  end
17
17
 
18
18
  module VMonkey
19
- refine String do
20
- def parent
21
- p = self.split('/')[0...-1].join('/')
22
- p == '' ? '/' : p
19
+ def self.string_parent(s)
20
+ p = s.split('/')[0...-1].join('/')
21
+ p == '' ? '/' : p
22
+ end
23
+
24
+ def self.string_basename(s)
25
+ p = s.split('/').last
26
+ end
27
+
28
+ if '1' == RUBY_VERSION.split('.')[0]
29
+ class ::String
30
+ def parent
31
+ VMonkey::string_parent(self)
32
+ end
33
+
34
+ def basename
35
+ VMonkey::string_basename(self)
36
+ end
23
37
  end
38
+ else
39
+ refine String do
40
+ def parent
41
+ VMonkey::string_parent(self)
42
+ end
24
43
 
25
- def basename
26
- p = self.split('/').last
44
+ def basename
45
+ VMonkey::string_basename(self)
46
+ end
27
47
  end
28
48
  end
29
49
  end
data/spec/vapp_spec.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  require_relative 'spec_helper'
2
- using VMonkey
2
+ using VMonkey unless RUBY_VERSION.split('.')[0] == '1'
3
3
 
4
4
  describe RbVmomi::VIM::VirtualApp do
5
5
 
@@ -1,5 +1,5 @@
1
1
  require_relative 'spec_helper'
2
- using VMonkey
2
+ using VMonkey unless RUBY_VERSION.split('.')[0] == '1'
3
3
 
4
4
  describe RbVmomi::VIM::VirtualMachine do
5
5
  before :all do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmonkey
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Dupras