feeder 0.3.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +119 -2
  3. data/app/controllers/feeder/application_controller.rb +1 -1
  4. data/app/controllers/feeder/items_controller.rb +7 -0
  5. data/app/models/feeder/feedable_observer.rb +43 -7
  6. data/app/models/feeder/item.rb +2 -6
  7. data/app/views/feeder/items/_item.html.erb +1 -1
  8. data/app/views/feeder/items/_item.json.jbuilder +1 -0
  9. data/app/views/feeder/{feeds → items}/index.html.erb +1 -1
  10. data/app/views/feeder/items/index.json.jbuilder +1 -0
  11. data/config/routes.rb +1 -1
  12. data/db/migrate/20140321085409_add_sticky_to_feeder_items.rb +5 -0
  13. data/db/migrate/20140401131911_prohibit_null_on_feeder_item_stickies.rb +13 -0
  14. data/db/migrate/20140526110451_add_blocked_to_feeder_items.rb +5 -0
  15. data/db/migrate/20140526110501_add_reported_to_feeder_items.rb +5 -0
  16. data/lib/feeder.rb +18 -2
  17. data/lib/feeder/active_record.rb +9 -0
  18. data/lib/feeder/concerns.rb +6 -0
  19. data/lib/feeder/concerns/controllers.rb +5 -0
  20. data/lib/feeder/concerns/controllers/items_controller.rb +22 -0
  21. data/lib/feeder/concerns/feedable.rb +27 -0
  22. data/lib/feeder/concerns/helpers.rb +5 -0
  23. data/lib/feeder/concerns/helpers/filter.rb +20 -0
  24. data/lib/feeder/concerns/models.rb +5 -0
  25. data/lib/feeder/concerns/models/item.rb +31 -0
  26. data/lib/feeder/configuration.rb +19 -5
  27. data/lib/feeder/engine.rb +3 -2
  28. data/lib/feeder/version.rb +1 -1
  29. data/spec/controllers/feeder/items_controller_spec.rb +36 -0
  30. data/spec/dummy/app/models/message.rb +2 -0
  31. data/spec/dummy/config/initializers/feeder.rb +1 -1
  32. data/spec/dummy/db/development.sqlite3 +0 -0
  33. data/spec/dummy/db/schema.rb +4 -1
  34. data/spec/dummy/db/test.sqlite3 +0 -0
  35. data/spec/dummy/log/development.log +359 -0
  36. data/spec/dummy/log/test.log +53050 -0
  37. data/spec/factories/feeder/items.rb +10 -0
  38. data/spec/lib/feeder/concerns/feedable_spec.rb +33 -0
  39. data/spec/lib/feeder/configuration_spec.rb +6 -6
  40. data/spec/lib/feeder_spec.rb +14 -2
  41. data/spec/models/feeder/feedable_observer_spec.rb +95 -0
  42. data/spec/models/feeder/item_spec.rb +38 -0
  43. data/spec/spec_helper.rb +4 -0
  44. data/spec/support/shared_examples/filterable.rb +48 -0
  45. metadata +97 -39
  46. data/app/controllers/feeder/feeds_controller.rb +0 -9
  47. data/app/views/layouts/feeder/application.html.erb +0 -14
  48. data/spec/controllers/feeder/feeds_controller_spec.rb +0 -27
@@ -1,9 +0,0 @@
1
- require_dependency "feeder/application_controller"
2
-
3
- module Feeder
4
- class FeedsController < ApplicationController
5
- def index
6
- @items = Item.order Feeder.config.sort_order
7
- end
8
- end
9
- end
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Feeder</title>
5
- <%= stylesheet_link_tag "feeder/application", media: "all" %>
6
- <%= javascript_include_tag "feeder/application" %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
14
- </html>
@@ -1,27 +0,0 @@
1
- require 'spec_helper'
2
-
3
- module Feeder
4
- describe FeedsController do
5
- routes { Feeder::Engine.routes }
6
-
7
- describe "GET 'index'" do
8
- let!(:items) do
9
- 10.times.map do
10
- m = Message.create header: 'Header', body: 'Body'
11
- Item.create feedable: m, published_at: Time.zone.now
12
- end.sort_by(&:published_at).reverse
13
- end
14
-
15
- it "returns http success" do
16
- get :index
17
- expect(response).to be_successful
18
- end
19
-
20
- it "fetches feed items ordered by publiction date, descending" do
21
- get :index
22
- expect(assigns(:items)).to eq items
23
- end
24
- end
25
-
26
- end
27
- end