taifu 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +1 -0
- data/Guardfile +1 -17
- data/lib/taifu/version.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/taifu_spec.rb +15 -15
- data/spec/util_spec.rb +2 -2
- data/taifu.gemspec +10 -11
- metadata +51 -51
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc6958e0508f0309d967a8a630695816a070cf56
|
4
|
+
data.tar.gz: 570df28277c2dfdf163d79f94d00ebc510c8ddfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 287df3fef237995451dc947e7e5472c90f5c07c2b60fc03ee820368eaf1e887a24c9b2650491ef7b8206911c4383a3b091fd8acdbdbbc54393021310a41957a4
|
7
|
+
data.tar.gz: 7e1122f7d1a0d7d69ba936ece2369eedeca94a0d58cc2a583849c910e8335614d4617218147eaa2f0314bde0c740218c010e4fbfae9852643e74aba2c2bd9307
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.2.0
|
data/.travis.yml
CHANGED
data/Guardfile
CHANGED
@@ -1,24 +1,8 @@
|
|
1
1
|
# A sample Guardfile
|
2
2
|
# More info at https://github.com/guard/guard#readme
|
3
3
|
|
4
|
-
guard 'rspec' do
|
4
|
+
guard 'rspec', cmd: 'bundle exec rspec' do
|
5
5
|
watch(%r{^spec/.+_spec\.rb$})
|
6
6
|
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
7
7
|
watch('spec/spec_helper.rb') { "spec" }
|
8
|
-
|
9
|
-
# Rails example
|
10
|
-
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
11
|
-
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
12
|
-
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
|
13
|
-
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
|
14
|
-
watch('config/routes.rb') { "spec/routing" }
|
15
|
-
watch('app/controllers/application_controller.rb') { "spec/controllers" }
|
16
|
-
|
17
|
-
# Capybara features specs
|
18
|
-
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
|
19
|
-
|
20
|
-
# Turnip features and steps
|
21
|
-
watch(%r{^spec/acceptance/(.+)\.feature$})
|
22
|
-
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
|
23
8
|
end
|
24
|
-
|
data/lib/taifu/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
data/spec/taifu_spec.rb
CHANGED
@@ -10,7 +10,7 @@ describe Taifu do
|
|
10
10
|
describe '#hit' do
|
11
11
|
context 'with no arguments' do
|
12
12
|
before do
|
13
|
-
ARGV.
|
13
|
+
allow(ARGV).to receive(:first).and_return(nil)
|
14
14
|
end
|
15
15
|
|
16
16
|
it 'raises an ArgumentError' do
|
@@ -20,15 +20,15 @@ describe Taifu do
|
|
20
20
|
|
21
21
|
context 'with an argument' do
|
22
22
|
before do
|
23
|
-
ARGV.
|
23
|
+
allow(ARGV).to receive(:first).and_return(url)
|
24
24
|
end
|
25
25
|
|
26
26
|
it 'recieves Taifu::App.new' do
|
27
27
|
taifu = double('taifu')
|
28
|
-
taifu.
|
29
|
-
taifu.
|
28
|
+
expect(taifu).to receive(:save_as_wav_with)
|
29
|
+
expect(taifu).to receive(:add_track)
|
30
30
|
|
31
|
-
Taifu::App.
|
31
|
+
expect(Taifu::App).to receive(:new).and_return(taifu)
|
32
32
|
Taifu.hit
|
33
33
|
end
|
34
34
|
end
|
@@ -43,7 +43,7 @@ describe Taifu do
|
|
43
43
|
|
44
44
|
context "if required app is not installed" do
|
45
45
|
before do
|
46
|
-
|
46
|
+
expect_any_instance_of(Taifu::App).to receive(:installed?).with(app).and_return(false)
|
47
47
|
end
|
48
48
|
|
49
49
|
it 'raises an RuntimeError' do
|
@@ -54,12 +54,12 @@ describe Taifu do
|
|
54
54
|
context 'if required apps are installed' do
|
55
55
|
|
56
56
|
before do
|
57
|
-
|
57
|
+
expect_any_instance_of(Taifu::App).to receive(:installed?).at_least(:twice).and_return(true)
|
58
58
|
FileUtils.rm_rf(working_dir)
|
59
59
|
end
|
60
60
|
|
61
61
|
it 'makes a working directory', fakefs: true do
|
62
|
-
|
62
|
+
expect_any_instance_of(Taifu::App).to receive(:working_dir).at_least(:twice).and_return(working_dir)
|
63
63
|
expect { subject }.to change { File.exist?(working_dir) }.from(false).to(true)
|
64
64
|
end
|
65
65
|
end
|
@@ -77,8 +77,8 @@ describe Taifu do
|
|
77
77
|
before { stub_app_installed }
|
78
78
|
|
79
79
|
it 'saves file as wav' do
|
80
|
-
util.
|
81
|
-
util.
|
80
|
+
expect(util).to receive(:save_flv_from_url)
|
81
|
+
expect(util).to receive(:convert_flv_to_wav)
|
82
82
|
|
83
83
|
subject
|
84
84
|
end
|
@@ -114,10 +114,10 @@ describe Taifu do
|
|
114
114
|
let(:converted_track) { Itunes::Track.new }
|
115
115
|
|
116
116
|
it 'calls Itunes util methods', fakefs: true do
|
117
|
-
Itunes::Player.
|
118
|
-
track.
|
119
|
-
converted_track.
|
120
|
-
track.
|
117
|
+
allow(Itunes::Player).to receive(:add).with(wav_path).and_return(track)
|
118
|
+
expect(track).to receive(:convert).and_return(converted_track)
|
119
|
+
expect(converted_track).to receive(:update_attributes)
|
120
|
+
expect(track).to receive(:delete!)
|
121
121
|
|
122
122
|
add_track
|
123
123
|
end
|
@@ -125,7 +125,7 @@ describe Taifu do
|
|
125
125
|
end
|
126
126
|
|
127
127
|
def stub_app_installed
|
128
|
-
|
128
|
+
expect_any_instance_of(Taifu::App).to receive(:system).with(/^which/).exactly(2).times.and_return(true)
|
129
129
|
end
|
130
130
|
end
|
131
131
|
end
|
data/spec/util_spec.rb
CHANGED
@@ -10,7 +10,7 @@ describe Taifu::Util do
|
|
10
10
|
let(:url) { 'http://www.youtube.com/watch?v=foo' }
|
11
11
|
let(:flv_path) { '/tmp/foo.flv' }
|
12
12
|
it 'executes youtube_dl command' do
|
13
|
-
util.
|
13
|
+
expect(util).to receive(:system).with("youtube-dl -q #{url} -o #{flv_path}")
|
14
14
|
save_flv_from_url
|
15
15
|
end
|
16
16
|
end
|
@@ -21,7 +21,7 @@ describe Taifu::Util do
|
|
21
21
|
let(:wav_path) { '/tmp/foo.wav' }
|
22
22
|
|
23
23
|
it 'executes ffmpeg command' do
|
24
|
-
util.
|
24
|
+
expect(util).to receive(:system).with("ffmpeg -i #{flv_path} #{wav_path} 2>/dev/null")
|
25
25
|
convert_flv_to_wav
|
26
26
|
end
|
27
27
|
end
|
data/taifu.gemspec
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# coding: utf-8
|
2
1
|
$:.push File.expand_path("../lib", __FILE__)
|
3
2
|
require "taifu/version"
|
4
3
|
|
@@ -19,15 +18,15 @@ Gem::Specification.new do |s|
|
|
19
18
|
s.require_paths = ["lib"]
|
20
19
|
s.licenses = ["MIT"]
|
21
20
|
|
22
|
-
s.add_development_dependency "rake", "~> 10.
|
23
|
-
s.add_development_dependency "rspec", "~>
|
24
|
-
s.add_development_dependency "rb-fsevent", "~> 0.9.
|
25
|
-
s.add_development_dependency "guard", "~>
|
26
|
-
s.add_development_dependency "guard-rspec", "~> 3.
|
21
|
+
s.add_development_dependency "rake", "~> 10.3.2"
|
22
|
+
s.add_development_dependency "rspec", "~> 3.0.0"
|
23
|
+
s.add_development_dependency "rb-fsevent", "~> 0.9.4"
|
24
|
+
s.add_development_dependency "guard", "~> 2.6.1"
|
25
|
+
s.add_development_dependency "guard-rspec", "~> 4.3.1"
|
27
26
|
s.add_development_dependency "growl", "~> 1.0.3"
|
28
|
-
s.add_development_dependency "fakefs", "~> 0.
|
29
|
-
s.add_development_dependency "coveralls", "~> 0.
|
30
|
-
s.add_development_dependency "simplecov", "~> 0.
|
31
|
-
s.add_development_dependency "pry", "~> 0.
|
32
|
-
s.add_dependency "itunes-client", "~> 0.
|
27
|
+
s.add_development_dependency "fakefs", "~> 0.5.3"
|
28
|
+
s.add_development_dependency "coveralls", "~> 0.7.1"
|
29
|
+
s.add_development_dependency "simplecov", "~> 0.9.0"
|
30
|
+
s.add_development_dependency "pry", "~> 0.10.1"
|
31
|
+
s.add_dependency "itunes-client", "~> 0.2.0"
|
33
32
|
end
|
metadata
CHANGED
@@ -1,169 +1,169 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: taifu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Katsuma
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-12-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 10.
|
19
|
+
version: 10.3.2
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 10.
|
26
|
+
version: 10.3.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 3.0.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 3.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rb-fsevent
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.9.
|
47
|
+
version: 0.9.4
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.9.
|
54
|
+
version: 0.9.4
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: guard
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 2.6.1
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 2.6.1
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: guard-rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 3.
|
75
|
+
version: 4.3.1
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - ~>
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 3.
|
82
|
+
version: 4.3.1
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: growl
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - ~>
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: 1.0.3
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - ~>
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 1.0.3
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: fakefs
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - ~>
|
101
|
+
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.
|
103
|
+
version: 0.5.3
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - ~>
|
108
|
+
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.
|
110
|
+
version: 0.5.3
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: coveralls
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - ~>
|
115
|
+
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.
|
117
|
+
version: 0.7.1
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- - ~>
|
122
|
+
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 0.
|
124
|
+
version: 0.7.1
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: simplecov
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- - ~>
|
129
|
+
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 0.
|
131
|
+
version: 0.9.0
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- - ~>
|
136
|
+
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 0.
|
138
|
+
version: 0.9.0
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: pry
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- - ~>
|
143
|
+
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.
|
145
|
+
version: 0.10.1
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- - ~>
|
150
|
+
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.
|
152
|
+
version: 0.10.1
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: itunes-client
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - ~>
|
157
|
+
- - "~>"
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 0.
|
159
|
+
version: 0.2.0
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- - ~>
|
164
|
+
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 0.
|
166
|
+
version: 0.2.0
|
167
167
|
description: taifu brings YouTube sound to your iTunes library silently
|
168
168
|
email:
|
169
169
|
- katsuma@gmail.com
|
@@ -172,10 +172,10 @@ executables:
|
|
172
172
|
extensions: []
|
173
173
|
extra_rdoc_files: []
|
174
174
|
files:
|
175
|
-
- .coveralls.yml
|
176
|
-
- .gitignore
|
177
|
-
- .ruby-version
|
178
|
-
- .travis.yml
|
175
|
+
- ".coveralls.yml"
|
176
|
+
- ".gitignore"
|
177
|
+
- ".ruby-version"
|
178
|
+
- ".travis.yml"
|
179
179
|
- Gemfile
|
180
180
|
- Guardfile
|
181
181
|
- LICENSE.txt
|
@@ -201,17 +201,17 @@ require_paths:
|
|
201
201
|
- lib
|
202
202
|
required_ruby_version: !ruby/object:Gem::Requirement
|
203
203
|
requirements:
|
204
|
-
- -
|
204
|
+
- - ">="
|
205
205
|
- !ruby/object:Gem::Version
|
206
206
|
version: '0'
|
207
207
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
208
208
|
requirements:
|
209
|
-
- -
|
209
|
+
- - ">="
|
210
210
|
- !ruby/object:Gem::Version
|
211
211
|
version: '0'
|
212
212
|
requirements: []
|
213
213
|
rubyforge_project: taifu
|
214
|
-
rubygems_version: 2.
|
214
|
+
rubygems_version: 2.4.5
|
215
215
|
signing_key:
|
216
216
|
specification_version: 4
|
217
217
|
summary: YouTube sound converter for iTunes
|