musix_match 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -36,7 +36,6 @@ Available options for the search_lyrics methods are:
36
36
  * q: string to be searched in every data field
37
37
  * q_track: string to be searched among tracks titles
38
38
  * q_artist: string to be searched among artists names
39
- * format: desired output format
40
39
  * page: requested page of results
41
40
  * page_size: desired number of items per result page
42
41
 
@@ -55,6 +54,15 @@ Available options for the search_lyrics methods are:
55
54
  puts "#{track.track_id}: #{track.track_name} (#{track.artist_name})"
56
55
  end
57
56
  end
57
+
58
+ Available options for the search_track methods are:
59
+
60
+ * q: a string that will be searched in every data field
61
+ * q_track: string to be searched among tracks titles
62
+ * q_artist: string to be searched among artists names
63
+ * page: requested page of results
64
+ * page_size: desired number of items per result page
65
+ * f_has_lyrics: exclude tracks without an available lyrics
58
66
 
59
67
  === Getting track
60
68
 
@@ -13,8 +13,10 @@ module MusixMatch
13
13
  class_variable_defined?("@@api_key") ? @@api_key : nil
14
14
  end
15
15
 
16
- def self.url_for(method, params={})
17
- params.merge!({ :apikey => api_key })
16
+ def self.url_for(method, params={})
17
+ params.delete('format')
18
+ params.delete('apikey')
19
+ params.merge!({ :apikey => api_key, :format => 'json' })
18
20
  url_params = params.collect{|k, v| "#{k}=#{v}"}.join('&')
19
21
  URI.escape("#{API_URL}/#{method}?#{url_params}")
20
22
  end
@@ -0,0 +1,13 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Base Model' do
4
+ it "should always use JSON as format" do
5
+ expected_url = MusixMatch::API::Base::API_URL + '/lyrics.get?apikey=&format=json'
6
+ MusixMatch::API::Base.url_for('lyrics.get', :format => 'xml').should == expected_url
7
+ end
8
+
9
+ it "should use JSON as format even if the format key is a string" do
10
+ expected_url = MusixMatch::API::Base::API_URL + '/lyrics.get?apikey=&format=json'
11
+ MusixMatch::API::Base.url_for('lyrics.get', 'format' => 'xml').should == expected_url
12
+ end
13
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: musix_match
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andrea Franz
@@ -72,6 +72,7 @@ files:
72
72
  - lib/musix_match/models/track.rb
73
73
  - lib/musix_match/track_find_result.rb
74
74
  - lib/musix_match/track_search_result.rb
75
+ - spec/base_model_spec.rb
75
76
  - spec/finder_spec.rb
76
77
  - spec/lyrics_spec.rb
77
78
  - spec/musix_match_spec.rb
@@ -114,6 +115,7 @@ signing_key:
114
115
  specification_version: 3
115
116
  summary: API wrapper for musixmatch.com API's
116
117
  test_files:
118
+ - spec/base_model_spec.rb
117
119
  - spec/finder_spec.rb
118
120
  - spec/lyrics_spec.rb
119
121
  - spec/musix_match_spec.rb