alacit 0.0.3 → 0.1.0
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.markdown +6 -6
- data/lib/alacit.rb +9 -9
- data/lib/version.rb +1 -1
- data/pkg/alacit-0.0.2.gem +0 -0
- data/pkg/alacit-0.0.3.gem +0 -0
- data/pkg/alacit-0.1.0.gem +0 -0
- data/test/converter_test.rb +17 -0
- data/test/fixtures/test.ape +0 -0
- metadata +15 -5
data/README.markdown
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
## AlacIt
|
2
2
|
|
3
|
-
Apple Lossless conversion utility. Converts FLAC and WAV audio files to Apple Lossless (ALAC) files in M4A format for importation into iTunes, iPhones, iPads, and iPods.
|
3
|
+
Apple Lossless conversion utility. Converts APE, FLAC, and WAV audio files to Apple Lossless (ALAC) files in M4A format for importation into iTunes, iPhones, iPads, and iPods.
|
4
4
|
|
5
5
|
* Very Fast. An entire album in 10 to 15 seconds.
|
6
6
|
* No quality loss
|
@@ -10,7 +10,7 @@ Apple Lossless conversion utility. Converts FLAC and WAV audio files to Apple L
|
|
10
10
|
|
11
11
|
### Install
|
12
12
|
|
13
|
-
Ensure you have Ruby 1.9.2 installed, and [FFmpeg](http://ffmpeg.org/), then type:
|
13
|
+
Ensure you have Ruby 1.9.2+ installed, and [FFmpeg](http://ffmpeg.org/), then type:
|
14
14
|
|
15
15
|
gem install alacit
|
16
16
|
|
@@ -18,7 +18,7 @@ Ensure you have Ruby 1.9.2 installed, and [FFmpeg](http://ffmpeg.org/), then typ
|
|
18
18
|
|
19
19
|
#### Single Files
|
20
20
|
|
21
|
-
Convert a single file. This outputs a file called `song.m4v` in same directory
|
21
|
+
Convert a single file. This outputs a file called `song.m4v` in same directory:
|
22
22
|
|
23
23
|
alacit song.flac
|
24
24
|
|
@@ -28,7 +28,7 @@ Convert several individual files:
|
|
28
28
|
|
29
29
|
#### Entire Directories
|
30
30
|
|
31
|
-
Convert a single directory. This finds and converts all `.flac
|
31
|
+
Convert a single directory. This finds and converts all `.ape`, `.flac`, and `.wav` files in that directory:
|
32
32
|
|
33
33
|
alacit ~/Music/Artist/Album
|
34
34
|
|
@@ -53,8 +53,8 @@ AlacIt won't overwrite existing files by default. If you need to, just force ove
|
|
53
53
|
|
54
54
|
### Dependencies
|
55
55
|
|
56
|
-
* **Ruby 1.9.2
|
57
|
-
* **FFmpeg 0.8.0+**
|
56
|
+
* **Ruby 1.9.2+**
|
57
|
+
* **FFmpeg 0.8.0+**
|
58
58
|
* **On OS X:** Get [Homebrew](http://mxcl.github.com/homebrew/) and type `brew install ffmpeg`.
|
59
59
|
* **On Linux:** `sudo apt-get install flac ffmpeg`
|
60
60
|
* **Windows:** [untested]
|
data/lib/alacit.rb
CHANGED
@@ -3,11 +3,11 @@
|
|
3
3
|
# AlacIt
|
4
4
|
# by: Russell Brooks (russbrooks.com)
|
5
5
|
#
|
6
|
-
# Converts FLAC and WAV files to ALAC (Apple Lossless Audio Codec) files in
|
7
|
-
# an M4A container for importation into iTunes. Fast.
|
8
|
-
# Basic metadata ports as well.
|
6
|
+
# Converts APE, FLAC, and WAV files to ALAC (Apple Lossless Audio Codec) files in
|
7
|
+
# an M4A container for importation into iTunes. Fast. No loss in quality.
|
8
|
+
# Basic metadata ports as well. Puts converted files in same dir as source.
|
9
9
|
#
|
10
|
-
# Dependency: FFmpeg 0.8.0+.
|
10
|
+
# Dependency: FFmpeg 0.8.0+.
|
11
11
|
# On OS X : Get Homebrew and type `brew install ffmpeg`.
|
12
12
|
# On Linux: `sudo apt-get install flac ffmpeg`
|
13
13
|
# Windows : [untested]
|
@@ -40,14 +40,14 @@ module AlacIt
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def convert_dir(source_dir)
|
43
|
-
source_glob = File.join(source_dir, '*.{flac,wav}')
|
43
|
+
source_glob = File.join(source_dir, '*.{ape,flac,wav}')
|
44
44
|
|
45
45
|
unless Dir.glob(source_glob).empty?
|
46
46
|
Dir.glob(source_glob) do |file|
|
47
47
|
m4a_file = file.chomp(File.extname(file)) + '.m4a'
|
48
48
|
|
49
49
|
if !File.exists?(m4a_file) || @options[:force]
|
50
|
-
command = 'ffmpeg -y -i "' + file + '" -
|
50
|
+
command = 'ffmpeg -y -i "' + file + '" -c:a alac "' + m4a_file + '"'
|
51
51
|
stdout_str, stderr_str, status = Open3.capture3(command)
|
52
52
|
|
53
53
|
if status.success?
|
@@ -63,13 +63,13 @@ module AlacIt
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
else
|
66
|
-
$stderr.puts 'Error: No FLAC or WAV files found.'
|
66
|
+
$stderr.puts 'Error: No APE, FLAC, or WAV files found.'
|
67
67
|
return
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
71
|
def convert_file(file)
|
72
|
-
if File.extname(file) =~ /(\.flac|\.wav)/i
|
72
|
+
if File.extname(file) =~ /(\.ape|\.flac|\.wav)/i
|
73
73
|
if File.exists? file
|
74
74
|
m4a_file = file.chomp(File.extname(file)) + '.m4a'
|
75
75
|
|
@@ -93,7 +93,7 @@ module AlacIt
|
|
93
93
|
return
|
94
94
|
end
|
95
95
|
else
|
96
|
-
$stderr.puts "Error: #{file}: Not
|
96
|
+
$stderr.puts "Error: #{file}: Not an APE, FLAC, or WAV file."
|
97
97
|
return
|
98
98
|
end
|
99
99
|
end
|
data/lib/version.rb
CHANGED
Binary file
|
Binary file
|
Binary file
|
data/test/converter_test.rb
CHANGED
@@ -35,12 +35,22 @@ class AlacItTest < MiniTest::Unit::TestCase
|
|
35
35
|
ARGV.clear
|
36
36
|
end
|
37
37
|
|
38
|
+
def test_single_ape
|
39
|
+
FileUtils.cp 'test/fixtures/test.ape', @temp_dir
|
40
|
+
ARGV.clear
|
41
|
+
ARGV << File.join(@temp_dir, 'test.ape')
|
42
|
+
out, = capture_io { @app.convert }
|
43
|
+
assert_match /test\.ape converted/, out
|
44
|
+
assert_equal File.exists?(File.join(@temp_dir, 'test.m4a')), true
|
45
|
+
end
|
46
|
+
|
38
47
|
def test_single_flac
|
39
48
|
FileUtils.cp 'test/fixtures/test.flac', @temp_dir
|
40
49
|
ARGV.clear
|
41
50
|
ARGV << File.join(@temp_dir, 'test.flac')
|
42
51
|
out, = capture_io { @app.convert }
|
43
52
|
assert_match /test\.flac converted/, out
|
53
|
+
assert_equal File.exists?(File.join(@temp_dir, 'test.m4a')), true
|
44
54
|
end
|
45
55
|
|
46
56
|
def test_single_wav
|
@@ -49,6 +59,7 @@ class AlacItTest < MiniTest::Unit::TestCase
|
|
49
59
|
ARGV << File.join(@temp_dir, 'test2.wav')
|
50
60
|
out, = capture_io { @app.convert }
|
51
61
|
assert_match /test2\.wav converted/, out
|
62
|
+
assert_equal File.exists?(File.join(@temp_dir, 'test2.m4a')), true
|
52
63
|
end
|
53
64
|
|
54
65
|
def test_mixed_directory
|
@@ -59,6 +70,8 @@ class AlacItTest < MiniTest::Unit::TestCase
|
|
59
70
|
out, = capture_io { @app.convert }
|
60
71
|
assert_match /test\.flac converted/, out
|
61
72
|
assert_match /test2\.wav converted/, out
|
73
|
+
assert_equal File.exists?(File.join(@temp_dir, 'test.m4a')), true
|
74
|
+
assert_equal File.exists?(File.join(@temp_dir, 'test2.m4a')), true
|
62
75
|
end
|
63
76
|
|
64
77
|
def test_single_flac_file_exists
|
@@ -77,6 +90,7 @@ class AlacItTest < MiniTest::Unit::TestCase
|
|
77
90
|
ARGV << '--force' << File.join(@temp_dir, 'test.flac')
|
78
91
|
out, = capture_io { @app.convert }
|
79
92
|
assert_match /test\.flac converted/, out
|
93
|
+
assert_equal File.exists?(File.join(@temp_dir, 'test.m4a')), true
|
80
94
|
end
|
81
95
|
|
82
96
|
def test_mixed_directory_file_exists
|
@@ -88,6 +102,7 @@ class AlacItTest < MiniTest::Unit::TestCase
|
|
88
102
|
out, err = capture_io { @app.convert }
|
89
103
|
assert_match /test\.m4a exists/, err
|
90
104
|
assert_match /test2\.wav converted/, out
|
105
|
+
assert_equal File.exists?(File.join(@temp_dir, 'test2.m4a')), true
|
91
106
|
end
|
92
107
|
|
93
108
|
def test_mixed_directory_file_exists_force_overwrite
|
@@ -99,6 +114,8 @@ class AlacItTest < MiniTest::Unit::TestCase
|
|
99
114
|
out, = capture_io { @app.convert }
|
100
115
|
assert_match /test\.flac converted/, out
|
101
116
|
assert_match /test2\.wav converted/, out
|
117
|
+
assert_equal File.exists?(File.join(@temp_dir, 'test.m4a')), true
|
118
|
+
assert_equal File.exists?(File.join(@temp_dir, 'test2.m4a')), true
|
102
119
|
end
|
103
120
|
|
104
121
|
def test_standard_exception_handling_invalid_option
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alacit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
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:
|
12
|
+
date: 2012-04-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,12 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
description: Quickly convert entire directories of FLAC and WAV files to Apple Lossless
|
26
31
|
(ALAC) for importation into iTunes, iPhones, iPads, and iPods.
|
27
32
|
email: me@russbrooks.com
|
@@ -40,7 +45,11 @@ files:
|
|
40
45
|
- lib/alacit.rb
|
41
46
|
- lib/application.rb
|
42
47
|
- lib/version.rb
|
48
|
+
- pkg/alacit-0.0.2.gem
|
49
|
+
- pkg/alacit-0.0.3.gem
|
50
|
+
- pkg/alacit-0.1.0.gem
|
43
51
|
- test/converter_test.rb
|
52
|
+
- test/fixtures/test.ape
|
44
53
|
- test/fixtures/test.flac
|
45
54
|
- test/fixtures/test.m4a
|
46
55
|
- test/fixtures/test2.wav
|
@@ -64,12 +73,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
73
|
version: '0'
|
65
74
|
requirements: []
|
66
75
|
rubyforge_project:
|
67
|
-
rubygems_version: 1.8.
|
76
|
+
rubygems_version: 1.8.21
|
68
77
|
signing_key:
|
69
78
|
specification_version: 3
|
70
79
|
summary: FLAC and WAV to Apple Lossless (ALAC) batch conversion utility.
|
71
80
|
test_files:
|
72
81
|
- test/converter_test.rb
|
82
|
+
- test/fixtures/test.ape
|
73
83
|
- test/fixtures/test.flac
|
74
84
|
- test/fixtures/test.m4a
|
75
85
|
- test/fixtures/test2.wav
|