next-big-sound 0.5.0 → 0.6.1
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.
- data/VERSION +1 -1
- data/lib/next-big-sound.rb +27 -40
- data/lib/{artist.rb → next-big-sound/artist.rb} +0 -0
- data/lib/{artist_profile.rb → next-big-sound/artist_profile.rb} +0 -0
- data/lib/next-big-sound/base.rb +23 -0
- data/lib/{datapoint.rb → next-big-sound/datapoint.rb} +0 -0
- data/lib/{memoize.rb → next-big-sound/memoize.rb} +0 -0
- data/lib/{metric.rb → next-big-sound/metric.rb} +0 -0
- data/lib/{search.rb → next-big-sound/search.rb} +0 -0
- data/next-big-sound.gemspec +8 -8
- metadata +10 -10
- data/lib/hash_extension.rb +0 -17
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6.1
|
data/lib/next-big-sound.rb
CHANGED
@@ -1,42 +1,29 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
require 'metric'
|
13
|
-
require 'datapoint'
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
#puts "#{File.dirname(__FILE__)}/config.yml"
|
18
|
-
NBS_CONFIG = YAML.load_file("#{File.dirname(__FILE__)}/config.yml")
|
19
|
-
|
20
|
-
#CACHE_ENABLED
|
21
|
-
#KEYSTORE = nil
|
22
|
-
|
23
|
-
|
24
|
-
class Base
|
25
|
-
|
26
|
-
extend NBS::MemcachedMemoize
|
27
|
-
|
28
|
-
def initialize(api_key)
|
29
|
-
$nbs_api_key = api_key
|
30
|
-
#puts CACHE_ENABLED
|
1
|
+
require 'rubygems'
|
2
|
+
require "cgi"
|
3
|
+
require 'xmlsimple'
|
4
|
+
require 'rubygems'
|
5
|
+
require 'yaml'
|
6
|
+
|
7
|
+
class Hash
|
8
|
+
def to_url_params
|
9
|
+
elements = []
|
10
|
+
keys.size.times do |i|
|
11
|
+
elements << "#{CGI::escape(keys[i])}=#{CGI::escape(values[i])}"
|
31
12
|
end
|
32
|
-
|
33
|
-
# if you prefer to just use the xml simply type to_xml
|
34
|
-
# this method with actually fetch the result
|
35
|
-
def search(query, options={} )
|
36
|
-
search = NBS::Search.new(query,options)
|
37
|
-
search.fetch
|
38
|
-
return search
|
39
|
-
end
|
40
|
-
remember :search
|
13
|
+
elements.join('&')
|
41
14
|
end
|
42
|
-
|
15
|
+
|
16
|
+
def self.from_xml(xml_data)
|
17
|
+
XmlSimple.xml_in(xml_data)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
directory = File.expand_path(File.dirname(__FILE__))
|
22
|
+
require File.join(directory,"next-big-sound", "memoize")
|
23
|
+
require File.join(directory,"next-big-sound", "base")
|
24
|
+
require File.join(directory,"next-big-sound", "search")
|
25
|
+
require File.join(directory,"next-big-sound","artist")
|
26
|
+
require File.join(directory,"next-big-sound","artist_profile")
|
27
|
+
require File.join(directory,"next-big-sound", "metric")
|
28
|
+
require File.join(directory,"next-big-sound","datapoint")
|
29
|
+
|
File without changes
|
File without changes
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module NBS
|
2
|
+
|
3
|
+
NBS_CONFIG = YAML.load_file("#{File.dirname(__FILE__)}/../config.yml")
|
4
|
+
|
5
|
+
class Base
|
6
|
+
|
7
|
+
extend NBS::MemcachedMemoize
|
8
|
+
|
9
|
+
def initialize(api_key)
|
10
|
+
$nbs_api_key = api_key
|
11
|
+
#puts CACHE_ENABLED
|
12
|
+
end
|
13
|
+
# return a search object that you can manipulate
|
14
|
+
# if you prefer to just use the xml simply type to_xml
|
15
|
+
# this method with actually fetch the result
|
16
|
+
def search(query, options={} )
|
17
|
+
search = NBS::Search.new(query,options)
|
18
|
+
search.fetch
|
19
|
+
return search
|
20
|
+
end
|
21
|
+
remember :search
|
22
|
+
end
|
23
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/next-big-sound.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{next-big-sound}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.6.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["jeff durand"]
|
@@ -23,15 +23,15 @@ Gem::Specification.new do |s|
|
|
23
23
|
"README.rdoc",
|
24
24
|
"Rakefile",
|
25
25
|
"VERSION",
|
26
|
-
"lib/artist.rb",
|
27
|
-
"lib/artist_profile.rb",
|
28
26
|
"lib/config.yml",
|
29
|
-
"lib/datapoint.rb",
|
30
|
-
"lib/hash_extension.rb",
|
31
|
-
"lib/memoize.rb",
|
32
|
-
"lib/metric.rb",
|
33
27
|
"lib/next-big-sound.rb",
|
34
|
-
"lib/
|
28
|
+
"lib/next-big-sound/artist.rb",
|
29
|
+
"lib/next-big-sound/artist_profile.rb",
|
30
|
+
"lib/next-big-sound/base.rb",
|
31
|
+
"lib/next-big-sound/datapoint.rb",
|
32
|
+
"lib/next-big-sound/memoize.rb",
|
33
|
+
"lib/next-big-sound/metric.rb",
|
34
|
+
"lib/next-big-sound/search.rb",
|
35
35
|
"next-big-sound.gemspec",
|
36
36
|
"test/helper.rb",
|
37
37
|
"test/test_search.rb"
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
7
|
+
- 6
|
8
|
+
- 1
|
9
|
+
version: 0.6.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- jeff durand
|
@@ -45,15 +45,15 @@ files:
|
|
45
45
|
- README.rdoc
|
46
46
|
- Rakefile
|
47
47
|
- VERSION
|
48
|
-
- lib/artist.rb
|
49
|
-
- lib/artist_profile.rb
|
50
48
|
- lib/config.yml
|
51
|
-
- lib/datapoint.rb
|
52
|
-
- lib/hash_extension.rb
|
53
|
-
- lib/memoize.rb
|
54
|
-
- lib/metric.rb
|
55
49
|
- lib/next-big-sound.rb
|
56
|
-
- lib/
|
50
|
+
- lib/next-big-sound/artist.rb
|
51
|
+
- lib/next-big-sound/artist_profile.rb
|
52
|
+
- lib/next-big-sound/base.rb
|
53
|
+
- lib/next-big-sound/datapoint.rb
|
54
|
+
- lib/next-big-sound/memoize.rb
|
55
|
+
- lib/next-big-sound/metric.rb
|
56
|
+
- lib/next-big-sound/search.rb
|
57
57
|
- next-big-sound.gemspec
|
58
58
|
- test/helper.rb
|
59
59
|
- test/test_search.rb
|
data/lib/hash_extension.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
require "cgi"
|
2
|
-
require 'rubygems'
|
3
|
-
require 'xmlsimple'
|
4
|
-
|
5
|
-
class Hash
|
6
|
-
def to_url_params
|
7
|
-
elements = []
|
8
|
-
keys.size.times do |i|
|
9
|
-
elements << "#{CGI::escape(keys[i])}=#{CGI::escape(values[i])}"
|
10
|
-
end
|
11
|
-
elements.join('&')
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.from_xml(xml_data)
|
15
|
-
XmlSimple.xml_in(xml_data)
|
16
|
-
end
|
17
|
-
end
|