etvnet-seek 0.7.2 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. data/Gemfile +18 -8
  2. data/README +1 -1
  3. data/Rakefile +27 -5
  4. data/VERSION +1 -1
  5. data/bin/etvnet-seek +8 -3
  6. data/etvnet-seek.gemspec +79 -42
  7. data/lib/etvnet_seek/accessor.rb +64 -0
  8. data/lib/etvnet_seek/commander.rb +37 -21
  9. data/lib/etvnet_seek/core/access_page.rb +23 -6
  10. data/lib/etvnet_seek/core/audio_page.rb +26 -0
  11. data/lib/etvnet_seek/core/best_hundred_page.rb +20 -0
  12. data/lib/etvnet_seek/core/browse_media_item.rb +1 -0
  13. data/lib/etvnet_seek/core/catalog_page.rb +26 -14
  14. data/lib/etvnet_seek/core/channels_page.rb +6 -2
  15. data/lib/etvnet_seek/core/group_media_item.rb +2 -0
  16. data/lib/etvnet_seek/core/group_page.rb +9 -23
  17. data/lib/etvnet_seek/core/home_page.rb +5 -2
  18. data/lib/etvnet_seek/core/items_page.rb +140 -0
  19. data/lib/etvnet_seek/core/items_page_factory.rb +47 -0
  20. data/lib/etvnet_seek/core/login_page.rb +3 -1
  21. data/lib/etvnet_seek/core/media_info.rb +3 -18
  22. data/lib/etvnet_seek/core/media_item.rb +10 -2
  23. data/lib/etvnet_seek/core/media_page.rb +54 -27
  24. data/lib/etvnet_seek/core/new_item.rb +2 -0
  25. data/lib/etvnet_seek/core/new_items_page.rb +4 -1
  26. data/lib/etvnet_seek/core/page.rb +2 -0
  27. data/lib/etvnet_seek/core/premiere_page.rb +7 -0
  28. data/lib/etvnet_seek/core/radio_page.rb +23 -0
  29. data/lib/etvnet_seek/core/search_page.rb +3 -33
  30. data/lib/etvnet_seek/core/service_call.rb +34 -6
  31. data/lib/etvnet_seek/core/top_this_week_page.rb +20 -0
  32. data/lib/etvnet_seek/etvnet_seek.rb +1 -4
  33. data/lib/etvnet_seek/main.rb +113 -84
  34. data/spec/etvnet_seek_spec.rb +10 -8
  35. data/spec/spec_helper.rb +3 -0
  36. data/spec/unit/pages_spec.rb +77 -0
  37. metadata +182 -32
  38. data/lib/etvnet_seek/core/base_page.rb +0 -43
  39. data/lib/etvnet_seek/core/page_factory.rb +0 -51
@@ -1,51 +0,0 @@
1
- require 'etvnet_seek/core/media_item'
2
- require 'etvnet_seek/core/new_item'
3
- require 'etvnet_seek/core/catalog_item'
4
- require 'etvnet_seek/core/media_info'
5
- require 'etvnet_seek/core/browse_media_item'
6
- require 'etvnet_seek/core/channel_media_item'
7
- require 'etvnet_seek/core/group_media_item'
8
-
9
- require 'etvnet_seek/core/service_call'
10
- require 'etvnet_seek/core/page'
11
- require 'etvnet_seek/core/home_page'
12
- require 'etvnet_seek/core/base_page'
13
- require 'etvnet_seek/core/media_page'
14
- require 'etvnet_seek/core/search_page'
15
- require 'etvnet_seek/core/channels_page'
16
- require 'etvnet_seek/core/catalog_page'
17
- require 'etvnet_seek/core/new_items_page'
18
- require 'etvnet_seek/core/group_page'
19
- require 'etvnet_seek/core/access_page'
20
- require 'etvnet_seek/core/login_page'
21
-
22
- class PageFactory
23
- def self.create mode, params = []
24
- url = (mode == 'search') ? nil : (params.class == String ? params : params[0])
25
-
26
- case mode
27
- when 'search' then
28
- SearchPage.new *params
29
- when 'main' then
30
- HomePage.new
31
- when 'channels' then
32
- ChannelsPage.new
33
- when 'catalog' then
34
- CatalogPage.new
35
- when 'best_hundred' then
36
- BestHundredPage.new
37
- when 'new_items' then
38
- NewItemsPage.new
39
- when 'premiere' then
40
- PremierePage.new
41
- when 'media' then
42
- MediaPage.new url
43
- when 'access' then
44
- AccessPage.new
45
- when 'login' then
46
- LoginPage.new
47
- else
48
- nil
49
- end
50
- end
51
- end