memfs 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0
4
+
5
+ * FIX: The gem is now Ruby 1.9 compatible
6
+
3
7
  ## 0.2.0
4
8
 
5
9
  * ADD: Allowing magic creation of files with `MemFs.touch`
@@ -31,27 +31,27 @@ module MemFs
31
31
  :path,
32
32
  :split
33
33
 
34
- %i[
35
- blockdev?
36
- chardev?
37
- directory?
38
- executable?
39
- executable_real?
40
- file?
41
- grpowned?
42
- owned?
43
- pipe?
44
- readable?
45
- readable_real?
46
- setgid?
47
- setuid?
48
- socket?
49
- sticky?
50
- world_readable?
51
- world_writable?
52
- writable?
53
- writable_real?
54
- zero?
34
+ [
35
+ :blockdev?,
36
+ :chardev?,
37
+ :directory?,
38
+ :executable?,
39
+ :executable_real?,
40
+ :file?,
41
+ :grpowned?,
42
+ :owned?,
43
+ :pipe?,
44
+ :readable?,
45
+ :readable_real?,
46
+ :setgid?,
47
+ :setuid?,
48
+ :socket?,
49
+ :sticky?,
50
+ :world_readable?,
51
+ :world_writable?,
52
+ :writable?,
53
+ :writable_real?,
54
+ :zero?
55
55
  ].each do |query_method|
56
56
  define_singleton_method(query_method) do |path| # def directory?(path)
57
57
  stat_query(path, query_method) # stat_query(path, :directory?)
@@ -139,11 +139,16 @@ module MemFs
139
139
  file.close if file && block_given?
140
140
  end
141
141
 
142
- def self.read(path, length = nil, offset = 0, mode: RDONLY, encoding: nil, open_args: nil)
143
- open_args ||= [mode, encoding: encoding]
142
+ def self.read(path, *args)
143
+ options = args.last.is_a?(Hash) ? args.pop : {}
144
+ options = { mode: RDONLY, encoding: nil, open_args: nil }.merge(options)
145
+ open_args = options[:open_args] ||
146
+ [options[:mode], encoding: options[:encoding]]
147
+
148
+ length, offset = args
144
149
 
145
150
  file = open(path, *open_args)
146
- file.seek(offset)
151
+ file.seek(offset || 0)
147
152
  file.read(length)
148
153
  ensure
149
154
  file.close if file
@@ -1,3 +1,3 @@
1
1
  module MemFs
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
@@ -1,3 +1,4 @@
1
+ # encoding: utf-8
1
2
  require 'spec_helper'
2
3
 
3
4
  module MemFs
metadata CHANGED
@@ -1,125 +1,142 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memfs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Simon COURTOIS
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-03-07 00:00:00.000000000 Z
12
+ date: 2014-03-08 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: coveralls
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - "~>"
19
+ - - ~>
18
20
  - !ruby/object:Gem::Version
19
21
  version: '0.6'
20
22
  type: :development
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - "~>"
27
+ - - ~>
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0.6'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: rake
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - "~>"
35
+ - - ~>
32
36
  - !ruby/object:Gem::Version
33
37
  version: '10.0'
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - "~>"
43
+ - - ~>
39
44
  - !ruby/object:Gem::Version
40
45
  version: '10.0'
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: rspec
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
- - - "~>"
51
+ - - ~>
46
52
  - !ruby/object:Gem::Version
47
53
  version: '2.14'
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
- - - "~>"
59
+ - - ~>
53
60
  - !ruby/object:Gem::Version
54
61
  version: '2.14'
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: guard
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
- - - "~>"
67
+ - - ~>
60
68
  - !ruby/object:Gem::Version
61
69
  version: '1.5'
62
70
  type: :development
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
- - - "~>"
75
+ - - ~>
67
76
  - !ruby/object:Gem::Version
68
77
  version: '1.5'
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: guard-rspec
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
- - - "~>"
83
+ - - ~>
74
84
  - !ruby/object:Gem::Version
75
85
  version: '2.1'
76
86
  type: :development
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
- - - "~>"
91
+ - - ~>
81
92
  - !ruby/object:Gem::Version
82
93
  version: '2.1'
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: rb-inotify
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
- - - "~>"
99
+ - - ~>
88
100
  - !ruby/object:Gem::Version
89
101
  version: '0.8'
90
102
  type: :development
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
- - - "~>"
107
+ - - ~>
95
108
  - !ruby/object:Gem::Version
96
109
  version: '0.8'
97
110
  - !ruby/object:Gem::Dependency
98
111
  name: rb-fsevent
99
112
  requirement: !ruby/object:Gem::Requirement
113
+ none: false
100
114
  requirements:
101
- - - "~>"
115
+ - - ~>
102
116
  - !ruby/object:Gem::Version
103
117
  version: '0.9'
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
107
122
  requirements:
108
- - - "~>"
123
+ - - ~>
109
124
  - !ruby/object:Gem::Version
110
125
  version: '0.9'
111
126
  - !ruby/object:Gem::Dependency
112
127
  name: rb-fchange
113
128
  requirement: !ruby/object:Gem::Requirement
129
+ none: false
114
130
  requirements:
115
- - - "~>"
131
+ - - ~>
116
132
  - !ruby/object:Gem::Version
117
133
  version: '0.0'
118
134
  type: :development
119
135
  prerelease: false
120
136
  version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
121
138
  requirements:
122
- - - "~>"
139
+ - - ~>
123
140
  - !ruby/object:Gem::Version
124
141
  version: '0.0'
125
142
  description: MemFs provides a fake file system that can be used for tests. Strongly
@@ -130,9 +147,9 @@ executables: []
130
147
  extensions: []
131
148
  extra_rdoc_files: []
132
149
  files:
133
- - ".gitignore"
134
- - ".rspec"
135
- - ".travis.yml"
150
+ - .gitignore
151
+ - .rspec
152
+ - .travis.yml
136
153
  - CHANGELOG.md
137
154
  - Gemfile
138
155
  - Guardfile
@@ -167,27 +184,34 @@ files:
167
184
  homepage: http://github.com/simonc/memfs
168
185
  licenses:
169
186
  - MIT
170
- metadata: {}
171
187
  post_install_message:
172
188
  rdoc_options: []
173
189
  require_paths:
174
190
  - lib
175
191
  required_ruby_version: !ruby/object:Gem::Requirement
192
+ none: false
176
193
  requirements:
177
- - - ">="
194
+ - - ! '>='
178
195
  - !ruby/object:Gem::Version
179
196
  version: '0'
197
+ segments:
198
+ - 0
199
+ hash: 711481126562546659
180
200
  required_rubygems_version: !ruby/object:Gem::Requirement
201
+ none: false
181
202
  requirements:
182
- - - ">="
203
+ - - ! '>='
183
204
  - !ruby/object:Gem::Version
184
205
  version: '0'
206
+ segments:
207
+ - 0
208
+ hash: 711481126562546659
185
209
  requirements: []
186
210
  rubyforge_project:
187
- rubygems_version: 2.2.2
211
+ rubygems_version: 1.8.23
188
212
  signing_key:
189
- specification_version: 4
190
- summary: memfs-0.2.0
213
+ specification_version: 3
214
+ summary: memfs-0.3.0
191
215
  test_files:
192
216
  - spec/fileutils_spec.rb
193
217
  - spec/memfs/dir_spec.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: b6b4c8b1d42a534f1cbd453777b69953e9938c6e
4
- data.tar.gz: 3380c5e4a95927aa42d69f97f7a94943222659c1
5
- SHA512:
6
- metadata.gz: d5df0d4bc1a1e21810d7486f88bc210254a93240f6421691e89b4e29799b87d097ad7bde48f1fbe43ab763863b41990d6043ac7de4faf5a55a2af2fd7843f1e0
7
- data.tar.gz: e216b80ba6337aa655ee91650cf68ccb51996e7610bed863733edfaa238873afb2e63fcc93151be79f6f52a1c022c7447dfac46f7235b1cc6be6dd310f34b87c