thinp_xml 0.0.20 → 0.0.24

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,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ODJiYjEzNzNmYzhmYzMwMzY0MDcxNjE2NzYzYWQyODMxMTMxYjUyNQ==
5
- data.tar.gz: !binary |-
6
- ODAwOWQxNWIwZGVhMWUyN2U3M2ZlOThjMDNiYTc2MWQ2ZTZkNWQ2ZQ==
2
+ SHA1:
3
+ metadata.gz: d6f915ce43b16825c99f62bfd2ff3c69431b1228
4
+ data.tar.gz: 80ca4400ac41dbda0941f081f637a3b52c00929c
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- M2NhZjdjNzQ3ZGQ5Y2M4YTRhNjlmYjE4YThkNDc1NDNjNTNiNWFkNTFkODZk
10
- ZjQ0MDEwMDlhYjNhYTE1NDE4NzZjZjg3OTRiZDgyYmNjZDkyYjA4NjIyMWEz
11
- NmYyYjAzNDExYWU2NWM3MWI3ZDQwYzI1ODEwMjQ1NDY1NDMxZjI=
12
- data.tar.gz: !binary |-
13
- ZmEyNzVkNzYzZjFiMzBiNmMwZjY5NDg2NWQ2NDc3N2I4NzUzOGNhNGM4ZjEz
14
- MWNkMzAyZTVmYmRiYjBmNzhhMjg3Nzk0ZTUyN2Q4NTM1NjAyNWM5YTQ5ZmQ4
15
- ZDQ1NDAxMjVkYjRlZmFiYmM5N2ViM2UzNjM2ZDkxZTljMDEzNTY=
6
+ metadata.gz: 9a68908cca82127b90634793b9ea52cd2914c88b2d0c710cfce2309847a6fa5a274c1a991ee3962f0f15439ca2b97a9cdb6afb7223005c4ed008742e40676c24
7
+ data.tar.gz: fd674d1b2e80fc8e04753e85fca5b92259a7d9862414cefc1998d950951f819b470b5e375ec2b14d9df2e3a42a8dcf5b13174cb753d125c8914f6cdd7c5df4ac
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  *~
2
+ *.swp
2
3
  *.gem
3
4
  *.rbc
4
5
  .bundle
@@ -0,0 +1 @@
1
+ 2.4.1
@@ -1,20 +1,20 @@
1
1
  When(/^I thinp_xml (.*)$/) do |cmd|
2
- run_simple(unescape("thinp_xml #{cmd}"), false)
2
+ run_simple(sanitize_text("thinp_xml #{cmd}"), false)
3
3
  end
4
4
 
5
5
  When(/^I cache_xml (.*)$/) do |cmd|
6
- run_simple(unescape("cache_xml #{cmd}"), false)
6
+ run_simple(sanitize_text("cache_xml #{cmd}"), false)
7
7
  end
8
8
 
9
9
  When(/^I era_xml (.*)$/) do |cmd|
10
- run_simple(unescape("era_xml #{cmd}"), false)
10
+ run_simple(sanitize_text("era_xml #{cmd}"), false)
11
11
  end
12
12
 
13
13
  Then(/^it should pass$/) do
14
- assert_success(true)
14
+ expect(last_command_started).to be_successfully_executed
15
15
  end
16
16
 
17
17
  Then(/^it should fail$/) do
18
- assert_success(false)
18
+ expect(last_command_started).to_not be_successfully_executed
19
19
  end
20
20
 
@@ -1,5 +1,5 @@
1
1
  module ThinpXML
2
- THINP_TOOLS_VERSION = '0.1.5'
2
+ THINP_TOOLS_VERSION = '0.7'
3
3
 
4
4
  def self.tools_are_installed
5
5
  true
@@ -72,7 +72,7 @@ module CacheXML
72
72
 
73
73
  def nr_mappings=(n)
74
74
  n = n.to_i
75
- #raise "nr_mappings must not exceed nr_cache_blocks" if n > @nr_cache_blocks
75
+ raise "nr_mappings must not exceed nr_cache_blocks" if n > @nr_cache_blocks
76
76
  @nr_mappings = n
77
77
  end
78
78
 
@@ -1,4 +1,5 @@
1
1
  require 'thinp_xml/era/builder'
2
2
  require 'thinp_xml/era/emit'
3
3
  require 'thinp_xml/era/metadata'
4
+ require 'thinp_xml/era/parse'
4
5
  require 'thinp_xml/version'
@@ -18,7 +18,7 @@ module ThinpXML
18
18
 
19
19
  mapping_counts = (0..nr_thins - 1).map {|n| @nr_mappings.to_i}
20
20
  nr_data_blocks = mapping_counts.inject(0) {|n, tot| n + tot}
21
- superblock = Superblock.new(@uuid, 0, 1, @block_size, nr_data_blocks)
21
+ superblock = Superblock.new(@uuid, 0, 1, 0, 2, @block_size, nr_data_blocks)
22
22
 
23
23
  devices = Array.new
24
24
  offset = 0
@@ -11,7 +11,7 @@ module ThinpXML
11
11
  end
12
12
 
13
13
  def emit_superblock(sb, &block)
14
- @e.emit_tag(sb, 'superblock', :uuid, :time, :transaction, :data_block_size, :nr_data_blocks, &block)
14
+ @e.emit_tag(sb, 'superblock', :uuid, :time, :transaction, :flags, :version, :data_block_size, :nr_data_blocks, &block)
15
15
  end
16
16
 
17
17
  def emit_device(dev, &block)
@@ -2,6 +2,8 @@ module ThinpXML
2
2
  SUPERBLOCK_FIELDS = [[:uuid, :string],
3
3
  [:time, :int],
4
4
  [:transaction, :int],
5
+ [:flags, :int],
6
+ [:version, :int],
5
7
  [:data_block_size, :int],
6
8
  [:nr_data_blocks, :int]]
7
9
 
@@ -12,6 +12,8 @@ module XMLFormat
12
12
 
13
13
  SUPERBLOCK_FIELDS = [[:uuid, :string],
14
14
  [:time, :int],
15
+ [:flags, :int],
16
+ [:version, :int],
15
17
  [:transaction, :int],
16
18
  [:data_block_size, :int],
17
19
  [:nr_data_blocks, :int]]
@@ -144,7 +146,7 @@ module XMLFormat
144
146
  end
145
147
 
146
148
  def emit_superblock(e, sb, &block)
147
- e.emit_tag(sb, 'superblock', :uuid, :time, :transaction, :data_block_size, :nr_data_blocks, &block)
149
+ e.emit_tag(sb, 'superblock', :uuid, :time, :transaction, :flags, :version, :data_block_size, :nr_data_blocks, &block)
148
150
  end
149
151
 
150
152
  def emit_device(e, dev, &block)
@@ -1,3 +1,3 @@
1
1
  module ThinpXml
2
- VERSION = "0.0.20"
2
+ VERSION = "0.0.24"
3
3
  end
@@ -1,4 +1,5 @@
1
1
  require 'thinp_xml/thinp/builder'
2
+ require 'thinp_xml/distribution'
2
3
 
3
4
  #----------------------------------------------------------------
4
5
 
@@ -69,7 +70,7 @@ describe "ThinpXML::Builder" do
69
70
  end
70
71
 
71
72
  it "should take a distribution" do
72
- @b.nr_thins = UniformDistribution.new(2, 6)
73
+ @b.nr_thins = ThinpXML::UniformDistribution.new(2, 6)
73
74
  md = @b.generate
74
75
 
75
76
  expect(md.devices.size).to be <= 5
@@ -26,7 +26,7 @@ EOF
26
26
  describe "CacheXML::read_xml" do
27
27
  # a sanity check (debugging some namespace issues)
28
28
  it "should work" do
29
- read_xml(StringIO.new(INPUT))
29
+ CacheXML::read_xml(StringIO.new(INPUT))
30
30
  end
31
31
  end
32
32
 
@@ -6,7 +6,7 @@ include EraXML
6
6
 
7
7
  describe "EraXML::read_xml" do
8
8
  it "should handle metadata with zero blocks" do
9
- metadata = read_xml(StringIO.new(<<EOF))
9
+ metadata = EraXML::read_xml(StringIO.new(<<EOF))
10
10
  <superblock uuid="" block_size="128" nr_blocks="0" current_era="0">
11
11
  <era_array>
12
12
  </era_array>
@@ -19,7 +19,7 @@ EOF
19
19
  end
20
20
 
21
21
  it "should handle more complicated metadata" do
22
- metadata = read_xml(StringIO.new(<<EOF))
22
+ metadata = EraXML::read_xml(StringIO.new(<<EOF))
23
23
  <superblock uuid="blip blop" block_size="256" nr_blocks="32" current_era="100">
24
24
  <writeset era="98" nr_bits="32">
25
25
  <bit block="0" value="true"/>
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.3"
24
24
  spec.add_development_dependency "rake"
25
- spec.add_development_dependency 'json', '~> 1.7.7'
25
+ spec.add_development_dependency 'json'
26
26
  spec.add_development_dependency "cucumber"
27
27
  spec.add_development_dependency "aruba"
28
28
  spec.add_development_dependency "rspec"
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thinp_xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20
4
+ version: 0.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Thornber
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-03 00:00:00.000000000 Z
11
+ date: 2017-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ejt_command_line
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.0.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.0.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: json
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 1.7.7
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 1.7.7
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: cucumber
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: aruba
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rspec
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ! '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ! '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  description: Ruby library for parsing and generating the Linux thin-provisioning xml
@@ -120,8 +120,9 @@ executables:
120
120
  extensions: []
121
121
  extra_rdoc_files: []
122
122
  files:
123
- - .gitignore
124
- - .rspec
123
+ - ".gitignore"
124
+ - ".rspec"
125
+ - ".ruby-version"
125
126
  - Gemfile
126
127
  - LICENSE.txt
127
128
  - README.md
@@ -177,17 +178,17 @@ require_paths:
177
178
  - lib
178
179
  required_ruby_version: !ruby/object:Gem::Requirement
179
180
  requirements:
180
- - - ! '>='
181
+ - - ">="
181
182
  - !ruby/object:Gem::Version
182
183
  version: '0'
183
184
  required_rubygems_version: !ruby/object:Gem::Requirement
184
185
  requirements:
185
- - - ! '>='
186
+ - - ">="
186
187
  - !ruby/object:Gem::Version
187
188
  version: '0'
188
189
  requirements: []
189
190
  rubyforge_project:
190
- rubygems_version: 2.2.2
191
+ rubygems_version: 2.6.11
191
192
  signing_key:
192
193
  specification_version: 4
193
194
  summary: Thin provisioning xml