ffi-xattr 0.0.5 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5181ad35070fb0035bf81d417c9ccae80f533384
4
- data.tar.gz: d2ac366fbc7441c2a20f97e2d00de292db189273
3
+ metadata.gz: 03fc82a1353a14b6b48327682f8efb5327f8d4a6
4
+ data.tar.gz: dd6a2abd62dd605cb0aae1cb65551e69f4c2d00f
5
5
  SHA512:
6
- metadata.gz: d79f9cf983ca89e0f53aabaac1b4c32b3f72b47815f58ddd80a6a7cf35e7278876fb85d7253eae3d3d4929958fcfac9af55f774a09f0b59f559e0cca258dab77
7
- data.tar.gz: a443c8fd63b32eb20924c9e3d5841d2e89aae52530cef42e16cb50fddce9bba7b3b9fa64525ad79e3030d58875fba2bc24fa6113cf537884f721eeaceffa44f4
6
+ metadata.gz: f9cc1cbaab866ac3a6d89d7066b8621ba66eb36ac45032df2a59b0c92a7d57fc297d3db3ed02bed7d41c05aa00520690f84d182979feca7ec881f5eb0ad7200c
7
+ data.tar.gz: 73dc271860f7c541aac07195bdfe4cc3746bee9fa0755917967fe899f90ff91934b2f915230446f19bcbd947bda236a37cf372fb6aeb89d0d84840d02e68b244
@@ -1,6 +1,7 @@
1
1
  rvm:
2
2
  - 1.8.7
3
- - 1.9.2
4
3
  - 1.9.3
4
+ - 2.0.0
5
+ - 2.1.0
5
6
  before_script:
6
7
  - 'sudo mount / -o remount,user_xattr || (echo "see https://github.com/travis-ci/travis-ci/issues/1281" && exit 1)'
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-2012 Jari Bakken
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
- xattr = Xattr.new("/path/to/file")
13
- xattr['user.foo'] = 'bar'
12
+ ```ruby
13
+ xattr = Xattr.new("/path/to/file")
14
+ xattr['user.foo'] = 'bar'
14
15
 
15
- xattr['user.foo'] #=> 'bar'
16
- xattr.list #=> ["user.foo"]
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-2012 Jari Bakken
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.
@@ -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(FFI.errno, ptr, 256)
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
@@ -1,3 +1,3 @@
1
1
  class Xattr
2
- VERSION = "0.0.5"
2
+ VERSION = "0.1.0"
3
3
  end
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 error when tries to remove inexistent attribute" do
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.5
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: 2013-12-05 00:00:00.000000000 Z
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.1.10
95
+ rubygems_version: 2.2.0
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: Manipulate extended file attributes