smartfm 0.4.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/ChangeLog +6 -2
  2. data/README +3 -10
  3. data/lib/smartfm.rb +3 -2
  4. data/lib/smartfm/core/version.rb +2 -2
  5. data/lib/smartfm/models.rb +7 -0
  6. data/lib/smartfm/{model → models}/base.rb +2 -1
  7. data/lib/smartfm/{model → models}/item.rb +18 -86
  8. data/lib/smartfm/models/like.rb +20 -0
  9. data/lib/smartfm/{model → models}/list.rb +35 -64
  10. data/lib/smartfm/models/notification.rb +26 -0
  11. data/lib/smartfm/models/sentence.rb +70 -0
  12. data/lib/smartfm/{model → models}/user.rb +54 -16
  13. data/lib/smartfm/modules.rb +4 -0
  14. data/lib/smartfm/modules/acts_as_likable.rb +16 -0
  15. data/lib/smartfm/modules/media_support.rb +37 -0
  16. data/lib/smartfm/modules/private_content.rb +25 -0
  17. data/lib/smartfm/modules/public_content.rb +51 -0
  18. data/lib/smartfm/rest_clients.rb +9 -0
  19. data/lib/smartfm/{rest_client → rest_clients}/base.rb +0 -0
  20. data/lib/smartfm/rest_clients/item.rb +17 -0
  21. data/lib/smartfm/rest_clients/like.rb +7 -0
  22. data/lib/smartfm/rest_clients/list.rb +18 -0
  23. data/lib/smartfm/rest_clients/notification.rb +8 -0
  24. data/lib/smartfm/rest_clients/sentence.rb +14 -0
  25. data/lib/smartfm/rest_clients/user.rb +20 -0
  26. data/spec/smartfm/{model → models}/base_spec.rb +5 -3
  27. data/spec/smartfm/{model → models}/item_spec.rb +24 -5
  28. data/spec/smartfm/models/like_spec.rb +19 -0
  29. data/spec/smartfm/models/list_spec.rb +70 -0
  30. data/spec/smartfm/models/notification_spec.rb +11 -0
  31. data/spec/smartfm/models/sentence_spec.rb +11 -0
  32. data/spec/smartfm/{model → models}/user_spec.rb +53 -19
  33. data/spec/smartfm/{rest_client → rest_clients}/base_spec.rb +0 -0
  34. data/spec/smartfm/{rest_client → rest_clients}/item_spec.rb +0 -0
  35. data/spec/smartfm/rest_clients/like_spec.rb +7 -0
  36. data/spec/smartfm/{rest_client → rest_clients}/list_spec.rb +0 -0
  37. data/spec/smartfm/rest_clients/notification_spec.rb +7 -0
  38. data/spec/smartfm/{rest_client → rest_clients}/sentence_spec.rb +0 -0
  39. data/spec/smartfm/{rest_client → rest_clients}/user_spec.rb +0 -0
  40. metadata +37 -24
  41. data/lib/smartfm/model.rb +0 -5
  42. data/lib/smartfm/model/sentence.rb +0 -118
  43. data/lib/smartfm/rest_client.rb +0 -8
  44. data/lib/smartfm/rest_client/item.rb +0 -14
  45. data/lib/smartfm/rest_client/list.rb +0 -15
  46. data/lib/smartfm/rest_client/sentence.rb +0 -12
  47. data/lib/smartfm/rest_client/user.rb +0 -14
  48. data/spec/smartfm/model/list_spec.rb +0 -7
  49. data/spec/smartfm/model/sentence_spec.rb +0 -7
@@ -1,8 +0,0 @@
1
- module Smartfm::RestClient
2
- end
3
-
4
- require 'smartfm/rest_client/base'
5
- require 'smartfm/rest_client/user'
6
- require 'smartfm/rest_client/list'
7
- require 'smartfm/rest_client/item'
8
- require 'smartfm/rest_client/sentence'
@@ -1,14 +0,0 @@
1
- class Smartfm::RestClient::Item < Smartfm::RestClient::Base
2
-
3
- ACTIONS = {
4
- :recent => { :path => '/items' },
5
- :find => { :path => '/items/__id__' },
6
- :matching => { :path => '/items/matching/__keyword__' },
7
- :extract => { :path => '/items/extract', },
8
- :create => { :path => '/items', :http_method => :post },
9
- :add_image => { :path => '/items/__id__/images', :http_method => :post },
10
- :add_sound => { :path => '/items/__id__/sounds', :http_method => :post },
11
- :add_tags => { :path => '/items/__id__/tags', :http_method => :post }
12
- }
13
-
14
- end
@@ -1,15 +0,0 @@
1
- class Smartfm::RestClient::List < Smartfm::RestClient::Base
2
-
3
- ACTIONS = {
4
- :recent => { :path => '/lists' },
5
- :find => { :path => '/lists/__id__' },
6
- :items => { :path => '/lists/__id__/items' },
7
- :sentences => { :path => '/lists/__id__/sentences' },
8
- :matching => { :path => '/lists/matching/__keyword__' },
9
- :create => { :path => '/lists', :http_method => :post },
10
- :delete => { :path => '/lists/__id__', :http_method => :delete },
11
- :add_item => { :path => '/lists/__list_id__/items', :http_method => :post },
12
- :delete_item => { :path => '/lists/__list_id__/items/__id__', :http_method => :delete }
13
- }
14
-
15
- end
@@ -1,12 +0,0 @@
1
- class Smartfm::RestClient::Sentence < Smartfm::RestClient::Base
2
-
3
- ACTIONS = {
4
- :recent => { :path => '/sentences' },
5
- :find => { :path => '/sentences/__id__' },
6
- :matching => { :path => '/sentences/matching/__keyword__' },
7
- :create => { :path => '/sentences', :http_method => :post },
8
- :add_image => { :path => '/sentences/__id__/images', :http_method => :post },
9
- :add_sound => { :path => '/sentences/__id__/sounds', :http_method => :post }
10
- }
11
-
12
- end
@@ -1,14 +0,0 @@
1
- class Smartfm::RestClient::User < Smartfm::RestClient::Base
2
-
3
- ACTIONS = {
4
- :find => { :path => '/users/__username__' },
5
- :lists => { :path => '/users/__username__/lists' },
6
- :items => { :path => '/users/__username__/items' },
7
- :friends => { :path => '/users/__username__/friends' },
8
- :followers => { :path => '/users/__username__/followers' },
9
- :study_results => { :path => '/users/__username__/study_results/__application__' },
10
- :matching => { :path => '/users/matching/__keyword__' },
11
- :username => { :path => '/sessions' }
12
- }
13
-
14
- end
@@ -1,7 +0,0 @@
1
- require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
2
-
3
- describe String do
4
- it "should respond to length" do
5
- "hoge".should respond_to(:length)
6
- end
7
- end
@@ -1,7 +0,0 @@
1
- require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
2
-
3
- describe String do
4
- it "should respond to length" do
5
- "hoge".should respond_to(:length)
6
- end
7
- end