cuesnap 1.2.4 → 1.2.5

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.
data/README.md CHANGED
@@ -60,6 +60,10 @@ _Tested on Mac OS X 10.7 (Lion)._
60
60
 
61
61
  ## Changelog
62
62
 
63
+ ### 1.2.5
64
+
65
+ * Added error when cue file is larger than 1MB.
66
+
63
67
  ### 1.2.4
64
68
 
65
69
  * Fixed error with CueSnap::VERSION not being defined.
data/lib/cuesnap/cli.rb CHANGED
@@ -20,6 +20,8 @@ module CueSnap
20
20
  splitter = CueSnap::Splitter.new(mp3_file, cue_file, options)
21
21
  rescue FileNotFound => e
22
22
  file_not_found e.message
23
+ rescue CueSnap::CueFileTooLarge => e
24
+ help_now! e.message
23
25
  end
24
26
 
25
27
  if File.exists? splitter.cue_file
@@ -6,6 +6,11 @@ module CueSnap
6
6
  class FileNotFound < StandardError; end
7
7
  class MP3FileNotFound < FileNotFound; end
8
8
  class CueFileNotFound < FileNotFound; end
9
+ class CueFileTooLarge < StandardError
10
+ def message
11
+ 'Only cue files less than 1MB are allowed.'
12
+ end
13
+ end
9
14
 
10
15
  class Splitter
11
16
  attr_reader :mp3_file, :cue_file, :output_folder, :options
@@ -33,6 +38,9 @@ module CueSnap
33
38
 
34
39
  raise CueSnap::CueFileNotFound, @cue_file unless File.exists? @cue_file
35
40
 
41
+ # If cue file is larger than 1MB, raise an error.
42
+ raise CueSnap::CueFileTooLarge if (File.size(@cue_file).to_f / 2**20) > 1
43
+
36
44
  @options = Hashie::Mash.new options
37
45
  @output_folder = @options.output_folder
38
46
  @output_folder ||= mp3_filename
@@ -1,3 +1,3 @@
1
1
  module CueSnap
2
- VERSION = '1.2.4'
2
+ VERSION = '1.2.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuesnap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-20 00:00:00.000000000 Z
12
+ date: 2012-12-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rubycue
@@ -107,6 +107,22 @@ dependencies:
107
107
  - - ~>
108
108
  - !ruby/object:Gem::Version
109
109
  version: 0.5.0
110
+ - !ruby/object:Gem::Dependency
111
+ name: rb-fsevent
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: 0.9.1
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ version: 0.9.1
110
126
  description: A Ruby wrapper around mp3splt that makes splitting mp3s with a cue file
111
127
  super simple.
112
128
  email: