musical 1.0.2 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b93d23893d873236fd13291ab1ff038c3bcbd308
4
- data.tar.gz: 4c1c1ed28e90ad688aedb0900a040c72bb4b80aa
3
+ metadata.gz: 8c0e3eed1e21640f605dd3be2378d305bb487389
4
+ data.tar.gz: 28c05bdec7551b0181b4de684428ab0b9c6bdd96
5
5
  SHA512:
6
- metadata.gz: 663e5f7acb2c8094444fc373e9da20a3504cc1e1309c100cef4ffb96fd6ed8f5c9ae8ad1ef5c942fb7362822721624b6e3338036ddcd22110b315794f25e549b
7
- data.tar.gz: 46f1d27eddcb7f958b506e5d11181184bec321879d129d545efa7b529e07ca655be04344f1fbda65a93fab66849099f9a25b53f0b10d68f9fcc9ee4495819640
6
+ metadata.gz: f9c74c2cc5c4f260ee84f4ae57b0cddf6d925f90fa6eba470787bcd28d09afa41646bd147b32d6aec6b6381b064dee765451d59065076202517be20852bb94a2
7
+ data.tar.gz: 36d9d57a9501d8f491175c3aaaecc85d71e70baddd059a1179e6aa0d2375b9a8e48518616b66300a4784b922fff1064b66790a5fb98ea67b1f04b70284fffee0
data/README.md CHANGED
@@ -48,6 +48,7 @@ They will help you to manage your music library easily.
48
48
 
49
49
 
50
50
  ## Supported OS
51
+ - OSX 10.9 (Mavericks)
51
52
  - OSX 10.8 (Mountain Lion)
52
53
 
53
54
  ## Supported Ruby
@@ -8,17 +8,26 @@ Musical.setup
8
8
  dvd_options = {
9
9
  title: Musical.configuration.title,
10
10
  artist: Musical.configuration.artist,
11
+ year: Musical.configuration.year,
11
12
  path: Musical.configuration.path
12
13
  }
14
+ progress_format = Musical.configuration.progress_format
13
15
 
14
16
  DVD.load(dvd_options) do |dvd|
15
17
  next puts dvd.info if Musical.configuration.info
16
18
 
17
- chapters = dvd.rip
19
+ chapter_size = dvd.title_sets.inject(0){ |size, set| size + set[:chapter] }
20
+ ripping_progress_bar = Notification::ProgressBar.create(title: 'Ripping', total: chapter_size)
18
21
 
19
- chapters.each do |chapter|
20
- next if Musical.configuration.ignore_convert_sound
22
+ chapters = dvd.rip { ripping_progress_bar.increment }
23
+
24
+ next if Musical.configuration.ignore_convert_sound
25
+
26
+ unless Musical.configuration.ignore_use_itunes
27
+ converting_progress_bar = Notification::ProgressBar.create(title: 'Converting', total: chapters.size)
28
+ end
21
29
 
30
+ chapters.each do |chapter|
22
31
  wav = chapter.to_wav
23
32
  next if Musical.configuration.ignore_use_itunes
24
33
 
@@ -29,12 +38,15 @@ DVD.load(dvd_options) do |dvd|
29
38
  name: chapter.name,
30
39
  album: dvd.title,
31
40
  artist: dvd.artist,
41
+ year: dvd.year,
32
42
  track_count: chapters.size,
33
43
  track_number: chapter.chapter_number,
34
44
  )
35
45
 
36
46
  wav.delete!
37
47
  track.delete!
48
+
49
+ converting_progress_bar.increment
38
50
  end
39
51
  end
40
52
 
@@ -37,6 +37,7 @@ module Musical
37
37
  opt :path, "Set device path of DVD", type: :string
38
38
  opt :title, "Set DVD title", type: :string, default: 'LIVE'
39
39
  opt :artist, "Set DVD artist", type: :string, default: 'Artist'
40
+ opt :year, "Set year DVD was recorded", type: :int, default: Time.now.year
40
41
  opt :output, "Set location of ripped data", type: :string, default: 'ripped'
41
42
  end
42
43
 
@@ -7,7 +7,7 @@ module Musical
7
7
  include Musical::Util
8
8
  extend Musical::Util
9
9
 
10
- attr_accessor :title, :artist
10
+ attr_accessor :title, :artist, :year
11
11
 
12
12
  @@path = nil
13
13
 
@@ -40,8 +40,9 @@ module Musical
40
40
  end
41
41
 
42
42
  dvd = DVD.instance
43
- dvd.title = options[:title] || Musical.configuration.title
43
+ dvd.title = options[:title] || Musical.configuration.title
44
44
  dvd.artist = options[:artist] || Musical.configuration.artist
45
+ dvd.year = options[:year] || Musical.configuration.year
45
46
 
46
47
  if block_given?
47
48
  yield(dvd)
@@ -84,8 +85,6 @@ module Musical
84
85
  save_dir = Musical.configuration.output
85
86
  FileUtils.mkdir_p save_dir
86
87
 
87
- chapter_size = title_sets.inject(0){ |size, set| size + set[:chapter] }
88
- progress_bar = Notification::ProgressBar.create(title: 'Ripping', total: chapter_size, format: '%a %B %p%% %t')
89
88
  chapters = []
90
89
 
91
90
  title_sets.each do |title_set|
@@ -99,10 +98,11 @@ module Musical
99
98
  commands << "--output='#{Musical.configuration.working_dir}'"
100
99
  execute_command(commands.join(' '), true)
101
100
 
102
- progress_bar.increment
103
-
104
101
  vob_save_path = "#{save_dir}/TITLE_#{title_set[:title]}_#{chapter_index}.VOB"
105
102
  FileUtils.mv(vob_path, vob_save_path)
103
+
104
+ yield if block_given?
105
+
106
106
  Chapter.new(vob_save_path, title_number: title_set[:title], chapter_number: chapter_index)
107
107
  end
108
108
  end
@@ -2,8 +2,11 @@
2
2
  module Musical
3
3
  module Notification
4
4
  class ProgressBar < ::ProgressBar
5
+ FORMAT = '%a %B %p%% %t'
6
+
5
7
  def self.create(options = {})
6
- progress_bar = super
8
+ options = { format: FORMAT }.merge(options)
9
+ progress_bar = super(options)
7
10
 
8
11
  Thread.new do
9
12
  while !progress_bar.finished?
@@ -1,4 +1,4 @@
1
1
  # coding: utf-8
2
2
  module Musical
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.4"
4
4
  end
@@ -30,5 +30,5 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency "coveralls", "~> 0.6.6"
31
31
  spec.add_runtime_dependency "ruby-progressbar", ">= 1.2.0"
32
32
  spec.add_runtime_dependency "trollop", ">= 2.0"
33
- spec.add_runtime_dependency "itunes-client", "~> 0.1.2"
33
+ spec.add_runtime_dependency "itunes-client", "~> 0.1.4"
34
34
  end
@@ -209,10 +209,6 @@ EOM
209
209
  dvd.should_receive(:title_sets).at_least(1).and_return(title_sets)
210
210
  dvd.should_receive(:execute_command).at_least(1).with(/dvdbackup (.)*/, true) { FileUtils.touch(vob_path) }
211
211
  dvd.should_receive(:execute_command).at_least(1).with(/find (.)*/).and_return("#{vob_path}\n")
212
-
213
- progress_bar = double
214
- progress_bar.should_receive(:increment).at_least(1)
215
- ProgressBar.should_receive(:create).and_return(progress_bar)
216
212
  end
217
213
 
218
214
  before do
@@ -37,6 +37,11 @@ describe Musical do
37
37
  it { expect(setup.artist).to eq("artist!") }
38
38
  end
39
39
 
40
+ context 'when argument `year` is given' do
41
+ before { stub_const('ARGV', ['--year=2000']) }
42
+ it { expect(setup.year).to eq(2000) }
43
+ end
44
+
40
45
  context 'when argument `output` is given' do
41
46
  before { stub_const('ARGV', ['--output=/tmp']) }
42
47
  it { expect(setup.output).to eq('/tmp') }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: musical
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - ryo katsuma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-15 00:00:00.000000000 Z
11
+ date: 2013-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -184,14 +184,14 @@ dependencies:
184
184
  requirements:
185
185
  - - ~>
186
186
  - !ruby/object:Gem::Version
187
- version: 0.1.2
187
+ version: 0.1.4
188
188
  type: :runtime
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - ~>
193
193
  - !ruby/object:Gem::Version
194
- version: 0.1.2
194
+ version: 0.1.4
195
195
  description: musical is a simple tool for your favorite DVD. You can rip vob file
196
196
  by DVD chapter, convert it to wav file and add it to your iTunes library.
197
197
  email: