kagu 0.2.3 → 0.2.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: c09a4e2ff706a85174a3774f3cf3af61c07f30ad
4
- data.tar.gz: 486a71fca87635c91196328176fe48ab09aae2fb
3
+ metadata.gz: 8abf34d5d6f0a29f343b0c69bacb3c9787e74d7c
4
+ data.tar.gz: 2455ade67d9bb0743c7c9dbceac47aae2f070e57
5
5
  SHA512:
6
- metadata.gz: 86f3d8e440a5402320f03d2164ebedee5733bbae8ff721185718cebbef3c76ab9ebdeaa1d38aa857c15e4c316e1a032c688bc5c58c3084366a6d966712806d6e
7
- data.tar.gz: 8f2acd2c6711f38a6f6aec4519805a8d2e5107eddac01fbab2f4c54280569c5907a3a6b0b751528aaff2e2bccbb1f302dcd66e41dbf1a2aba27dc751d2574ac4
6
+ metadata.gz: 32627c692f97355c767f5c90696729703e4f18d81a1bc6c7e3d5f68496babf51dafe957be3a8d9a5cb79996b0c4adaf4119cd570968507e84cdd2bc5a5cd95be
7
+ data.tar.gz: 3de217af25a4f43e343a78b58db6eda4c09a6deefa7c60a08a9cb0a857578b042340a7ddd1010dc64cc37c7be6556c831ed9375a4108a77bc77fae1b63c152eb
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.3
1
+ 0.2.4
data/kagu.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.add_dependency 'applescript', '>= 1.0', '< 2.0'
21
21
  s.add_dependency 'htmlentities', '>= 4.3.0', '< 4.4.0'
22
22
 
23
- s.add_development_dependency 'byebug', '>= 3.2.0', '< 3.3.0'
23
+ s.add_development_dependency 'byebug', '>= 3.2.0', '< 3.5.0'
24
24
  s.add_development_dependency 'rake', '>= 10.3.0', '< 10.4.0'
25
- s.add_development_dependency 'rspec', '>= 3.0.0', '< 3.1.0'
25
+ s.add_development_dependency 'rspec', '>= 3.1.0', '< 3.2.0'
26
26
  end
data/lib/kagu/library.rb CHANGED
@@ -11,11 +11,11 @@ module Kagu
11
11
  end
12
12
 
13
13
  def playlists
14
- @playlists ||= Playlists.new(self)
14
+ Playlists.new(self)
15
15
  end
16
16
 
17
17
  def tracks
18
- @tracks ||= Tracks.new(self)
18
+ Tracks.new(self)
19
19
  end
20
20
 
21
21
  private
data/lib/kagu/track.rb CHANGED
@@ -6,6 +6,7 @@ module Kagu
6
6
  include Comparable
7
7
 
8
8
  MANDATORY_ATTRIBUTES = %w(added_at id length path)
9
+ IS_MAC_OS = RUBY_PLATFORM =~ /darwin/
9
10
 
10
11
  attr_reader :added_at, :album, :artist, :genre, :id, :length, :path, :title
11
12
 
@@ -80,6 +81,7 @@ module Kagu
80
81
 
81
82
  def itunes_location=(value)
82
83
  self.path = CGI.unescape(html_entities_decode(value).gsub('+', '%2B')).gsub(/\Afile:\/\/localhost/, '')
84
+ self.path = path.encode('UTF-8', 'UTF-8-MAC') if IS_MAC_OS
83
85
  end
84
86
 
85
87
  def itunes_name=(value)
@@ -31,10 +31,6 @@ describe Kagu::Library do
31
31
  expect(library.playlists.library).to be(library)
32
32
  end
33
33
 
34
- it 'always return same object' do
35
- expect(library.playlists.object_id).to be(library.playlists.object_id)
36
- end
37
-
38
34
  end
39
35
 
40
36
  describe '#tracks' do
@@ -44,8 +40,11 @@ describe Kagu::Library do
44
40
  expect(library.tracks.library).to be(library)
45
41
  end
46
42
 
47
- it 'always return same object' do
48
- expect(library.tracks.object_id).to be(library.tracks.object_id)
43
+ it 'path must exists and not include UTF-8-MAC charset' do
44
+ library.tracks.each do |track|
45
+ expect(track.path).not_to include("\u{65}\u{301}")
46
+ expect(File.file?(track.path)).to be(true)
47
+ end
49
48
  end
50
49
 
51
50
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kagu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexis Toulotte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-30 00:00:00.000000000 Z
11
+ date: 2014-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -79,7 +79,7 @@ dependencies:
79
79
  version: 3.2.0
80
80
  - - "<"
81
81
  - !ruby/object:Gem::Version
82
- version: 3.3.0
82
+ version: 3.5.0
83
83
  type: :development
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
@@ -89,7 +89,7 @@ dependencies:
89
89
  version: 3.2.0
90
90
  - - "<"
91
91
  - !ruby/object:Gem::Version
92
- version: 3.3.0
92
+ version: 3.5.0
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: rake
95
95
  requirement: !ruby/object:Gem::Requirement
@@ -116,20 +116,20 @@ dependencies:
116
116
  requirements:
117
117
  - - ">="
118
118
  - !ruby/object:Gem::Version
119
- version: 3.0.0
119
+ version: 3.1.0
120
120
  - - "<"
121
121
  - !ruby/object:Gem::Version
122
- version: 3.1.0
122
+ version: 3.2.0
123
123
  type: :development
124
124
  prerelease: false
125
125
  version_requirements: !ruby/object:Gem::Requirement
126
126
  requirements:
127
127
  - - ">="
128
128
  - !ruby/object:Gem::Version
129
- version: 3.0.0
129
+ version: 3.1.0
130
130
  - - "<"
131
131
  - !ruby/object:Gem::Version
132
- version: 3.1.0
132
+ version: 3.2.0
133
133
  description: API to manage iTunes tracks and playlists
134
134
  email: al@alweb.org
135
135
  executables: []