ffi-xattr 0.0.5 → 0.1.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.
- checksums.yaml +4 -4
- data/{.travis.yml → .travis.disabled.yml} +2 -1
- data/LICENSE +1 -1
- data/README.md +9 -8
- data/lib/ffi-xattr/error.rb +4 -3
- data/lib/ffi-xattr/version.rb +1 -1
- data/spec/xattr_spec.rb +5 -2
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03fc82a1353a14b6b48327682f8efb5327f8d4a6
|
4
|
+
data.tar.gz: dd6a2abd62dd605cb0aae1cb65551e69f4c2d00f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9cc1cbaab866ac3a6d89d7066b8621ba66eb36ac45032df2a59b0c92a7d57fc297d3db3ed02bed7d41c05aa00520690f84d182979feca7ec881f5eb0ad7200c
|
7
|
+
data.tar.gz: 73dc271860f7c541aac07195bdfe4cc3746bee9fa0755917967fe899f90ff91934b2f915230446f19bcbd947bda236a37cf372fb6aeb89d0d84840d02e68b244
|
data/LICENSE
CHANGED
@@ -186,7 +186,7 @@ APPENDIX: How to apply the Apache License to your work.
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
187
187
|
identification within third-party archives.
|
188
188
|
|
189
|
-
Copyright 2011-
|
189
|
+
Copyright 2011-2014 Jari Bakken
|
190
190
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
192
192
|
you may not use this file except in compliance with the License.
|
data/README.md
CHANGED
@@ -9,15 +9,16 @@ Ruby library to manage extended file attributes.
|
|
9
9
|
Example
|
10
10
|
-------
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
```ruby
|
13
|
+
xattr = Xattr.new("/path/to/file")
|
14
|
+
xattr['user.foo'] = 'bar'
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
xattr.each { |key, value| ... }
|
19
|
-
xattr.as_json #=> {"user.foo" => "bar"}
|
16
|
+
xattr['user.foo'] #=> 'bar'
|
17
|
+
xattr.list #=> ["user.foo"]
|
20
18
|
|
19
|
+
xattr.each { |key, value| ... }
|
20
|
+
xattr.as_json #=> {"user.foo" => "bar"}
|
21
|
+
```
|
21
22
|
|
22
23
|
Note on Patches/Pull Requests
|
23
24
|
-----------------------------
|
@@ -33,7 +34,7 @@ Note on Patches/Pull Requests
|
|
33
34
|
Copyright
|
34
35
|
---------
|
35
36
|
|
36
|
-
Copyright 2011-
|
37
|
+
Copyright 2011-2014 Jari Bakken
|
37
38
|
|
38
39
|
Licensed under the Apache License, Version 2.0 (the "License");
|
39
40
|
you may not use this file except in compliance with the License.
|
data/lib/ffi-xattr/error.rb
CHANGED
@@ -8,14 +8,15 @@ class Xattr # :nodoc: all
|
|
8
8
|
|
9
9
|
class << self
|
10
10
|
def last
|
11
|
+
errno = FFI.errno
|
11
12
|
ptr = FFI::MemoryPointer.new(:char, 256)
|
12
|
-
strerror_r(
|
13
|
+
strerror_r(errno, ptr, 256)
|
13
14
|
|
14
|
-
ptr.read_string
|
15
|
+
[ ptr.read_string, errno ]
|
15
16
|
end
|
16
17
|
|
17
18
|
def check(int)
|
18
|
-
raise last if int != 0
|
19
|
+
raise SystemCallError.new(*last) if int != 0
|
19
20
|
end
|
20
21
|
end
|
21
22
|
end
|
data/lib/ffi-xattr/version.rb
CHANGED
data/spec/xattr_spec.rb
CHANGED
@@ -35,8 +35,11 @@ describe Xattr do
|
|
35
35
|
xattr.list.should == []
|
36
36
|
end
|
37
37
|
|
38
|
-
it "raises
|
39
|
-
lambda { xattr.remove("inexisting") }.should raise_error
|
38
|
+
it "raises Errno: when tries to remove inexistent attribute" do
|
39
|
+
lambda { xattr.remove("user.inexisting") }.should raise_error { |error|
|
40
|
+
error.should be_a(SystemCallError)
|
41
|
+
error.should respond_to(:errno)
|
42
|
+
}
|
40
43
|
end
|
41
44
|
|
42
45
|
it "returns nil if the attribute is not set" do
|
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ffi-xattr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jari Bakken
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
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'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '2.5'
|
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: '2.5'
|
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.9.2
|
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.9.2
|
55
55
|
description: Manipulate extended file attributes
|
@@ -59,8 +59,8 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
-
- .gitignore
|
63
|
-
- .travis.yml
|
62
|
+
- ".gitignore"
|
63
|
+
- ".travis.disabled.yml"
|
64
64
|
- Gemfile
|
65
65
|
- LICENSE
|
66
66
|
- README.md
|
@@ -82,17 +82,17 @@ require_paths:
|
|
82
82
|
- lib
|
83
83
|
required_ruby_version: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
|
-
- -
|
85
|
+
- - ">="
|
86
86
|
- !ruby/object:Gem::Version
|
87
87
|
version: '0'
|
88
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
89
|
requirements:
|
90
|
-
- -
|
90
|
+
- - ">="
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: '0'
|
93
93
|
requirements: []
|
94
94
|
rubyforge_project: ffi-xattr
|
95
|
-
rubygems_version: 2.
|
95
|
+
rubygems_version: 2.2.0
|
96
96
|
signing_key:
|
97
97
|
specification_version: 4
|
98
98
|
summary: Manipulate extended file attributes
|