sounddrop 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZGIyNjkwODRlNDQ4NjUxY2FjNzQwYTc3MGU4Mjk5ZGU2NGE5ODFhNw==
4
+ NjQ2ZTVmMzAxZjE2MTg3ZTFkYTk3MGI3N2RiMTY3NjY4ZGMwMjkyZQ==
5
5
  data.tar.gz: !binary |-
6
- ZjQ1NzM2NGQwMzRkODRmNTYxOTFmNzM2OWNiNzRmMjczZGE0ZmFhYg==
6
+ ODNiMDU0YWJmZTVhYzMyZGZjMDkyYzIyZWQxMDg0MjcyNjcxNTNjYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YmVjYWIyNTQ3OTRiY2NmMmE0YzNhM2U1ZDExOWI2MzBhZWQ1OGUyNzI1YTBh
10
- YWI5OTBmY2ZmMzQ4NTIxNjk5YjA3MTYwYmU0YTdlNmFhYTcwMDhiOTJkM2Mz
11
- OTlhNDUyZTU2OWZkYjllMzc1MWVmNzA0YTQ5MjRmMmNjZTdlN2Y=
9
+ ZTNlNjUyMWYzZDBlNTQyNTg3ZTRiNDllODJlNWFiOTE3YjZiOTcwNjQwOGE1
10
+ ZmU1ZmZhNzYwNjZhOGIzZThkNTIyMWUwZWU2MWI0NWIzOThlYTcxODg4MTc3
11
+ ZDI3OTU0ZGNhYjI3NzMwYTA2ZmVjOGYyNWYzMTFhMWU0NmE1ODA=
12
12
  data.tar.gz: !binary |-
13
- MWJkYzc1ZWEyNTcyNmVlNTI4Zjk5ZTEzZjQ3MmYyYWJhYTE0YWNjMzU2OGQ0
14
- ZjgzOGM1MWUzYmMyNTVlNmE3N2JiY2FhZjkzNDVhYTkyNmJiMDM3Y2Y4YjY2
15
- Y2IxNzlkZDUwMmQwMzBkYzMyYmFmZDdmYmIzZmM5NjczN2VmMjA=
13
+ MWE3YWVhMDc1MWQ5MDk2NzZlYTY5ZTQyNWVkMzc5MGU5YmEwODNmMzU5Yjgw
14
+ MTkyNTU1ZDIwNDhjMzFhNmQ3OTYxZjg0Yjk0YTc1YmNkMThkODMzMDg5NTA4
15
+ MDZjMmQ4NWIxZGI0MGU2NGU1ZjMxMjQ4MjU0ZGFjNTFmOGFjMjI=
@@ -1,4 +1,4 @@
1
- module Sounddrop
1
+ module SoundDrop
2
2
  class Client
3
3
 
4
4
  ###########################################################################
@@ -16,6 +16,10 @@ module Sounddrop
16
16
  @client = get_client
17
17
  end
18
18
 
19
+ ###########################################################################
20
+ # Core #
21
+ ###########################################################################
22
+
19
23
  # Did the user specify a username?
20
24
  def username?
21
25
  @USERNAME.nil?
@@ -41,14 +45,13 @@ module Sounddrop
41
45
  Soundcloud.new(init_opts)
42
46
  end
43
47
 
44
- # Returns a Track object with all sorts of useful data with useful getters.
45
- # The Track object is where most of the data retrieval occurs.
48
+ # Returns a Drop object that contains useful track information.
46
49
  def get_drop(url)
47
50
  sc_track = client.get('/resolve', url: url)
48
- Sounddrop::Drop.new(sc_track, client)
51
+ SoundDrop::Drop.new(client: client, track: sc_track)
49
52
  end
50
53
 
51
54
  private :get_client, :username?, :password?
52
55
 
53
56
  end # class Client
54
- end # module Sounddrop
57
+ end # module SoundDrop
@@ -1,4 +1,4 @@
1
- module Sounddrop
1
+ module SoundDrop
2
2
  class Drop
3
3
 
4
4
  ###########################################################################
@@ -7,9 +7,9 @@ module Sounddrop
7
7
 
8
8
  LOG = Logbert[self]
9
9
 
10
- def initialize(track_hash, client)
11
- @TRACK = track_hash
12
- @CLIENT = client
10
+ def initialize(params)
11
+ @TRACK = params[:track]
12
+ @CLIENT = params[:client]
13
13
  end
14
14
 
15
15
  ###########################################################################
@@ -37,9 +37,9 @@ module Sounddrop
37
37
  r = HTTParty.get("https://api.soundcloud.com/i1/tracks/#{id}/streams?client_id=#{@CLIENT.client_id}")
38
38
  r['http_mp3_128_url']
39
39
  rescue Exception => ex
40
- raise Sounddrop::Exception::FailedRequest.new(ex)
40
+ raise SoundDrop::Exception::FailedRequest.new(ex)
41
41
  end
42
42
  end
43
43
 
44
44
  end # class Drop
45
- end # module Sounddrop
45
+ end # module SoundDrop
@@ -1,11 +1,13 @@
1
- module Sounddrop::Exception
1
+ module SoundDrop
2
+ module Exception
2
3
 
3
- class FailedRequest < StandardError
4
- attr_reader :message
4
+ class FailedRequest < StandardError
5
+ attr_reader :message
5
6
 
6
- def initialize(message)
7
- @message = message
7
+ def initialize(message)
8
+ @message = message
9
+ end
8
10
  end
9
- end
10
11
 
11
- end # module Sounddrop::Exception
12
+ end # module Exception
13
+ end # module SoundDrop
@@ -1,3 +1,3 @@
1
- module Sounddrop
2
- VERSION = "0.0.3"
1
+ module SoundDrop
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sounddrop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Bezobchuk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-16 00:00:00.000000000 Z
11
+ date: 2014-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: soundcloud
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  version: '0'
115
115
  requirements: []
116
116
  rubyforge_project:
117
- rubygems_version: 2.4.2
117
+ rubygems_version: 2.2.2
118
118
  signing_key:
119
119
  specification_version: 4
120
120
  summary: Provides audio and track information about a Soundcloud song given a URL