di-ruby-lvm 0.1.3 → 0.2.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c59af229d12766a5b476ad6c391ebb46c66cd1f2
4
+ data.tar.gz: 6a47b08bf7f9119d4c25c9d19a7896a1f95df6f8
5
+ SHA512:
6
+ metadata.gz: d125aa835643b82d0ebddf611cf9d2840fe1812146d1d0b06054654fd6d6486c9020f60fdc3a8317c51f6e81d41d7ec31b45e16a05a5cd90cee0ca4d6384a224
7
+ data.tar.gz: 395564c1eca2a2047f6c84eda994cb998209111a7b5378106dc6e984d2dbfedc7447ea09b418ae7a78701dc05b604fc1108b2828928b9024693c43e5321b34b4
@@ -0,0 +1 @@
1
+ *.gem
@@ -0,0 +1,26 @@
1
+ $:.unshift(File.expand_path('../lib/', __FILE__))
2
+ require 'lvm/version'
3
+
4
+ deps = {
5
+ 'open4' => [ '~> 0.9', '>= 0.9.6' ],
6
+ 'di-ruby-lvm-attrib' => ['~> 0.0.3']
7
+ }
8
+
9
+ Gem::Specification.new do |gem|
10
+ gem.authors = ["Greg Symons", "Matthew Kent"]
11
+ gem.email = ["mkent@magoazul.com", 'gsymons@gsconsulting.biz']
12
+ gem.description = %q{A wrapper for the LVM2 administration utility, lvm.}
13
+ gem.license = "MIT"
14
+ gem.summary = %q{A wrapper for the LVM2 administration utility, lvm.}
15
+ gem.homepage = "https://github.com/gregsymons/di-ruby-lvm"
16
+ gem.files = `git ls-files`.split($\)
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.name = "di-ruby-lvm"
19
+ gem.require_paths = ["lib"]
20
+ gem.version = LVM::VERSION
21
+
22
+ deps.each do |dep, constraints|
23
+ gem.add_runtime_dependency dep, *constraints
24
+ end
25
+ end
26
+
data/lib/lvm.rb CHANGED
@@ -3,10 +3,9 @@ require 'lvm/userland'
3
3
  require 'lvm/logical_volumes'
4
4
  require 'lvm/volume_groups'
5
5
  require 'lvm/physical_volumes'
6
+ require 'lvm/version'
6
7
 
7
8
  module LVM
8
- VERSION = '0.1.3'
9
-
10
9
  class LVM
11
10
  attr_reader :command
12
11
  attr_reader :logical_volumes
@@ -22,16 +22,13 @@ module LVM
22
22
  lvsseg = @lvsseg.list
23
23
 
24
24
  lvs.each do |lv|
25
- lv.segments ||= []
26
- lvsseg.each do |lvseg|
27
- if lvseg.lv_uuid == lv.uuid
28
- lv.segments << lvseg
29
- end
30
- end
25
+ lv.segments = lvsseg.select { |seg| seg.lv_uuid == lv.uuid }
26
+ yield lv
31
27
  end
28
+ end
32
29
 
33
- return lvs.each {|l| yield l}
30
+ def list
31
+ self.each { }
34
32
  end
35
33
  end
36
-
37
34
  end
@@ -22,16 +22,13 @@ module LVM
22
22
  pvsseg = @pvsseg.list
23
23
 
24
24
  pvs.each do |pv|
25
- pv.segments ||= []
26
- pvsseg.each do |pvseg|
27
- if pvseg.pv_uuid == pv.uuid
28
- pv.segments << pvseg
29
- end
30
- end
25
+ pv.segments = pvsseg.select { |seg| seg.pv_uuid == pv.uuid }
26
+ yield pv
31
27
  end
32
-
33
- return pvs.each {|p| yield p}
34
28
  end
35
29
  end
36
30
 
31
+ def list
32
+ self.each { }
33
+ end
37
34
  end
@@ -0,0 +1,3 @@
1
+ module LVM
2
+ VERSION = '0.2.0'
3
+ end
@@ -22,25 +22,18 @@ module LVM
22
22
  # This is the best representation of LVM data.
23
23
  def each
24
24
  vgs = @vgs.list
25
+ lvs = @lvs.list
26
+ pvs = @pvs.list
25
27
 
26
28
  vgs.each do |vg|
27
- vg.logical_volumes ||= []
28
- @lvs.each do |lv|
29
- if lv.vg_uuid == vg.uuid
30
- vg.logical_volumes << lv
31
- end
32
- end
33
- vg.physical_volumes ||= []
34
- @pvs.each do |pv|
35
- if pv.vg_uuid == vg.uuid
36
- vg.physical_volumes << pv
37
- end
38
- end
29
+ vg.logical_volumes = lvs.select { |lv| lv.vg_uuid == vg.uuid }
30
+ vg.physical_volumes = pvs.select { |pv| pv.vg_uuid == vg.uuid }
31
+ yield vg
39
32
  end
40
-
41
- return vgs.each {|v| yield v}
42
33
  end
43
34
 
35
+ def list
36
+ self.each { }
37
+ end
44
38
  end
45
-
46
39
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: di-ruby-lvm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
5
- prerelease:
4
+ version: 0.2.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Greg Symons
@@ -10,110 +9,55 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2012-06-05 00:00:00.000000000 Z
12
+ date: 2015-12-02 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: open4
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ! '>='
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '0.9'
21
+ - - ">="
21
22
  - !ruby/object:Gem::Version
22
23
  version: 0.9.6
23
24
  type: :runtime
24
25
  prerelease: false
25
26
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
27
  requirements:
28
- - - ! '>='
28
+ - - "~>"
29
+ - !ruby/object:Gem::Version
30
+ version: '0.9'
31
+ - - ">="
29
32
  - !ruby/object:Gem::Version
30
33
  version: 0.9.6
31
34
  - !ruby/object:Gem::Dependency
32
35
  name: di-ruby-lvm-attrib
33
36
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
37
  requirements:
36
- - - ~>
38
+ - - "~>"
37
39
  - !ruby/object:Gem::Version
38
40
  version: 0.0.3
39
41
  type: :runtime
40
42
  prerelease: false
41
43
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
44
  requirements:
44
- - - ~>
45
+ - - "~>"
45
46
  - !ruby/object:Gem::Version
46
47
  version: 0.0.3
47
- - !ruby/object:Gem::Dependency
48
- name: rdoc
49
- requirement: !ruby/object:Gem::Requirement
50
- none: false
51
- requirements:
52
- - - ~>
53
- - !ruby/object:Gem::Version
54
- version: '3.10'
55
- type: :development
56
- prerelease: false
57
- version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
- requirements:
60
- - - ~>
61
- - !ruby/object:Gem::Version
62
- version: '3.10'
63
- - !ruby/object:Gem::Dependency
64
- name: hoe
65
- requirement: !ruby/object:Gem::Requirement
66
- none: false
67
- requirements:
68
- - - ~>
69
- - !ruby/object:Gem::Version
70
- version: '3.0'
71
- type: :development
72
- prerelease: false
73
- version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
76
- - - ~>
77
- - !ruby/object:Gem::Version
78
- version: '3.0'
79
- description: ! 'This is a fork of the ruby-lvm gem found at git://rubyforge.org/ruby-lvm.git.
80
-
81
- The primary difference from upstream is that it depends on
82
-
83
- di-ruby-lvm-attributes instead of ruby-lvm-attributes. This adds support for lvm
84
-
85
- version 2.02.66(2).
86
-
87
-
88
-
89
- This is a wrapper for the LVM2 administration utility, lvm. Its primary
90
-
91
- function it to convert physical volumes, logical volumes and volume groups
92
-
93
- into easy to use ruby objects. It also provides a simple wrapper for typical
94
-
95
- create/delete/etc operations.
96
-
97
-
98
- Due to a lack of LVM2 api this is a best effort attempt at ruby integration but
99
-
100
- subject to complete replacement in the future.'
48
+ description: A wrapper for the LVM2 administration utility, lvm.
101
49
  email:
102
- - gsymons@drillinginfo.com
103
50
  - mkent@magoazul.com
51
+ - gsymons@gsconsulting.biz
104
52
  executables: []
105
53
  extensions: []
106
- extra_rdoc_files:
107
- - History.txt
108
- - Manifest.txt
109
- - README.txt
110
- - Todo.txt
54
+ extra_rdoc_files: []
111
55
  files:
56
+ - ".gitignore"
112
57
  - History.txt
113
- - Manifest.txt
114
58
  - README.txt
115
- - Rakefile
116
59
  - Todo.txt
60
+ - di-ruby-lvm.gemspec
117
61
  - examples/create_snapshot.rb
118
62
  - examples/error_handling.rb
119
63
  - examples/show_lvm_config.rb
@@ -126,6 +70,7 @@ files:
126
70
  - lib/lvm/physical_volume_segment.rb
127
71
  - lib/lvm/physical_volumes.rb
128
72
  - lib/lvm/userland.rb
73
+ - lib/lvm/version.rb
129
74
  - lib/lvm/volume_group.rb
130
75
  - lib/lvm/volume_groups.rb
131
76
  - lib/lvm/volumes.rb
@@ -137,32 +82,29 @@ files:
137
82
  - lib/lvm/wrapper/pvsseg.rb
138
83
  - lib/lvm/wrapper/vgs.rb
139
84
  - test/test_lvm.rb
140
- - .gemtest
141
- homepage: http://ruby-lvm.rubyforge.org
142
- licenses: []
85
+ homepage: https://github.com/gregsymons/di-ruby-lvm
86
+ licenses:
87
+ - MIT
88
+ metadata: {}
143
89
  post_install_message:
144
- rdoc_options:
145
- - --main
146
- - README.txt
90
+ rdoc_options: []
147
91
  require_paths:
148
92
  - lib
149
93
  required_ruby_version: !ruby/object:Gem::Requirement
150
- none: false
151
94
  requirements:
152
- - - ! '>='
95
+ - - ">="
153
96
  - !ruby/object:Gem::Version
154
97
  version: '0'
155
98
  required_rubygems_version: !ruby/object:Gem::Requirement
156
- none: false
157
99
  requirements:
158
- - - ! '>='
100
+ - - ">="
159
101
  - !ruby/object:Gem::Version
160
102
  version: '0'
161
103
  requirements: []
162
- rubyforge_project: di-ruby-lvm
163
- rubygems_version: 1.8.24
104
+ rubyforge_project:
105
+ rubygems_version: 2.4.6
164
106
  signing_key:
165
- specification_version: 3
166
- summary: This is a fork of the ruby-lvm gem found at git://rubyforge.org/ruby-lvm.git
107
+ specification_version: 4
108
+ summary: A wrapper for the LVM2 administration utility, lvm.
167
109
  test_files:
168
110
  - test/test_lvm.rb
data/.gemtest DELETED
File without changes
@@ -1,28 +0,0 @@
1
- History.txt
2
- Manifest.txt
3
- README.txt
4
- Rakefile
5
- Todo.txt
6
- examples/create_snapshot.rb
7
- examples/error_handling.rb
8
- examples/show_lvm_config.rb
9
- lib/lvm.rb
10
- lib/lvm/external.rb
11
- lib/lvm/logical_volume.rb
12
- lib/lvm/logical_volume_segment.rb
13
- lib/lvm/logical_volumes.rb
14
- lib/lvm/physical_volume.rb
15
- lib/lvm/physical_volume_segment.rb
16
- lib/lvm/physical_volumes.rb
17
- lib/lvm/userland.rb
18
- lib/lvm/volume_group.rb
19
- lib/lvm/volume_groups.rb
20
- lib/lvm/volumes.rb
21
- lib/lvm/wrapper.rb
22
- lib/lvm/wrapper/constants.rb
23
- lib/lvm/wrapper/lvs.rb
24
- lib/lvm/wrapper/lvsseg.rb
25
- lib/lvm/wrapper/pvs.rb
26
- lib/lvm/wrapper/pvsseg.rb
27
- lib/lvm/wrapper/vgs.rb
28
- test/test_lvm.rb
data/Rakefile DELETED
@@ -1,14 +0,0 @@
1
- # -*- ruby -*-
2
-
3
- require 'rubygems'
4
- require 'hoe'
5
-
6
- Hoe.spec 'di-ruby-lvm' do |p|
7
- p.developer('Greg Symons', 'gsymons@drillinginfo.com')
8
- p.developer('Matthew Kent', 'mkent@magoazul.com')
9
- p.extra_deps << ['open4', '>= 0.9.6']
10
- p.extra_deps << ['di-ruby-lvm-attrib', '~> 0.0.3']
11
- p.remote_rdoc_dir = ''
12
- end
13
-
14
- # vim:syntax=ruby