From ea13ff21f31df5e70a3cb8bf9d74588dd4b8adf8 Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Fri, 17 Jul 2009 20:19:19 +0000 Subject: [PATCH] Deleting superfluous trunk in branches --- app/controllers/application_controller.rb | 10 ------ app/controllers/feed_controller.rb | 38 ----------------------- app/helpers/application_helper.rb | 3 -- app/helpers/feed_helper.rb | 2 -- app/models/feed_item.rb | 21 ------------- app/views/feed/index.html.erb | 14 --------- app/views/feed/index.rss.builder | 17 ---------- app/views/feed/show.html.erb | 17 ---------- app/views/feed/show.rss.builder | 16 ---------- app/views/feed/update.html.erb | 2 -- app/views/layouts/application.html.erb | 8 ----- 11 files changed, 148 deletions(-) delete mode 100644 app/controllers/application_controller.rb delete mode 100644 app/controllers/feed_controller.rb delete mode 100644 app/helpers/application_helper.rb delete mode 100644 app/helpers/feed_helper.rb delete mode 100644 app/models/feed_item.rb delete mode 100644 app/views/feed/index.html.erb delete mode 100644 app/views/feed/index.rss.builder delete mode 100644 app/views/feed/show.html.erb delete mode 100644 app/views/feed/show.rss.builder delete mode 100644 app/views/feed/update.html.erb delete mode 100644 app/views/layouts/application.html.erb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb deleted file mode 100644 index 6635a3f..0000000 --- a/app/controllers/application_controller.rb +++ /dev/null @@ -1,10 +0,0 @@ -# Filters added to this controller apply to all controllers in the application. -# Likewise, all the methods added will be available for all controllers. - -class ApplicationController < ActionController::Base - helper :all # include all helpers, all the time - protect_from_forgery # See ActionController::RequestForgeryProtection for details - - # Scrub sensitive parameters from your log - # filter_parameter_logging :password -end diff --git a/app/controllers/feed_controller.rb b/app/controllers/feed_controller.rb deleted file mode 100644 index 71ab1df..0000000 --- a/app/controllers/feed_controller.rb +++ /dev/null @@ -1,38 +0,0 @@ -class FeedController < ApplicationController - - skip_before_filter :verify_authenticity_token - - def index - @feeds = FeedItem.find(:all, :select => 'DISTINCT feed_name') - respond_to do |format| - format.html - format.rss { render :layout => false } - end - end - - def show - @feed_items = FeedItem.find_all_by_feed_name(params[:feed_name]) - redirect_to index_url if @feed_items == [] - respond_to do |format| - format.html - format.rss { render :layout => false } - end - end - - def update - item = FeedItem.find_by_feed_name_and_title(params[:feed_name], params[:title]) - if item - if params[:description] == '' - item.destroy - else - item.update_attribute(:description, params[:description]) - end - else - FeedItem.create(:feed_name => params[:feed_name], - :title => params[:title], - :description => params[:description]) - end - redirect_to feed_url(params[:feed_name]) - end - -end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb deleted file mode 100644 index 22a7940..0000000 --- a/app/helpers/application_helper.rb +++ /dev/null @@ -1,3 +0,0 @@ -# Methods added to this helper will be available to all templates in the application. -module ApplicationHelper -end diff --git a/app/helpers/feed_helper.rb b/app/helpers/feed_helper.rb deleted file mode 100644 index 6709856..0000000 --- a/app/helpers/feed_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module FeedHelper -end diff --git a/app/models/feed_item.rb b/app/models/feed_item.rb deleted file mode 100644 index cf01358..0000000 --- a/app/models/feed_item.rb +++ /dev/null @@ -1,21 +0,0 @@ -class FeedItem < ActiveRecord::Base - - # require 'cgi' # needed for url decoding - - validates_presence_of :feed_name, :title, :description - validate :feed_name_must_be_legal - -protected - - def feed_name_must_be_legal - if Rack::Utils::escape(feed_name) != feed_name or - Rack::Utils::unescape(feed_name) != feed_name or - feed_name == 'index' or - feed_name == 'show' or - feed_name == 'update' or - feed_name == 'action' - errors.add(:feed_name, 'is an invalid feed name') - end - end - -end diff --git a/app/views/feed/index.html.erb b/app/views/feed/index.html.erb deleted file mode 100644 index b9e082a..0000000 --- a/app/views/feed/index.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -

Feeds available

- -<% form_tag :action => 'update' do %> -

Set feed <%= text_field_tag :feed_name, '', :size => 20 %> - to include <%= text_field_tag :title, '', :size => 30 %> - containing <%= text_field_tag :description, '', :size => 50 %> - <%= submit_tag 'Update' %>

-<% end %> - - \ No newline at end of file diff --git a/app/views/feed/index.rss.builder b/app/views/feed/index.rss.builder deleted file mode 100644 index 93ce050..0000000 --- a/app/views/feed/index.rss.builder +++ /dev/null @@ -1,17 +0,0 @@ -# index.rss.builder -xml.instruct! :xml, :version => "1.0" -xml.rss :version => "2.0" do - xml.channel do - xml.title "Feedcatcher" - xml.description "Feeds available" - xml.link index_url(:rss) - - for feed in @feeds - xml.item do - xml.title feed.feed_name - xml.link feed_url(feed.feed_name, :rss) - xml.guid feed_url(feed.feed_name, :rss) - end - end - end -end diff --git a/app/views/feed/show.html.erb b/app/views/feed/show.html.erb deleted file mode 100644 index 2a2b9b1..0000000 --- a/app/views/feed/show.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -

Contents of feed <%= h params[:feed_name] %>

-

<%= link_to("List of all feeds", index_url) %>

- -<% form_tag :action => 'update' do %> -

Set feed <%= text_field_tag :feed_name, h(params[:feed_name]), :size => 20 %> - to include <%= text_field_tag :title, '', :size => 30 %> - containing <%= text_field_tag :description, '', :size => 50 %> - <%= submit_tag 'Update' %>

-<% end %> - - -
- <% for item in @feed_items %> -
<%= h item.title %>
-
<%= h item.description %>
- <% end %> -
diff --git a/app/views/feed/show.rss.builder b/app/views/feed/show.rss.builder deleted file mode 100644 index 522b662..0000000 --- a/app/views/feed/show.rss.builder +++ /dev/null @@ -1,16 +0,0 @@ -# index.rss.builder -xml.instruct! :xml, :version => "1.0" -xml.rss :version => "2.0" do - xml.channel do - xml.title @feed_items[0].feed_name - xml.link feed_url(@feed_items[0].feed_name, :rss) - - for item in @feed_items - xml.item do - xml.title item.title - xml.description item.description - xml.guid item.id, :isPermaLink => 'false' - end - end - end -end diff --git a/app/views/feed/update.html.erb b/app/views/feed/update.html.erb deleted file mode 100644 index 96fff67..0000000 --- a/app/views/feed/update.html.erb +++ /dev/null @@ -1,2 +0,0 @@ -

Feed#update

-

Find me in app/views/feed/update.html.erb

diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb deleted file mode 100644 index 6ac8aa8..0000000 --- a/app/views/layouts/application.html.erb +++ /dev/null @@ -1,8 +0,0 @@ - - - Form: <%= controller.action_name %> - - - <%= yield :layout %> - - -- 2.34.1