linux_block_device 0.1.0 → 0.2.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 +4 -4
- data/.gitignore +2 -0
- data/ext/linux_block_device/extconf.rb +1 -1
- data/ext/linux_block_device/linux_block_device.c +10 -3
- data/lib/linux_block_device/version.rb +1 -1
- data/linux_block_device.gemspec +0 -8
- metadata +17 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88e1d4718439ab4a22395f81897d697027ff65c0
|
4
|
+
data.tar.gz: 1d6541c0861913896bdfe0a879f6670ac6af8f3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cc1daa9cdff06fa6f22899c18fb63df6e27bc5058673dadb20c887a3fbd2f916057a949c70f5e676af15ba4a1324c4f8fdf7b33d27981a0cf06075b4c153c83
|
7
|
+
data.tar.gz: 959d655661ff8a4a57ea08a75a94b5119daf016da755f4bff24a6af390ef775edd60b6d89b1a2b5d7cfbb30e4f4595f4f2c0f458ad9bc3e3f9496414b454f4a6
|
data/.gitignore
CHANGED
@@ -2,9 +2,12 @@
|
|
2
2
|
* Ruby module to block device operations on Linux platforms.
|
3
3
|
*/
|
4
4
|
|
5
|
-
#include <sys/ioctl.h>
|
6
5
|
#include <errno.h>
|
6
|
+
|
7
|
+
#ifdef __linux__
|
8
|
+
#include <sys/ioctl.h>
|
7
9
|
#include <linux/fs.h>
|
10
|
+
#endif
|
8
11
|
|
9
12
|
#include "ruby.h"
|
10
13
|
|
@@ -12,11 +15,12 @@ static const char *module_name = "LinuxBlockDevice";
|
|
12
15
|
|
13
16
|
static VALUE
|
14
17
|
lbd_size(VALUE self, VALUE rfd) {
|
18
|
+
#ifdef __linux__
|
15
19
|
int fd;
|
16
20
|
int64_t sz;
|
17
|
-
|
21
|
+
|
18
22
|
fd = NUM2INT(rfd);
|
19
|
-
|
23
|
+
|
20
24
|
if (ioctl(fd, BLKGETSIZE64, &sz) < 0) {
|
21
25
|
rb_raise(rb_eSystemCallError,
|
22
26
|
"%s.size - ioctl failed on file descriptor: %d, %s\n",
|
@@ -26,6 +30,9 @@ lbd_size(VALUE self, VALUE rfd) {
|
|
26
30
|
);
|
27
31
|
}
|
28
32
|
return OFFT2NUM(sz);
|
33
|
+
#else
|
34
|
+
rb_raise(rb_eNotImpError, "Not supported on this platform.\n");
|
35
|
+
#endif
|
29
36
|
}
|
30
37
|
|
31
38
|
VALUE mLinuxBlockDevice;
|
data/linux_block_device.gemspec
CHANGED
@@ -14,14 +14,6 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.homepage = "http://github.com/ManageIQ/linux_block_device"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
|
-
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
18
|
-
# delete this section to allow pushing this gem to any host.
|
19
|
-
if spec.respond_to?(:metadata)
|
20
|
-
spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
21
|
-
else
|
22
|
-
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
23
|
-
end
|
24
|
-
|
25
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
18
|
spec.extensions = ["ext/linux_block_device/extconf.rb"]
|
27
19
|
spec.bindir = "exe"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linux_block_device
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rich Oliveri
|
@@ -9,62 +9,62 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-10-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '0'
|
21
21
|
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rake
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- - ~>
|
32
|
+
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '10.0'
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- - ~>
|
39
|
+
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '10.0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rake-compiler
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - ">="
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0'
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: rspec
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
description: Ruby module to interact with block devices on Linux platforms.
|
@@ -76,9 +76,9 @@ extensions:
|
|
76
76
|
- ext/linux_block_device/extconf.rb
|
77
77
|
extra_rdoc_files: []
|
78
78
|
files:
|
79
|
-
- .gitignore
|
80
|
-
- .rspec
|
81
|
-
- .travis.yml
|
79
|
+
- ".gitignore"
|
80
|
+
- ".rspec"
|
81
|
+
- ".travis.yml"
|
82
82
|
- Gemfile
|
83
83
|
- LICENSE.txt
|
84
84
|
- README.md
|
@@ -93,25 +93,24 @@ files:
|
|
93
93
|
homepage: http://github.com/ManageIQ/linux_block_device
|
94
94
|
licenses:
|
95
95
|
- MIT
|
96
|
-
metadata:
|
97
|
-
allowed_push_host: 'TODO: Set to ''http://mygemserver.com'''
|
96
|
+
metadata: {}
|
98
97
|
post_install_message:
|
99
98
|
rdoc_options: []
|
100
99
|
require_paths:
|
101
100
|
- lib
|
102
101
|
required_ruby_version: !ruby/object:Gem::Requirement
|
103
102
|
requirements:
|
104
|
-
- -
|
103
|
+
- - ">="
|
105
104
|
- !ruby/object:Gem::Version
|
106
105
|
version: '0'
|
107
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
107
|
requirements:
|
109
|
-
- -
|
108
|
+
- - ">="
|
110
109
|
- !ruby/object:Gem::Version
|
111
110
|
version: '0'
|
112
111
|
requirements: []
|
113
112
|
rubyforge_project:
|
114
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.5.1
|
115
114
|
signing_key:
|
116
115
|
specification_version: 4
|
117
116
|
summary: Ruby module to interact with block devices on Linux platforms.
|