maid 0.4.0.beta.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,5 +1,8 @@
1
- maid (0.4.0) unstable; urgency=low
1
+ maid (0.4.0) stable; urgency=low
2
2
 
3
+ * Stats! { 'collaborators' => 12, 'downloads' => 8227, 'forks' => 40,
4
+ 'open_issues' => 29, 'closed_issues' => 83, 'stars' => 713,
5
+ 'users_sharing_rules' => 28 }
3
6
  * New utility methods: "checksum_of", "escape_glob", "files"
4
7
  * New duplicate detection methods: "dupes_in", "newest_dupes_in",
5
8
  "verbose_dupes_in"
@@ -21,7 +24,7 @@ maid (0.4.0) unstable; urgency=low
21
24
  * Changed from ArgumentError to NotImplementedError when a command is
22
25
  unsupported on the host OS.
23
26
 
24
- -- Benjamin Oakes <hello@benjaminoakes.com> TODO
27
+ -- Benjamin Oakes <hello@benjaminoakes.com> Sun, 27 Oct 2013 00:00:00 +0000
25
28
 
26
29
  maid (0.3.0) stable; urgency=high
27
30
 
@@ -214,7 +214,7 @@ module Maid::Tools
214
214
 
215
215
  # Give only files matching the given glob.
216
216
  #
217
- # This is the same as #dir but only includes actual files (no directories or symlinks).
217
+ # This is the same as `dir` but only includes actual files (no directories or symlinks).
218
218
  #
219
219
  def files(globs)
220
220
  dir(globs).
@@ -576,7 +576,10 @@ module Maid::Tools
576
576
  # mime_type('bar.jpg') # => "image/jpeg"
577
577
  def mime_type(path)
578
578
  type = MIME::Types.type_for(path)[0]
579
- [type.media_type, type.sub_type].join('/')
579
+
580
+ if type
581
+ [type.media_type, type.sub_type].join('/')
582
+ end
580
583
  end
581
584
 
582
585
  # Get the Internet media type of the file.
@@ -587,7 +590,11 @@ module Maid::Tools
587
590
  #
588
591
  # media_type('bar.jpg') # => "image"
589
592
  def media_type(path)
590
- MIME::Types.type_for(path)[0].media_type
593
+ type = MIME::Types.type_for(path)[0]
594
+
595
+ if type
596
+ type.media_type
597
+ end
591
598
  end
592
599
 
593
600
  # Filter an array by content types.
@@ -1,3 +1,3 @@
1
1
  module Maid
2
- VERSION = '0.4.0.beta.2'
2
+ VERSION = '0.4.0'
3
3
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.email = %w(hello@benjaminoakes.com)
11
11
  s.license = 'GPLv2'
12
12
  s.homepage = 'http://github.com/benjaminoakes/maid'
13
- s.summary = 'Be lazy. Let Maid clean up after you, based on rules you define. Think of it as "Hazel for hackers".'
13
+ s.summary = 'Be lazy: let Maid clean up after you. Think of it as "Hazel for hackers".'
14
14
  s.description = s.summary
15
15
 
16
16
  s.rubyforge_project = 'maid'
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.add_dependency('escape', '>= 0.0.1', '< 0.1.0') # Used for better Ruby 1.8.7 support, could be replaced with `Shellwords`
22
22
  s.add_dependency('thor', '>= 0.14.0', '< 0.19.0')
23
23
  s.add_dependency('deprecated', '~> 3.0.0')
24
- s.add_dependency('mime-types', '~> 1.21') # TODO: loosen version restrictions based on testing
24
+ s.add_dependency('mime-types', '~> 1.21')
25
25
  s.add_dependency('rubyzip', '~> 1.0.0')
26
26
  s.add_dependency('xdg', '~> 2.2.3') # previous versions had bugs
27
27
  # TODO: use one of these two gems instead of `mdfind`. **But** They have to work on Linux as well.
@@ -35,6 +35,14 @@ describe 'Dependency expectations' do
35
35
  type.media_type.should == 'image'
36
36
  type.sub_type.should == 'jpeg'
37
37
  end
38
+
39
+ context 'when the type is unknown' do
40
+ it 'returns []' do
41
+ types = MIME::Types.type_for('unknown.foo')
42
+ types.length.should == 0
43
+ types[0].should be_nil
44
+ end
45
+ end
38
46
  end
39
47
 
40
48
  describe RbConfig do
File without changes
@@ -521,6 +521,7 @@ module Maid
521
521
  let(:file_fixtures_path) { File.expand_path(File.dirname(__FILE__) + '../../../fixtures/files/') }
522
522
  let(:file_fixtures_glob) { "#{ file_fixtures_path }/*" }
523
523
  let(:image_path) { File.join(file_fixtures_path, 'ruby.jpg') }
524
+ let(:unknown_path) { File.join(file_fixtures_path, 'unknown.foo') }
524
525
 
525
526
  before do
526
527
  @logger = double('Logger').as_null_object
@@ -564,6 +565,12 @@ module Maid
564
565
  @maid.mime_type(image_path).should == 'image/jpeg'
565
566
  end
566
567
  end
568
+
569
+ context 'given an unknown type' do
570
+ it 'returns nil' do
571
+ @maid.mime_type(unknown_path).should be_nil
572
+ end
573
+ end
567
574
  end
568
575
 
569
576
  describe '#media_type' do
@@ -572,6 +579,12 @@ module Maid
572
579
  @maid.media_type(image_path).should == 'image'
573
580
  end
574
581
  end
582
+
583
+ context 'given an unknown type' do
584
+ it 'returns nil' do
585
+ @maid.media_type(unknown_path).should be_nil
586
+ end
587
+ end
575
588
  end
576
589
 
577
590
  describe '#where_content_type' do
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0.beta.2
5
- prerelease: 6
4
+ version: 0.4.0
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Benjamin Oakes
@@ -13,7 +13,7 @@ date: 2013-10-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: escape
16
- requirement: &16846920 !ruby/object:Gem::Requirement
16
+ requirement: &15448540 !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: *16846920
27
+ version_requirements: *15448540
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: thor
30
- requirement: &16846100 !ruby/object:Gem::Requirement
30
+ requirement: &15447700 !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: *16846100
41
+ version_requirements: *15447700
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: deprecated
44
- requirement: &16845180 !ruby/object:Gem::Requirement
44
+ requirement: &15446860 !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: *16845180
52
+ version_requirements: *15446860
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: mime-types
55
- requirement: &16844620 !ruby/object:Gem::Requirement
55
+ requirement: &15446320 !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: *16844620
63
+ version_requirements: *15446320
64
64
  - !ruby/object:Gem::Dependency
65
65
  name: rubyzip
66
- requirement: &16843740 !ruby/object:Gem::Requirement
66
+ requirement: &15445580 !ruby/object:Gem::Requirement
67
67
  none: false
68
68
  requirements:
69
69
  - - ~>
@@ -71,10 +71,10 @@ dependencies:
71
71
  version: 1.0.0
72
72
  type: :runtime
73
73
  prerelease: false
74
- version_requirements: *16843740
74
+ version_requirements: *15445580
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: xdg
77
- requirement: &16842960 !ruby/object:Gem::Requirement
77
+ requirement: &15444780 !ruby/object:Gem::Requirement
78
78
  none: false
79
79
  requirements:
80
80
  - - ~>
@@ -82,10 +82,10 @@ dependencies:
82
82
  version: 2.2.3
83
83
  type: :runtime
84
84
  prerelease: false
85
- version_requirements: *16842960
85
+ version_requirements: *15444780
86
86
  - !ruby/object:Gem::Dependency
87
87
  name: fakefs
88
- requirement: &16841920 !ruby/object:Gem::Requirement
88
+ requirement: &15443920 !ruby/object:Gem::Requirement
89
89
  none: false
90
90
  requirements:
91
91
  - - ~>
@@ -93,10 +93,10 @@ dependencies:
93
93
  version: 0.4.2
94
94
  type: :development
95
95
  prerelease: false
96
- version_requirements: *16841920
96
+ version_requirements: *15443920
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: guard
99
- requirement: &16841040 !ruby/object:Gem::Requirement
99
+ requirement: &15442860 !ruby/object:Gem::Requirement
100
100
  none: false
101
101
  requirements:
102
102
  - - ~>
@@ -104,10 +104,10 @@ dependencies:
104
104
  version: 2.2.2
105
105
  type: :development
106
106
  prerelease: false
107
- version_requirements: *16841040
107
+ version_requirements: *15442860
108
108
  - !ruby/object:Gem::Dependency
109
109
  name: guard-rspec
110
- requirement: &16839820 !ruby/object:Gem::Requirement
110
+ requirement: &15441980 !ruby/object:Gem::Requirement
111
111
  none: false
112
112
  requirements:
113
113
  - - ~>
@@ -115,10 +115,10 @@ dependencies:
115
115
  version: 4.0.3
116
116
  type: :development
117
117
  prerelease: false
118
- version_requirements: *16839820
118
+ version_requirements: *15441980
119
119
  - !ruby/object:Gem::Dependency
120
120
  name: rake
121
- requirement: &16836680 !ruby/object:Gem::Requirement
121
+ requirement: &15440580 !ruby/object:Gem::Requirement
122
122
  none: false
123
123
  requirements:
124
124
  - - ~>
@@ -126,10 +126,10 @@ dependencies:
126
126
  version: 10.1.0
127
127
  type: :development
128
128
  prerelease: false
129
- version_requirements: *16836680
129
+ version_requirements: *15440580
130
130
  - !ruby/object:Gem::Dependency
131
131
  name: redcarpet
132
- requirement: &16835760 !ruby/object:Gem::Requirement
132
+ requirement: &15437500 !ruby/object:Gem::Requirement
133
133
  none: false
134
134
  requirements:
135
135
  - - ~>
@@ -137,10 +137,10 @@ dependencies:
137
137
  version: 3.0.0
138
138
  type: :development
139
139
  prerelease: false
140
- version_requirements: *16835760
140
+ version_requirements: *15437500
141
141
  - !ruby/object:Gem::Dependency
142
142
  name: rspec
143
- requirement: &16835060 !ruby/object:Gem::Requirement
143
+ requirement: &15436820 !ruby/object:Gem::Requirement
144
144
  none: false
145
145
  requirements:
146
146
  - - ~>
@@ -148,10 +148,10 @@ dependencies:
148
148
  version: 2.14.1
149
149
  type: :development
150
150
  prerelease: false
151
- version_requirements: *16835060
151
+ version_requirements: *15436820
152
152
  - !ruby/object:Gem::Dependency
153
153
  name: timecop
154
- requirement: &16834140 !ruby/object:Gem::Requirement
154
+ requirement: &15436100 !ruby/object:Gem::Requirement
155
155
  none: false
156
156
  requirements:
157
157
  - - ~>
@@ -159,10 +159,10 @@ dependencies:
159
159
  version: 0.6.3
160
160
  type: :development
161
161
  prerelease: false
162
- version_requirements: *16834140
162
+ version_requirements: *15436100
163
163
  - !ruby/object:Gem::Dependency
164
164
  name: yard
165
- requirement: &16833200 !ruby/object:Gem::Requirement
165
+ requirement: &15435060 !ruby/object:Gem::Requirement
166
166
  none: false
167
167
  requirements:
168
168
  - - ~>
@@ -170,10 +170,10 @@ dependencies:
170
170
  version: 0.8.4
171
171
  type: :development
172
172
  prerelease: false
173
- version_requirements: *16833200
173
+ version_requirements: *15435060
174
174
  - !ruby/object:Gem::Dependency
175
175
  name: rb-inotify
176
- requirement: &16831180 !ruby/object:Gem::Requirement
176
+ requirement: &15434100 !ruby/object:Gem::Requirement
177
177
  none: false
178
178
  requirements:
179
179
  - - ~>
@@ -181,10 +181,10 @@ dependencies:
181
181
  version: 0.9.0
182
182
  type: :development
183
183
  prerelease: false
184
- version_requirements: *16831180
184
+ version_requirements: *15434100
185
185
  - !ruby/object:Gem::Dependency
186
186
  name: rb-fsevent
187
- requirement: &16828880 !ruby/object:Gem::Requirement
187
+ requirement: &15431740 !ruby/object:Gem::Requirement
188
188
  none: false
189
189
  requirements:
190
190
  - - ~>
@@ -192,9 +192,8 @@ dependencies:
192
192
  version: 0.9.2
193
193
  type: :development
194
194
  prerelease: false
195
- version_requirements: *16828880
196
- description: Be lazy. Let Maid clean up after you, based on rules you define. Think
197
- of it as "Hazel for hackers".
195
+ version_requirements: *15431740
196
+ description: ! 'Be lazy: let Maid clean up after you. Think of it as "Hazel for hackers".'
198
197
  email:
199
198
  - hello@benjaminoakes.com
200
199
  executables:
@@ -243,6 +242,7 @@ files:
243
242
  - spec/fixtures/files/bar.zip
244
243
  - spec/fixtures/files/foo.zip
245
244
  - spec/fixtures/files/ruby.jpg
245
+ - spec/fixtures/files/unknown.foo
246
246
  - ! "spec/fixtures/files/ã\x81\x95.zip"
247
247
  - spec/lib/maid/app_spec.rb
248
248
  - spec/lib/maid/maid_spec.rb
@@ -270,15 +270,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
270
270
  required_rubygems_version: !ruby/object:Gem::Requirement
271
271
  none: false
272
272
  requirements:
273
- - - ! '>'
273
+ - - ! '>='
274
274
  - !ruby/object:Gem::Version
275
- version: 1.3.1
275
+ version: '0'
276
276
  requirements: []
277
277
  rubyforge_project: maid
278
278
  rubygems_version: 1.8.11
279
279
  signing_key:
280
280
  specification_version: 3
281
- summary: Be lazy. Let Maid clean up after you, based on rules you define. Think
282
- of it as "Hazel for hackers".
281
+ summary: ! 'Be lazy: let Maid clean up after you. Think of it as "Hazel for hackers".'
283
282
  test_files: []
284
283
  has_rdoc: