echowrap 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +22 -0
- data/.travis.yml +16 -0
- data/Gemfile +13 -0
- data/LICENSE.txt +22 -0
- data/README.md +111 -0
- data/Rakefile +1 -0
- data/echowrap.gemspec +24 -0
- data/lib/echowrap/analysis.rb +39 -0
- data/lib/echowrap/api/artist.rb +387 -0
- data/lib/echowrap/api/oauth.rb +25 -0
- data/lib/echowrap/api/playlist.rb +248 -0
- data/lib/echowrap/api/sandbox.rb +45 -0
- data/lib/echowrap/api/song.rb +111 -0
- data/lib/echowrap/api/taste_profile.rb +296 -0
- data/lib/echowrap/api/track.rb +64 -0
- data/lib/echowrap/api/utils.rb +57 -0
- data/lib/echowrap/artist.rb +73 -0
- data/lib/echowrap/asset.rb +12 -0
- data/lib/echowrap/audio_summary.rb +15 -0
- data/lib/echowrap/base.rb +88 -0
- data/lib/echowrap/biography.rb +13 -0
- data/lib/echowrap/blog.rb +8 -0
- data/lib/echowrap/call_list.rb +8 -0
- data/lib/echowrap/category_map.rb +8 -0
- data/lib/echowrap/client.rb +80 -0
- data/lib/echowrap/configurable.rb +84 -0
- data/lib/echowrap/default.rb +88 -0
- data/lib/echowrap/doc_counts.rb +8 -0
- data/lib/echowrap/echonest_id.rb +8 -0
- data/lib/echowrap/error/bad_gateway.rb +11 -0
- data/lib/echowrap/error/bad_request.rb +10 -0
- data/lib/echowrap/error/client_error.rb +35 -0
- data/lib/echowrap/error/configuration_error.rb +8 -0
- data/lib/echowrap/error/forbidden.rb +10 -0
- data/lib/echowrap/error/gateway_timeout.rb +11 -0
- data/lib/echowrap/error/internal_server_error.rb +11 -0
- data/lib/echowrap/error/not_acceptable.rb +10 -0
- data/lib/echowrap/error/not_found.rb +10 -0
- data/lib/echowrap/error/server_error.rb +28 -0
- data/lib/echowrap/error/service_unavailable.rb +11 -0
- data/lib/echowrap/error/too_many_requests.rb +12 -0
- data/lib/echowrap/error/unauthorized.rb +10 -0
- data/lib/echowrap/error/unprocessable_entity.rb +10 -0
- data/lib/echowrap/error.rb +32 -0
- data/lib/echowrap/familiarity.rb +8 -0
- data/lib/echowrap/feed.rb +14 -0
- data/lib/echowrap/foreign_id.rb +10 -0
- data/lib/echowrap/genre.rb +8 -0
- data/lib/echowrap/hotttnesss.rb +8 -0
- data/lib/echowrap/image.rb +15 -0
- data/lib/echowrap/item.rb +95 -0
- data/lib/echowrap/item_request.rb +8 -0
- data/lib/echowrap/keyvalues.rb +8 -0
- data/lib/echowrap/license.rb +10 -0
- data/lib/echowrap/location.rb +8 -0
- data/lib/echowrap/meta.rb +9 -0
- data/lib/echowrap/news_article.rb +8 -0
- data/lib/echowrap/options.rb +10 -0
- data/lib/echowrap/playlist.rb +47 -0
- data/lib/echowrap/prediction.rb +7 -0
- data/lib/echowrap/rate_limit.rb +47 -0
- data/lib/echowrap/reference.rb +8 -0
- data/lib/echowrap/request/multipart_with_file.rb +36 -0
- data/lib/echowrap/response/parse_json.rb +25 -0
- data/lib/echowrap/response/raise_error.rb +31 -0
- data/lib/echowrap/review.rb +8 -0
- data/lib/echowrap/rule.rb +8 -0
- data/lib/echowrap/sandbox.rb +11 -0
- data/lib/echowrap/seeds.rb +9 -0
- data/lib/echowrap/sequenced_data/bar.rb +4 -0
- data/lib/echowrap/sequenced_data/beat.rb +4 -0
- data/lib/echowrap/sequenced_data/section.rb +6 -0
- data/lib/echowrap/sequenced_data/segment.rb +4 -0
- data/lib/echowrap/sequenced_data/tatum.rb +4 -0
- data/lib/echowrap/sequenced_data.rb +12 -0
- data/lib/echowrap/song.rb +24 -0
- data/lib/echowrap/status.rb +12 -0
- data/lib/echowrap/taste_profile.rb +28 -0
- data/lib/echowrap/term.rb +8 -0
- data/lib/echowrap/track.rb +21 -0
- data/lib/echowrap/update_info.rb +8 -0
- data/lib/echowrap/urls.rb +9 -0
- data/lib/echowrap/version.rb +18 -0
- data/lib/echowrap/video.rb +7 -0
- data/lib/echowrap/years_active.rb +8 -0
- data/lib/echowrap.rb +78 -0
- data/spec/echonest/api/artist_spec.rb +901 -0
- data/spec/echonest/api/oauth_spec.rb +29 -0
- data/spec/echonest/api/playlist_spec.rb +274 -0
- data/spec/echonest/api/sandbox_spec.rb +67 -0
- data/spec/echonest/api/song_spec.rb +326 -0
- data/spec/echonest/api/taste_profile_spec.rb +403 -0
- data/spec/echonest/api/track_spec.rb +167 -0
- data/spec/echonest/base_spec.rb +119 -0
- data/spec/echonest/client_spec.rb +174 -0
- data/spec/echonest/error_spec.rb +20 -0
- data/spec/echonest/rate_limit_spec.rb +76 -0
- data/spec/echonest_spec.rb +65 -0
- data/spec/fixtures/artist/biographies.json +1 -0
- data/spec/fixtures/artist/blogs.json +1 -0
- data/spec/fixtures/artist/extract.json +1 -0
- data/spec/fixtures/artist/familiarity.json +1 -0
- data/spec/fixtures/artist/hotttnesss.json +1 -0
- data/spec/fixtures/artist/images.json +1 -0
- data/spec/fixtures/artist/list_genres.json +1 -0
- data/spec/fixtures/artist/list_terms.json +1 -0
- data/spec/fixtures/artist/news.json +1 -0
- data/spec/fixtures/artist/profile.json +1 -0
- data/spec/fixtures/artist/reviews.json +1 -0
- data/spec/fixtures/artist/search.json +1 -0
- data/spec/fixtures/artist/similar.json +1 -0
- data/spec/fixtures/artist/songs.json +1 -0
- data/spec/fixtures/artist/suggest.json +1 -0
- data/spec/fixtures/artist/terms.json +1 -0
- data/spec/fixtures/artist/top_hottt.json +1 -0
- data/spec/fixtures/artist/top_terms.json +1 -0
- data/spec/fixtures/artist/twitter.json +1 -0
- data/spec/fixtures/artist/urls.json +1 -0
- data/spec/fixtures/artist/video.json +1 -0
- data/spec/fixtures/billie_jean_fingerprint.txt +1 -0
- data/spec/fixtures/billie_jean_query.json +16 -0
- data/spec/fixtures/oauth/timestamp.json +1 -0
- data/spec/fixtures/playlist/basic.json +1 -0
- data/spec/fixtures/playlist/dynamic/create.json +1 -0
- data/spec/fixtures/playlist/dynamic/delete.json +1 -0
- data/spec/fixtures/playlist/dynamic/feedback.json +1 -0
- data/spec/fixtures/playlist/dynamic/info.json +1 -0
- data/spec/fixtures/playlist/dynamic/next.json +1 -0
- data/spec/fixtures/playlist/dynamic/restart.json +1 -0
- data/spec/fixtures/playlist/dynamic/steer.json +1 -0
- data/spec/fixtures/playlist/static.json +1 -0
- data/spec/fixtures/sandbox/access.json +19 -0
- data/spec/fixtures/sandbox/list.json +1 -0
- data/spec/fixtures/song/identify.json +19 -0
- data/spec/fixtures/song/profile.json +1 -0
- data/spec/fixtures/song/search.json +1 -0
- data/spec/fixtures/taste_profile/ban.json +9 -0
- data/spec/fixtures/taste_profile/create.json +1 -0
- data/spec/fixtures/taste_profile/delete.json +11 -0
- data/spec/fixtures/taste_profile/favorite.json +9 -0
- data/spec/fixtures/taste_profile/feed.json +1 -0
- data/spec/fixtures/taste_profile/keyvalues.json +4 -0
- data/spec/fixtures/taste_profile/list.json +1 -0
- data/spec/fixtures/taste_profile/play.json +9 -0
- data/spec/fixtures/taste_profile/predict.json +1 -0
- data/spec/fixtures/taste_profile/profile.json +1 -0
- data/spec/fixtures/taste_profile/rate.json +9 -0
- data/spec/fixtures/taste_profile/read.json +1 -0
- data/spec/fixtures/taste_profile/similar.json +14 -0
- data/spec/fixtures/taste_profile/skip.json +9 -0
- data/spec/fixtures/taste_profile/status.json +2 -0
- data/spec/fixtures/taste_profile/update.json +10 -0
- data/spec/fixtures/taste_profile/update_request_data.json +4 -0
- data/spec/fixtures/technolol-music.mp3 +0 -0
- data/spec/fixtures/track/analysis.json +3 -0
- data/spec/fixtures/track/profile.json +35 -0
- data/spec/fixtures/track/upload.json +21 -0
- data/spec/helper.rb +50 -0
- metadata +323 -0
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'echowrap/base'
|
2
|
+
|
3
|
+
module Echowrap
|
4
|
+
class Playlist < Echowrap::Base
|
5
|
+
attr_reader :actual_history_length, :api_key, :banned_artist_ids, :banned_song_ids,
|
6
|
+
:contraints, :favorited_artist_ids, :favorited_song_ids, :favorites_map,
|
7
|
+
:history, :invalid_artist_ids, :invalid_songs, :playlist_score, :ratings_map,
|
8
|
+
:restart_request_ids, :rules_retries, :rules_run, :rules_runtime, :session_id,
|
9
|
+
:skipped_songs, :song_scores
|
10
|
+
|
11
|
+
|
12
|
+
# @return [Array]
|
13
|
+
def call_list
|
14
|
+
@call_list ||= map_collection(Echowrap::CallList, :call_list)
|
15
|
+
end
|
16
|
+
|
17
|
+
# @return [Echowrap::CategoryMap]
|
18
|
+
def category_map
|
19
|
+
@category_map ||= Echowrap::CategoryMap.new(@attrs[:category_map])
|
20
|
+
end
|
21
|
+
|
22
|
+
# @return [Array]
|
23
|
+
def lookahead
|
24
|
+
@lookahead ||= map_collection(Echowrap::Song, :lookahead)
|
25
|
+
end
|
26
|
+
|
27
|
+
# @return [Echowrap::Options]
|
28
|
+
def options
|
29
|
+
@options ||= Echowrap::Options.new(@attrs[:options])
|
30
|
+
end
|
31
|
+
|
32
|
+
# @return [Array]
|
33
|
+
def rules
|
34
|
+
@rules ||= map_collection(Echowrap::Rule, :rules)
|
35
|
+
end
|
36
|
+
|
37
|
+
# @return [Echowrap::Seeds]
|
38
|
+
def seeds
|
39
|
+
@seeds ||= Echowrap::Seeds.new(@attrs[:seeds])
|
40
|
+
end
|
41
|
+
|
42
|
+
# @return [Array]
|
43
|
+
def songs
|
44
|
+
@songs ||= map_collection(Echowrap::Song, :songs)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'echowrap/base'
|
2
|
+
|
3
|
+
module Echowrap
|
4
|
+
class RateLimit
|
5
|
+
attr_reader :attrs
|
6
|
+
alias to_hash attrs
|
7
|
+
|
8
|
+
# @return [Echowrap::RateLimit]
|
9
|
+
def initialize(attrs={})
|
10
|
+
@attrs = attrs
|
11
|
+
end
|
12
|
+
|
13
|
+
# @return [Integer]
|
14
|
+
def limit
|
15
|
+
limit = @attrs['x-rate-limit-limit']
|
16
|
+
limit.to_i if limit
|
17
|
+
end
|
18
|
+
|
19
|
+
# @return [Integer]
|
20
|
+
def remaining
|
21
|
+
remaining = @attrs['x-rate-limit-remaining']
|
22
|
+
remaining.to_i if remaining
|
23
|
+
end
|
24
|
+
|
25
|
+
# @return [Time]
|
26
|
+
def reset_at
|
27
|
+
reset = @attrs['x-rate-limit-reset']
|
28
|
+
Time.at(reset.to_i) if reset
|
29
|
+
end
|
30
|
+
|
31
|
+
# @return [Integer]
|
32
|
+
def reset_in
|
33
|
+
[(reset_at - Time.now).ceil, 0].max if reset_at
|
34
|
+
end
|
35
|
+
alias retry_after reset_in
|
36
|
+
|
37
|
+
# Update the attributes of a RateLimit
|
38
|
+
#
|
39
|
+
# @param attrs [Hash]
|
40
|
+
# @return [Echowrap::RateLimit]
|
41
|
+
def update(attrs)
|
42
|
+
@attrs.update(attrs)
|
43
|
+
self
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
|
3
|
+
module Echowrap
|
4
|
+
module Request
|
5
|
+
class MultipartWithFile < Faraday::Middleware
|
6
|
+
CONTENT_TYPE = 'Content-Type'
|
7
|
+
|
8
|
+
def call(env)
|
9
|
+
env[:body].each do |key, value|
|
10
|
+
if value.respond_to?(:to_io)
|
11
|
+
env[:body][key] = Faraday::UploadIO.new(value, mime_type(value.path), value.path)
|
12
|
+
end
|
13
|
+
end if env[:body].is_a?(::Hash)
|
14
|
+
@app.call(env)
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def mime_type(path)
|
20
|
+
case path
|
21
|
+
when /\.jpe?g/i
|
22
|
+
'image/jpeg'
|
23
|
+
when /\.gif$/i
|
24
|
+
'image/gif'
|
25
|
+
when /\.png$/i
|
26
|
+
'image/png'
|
27
|
+
when /\.mp3$/i
|
28
|
+
'audio/mpeg'
|
29
|
+
else
|
30
|
+
'application/octet-stream'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
require 'multi_json'
|
3
|
+
|
4
|
+
module Echowrap
|
5
|
+
module Response
|
6
|
+
class ParseJson < Faraday::Response::Middleware
|
7
|
+
|
8
|
+
def parse(body)
|
9
|
+
case body
|
10
|
+
when /\A^\s*$\z/, nil
|
11
|
+
nil
|
12
|
+
else
|
13
|
+
MultiJson.decode(body, :symbolize_keys => true)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def on_complete(env)
|
18
|
+
if respond_to?(:parse)
|
19
|
+
env[:body] = parse(env[:body]) unless [204, 301, 302, 304].include?(env[:status])
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
require 'echowrap/error/bad_gateway'
|
3
|
+
require 'echowrap/error/bad_request'
|
4
|
+
require 'echowrap/error/forbidden'
|
5
|
+
require 'echowrap/error/gateway_timeout'
|
6
|
+
require 'echowrap/error/internal_server_error'
|
7
|
+
require 'echowrap/error/not_acceptable'
|
8
|
+
require 'echowrap/error/not_found'
|
9
|
+
require 'echowrap/error/service_unavailable'
|
10
|
+
require 'echowrap/error/too_many_requests'
|
11
|
+
require 'echowrap/error/unauthorized'
|
12
|
+
require 'echowrap/error/unprocessable_entity'
|
13
|
+
|
14
|
+
module Echowrap
|
15
|
+
module Response
|
16
|
+
class RaiseError < Faraday::Response::Middleware
|
17
|
+
|
18
|
+
def on_complete(env)
|
19
|
+
status_code = env[:status].to_i
|
20
|
+
error_class = @klass.errors[status_code]
|
21
|
+
raise error_class.from_response(env) if error_class
|
22
|
+
end
|
23
|
+
|
24
|
+
def initialize(app, klass)
|
25
|
+
@klass = klass
|
26
|
+
super(app)
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'echowrap/base'
|
2
|
+
|
3
|
+
module Echowrap
|
4
|
+
class Song < Echowrap::Base
|
5
|
+
attr_reader :artist_id, :artist_familiarity, :artist_hotttnesss, :artist_name,
|
6
|
+
:attributes, :id, :message, :score, :song_currency, :song_discovery,
|
7
|
+
:song_hotttnesss, :song_type, :title
|
8
|
+
|
9
|
+
# @return [Echowrap::AudioSummary]
|
10
|
+
def audio_summary
|
11
|
+
@audio_summary ||= Echowrap::AudioSummary.new(@attrs[:audio_summary])
|
12
|
+
end
|
13
|
+
|
14
|
+
# @return [Echowrap::ArtistLocation]
|
15
|
+
def artist_location
|
16
|
+
@artist_location ||= Echowrap::Location.new(@attrs[:artist_location])
|
17
|
+
end
|
18
|
+
|
19
|
+
# @return [Array]
|
20
|
+
def tracks
|
21
|
+
@tracks ||= map_collection(Echowrap::Track, :tracks)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'echowrap/base'
|
2
|
+
|
3
|
+
module Echowrap
|
4
|
+
class Status < Echowrap::Base
|
5
|
+
attr_reader :details, :items_updated, :percent_complete, :ticket_status, :total_items
|
6
|
+
|
7
|
+
def update_info
|
8
|
+
@update_info ||= map_collection(Echowrap::UpdateInfo, :update_info)
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'echowrap/base'
|
2
|
+
|
3
|
+
module Echowrap
|
4
|
+
class TasteProfile < Echowrap::Base
|
5
|
+
attr_reader :name, :pending_tickets, :resolved, :score, :ticket, :total, :type
|
6
|
+
|
7
|
+
# @return [String]
|
8
|
+
def id
|
9
|
+
@attrs[:id] || @attrs[:ticket]
|
10
|
+
end
|
11
|
+
|
12
|
+
# @return [Array]
|
13
|
+
def items
|
14
|
+
@items ||= map_collection(Echowrap::Item, :items)
|
15
|
+
end
|
16
|
+
|
17
|
+
# @return [Echowrap::Keyvalues]
|
18
|
+
def keyvalues
|
19
|
+
@keyvalues ||= Echowrap::Keyvalues.new(@attrs[:keyvalues])
|
20
|
+
end
|
21
|
+
|
22
|
+
# @return [Array]
|
23
|
+
def predictions
|
24
|
+
@predictions ||= map_collection(Echowrap::Prediction, :predictions)
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'echowrap/base'
|
2
|
+
|
3
|
+
module Echowrap
|
4
|
+
class Track < Echowrap::Base
|
5
|
+
attr_reader :analysis_channels, :analysis_sample_rate, :analyzer_version, :artist,
|
6
|
+
:attributes, :audio_md5, :bitrate, :catalog, :code_version, :codestring,
|
7
|
+
:decoder, :duration, :echoprint_version, :echoprintstring, :end_of_fade_in,
|
8
|
+
:foreign_id, :foreign_release_id, :id, :key, :key_confidence, :loudness,
|
9
|
+
:md5, :mode, :mode_confidence, :num_samples, :offset_seconds, :preview_url,
|
10
|
+
:release, :release_image, :sample_md5, :samplerate, :song_id,
|
11
|
+
:start_of_fade_out, :status, :synch_version, :synchstring, :tempo,
|
12
|
+
:tempo_confidence, :time_signature, :time_signature_confidence, :title,
|
13
|
+
:window_seconds
|
14
|
+
|
15
|
+
# @return [Echowrap::AudioSummary]
|
16
|
+
def audio_summary
|
17
|
+
@audio_summary ||= Echowrap::AudioSummary.new(@attrs[:audio_summary])
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Echowrap
|
2
|
+
class Version
|
3
|
+
MAJOR = 0 unless defined? Echowrap::Version::MAJOR
|
4
|
+
MINOR = 0 unless defined? Echowrap::Version::MINOR
|
5
|
+
PATCH = 1 unless defined? Echowrap::Version::PATCH
|
6
|
+
PRE = nil unless defined? Echowrap::Version::PRE
|
7
|
+
|
8
|
+
class << self
|
9
|
+
|
10
|
+
# @return [String]
|
11
|
+
def to_s
|
12
|
+
[MAJOR, MINOR, PATCH, PRE].compact.join('.')
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
data/lib/echowrap.rb
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
require 'echowrap/analysis'
|
2
|
+
require 'echowrap/artist'
|
3
|
+
require 'echowrap/asset'
|
4
|
+
require 'echowrap/biography'
|
5
|
+
require 'echowrap/blog'
|
6
|
+
require 'echowrap/audio_summary'
|
7
|
+
require 'echowrap/call_list'
|
8
|
+
require 'echowrap/category_map'
|
9
|
+
require 'echowrap/client'
|
10
|
+
require 'echowrap/configurable'
|
11
|
+
require 'echowrap/doc_counts'
|
12
|
+
require 'echowrap/echonest_id'
|
13
|
+
require 'echowrap/error'
|
14
|
+
require 'echowrap/familiarity'
|
15
|
+
require 'echowrap/feed'
|
16
|
+
require 'echowrap/foreign_id'
|
17
|
+
require 'echowrap/hotttnesss'
|
18
|
+
require 'echowrap/genre'
|
19
|
+
require 'echowrap/keyvalues'
|
20
|
+
require 'echowrap/image'
|
21
|
+
require 'echowrap/item'
|
22
|
+
require 'echowrap/item_request'
|
23
|
+
require 'echowrap/location'
|
24
|
+
require 'echowrap/license'
|
25
|
+
require 'echowrap/meta'
|
26
|
+
require 'echowrap/news_article'
|
27
|
+
require 'echowrap/options'
|
28
|
+
require 'echowrap/playlist'
|
29
|
+
require 'echowrap/prediction'
|
30
|
+
require 'echowrap/rate_limit'
|
31
|
+
require 'echowrap/reference'
|
32
|
+
require 'echowrap/review'
|
33
|
+
require 'echowrap/rule'
|
34
|
+
require 'echowrap/seeds'
|
35
|
+
require 'echowrap/sequenced_data'
|
36
|
+
require 'echowrap/sequenced_data/bar'
|
37
|
+
require 'echowrap/sequenced_data/beat'
|
38
|
+
require 'echowrap/sequenced_data/section'
|
39
|
+
require 'echowrap/sequenced_data/segment'
|
40
|
+
require 'echowrap/sequenced_data/tatum'
|
41
|
+
require 'echowrap/sandbox'
|
42
|
+
require 'echowrap/song'
|
43
|
+
require 'echowrap/status'
|
44
|
+
require 'echowrap/taste_profile'
|
45
|
+
require 'echowrap/term'
|
46
|
+
require 'echowrap/track'
|
47
|
+
require 'echowrap/update_info'
|
48
|
+
require 'echowrap/urls'
|
49
|
+
require 'echowrap/version'
|
50
|
+
require 'echowrap/video'
|
51
|
+
require 'echowrap/years_active'
|
52
|
+
|
53
|
+
|
54
|
+
module Echowrap
|
55
|
+
class << self
|
56
|
+
include Echowrap::Configurable
|
57
|
+
|
58
|
+
# Delegate to a Echowrap::Client
|
59
|
+
#
|
60
|
+
# @return [Echowrap::Client]
|
61
|
+
def client
|
62
|
+
@client = Echowrap::Client.new(options) unless defined?(@client) && @client.hash == options.hash
|
63
|
+
@client
|
64
|
+
end
|
65
|
+
|
66
|
+
def respond_to_missing?(method_name, include_private=false); client.respond_to?(method_name, include_private); end if RUBY_VERSION >= "1.9"
|
67
|
+
def respond_to?(method_name, include_private=false); client.respond_to?(method_name, include_private) || super; end if RUBY_VERSION < "1.9"
|
68
|
+
|
69
|
+
private
|
70
|
+
|
71
|
+
def method_missing(method_name, *args, &block)
|
72
|
+
return super unless client.respond_to?(method_name)
|
73
|
+
client.send(method_name, *args, &block)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
Echowrap.setup
|