disk 0.0.2

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 68d820befcab6ea64f7f002f8cd8c32d11d92ac6
4
+ data.tar.gz: 9d1603e644f6e0d70a84b1b8453c6e21e7985561
5
+ SHA512:
6
+ metadata.gz: 201c06646d73ddbd8136626d6170f9859213027dad05ed8bc2a4094e773b1dfcaea4b7789a4ff1b60da0f8322c50b7c9c7266dc343020a51be5d0795eb556d0e
7
+ data.tar.gz: 71b558465628454325b75a3ce1a2af00d8db05a5a95ccb144f596ecbadeb759b889d96a46f84257464200f3204781978e75b97cc61fc3c2f18fb95a9845ab826
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org/"
2
+
3
+ gem "ffi"
data/disk.gemspec ADDED
@@ -0,0 +1,12 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = 'disk'
3
+ s.version = '0.0.2'
4
+ s.date = '2014-11-25'
5
+ s.summary = "Disk Functions"
6
+ s.description = "Disk Functions"
7
+ s.authors = ["Naner Nunes"]
8
+ s.email = 'naner@naner.com.br'
9
+ s.files = %w(Gemfile disk.gemspec lib/disk.rb lib/blkid/c.rb lib/blkid/c/types.rb lib/blkid/c/functions.rb)
10
+ s.homepage = 'http://rubygems.org/gems/disk'
11
+ s.license = 'MIT'
12
+ end
data/lib/blkid/c.rb ADDED
@@ -0,0 +1,11 @@
1
+ require 'ffi'
2
+
3
+ module Blkid
4
+ module C
5
+ extend FFI::Library
6
+ ffi_lib ['libblkid.so.1']
7
+ end
8
+ end
9
+
10
+ require_relative 'c/types'
11
+ require_relative 'c/functions'
@@ -0,0 +1,9 @@
1
+ require_relative 'types'
2
+
3
+ module Blkid
4
+ module C
5
+
6
+ attach_function :blkid_new_probe_from_filename, [:string], BlkIDProbe.by_ref
7
+
8
+ end
9
+ end
@@ -0,0 +1,28 @@
1
+ module Blkid
2
+ module C
3
+
4
+ FFI.typedef(:int64, :blkid_loff_t)
5
+
6
+ class BlkIDProbe < FFI::Struct
7
+ layout \
8
+ :fd, :int,
9
+ :off, :blkid_loff_t,
10
+ :size, :blkid_loff_t,
11
+ :devno, :dev_t,
12
+ :disk_devno, :dev_t,
13
+ :blkssz, :uint,
14
+ :mode, :mode_t,
15
+ :flags, :int,
16
+ :prob_flags, :int,
17
+ :wipe_off, :blkid_loff_t,
18
+ :wipe_size, :blkid_loff_t,
19
+ :wipe_chain, :pointer,
20
+ #:buffers, ListHead,
21
+ #:chains, [BlkIDChain, 3],
22
+ :cur_chain, :pointer,
23
+ #:vals, [BlkIDPrVal, 29],
24
+ :nvals, :int
25
+ end
26
+
27
+ end
28
+ end
data/lib/disk.rb ADDED
@@ -0,0 +1,9 @@
1
+ require_relative 'blkid/c'
2
+
3
+ module Disk
4
+ class << self
5
+ def get_probe( path )
6
+ probe = Blkid::C.blkid_new_probe_from_filename path
7
+ end
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,49 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: disk
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Naner Nunes
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-11-25 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Disk Functions
14
+ email: naner@naner.com.br
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - Gemfile
20
+ - disk.gemspec
21
+ - lib/blkid/c.rb
22
+ - lib/blkid/c/functions.rb
23
+ - lib/blkid/c/types.rb
24
+ - lib/disk.rb
25
+ homepage: http://rubygems.org/gems/disk
26
+ licenses:
27
+ - MIT
28
+ metadata: {}
29
+ post_install_message:
30
+ rdoc_options: []
31
+ require_paths:
32
+ - lib
33
+ required_ruby_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ required_rubygems_version: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: '0'
43
+ requirements: []
44
+ rubyforge_project:
45
+ rubygems_version: 2.4.2
46
+ signing_key:
47
+ specification_version: 4
48
+ summary: Disk Functions
49
+ test_files: []