maid 0.4.0.alpha.1 → 0.4.0.alpha.2

Sign up to get free protection for your applications and to get access to all the features.
data/AUTHORS.md CHANGED
@@ -11,3 +11,4 @@ In alphabetical order:
11
11
  * Mark Jaquith (@markjaquith)
12
12
  * Mikael Hultgren (@blomma)
13
13
  * Mu Ye (@yemutex)
14
+ * Vladimir Agafonkin (@mourner)
data/ChangeLog CHANGED
@@ -11,6 +11,8 @@ maid (0.4.0) unstable; urgency=low
11
11
  * Changed from ArgumentError to NotImplementedError when a command is
12
12
  unsupported on the host OS.
13
13
  * Bradley Smith: Add locate support on Ubuntu (Closes: #67)
14
+ * Vladimir Agafonkin: Add escape_glob method for escaping brackets in paths
15
+ that will be passed to dir (Closes: #104)
14
16
 
15
17
  -- Benjamin Oakes <hello@benjaminoakes.com> TODO
16
18
 
@@ -220,6 +220,17 @@ module Maid::Tools
220
220
  dir(globs).
221
221
  select { |f| File.file?(f) }
222
222
  end
223
+
224
+ # Escape characters that have special meaning as a part of path global patterns.
225
+ #
226
+ # Useful when using `dir` with file names that may contain `{ } [ ]` characters.
227
+ #
228
+ # ## Example
229
+ #
230
+ # escape_glob('test [tmp]') # => 'test \\[tmp\\]'
231
+ def escape_glob(glob)
232
+ glob.gsub(/[\{\}\[\]]/) { |s| '\\' + s }
233
+ end
223
234
 
224
235
  # Create a directory and all of its parent directories.
225
236
  #
@@ -1,3 +1,3 @@
1
1
  module Maid
2
- VERSION = '0.4.0.alpha.1'
2
+ VERSION = '0.4.0.alpha.2'
3
3
  end
@@ -15,12 +15,14 @@ Gem::Specification.new do |s|
15
15
 
16
16
  s.rubyforge_project = 'maid'
17
17
 
18
+ s.required_ruby_version = Gem::Requirement.new('>= 1.8.7')
19
+
18
20
  # Strategy: if possible, use ranges (so there are fewer chances of version conflicts)
19
21
  s.add_dependency('escape', '>= 0.0.1', '< 0.1.0') # Used for better Ruby 1.8.7 support
20
22
  s.add_dependency('thor', '>= 0.14.0', '< 0.19.0')
21
23
  s.add_dependency('deprecated', '~> 3.0.0')
22
24
  s.add_dependency('mime-types', '~> 1.21') # TODO: loosen version restrictions based on testing
23
- s.add_dependency('ohai', '>= 6.14.0', '< 6.18.0')
25
+ s.add_dependency('ohai', '>= 6.14.0', '< 6.17.0')
24
26
  s.add_dependency('rubyzip', '>= 0.5.7', '< 0.10.0')
25
27
  s.add_dependency('xdg', '~> 2.2.3') # previous versions had bugs
26
28
  # TODO: use one of these two gems instead of `mdfind`. **But** They have to work on Linux as well.
@@ -35,7 +37,7 @@ Gem::Specification.new do |s|
35
37
  s.add_development_dependency('rake', '~> 10.0.3')
36
38
  s.add_development_dependency('redcarpet', '~> 2.2.2') # Soft dependency of `yard`
37
39
  s.add_development_dependency('rspec', '~> 2.13.0')
38
- s.add_development_dependency('timecop', '~> 0.6.1')
40
+ s.add_development_dependency('timecop', '= 0.6.1') # v0.6.2.2 requires Ruby 1.9.2, but we need to support 1.8.7
39
41
  s.add_development_dependency('yard', '~> 0.8.4')
40
42
 
41
43
  # In Vagrant, polling won't cross over the OS boundary if you develop in the host OS but run your tests in the
@@ -301,6 +301,12 @@ module Maid
301
301
  end
302
302
  end
303
303
 
304
+ describe '#escape_glob' do
305
+ it 'escapes characters that have special meanings in globs' do
306
+ @maid.escape_glob('test [tmp]').should == 'test \\[tmp\\]'
307
+ end
308
+ end
309
+
304
310
  describe '#mkdir' do
305
311
  it 'should create a directory successfully' do
306
312
  @maid.mkdir('~/Downloads/Music/Pink.Floyd')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0.alpha.1
4
+ version: 0.4.0.alpha.2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-21 00:00:00.000000000 Z
12
+ date: 2013-08-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: escape
16
- requirement: &10781460 !ruby/object:Gem::Requirement
16
+ requirement: &23521940 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -24,10 +24,10 @@ dependencies:
24
24
  version: 0.1.0
25
25
  type: :runtime
26
26
  prerelease: false
27
- version_requirements: *10781460
27
+ version_requirements: *23521940
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: thor
30
- requirement: &10780320 !ruby/object:Gem::Requirement
30
+ requirement: &23520660 !ruby/object:Gem::Requirement
31
31
  none: false
32
32
  requirements:
33
33
  - - ! '>='
@@ -38,10 +38,10 @@ dependencies:
38
38
  version: 0.19.0
39
39
  type: :runtime
40
40
  prerelease: false
41
- version_requirements: *10780320
41
+ version_requirements: *23520660
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: deprecated
44
- requirement: &10779220 !ruby/object:Gem::Requirement
44
+ requirement: &23513460 !ruby/object:Gem::Requirement
45
45
  none: false
46
46
  requirements:
47
47
  - - ~>
@@ -49,10 +49,10 @@ dependencies:
49
49
  version: 3.0.0
50
50
  type: :runtime
51
51
  prerelease: false
52
- version_requirements: *10779220
52
+ version_requirements: *23513460
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: mime-types
55
- requirement: &10794980 !ruby/object:Gem::Requirement
55
+ requirement: &23512980 !ruby/object:Gem::Requirement
56
56
  none: false
57
57
  requirements:
58
58
  - - ~>
@@ -60,10 +60,10 @@ dependencies:
60
60
  version: '1.21'
61
61
  type: :runtime
62
62
  prerelease: false
63
- version_requirements: *10794980
63
+ version_requirements: *23512980
64
64
  - !ruby/object:Gem::Dependency
65
65
  name: ohai
66
- requirement: &10794500 !ruby/object:Gem::Requirement
66
+ requirement: &23512460 !ruby/object:Gem::Requirement
67
67
  none: false
68
68
  requirements:
69
69
  - - ! '>='
@@ -71,13 +71,13 @@ dependencies:
71
71
  version: 6.14.0
72
72
  - - <
73
73
  - !ruby/object:Gem::Version
74
- version: 6.18.0
74
+ version: 6.17.0
75
75
  type: :runtime
76
76
  prerelease: false
77
- version_requirements: *10794500
77
+ version_requirements: *23512460
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: rubyzip
80
- requirement: &10793740 !ruby/object:Gem::Requirement
80
+ requirement: &23511580 !ruby/object:Gem::Requirement
81
81
  none: false
82
82
  requirements:
83
83
  - - ! '>='
@@ -88,10 +88,10 @@ dependencies:
88
88
  version: 0.10.0
89
89
  type: :runtime
90
90
  prerelease: false
91
- version_requirements: *10793740
91
+ version_requirements: *23511580
92
92
  - !ruby/object:Gem::Dependency
93
93
  name: xdg
94
- requirement: &10792860 !ruby/object:Gem::Requirement
94
+ requirement: &23510560 !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
97
97
  - - ~>
@@ -99,10 +99,10 @@ dependencies:
99
99
  version: 2.2.3
100
100
  type: :runtime
101
101
  prerelease: false
102
- version_requirements: *10792860
102
+ version_requirements: *23510560
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: fakefs
105
- requirement: &10792180 !ruby/object:Gem::Requirement
105
+ requirement: &23509720 !ruby/object:Gem::Requirement
106
106
  none: false
107
107
  requirements:
108
108
  - - ~>
@@ -110,10 +110,10 @@ dependencies:
110
110
  version: 0.4.2
111
111
  type: :development
112
112
  prerelease: false
113
- version_requirements: *10792180
113
+ version_requirements: *23509720
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: guard
116
- requirement: &10791120 !ruby/object:Gem::Requirement
116
+ requirement: &23509220 !ruby/object:Gem::Requirement
117
117
  none: false
118
118
  requirements:
119
119
  - - ~>
@@ -121,10 +121,10 @@ dependencies:
121
121
  version: 1.6.2
122
122
  type: :development
123
123
  prerelease: false
124
- version_requirements: *10791120
124
+ version_requirements: *23509220
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: guard-rspec
127
- requirement: &10790520 !ruby/object:Gem::Requirement
127
+ requirement: &23508620 !ruby/object:Gem::Requirement
128
128
  none: false
129
129
  requirements:
130
130
  - - ~>
@@ -132,10 +132,10 @@ dependencies:
132
132
  version: 2.5.0
133
133
  type: :development
134
134
  prerelease: false
135
- version_requirements: *10790520
135
+ version_requirements: *23508620
136
136
  - !ruby/object:Gem::Dependency
137
137
  name: rake
138
- requirement: &10789880 !ruby/object:Gem::Requirement
138
+ requirement: &23508020 !ruby/object:Gem::Requirement
139
139
  none: false
140
140
  requirements:
141
141
  - - ~>
@@ -143,10 +143,10 @@ dependencies:
143
143
  version: 10.0.3
144
144
  type: :development
145
145
  prerelease: false
146
- version_requirements: *10789880
146
+ version_requirements: *23508020
147
147
  - !ruby/object:Gem::Dependency
148
148
  name: redcarpet
149
- requirement: &10788600 !ruby/object:Gem::Requirement
149
+ requirement: &23507260 !ruby/object:Gem::Requirement
150
150
  none: false
151
151
  requirements:
152
152
  - - ~>
@@ -154,10 +154,10 @@ dependencies:
154
154
  version: 2.2.2
155
155
  type: :development
156
156
  prerelease: false
157
- version_requirements: *10788600
157
+ version_requirements: *23507260
158
158
  - !ruby/object:Gem::Dependency
159
159
  name: rspec
160
- requirement: &10787920 !ruby/object:Gem::Requirement
160
+ requirement: &23506580 !ruby/object:Gem::Requirement
161
161
  none: false
162
162
  requirements:
163
163
  - - ~>
@@ -165,21 +165,21 @@ dependencies:
165
165
  version: 2.13.0
166
166
  type: :development
167
167
  prerelease: false
168
- version_requirements: *10787920
168
+ version_requirements: *23506580
169
169
  - !ruby/object:Gem::Dependency
170
170
  name: timecop
171
- requirement: &10787160 !ruby/object:Gem::Requirement
171
+ requirement: &23506120 !ruby/object:Gem::Requirement
172
172
  none: false
173
173
  requirements:
174
- - - ~>
174
+ - - =
175
175
  - !ruby/object:Gem::Version
176
176
  version: 0.6.1
177
177
  type: :development
178
178
  prerelease: false
179
- version_requirements: *10787160
179
+ version_requirements: *23506120
180
180
  - !ruby/object:Gem::Dependency
181
181
  name: yard
182
- requirement: &10803020 !ruby/object:Gem::Requirement
182
+ requirement: &23505000 !ruby/object:Gem::Requirement
183
183
  none: false
184
184
  requirements:
185
185
  - - ~>
@@ -187,10 +187,10 @@ dependencies:
187
187
  version: 0.8.4
188
188
  type: :development
189
189
  prerelease: false
190
- version_requirements: *10803020
190
+ version_requirements: *23505000
191
191
  - !ruby/object:Gem::Dependency
192
192
  name: rb-inotify
193
- requirement: &10802560 !ruby/object:Gem::Requirement
193
+ requirement: &23504520 !ruby/object:Gem::Requirement
194
194
  none: false
195
195
  requirements:
196
196
  - - ~>
@@ -198,10 +198,10 @@ dependencies:
198
198
  version: 0.9.0
199
199
  type: :development
200
200
  prerelease: false
201
- version_requirements: *10802560
201
+ version_requirements: *23504520
202
202
  - !ruby/object:Gem::Dependency
203
203
  name: rb-fsevent
204
- requirement: &10802060 !ruby/object:Gem::Requirement
204
+ requirement: &23504020 !ruby/object:Gem::Requirement
205
205
  none: false
206
206
  requirements:
207
207
  - - ~>
@@ -209,7 +209,7 @@ dependencies:
209
209
  version: 0.9.2
210
210
  type: :development
211
211
  prerelease: false
212
- version_requirements: *10802060
212
+ version_requirements: *23504020
213
213
  description: Be lazy. Let Maid clean up after you, based on rules you define. Think
214
214
  of it as "Hazel for hackers".
215
215
  email:
@@ -282,7 +282,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
282
282
  requirements:
283
283
  - - ! '>='
284
284
  - !ruby/object:Gem::Version
285
- version: '0'
285
+ version: 1.8.7
286
286
  required_rubygems_version: !ruby/object:Gem::Requirement
287
287
  none: false
288
288
  requirements: