libarchive-ruby-swig 0.4.1 → 0.5.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.
@@ -14,6 +14,8 @@
14
14
  #include <archive.h>
15
15
  #include <archive_entry.h>
16
16
  #include <ruby.h>
17
+
18
+ #include "stat.h"
17
19
  #include "reader.h"
18
20
  #include "writer.h"
19
21
  #include "entry.h"
@@ -26,7 +28,7 @@
26
28
 
27
29
  %apply (char *STRING, int LENGTH) { (const char *string, int length) };
28
30
 
31
+ %include "stat.h"
29
32
  %include "reader.h"
30
33
  %include "writer.h"
31
34
  %include "entry.h"
32
-
@@ -0,0 +1,51 @@
1
+ /*
2
+ This file is part of "libarchive-ruby-swig", a simple SWIG wrapper around
3
+ libarchive.
4
+
5
+ Copyright 2011, Tobias Koch <tobias.koch@gmail.com>
6
+
7
+ libarchive-ruby-swig is licensed under a simplified BSD License. A copy of the
8
+ license text can be found in the file LICENSE.txt distributed with the source.
9
+ */
10
+
11
+ #include <sys/types.h>
12
+ #include <sys/stat.h>
13
+ #include <unistd.h>
14
+
15
+ #include "stat.h"
16
+
17
+ int Stat::type_file()
18
+ {
19
+ return S_IFREG;
20
+ }
21
+
22
+ int Stat::type_directory()
23
+ {
24
+ return S_IFDIR;
25
+ }
26
+
27
+ int Stat::type_symbolic_link()
28
+ {
29
+ return S_IFLNK;
30
+ }
31
+
32
+ int Stat::type_block_special()
33
+ {
34
+ return S_IFBLK;
35
+ }
36
+
37
+ int Stat::type_character_special()
38
+ {
39
+ return S_IFCHR;
40
+ }
41
+
42
+ int Stat::type_fifo()
43
+ {
44
+ return S_IFIFO;
45
+ }
46
+
47
+ int Stat::type_socket()
48
+ {
49
+ return S_IFSOCK;
50
+ }
51
+
@@ -0,0 +1,27 @@
1
+ /*
2
+ This file is part of "libarchive-ruby-swig", a simple SWIG wrapper around
3
+ libarchive.
4
+
5
+ Copyright 2011, Tobias Koch <tobias.koch@gmail.com>
6
+
7
+ libarchive-ruby-swig is licensed under a simplified BSD License. A copy of the
8
+ license text can be found in the file LICENSE.txt distributed with the source.
9
+ */
10
+
11
+ #ifndef CLASS_ARCHIVE_STAT_H_INCLUDED
12
+ #define CLASS_ARCHIVE_STAT_H_INCLUDED
13
+
14
+ class Stat
15
+ {
16
+ public:
17
+
18
+ static int type_file();
19
+ static int type_directory();
20
+ static int type_symbolic_link();
21
+ static int type_block_special();
22
+ static int type_character_special();
23
+ static int type_fifo();
24
+ static int type_socket();
25
+ };
26
+
27
+ #endif
data/lib/libarchive_rs.rb CHANGED
@@ -12,6 +12,14 @@ require 'archive'
12
12
 
13
13
  module Archive
14
14
 
15
+ ENTRY_FILE = Stat.type_file
16
+ ENTRY_DIRECTORY = Stat.type_directory
17
+ ENTRY_SYMBOLIC_LINK = Stat.type_symbolic_link
18
+ ENTRY_FIFO = Stat.type_fifo
19
+ ENTRY_SOCKET = Stat.type_socket
20
+ ENTRY_BLOCK_SPECIAL = Stat.type_block_special
21
+ ENTRY_CHARACTER_SPECIAL = Stat.type_character_special
22
+
15
23
  class Error < StandardError
16
24
  end
17
25
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libarchive-ruby-swig
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 4
8
+ - 5
9
9
  - 1
10
- version: 0.4.1
10
+ version: 0.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tobias Koch
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-06 00:00:00 +02:00
18
+ date: 2011-02-07 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -29,6 +29,8 @@ extra_rdoc_files: []
29
29
 
30
30
  files:
31
31
  - lib/libarchive_rs.rb
32
+ - ext/libarchive-ruby-swig/stat.cpp
33
+ - ext/libarchive-ruby-swig/stat.h
32
34
  - ext/libarchive-ruby-swig/entry.cpp
33
35
  - ext/libarchive-ruby-swig/entry.h
34
36
  - ext/libarchive-ruby-swig/error.h