songkickr 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. data/Gemfile +6 -2
  2. data/Gemfile.lock +32 -10
  3. data/README.rdoc +7 -7
  4. data/Rakefile +1 -1
  5. data/VERSION +1 -1
  6. data/bin/autospec +16 -0
  7. data/bin/convert_to_should_syntax +16 -0
  8. data/bin/guard +16 -0
  9. data/bin/htmldiff +16 -0
  10. data/bin/httparty +16 -0
  11. data/bin/jeweler +16 -0
  12. data/bin/ldiff +16 -0
  13. data/bin/rake +16 -0
  14. data/bin/rake2thor +16 -0
  15. data/bin/rg +16 -0
  16. data/bin/ri +16 -0
  17. data/bin/rspec +16 -0
  18. data/bin/thor +16 -0
  19. data/doc/APIError.html +241 -0
  20. data/doc/APIKeyNotSet.html +164 -175
  21. data/doc/LICENSE.html +109 -109
  22. data/doc/README_rdoc.html +120 -117
  23. data/doc/ResourceNotFound.html +203 -0
  24. data/doc/Songkickr/Artist.html +210 -237
  25. data/doc/Songkickr/ArtistResult.html +228 -254
  26. data/doc/Songkickr/ConcertSetlistResult.html +205 -223
  27. data/doc/Songkickr/Event.html +344 -409
  28. data/doc/Songkickr/EventResult.html +226 -252
  29. data/doc/Songkickr/Location.html +210 -237
  30. data/doc/Songkickr/LocationResult.html +229 -255
  31. data/doc/Songkickr/Performance.html +222 -253
  32. data/doc/Songkickr/Remote.html +630 -481
  33. data/doc/Songkickr/Setlist.html +258 -296
  34. data/doc/Songkickr/SetlistItem.html +187 -206
  35. data/doc/Songkickr/Venue.html +205 -232
  36. data/doc/Songkickr.html +204 -271
  37. data/doc/created.rid +16 -16
  38. data/doc/images/add.png +0 -0
  39. data/doc/images/delete.png +0 -0
  40. data/doc/images/tag_blue.png +0 -0
  41. data/doc/images/transparent.png +0 -0
  42. data/doc/index.html +93 -127
  43. data/doc/js/darkfish.js +99 -62
  44. data/doc/js/jquery.js +15 -29
  45. data/doc/js/navigation.js +142 -0
  46. data/doc/js/search.js +94 -0
  47. data/doc/js/search_index.js +1 -0
  48. data/doc/js/searcher.js +228 -0
  49. data/doc/rdoc.css +119 -339
  50. data/doc/table_of_contents.html +185 -0
  51. data/lib/songkickr/artist.rb +3 -3
  52. data/lib/songkickr/remote.rb +36 -13
  53. data/lib/songkickr.rb +16 -2
  54. data/songkickr.gemspec +121 -4
  55. data/test/fixtures/vcr/invalid_api_key.yml +63 -0
  56. data/test/fixtures/vcr/invalid_event_id.yml +33 -0
  57. data/test/fixtures/vcr/invalid_user.yml +32 -0
  58. data/test/fixtures/vcr/invalid_venue_id.yml +33 -0
  59. data/test/fixtures/vcr/valid_event.yml +52 -0
  60. data/test/fixtures/vcr/valid_user.yml +71 -0
  61. data/test/fixtures/vcr/valid_venue.yml +53 -0
  62. data/test/helper.rb +2 -2
  63. data/test/songkickr/test_remote.rb +68 -24
  64. data/test/vcr_helper.rb +7 -0
  65. data/test.rb +2 -2
  66. metadata +626 -40
data/doc/index.html CHANGED
@@ -1,144 +1,110 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
1
+ <!DOCTYPE html>
4
2
 
5
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3
+ <html>
6
4
  <head>
7
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
8
6
 
9
- <title>RDoc Documentation</title>
7
+ <title>RDoc Documentation</title>
10
8
 
11
- <link type="text/css" media="screen" href="rdoc.css" rel="stylesheet" />
9
+ <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
12
10
 
13
- <script src="js/jquery.js" type="text/javascript" charset="utf-8"></script>
14
- <script src="js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
15
- <script src="js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
16
- <script src="js/darkfish.js" type="text/javascript" charset="utf-8"></script>
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "./";
13
+ </script>
17
14
 
18
- </head>
19
- <body class="indexpage">
15
+ <script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
20
21
 
21
-
22
- <h1>RDoc Documentation</h1>
23
22
 
24
-
25
- <p>This is the API documentation for 'RDoc Documentation'.</p>
26
-
23
+ <body>
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="./index.html">Home</a>
28
+ <a href="./table_of_contents.html#classes">Classes</a>
29
+ <a href="./table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
32
+
33
+
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
27
41
 
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
44
+
45
+
46
+ <div id="project-metadata">
47
+ <nav id="fileindex-section" class="section project-section">
48
+ <h3 class="section-header">Pages</h3>
49
+
50
+ <ul>
28
51
 
52
+ <li class="file"><a href="./LICENSE.html">LICENSE</a>
29
53
 
30
- <h2>Files</h2>
31
- <ul>
32
-
33
- <li class="file"><a href="LICENSE.html">LICENSE</a></li>
34
-
35
- <li class="file"><a href="README_rdoc.html">README.rdoc</a></li>
36
-
37
- </ul>
54
+ <li class="file"><a href="./README_rdoc.html">README</a>
38
55
 
39
-
40
- <h2 id="classes">Classes/Modules</h2>
41
- <ul>
42
-
43
- <li class="module"><a href="Songkickr.html">Songkickr</a></li>
44
-
45
- <li class="class"><a href="Songkickr/Artist.html">Songkickr::Artist</a></li>
46
-
47
- <li class="class"><a href="Songkickr/ArtistResult.html">Songkickr::ArtistResult</a></li>
48
-
49
- <li class="class"><a href="Songkickr/ConcertSetlistResult.html">Songkickr::ConcertSetlistResult</a></li>
50
-
51
- <li class="class"><a href="Songkickr/Event.html">Songkickr::Event</a></li>
52
-
53
- <li class="class"><a href="Songkickr/EventResult.html">Songkickr::EventResult</a></li>
54
-
55
- <li class="class"><a href="Songkickr/Location.html">Songkickr::Location</a></li>
56
-
57
- <li class="class"><a href="Songkickr/LocationResult.html">Songkickr::LocationResult</a></li>
58
-
59
- <li class="class"><a href="Songkickr/Performance.html">Songkickr::Performance</a></li>
60
-
61
- <li class="class"><a href="Songkickr/Remote.html">Songkickr::Remote</a></li>
62
-
63
- <li class="class"><a href="Songkickr/Setlist.html">Songkickr::Setlist</a></li>
64
-
65
- <li class="class"><a href="Songkickr/SetlistItem.html">Songkickr::SetlistItem</a></li>
66
-
67
- <li class="class"><a href="Songkickr/Venue.html">Songkickr::Venue</a></li>
68
-
69
- <li class="class"><a href="APIKeyNotSet.html">APIKeyNotSet</a></li>
70
-
71
56
  </ul>
57
+ </nav>
72
58
 
73
- <h2 id="methods">Methods</h2>
74
- <ul>
75
-
76
- <li><a href="Songkickr.html#method-c-api_key">::api_key &mdash; Songkickr</a></li>
77
-
78
- <li><a href="Songkickr.html#method-c-api_key-3D">::api_key= &mdash; Songkickr</a></li>
79
-
80
- <li><a href="Songkickr/Event.html#method-c-new">::new &mdash; Songkickr::Event</a></li>
81
-
82
- <li><a href="Songkickr/Artist.html#method-c-new">::new &mdash; Songkickr::Artist</a></li>
83
-
84
- <li><a href="Songkickr/SetlistItem.html#method-c-new">::new &mdash; Songkickr::SetlistItem</a></li>
85
-
86
- <li><a href="Songkickr/ArtistResult.html#method-c-new">::new &mdash; Songkickr::ArtistResult</a></li>
87
-
88
- <li><a href="Songkickr/Setlist.html#method-c-new">::new &mdash; Songkickr::Setlist</a></li>
89
-
90
- <li><a href="Songkickr/ConcertSetlistResult.html#method-c-new">::new &mdash; Songkickr::ConcertSetlistResult</a></li>
91
-
92
- <li><a href="Songkickr/Performance.html#method-c-new">::new &mdash; Songkickr::Performance</a></li>
93
-
94
- <li><a href="Songkickr/LocationResult.html#method-c-new">::new &mdash; Songkickr::LocationResult</a></li>
95
-
96
- <li><a href="Songkickr/Venue.html#method-c-new">::new &mdash; Songkickr::Venue</a></li>
97
-
98
- <li><a href="Songkickr/EventResult.html#method-c-new">::new &mdash; Songkickr::EventResult</a></li>
99
-
100
- <li><a href="Songkickr/Location.html#method-c-new">::new &mdash; Songkickr::Location</a></li>
101
-
102
- <li><a href="Songkickr/Remote.html#method-c-new">::new &mdash; Songkickr::Remote</a></li>
103
-
104
- <li><a href="Songkickr/Remote.html#method-i-artist_search">#artist_search &mdash; Songkickr::Remote</a></li>
105
-
106
- <li><a href="Songkickr/Remote.html#method-i-concert_setlists">#concert_setlists &mdash; Songkickr::Remote</a></li>
107
-
108
- <li><a href="Songkickr/Remote.html#method-i-event">#event &mdash; Songkickr::Remote</a></li>
109
-
110
- <li><a href="Songkickr/Remote.html#method-i-events">#events &mdash; Songkickr::Remote</a></li>
111
-
112
- <li><a href="Songkickr/Remote.html#method-i-gigography">#gigography &mdash; Songkickr::Remote</a></li>
113
-
114
- <li><a href="Songkickr/Remote.html#method-i-location_search">#location_search &mdash; Songkickr::Remote</a></li>
115
-
116
- <li><a href="Songkickr/Remote.html#method-i-metro_areas_events">#metro_areas_events &mdash; Songkickr::Remote</a></li>
117
-
118
- <li><a href="Songkickr/Event.html#method-i-parse_performance">#parse_performance &mdash; Songkickr::Event</a></li>
119
-
120
- <li><a href="Songkickr/EventResult.html#method-i-parse_results">#parse_results &mdash; Songkickr::EventResult</a></li>
121
-
122
- <li><a href="Songkickr/ArtistResult.html#method-i-parse_results">#parse_results &mdash; Songkickr::ArtistResult</a></li>
123
-
124
- <li><a href="Songkickr/LocationResult.html#method-i-parse_results">#parse_results &mdash; Songkickr::LocationResult</a></li>
125
-
126
- <li><a href="Songkickr/ConcertSetlistResult.html#method-i-parse_results">#parse_results &mdash; Songkickr::ConcertSetlistResult</a></li>
127
-
128
- <li><a href="Songkickr/Setlist.html#method-i-parse_setlist_items">#parse_setlist_items &mdash; Songkickr::Setlist</a></li>
129
-
130
- <li><a href="Songkickr/Event.html#method-i-start_hash_to_datetime">#start_hash_to_datetime &mdash; Songkickr::Event</a></li>
131
-
132
- <li><a href="APIKeyNotSet.html#method-i-to_s">#to_s &mdash; APIKeyNotSet</a></li>
133
-
134
- <li><a href="Songkickr/Remote.html#method-i-users_events">#users_events &mdash; Songkickr::Remote</a></li>
135
-
59
+ <nav id="classindex-section" class="section project-section">
60
+ <h3 class="section-header">Class and Module Index</h3>
61
+
62
+ <ul class="link-list">
63
+
64
+ <li><a href="./Songkickr.html">Songkickr</a>
65
+
66
+ <li><a href="./Songkickr/Artist.html">Songkickr::Artist</a>
67
+
68
+ <li><a href="./Songkickr/ArtistResult.html">Songkickr::ArtistResult</a>
69
+
70
+ <li><a href="./Songkickr/ConcertSetlistResult.html">Songkickr::ConcertSetlistResult</a>
71
+
72
+ <li><a href="./Songkickr/Event.html">Songkickr::Event</a>
73
+
74
+ <li><a href="./Songkickr/EventResult.html">Songkickr::EventResult</a>
75
+
76
+ <li><a href="./Songkickr/Location.html">Songkickr::Location</a>
77
+
78
+ <li><a href="./Songkickr/LocationResult.html">Songkickr::LocationResult</a>
79
+
80
+ <li><a href="./Songkickr/Performance.html">Songkickr::Performance</a>
81
+
82
+ <li><a href="./Songkickr/Remote.html">Songkickr::Remote</a>
83
+
84
+ <li><a href="./Songkickr/Setlist.html">Songkickr::Setlist</a>
85
+
86
+ <li><a href="./Songkickr/SetlistItem.html">Songkickr::SetlistItem</a>
87
+
88
+ <li><a href="./Songkickr/Venue.html">Songkickr::Venue</a>
89
+
90
+ <li><a href="./APIError.html">APIError</a>
91
+
92
+ <li><a href="./APIKeyNotSet.html">APIKeyNotSet</a>
93
+
94
+ <li><a href="./ResourceNotFound.html">ResourceNotFound</a>
95
+
136
96
  </ul>
97
+ </nav>
137
98
 
138
- <div id="validator-badges">
139
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
140
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
141
- Rdoc Generator</a> 2</small>.</p>
142
99
  </div>
143
- </body>
144
- </html>
100
+ </nav>
101
+
102
+ <p>This is the API documentation for RDoc Documentation.
103
+
104
+
105
+ <footer id="validator-badges">
106
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
107
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
108
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
109
+ </footer>
110
+
data/doc/js/darkfish.js CHANGED
@@ -9,12 +9,12 @@
9
9
 
10
10
  /* Provide console simulation for firebug-less environments */
11
11
  if (!("console" in window) || !("firebug" in console)) {
12
- var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
12
+ var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
13
13
  "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
14
14
 
15
- window.console = {};
16
- for (var i = 0; i < names.length; ++i)
17
- window.console[names[i]] = function() {};
15
+ window.console = {};
16
+ for (var i = 0; i < names.length; ++i)
17
+ window.console[names[i]] = function() {};
18
18
  };
19
19
 
20
20
 
@@ -23,94 +23,131 @@ if (!("console" in window) || !("firebug" in console)) {
23
23
  */
24
24
  $.fn.unwrap = function( expr ) {
25
25
  return this.each( function() {
26
- $(this).parents( expr ).eq( 0 ).after( this ).remove();
26
+ $(this).parents( expr ).eq( 0 ).after( this ).remove();
27
27
  });
28
28
  };
29
29
 
30
30
 
31
31
  function showSource( e ) {
32
- var target = e.target;
33
- var codeSections = $(target).
34
- parents('.method-detail').
35
- find('.method-source-code');
36
-
37
- $(target).
38
- parents('.method-detail').
39
- find('.method-source-code').
40
- slideToggle();
32
+ var target = e.target;
33
+ var codeSections = $(target).
34
+ parents('.method-detail').
35
+ find('.method-source-code');
36
+
37
+ $(target).
38
+ parents('.method-detail').
39
+ find('.method-source-code').
40
+ slideToggle();
41
41
  };
42
42
 
43
43
  function hookSourceViews() {
44
- $('.method-description,.method-heading').click( showSource );
44
+ $('.method-heading').click( showSource );
45
45
  };
46
46
 
47
47
  function toggleDebuggingSection() {
48
- $('.debugging-section').slideToggle();
48
+ $('.debugging-section').slideToggle();
49
49
  };
50
50
 
51
51
  function hookDebuggingToggle() {
52
- $('#debugging-toggle img').click( toggleDebuggingSection );
52
+ $('#debugging-toggle img').click( toggleDebuggingSection );
53
53
  };
54
54
 
55
- function hookQuickSearch() {
56
- $('.quicksearch-field').each( function() {
57
- var searchElems = $(this).parents('.section').find( 'li' );
58
- var toggle = $(this).parents('.section').find('h3 .search-toggle');
59
- // console.debug( "Toggle is: %o", toggle );
60
- var qsbox = $(this).parents('form').get( 0 );
61
-
62
- $(this).quicksearch( this, searchElems, {
63
- noSearchResultsIndicator: 'no-class-search-results',
64
- focusOnLoad: false
65
- });
66
- $(toggle).click( function() {
67
- // console.debug( "Toggling qsbox: %o", qsbox );
68
- $(qsbox).toggle();
69
- });
70
- });
55
+ function hookTableOfContentsToggle() {
56
+ $('.indexpage li .toc-toggle').each( function() {
57
+ $(this).click( function() {
58
+ $(this).toggleClass('open');
59
+ });
60
+
61
+ var section = $(this).next();
62
+
63
+ $(this).click( function() {
64
+ section.slideToggle();
65
+ });
66
+ });
67
+ }
68
+
69
+ function hookSearch() {
70
+ var input = $('#search-field').eq(0);
71
+ var result = $('#search-results').eq(0);
72
+ $(result).show();
73
+
74
+ var search_section = $('#search-section').get(0);
75
+ $(search_section).show();
76
+
77
+ var search = new Search(search_data, input, result);
78
+
79
+ search.renderItem = function(result) {
80
+ var li = document.createElement('li');
81
+ var html = '';
82
+
83
+ // TODO add relative path to <script> per-page
84
+ html += '<p class="search-match"><a href="' + rdoc_rel_prefix + result.path + '">' + this.hlt(result.title);
85
+ if (result.params)
86
+ html += '<span class="params">' + result.params + '</span>';
87
+ html += '</a>';
88
+
89
+
90
+ if (result.namespace)
91
+ html += '<p class="search-namespace">' + this.hlt(result.namespace);
92
+
93
+ if (result.snippet)
94
+ html += '<div class="search-snippet">' + result.snippet + '</div>';
95
+
96
+ li.innerHTML = html;
97
+
98
+ return li;
99
+ }
100
+
101
+ search.select = function(result) {
102
+ var result_element = result.get(0);
103
+ window.location.href = result_element.firstChild.firstChild.href;
104
+ }
105
+
106
+ search.scrollIntoView = search.scrollInWindow;
71
107
  };
72
108
 
73
109
  function highlightTarget( anchor ) {
74
- console.debug( "Highlighting target '%s'.", anchor );
75
-
76
- $("a[name=" + anchor + "]").each( function() {
77
- if ( !$(this).parent().parent().hasClass('target-section') ) {
78
- console.debug( "Wrapping the target-section" );
79
- $('div.method-detail').unwrap( 'div.target-section' );
80
- $(this).parent().wrap( '<div class="target-section"></div>' );
81
- } else {
82
- console.debug( "Already wrapped." );
83
- }
84
- });
110
+ console.debug( "Highlighting target '%s'.", anchor );
111
+
112
+ $("a[name=" + anchor + "]").each( function() {
113
+ if ( !$(this).parent().parent().hasClass('target-section') ) {
114
+ console.debug( "Wrapping the target-section" );
115
+ $('div.method-detail').unwrap( 'div.target-section' );
116
+ $(this).parent().wrap( '<div class="target-section"></div>' );
117
+ } else {
118
+ console.debug( "Already wrapped." );
119
+ }
120
+ });
85
121
  };
86
122
 
87
123
  function highlightLocationTarget() {
88
- console.debug( "Location hash: %s", window.location.hash );
89
- if ( ! window.location.hash || window.location.hash.length == 0 ) return;
124
+ console.debug( "Location hash: %s", window.location.hash );
125
+ if ( ! window.location.hash || window.location.hash.length == 0 ) return;
90
126
 
91
- var anchor = window.location.hash.substring(1);
92
- console.debug( "Found anchor: %s; matching %s", anchor, "a[name=" + anchor + "]" );
127
+ var anchor = window.location.hash.substring(1);
128
+ console.debug( "Found anchor: %s; matching %s", anchor, "a[name=" + anchor + "]" );
93
129
 
94
- highlightTarget( anchor );
130
+ highlightTarget( anchor );
95
131
  };
96
132
 
97
133
  function highlightClickTarget( event ) {
98
- console.debug( "Highlighting click target for event %o", event.target );
99
- try {
100
- var anchor = $(event.target).attr( 'href' ).substring(1);
101
- console.debug( "Found target anchor: %s", anchor );
102
- highlightTarget( anchor );
103
- } catch ( err ) {
104
- console.error( "Exception while highlighting: %o", err );
105
- };
134
+ console.debug( "Highlighting click target for event %o", event.target );
135
+ try {
136
+ var anchor = $(event.target).attr( 'href' ).substring(1);
137
+ console.debug( "Found target anchor: %s", anchor );
138
+ highlightTarget( anchor );
139
+ } catch ( err ) {
140
+ console.error( "Exception while highlighting: %o", err );
141
+ };
106
142
  };
107
143
 
108
144
 
109
145
  $(document).ready( function() {
110
- hookSourceViews();
111
- hookDebuggingToggle();
112
- hookQuickSearch();
113
- highlightLocationTarget();
146
+ hookSourceViews();
147
+ hookDebuggingToggle();
148
+ hookSearch();
149
+ highlightLocationTarget();
150
+ hookTableOfContentsToggle();
114
151
 
115
- $('ul.link-list a').bind( "click", highlightClickTarget );
152
+ $('ul.link-list a').bind( "click", highlightClickTarget );
116
153
  });