Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

more things configurable via app_config.yml

  • Loading branch information...
commit b83826c4e06eb314ea7224bcb06e558768633090 1 parent b309e0c
Pascal authored
Showing with 165 additions and 211 deletions.
  1. +4 −1 .gitignore
  2. +8 −8 app/controllers/projects_controller.rb
  3. +1 −1  app/controllers/screenshots_controller.rb
  4. +1 −1  app/controllers/versions_controller.rb
  5. +3 −3 app/helpers/projects_helper.rb
  6. +3 −3 app/models/activity.rb
  7. +4 −1 app/models/project.rb
  8. +1 −1  app/models/user_mailer.rb
  9. +1 −1  app/views/bookmarks/_bookmark_list.html.haml
  10. +1 −1  app/views/comments/_form.html.haml
  11. +2 −2 app/views/layouts/_about_us.html.haml
  12. +7 −6 app/views/layouts/_footer.html.haml
  13. +2 −1  app/views/layouts/_header.html.haml
  14. +1 −1  app/views/layouts/_searchbox.html.haml
  15. +0 −17 app/views/layouts/_tracking.html.erb
  16. +13 −9 app/views/pages/about.html.haml
  17. +8 −4 app/views/projects/_form.html.haml
  18. +1 −1  app/views/projects/index.atom.builder
  19. +2 −2 app/views/projects/index.html.haml
  20. +6 −0 app/views/projects/parts/_about_project.html.haml
  21. +1 −1  app/views/projects/parts/_grid.html.haml
  22. +2 −2 app/views/projects/parts/_mini_form.html.haml
  23. +3 −3 app/views/projects/parts/_submit_panel.html.haml
  24. +2 −2 app/views/projects/parts/_tabs.html.haml
  25. +4 −2 app/views/projects/show.html.haml
  26. +2 −2 app/views/projects/tabs/_project_activity.html.haml
  27. +1 −1  app/views/user_mailer/signup_notification.html.erb
  28. +1 −1  app/views/users/show.html.haml
  29. +1 −1  app/views/versions/_version.html.haml
  30. +0 −31 config/app_config.yml
  31. +0 −54 config/database.yml
  32. +58 −38 config/deploy.rb
  33. +8 −5 config/environment.rb
  34. +0 −1  config/environments/production.yml
  35. +9 −0 db/migrate/20080806062958_add_feed.rb
  36. +2 −1  db/schema.rb
  37. BIN  public/images/big-approve-button-blank.psd
  38. BIN  public/images/big-approve-button.png
  39. BIN  public/images/big-approve-button.psd
  40. BIN  public/images/big-delete-button.png
  41. BIN  public/images/big-delete-button.psd
  42. BIN  public/images/big-submit-button.png
  43. BIN  public/images/big-submit-button.psd
  44. BIN  public/images/template/submit_app.psd
  45. BIN  public/images/template/submit_site.png
  46. +1 −1  public/stylesheets/sass/v2/parts/header.sass
  47. +1 −1  public/stylesheets/template/style.css
View
5 .gitignore
@@ -9,4 +9,7 @@ public/avatars
public/downloads
public/screenshots
public/images/screenshots
-db/restore.sql
+db/restore.sql
+config/database.yml
+config/app_config.yml
+app/views/layouts/_tracking.erb.html
View
16 app/controllers/projects_controller.rb
@@ -56,9 +56,9 @@ def create
redirect_to @project
else
if @project.title.blank?
- flash[:error] = "Please give the application a name."
+ flash[:error] = "Please give the #{AppConfig.directory_type} a name."
else
- flash[:error] = "Application name is already taken."
+ flash[:error] = "#{AppConfig.directory_type} name is already taken."
end
redirect_to :back
@@ -117,7 +117,7 @@ def destroy
return unless verify_owner(@project)
@project.destroy
- flash[:notice] = %(Application "#{@project.title}" has been deleted.)
+ flash[:notice] = %("#{AppConfig.directory_type}" "#{@project.title}" has been deleted.)
redirect_to root_url
end
@@ -128,9 +128,9 @@ def submit
if @project.owned_by?(current_or_anon_user)
@project.update_attribute(:is_submitted, true)
@project.mark_changed!
- flash[:success] = %(Application "#{@project.title}" has been submitted. It will be shown in the "Upcoming" list until it's approved by an Admin. Adding additional screenshots and links will improve its chances of being accepted into the gallery.)
+ flash[:success] = %(#{AppConfig.directory_type} "#{@project.title}" has been submitted. It will be shown in the "Upcoming" list until it's approved by an Admin. Adding additional screenshots and links will improve its chances of being accepted into the gallery.)
else
- flash[:error] = "You no longer have access to this application. Your session may have expired."
+ flash[:error] = "You no longer have access to this #{AppConfig.directory_type}. Your session may have expired."
end
redirect_to @project
@@ -145,9 +145,9 @@ def approve
@project.promoted_at = Time.now
@project.mark_changed
@project.save!
- flash[:success] = %(Application "#{@project.title}" has been promoted. It is now in the gallery.)
+ flash[:success] = %("#{AppConfig.directory_type}" "#{@project.title}" has been promoted. It is now in the gallery.)
else
- flash[:error] = "Sorry, only admins are allowed to promote an application."
+ flash[:error] = "Sorry, only admins are allowed to promote a #{AppConfig.directory_type}."
end
redirect_to root_url
@@ -260,7 +260,7 @@ def verify_owner(project)
# render an output
respond_to do |format|
- flash[:error] = "You don't have access to edit this application."
+ flash[:error] = "You don't have access to edit this #{AppConfig.directory_type}."
format.js do
render :text => flash[:error], :layout => false
flash.discard
View
2  app/controllers/screenshots_controller.rb
@@ -62,7 +62,7 @@ def destroy
def set
@screenshot = get_screenshot
if @screenshot and @screenshot.owned_by?(current_or_anon_user)
- flash[:success] = "Default Application Screenshot has been updated."
+ flash[:success] = "Default #{AppConfig.directory_type} Screenshot has been updated."
@project.set_default_screenshot(@screenshot)
else
flash[:error] = "Unable to set default screenshot."
View
2  app/controllers/versions_controller.rb
@@ -27,7 +27,7 @@ def create
@project.set_default_version(@version)
end
- flash[:success] = "New Application Version was uploaded."
+ flash[:success] = "New #{AppConfig.directory_type} Version was uploaded."
redirect_to @project
else
flash[:error] = "Unable to Save Version. " + @version.errors.map{|error| "#{error.first.capitalize} #{error.last}"}.join(",")
View
6 app/helpers/projects_helper.rb
@@ -74,7 +74,7 @@ def bookmark_control(project)
def bookmark_mini(project)
haml_tag :span, :class => "bookmark-mini" do
# Add Bookmark Button
- bookmark_count = pluralize(project.bookmarks.size, "person")+" bookmarked this application"
+ bookmark_count = pluralize(project.bookmarks.size, "person")+" bookmarked this #{AppConfig.directory_type.downcase}"
if current_or_anon_user.bookmarked?(project)
puts link_to_image("favorite-mini.png", project_bookmark_url(project), :method => :delete, :title => bookmark_count, :class => "bookmark-button remove")
else
@@ -111,7 +111,7 @@ def check_empty(collection, name = nil, &block)
if collection.nil? or collection.empty?
inner_html = capture_haml(&block) if block_given?
- haml_tag(:p, "There are no #{name} currently associated with this application. #{inner_html}", :class => "empty")
+ haml_tag(:p, "There are no #{name} currently associated with this #{AppConfig.directory_type.downcase}. #{inner_html}", :class => "empty")
end
@@ -145,7 +145,7 @@ def approve_button(project)
puts link_to(image_tag("big-approve-button.png"),
approve_project_url(@project),
:method => :put,
- :confirm => "This will promote the application to the gallery.")
+ :confirm => "This will promote the #{AppConfig.directory_type.downcase} to the gallery.")
end
end
end
View
6 app/models/activity.rb
@@ -98,9 +98,9 @@ def self.activity_for_projects(project, is_new, is_updated, is_deleted)
a.action_name = "updated" if is_updated
a.action_name = "deleted" if is_deleted
- a.midsentence = "a new application:" if is_new
- a.midsentence = "the application details of" if is_updated
- a.midsentence = "the application:" if is_deleted
+ a.midsentence = "a new #{AppConfig.directory_type.downcase}:" if is_new
+ a.midsentence = "the #{AppConfig.directory_type.downcase} details of" if is_updated
+ a.midsentence = "the #{AppConfig.directory_type.downcase}:" if is_deleted
a.project_name = project.title
a.project_id = project.id
View
5 app/models/project.rb
@@ -16,7 +16,7 @@ class Project < ActiveRecord::Base
validates_uniqueness_of :title, :on => :create, :message => "must be unique"
attr_accessible :title, :description, :author_name, :author_contact,
- :homepage_url, :source_url, :license, :short_description, :tag_list
+ :homepage_url, :source_url, :license, :short_description, :tag_list, :feed_url
# checkbox used to auto assign author from current_user
attr_accessor :is_creator
@@ -200,6 +200,9 @@ def prepend_urls
unless check_url(self.source_url)
self.source_url = "http://#{self.source_url}"
end
+ unless check_url(self.feed_url)
+ self.feed_url = "http://#{self.feed_url}"
+ end
unless check_url(self.author_contact)
self.author_contact = "http://#{self.author_contact}"
end
View
2  app/models/user_mailer.rb
@@ -24,7 +24,7 @@ def send_password_reset(user)
protected
def setup_email(user)
recipients "#{user.email}"
- from "Admin"
+ from AppConfig.contact_email
sent_on Time.now
end
end
View
2  app/views/bookmarks/_bookmark_list.html.haml
@@ -1,7 +1,7 @@
- projects = [] unless local_assigns[:projects]
- if projects.empty?
- %p You haven't bookmarked any applications.
+ %p== You haven't bookmarked any #{AppConfig.directory_type.downcase}s.
- else
-# list my projects
= partial "projects/parts/list", :projects => @my_projects
View
2  app/views/comments/_form.html.haml
@@ -1,5 +1,5 @@
- comment = Comment.initialize_from_user(current_or_anon_user) unless local_assigns[:comment]
-- heading = "Share your thoughts about this application:" unless local_assigns[:heading]
+- heading = "Share your thoughts about this #{AppConfig.directory_type.downcase}:" unless local_assigns[:heading]
#show_comment_link.text-right.hidden
%strong= link_to "Add Comment", "#", :class => "toggle", :rel => "#app_form", :onclick => "$j('#show_comment_link').fadeOut();"
View
4 app/views/layouts/_about_us.html.haml
@@ -1,9 +1,9 @@
- force_show = false unless local_assigns[:force_show]
#about_us{hide_unless(current_or_anon_user.show_welcome! || force_show)}
- right_box "about" do
- %h3.about About Open Source Rails
+ %h3.about About Home Chefs
%p
- Open Source Rails is a community site dedicated to tracking the best open source Ruby on Rails applications.
+ Home Chefs is a community site dedicated to tracking the best Cooking and Food blogs.
- unless force_show
= link_to "Read More...", about_url, :class => "readmore"
View
13 app/views/layouts/_footer.html.haml
@@ -7,8 +7,9 @@
= link_to "Profile", user_url(current_user)
|
= link_to "About", about_url
- |
- = link_to "Blog", blog_url
+ - if AppConfig.show_blog
+ |
+ = link_to "Blog", blog_url
- unless logged_in?
|
= link_to "Login", new_session_url
@@ -17,14 +18,14 @@
.about
.credits
- &copy; Open Source Rails
+ = "&copy; #{AppConfig.site_name}"
|
Developed by
= link_to "RailsJedi", "http://www.railsjedi.com"
+ ,
+ = link_to "nanoRAILS", "http://blog.nanorails.com"
.credits
- Logo by
- = link_to("VivaLogo", "http://www.vivalogo.com")+","
Source Code
- = link_to "Available", "http://www.github.com/jcnetdev/opensourcerails"
+ = link_to "Available", "http://www.github.com/psq/opensourcerails"
= clear
View
3  app/views/layouts/_header.html.haml
@@ -11,7 +11,8 @@
%li= menu_item(active_tab, url_for, true)
%li= menu_item("Gallery", root_url, active_tab == :gallery)
%li= menu_item("About", about_url, active_tab == :about)
- %li= menu_item("Blog", blog_url, active_tab == :blog)
+ - if AppConfig.show_blog
+ %li= menu_item("Blog", blog_url, active_tab == :blog)
- if logged_in?
%li= link_to menu_tag("Log Out"), session_url, :method => :delete, :confirm => "Are you sure you want to log out?"
View
2  app/views/layouts/_searchbox.html.haml
@@ -1,6 +1,6 @@
#search_box
- form_tag projects_url, :method => :get do
%fieldset
- = text_field_tag :q, @search_term || "", :class => "search_input example", :title => "Search for Applications..."
+ = text_field_tag :q, @search_term || "", :class => "search_input example", :title => "Search for a #{AppConfig.directory_type}..."
= image_submit_tag "find.png", :class => "search_sub find", :id => "searchsubmit"
= clear
View
17 app/views/layouts/_tracking.html.erb
@@ -1,17 +0,0 @@
-<script type="text/javascript">
-var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
-document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
-</script>
-<script type="text/javascript">
-var pageTracker = _gat._getTracker("UA-4015809-2");
-pageTracker._initData();
-pageTracker._trackPageview();
-</script>
-
-<script type="text/javascript">
-var woopra_id = '1901482583';
-</script>
-<script src="http://static.woopra.com/js/woopra.js"></script>
-
-<script src="http://www.savethedevelopers.org/say.no.to.ie.6.js"></script>
-
View
22 app/views/pages/about.html.haml
@@ -8,23 +8,23 @@
%h2.left About OpenSourceRails.com
= clear
.entry{:style => "font-size: 20px;color:#666"}
- %p Open Source Rails is dedicated to keeping track of the latest and greatest Ruby on Rails open source applications.
+ %p== #{AppConfig.about}
%p
- If you are the author of one of the projects listed on the site and want admin access over your project,
+ If you are the author of one of the site listed here and would like admin access over your site,
register a user and then email us
- = mail_to "opensourcerails@gmail.com", "here", :encode => "javascript"
+ = mail_to "#{AppConfig.contact_email}", "here", :encode => "javascript"
and we'll grant you project ownership access.
%p
- Feature request and bug can be
+ Feature requests and bugs can be
sent
- = mail_to "opensourcerails@gmail.com", "here.", :encode => "javascript"
+ = mail_to "#{AppConfig.contact_email}", "here.", :encode => "javascript"
#body_right
= partial "layouts/about_us", :force_show => true
#about_tabs
- tabs do
- tab "Credits", "credits_tab" do
- %p{:style => "margin-bottom: 0px"} Open Source Rails uses the following freely available design components.
+ %p{:style => "margin-bottom: 0px"}== #{AppConfig.site_name} uses the following freely available design components.
%ul
%li
Vector Icons by
@@ -42,7 +42,7 @@
= link_to "Nick Stakenburg", "http://www.nickstakenburg.com"
- tab "Plugins", "plugins_tab" do
- %p{:style => "margin-bottom: 0px"} Open Source Rails proudly uses and abuses the following Rails plugins:
+ %p{:style => "margin-bottom: 0px"}== #{AppConfig.site_name} proudly uses and abuses the following Rails plugins:
%ul
%li
= link_to "AttachmentFu", "http://svn.techno-weenie.net/projects/plugins/attachment_fu/"
@@ -67,10 +67,14 @@
%p Thanks!
.credits
- %h2 Developed and Hosted by:
+ %h2 Developed by:
#ads
%ul
- %li= link_to_image("yoda_dude.png", "http://www.railsjedi.com", :label => "RailsJedi")
+ %li
+ = link_to_image("yoda_dude.png", "http://www.railsjedi.com", :label => "RailsJedi")
+ = clear
+ %li
+ = link_to("nanoRAILS", "http://blog.nanorails.com")
= clear
View
12 app/views/projects/_form.html.haml
@@ -10,13 +10,17 @@
= f.error_messages
= f.text_field :title
= f.text_field :short_description
- = f.text_area :description, :label => "About this Application"
+ = f.text_area :description, :label => "About this #{AppConfig.directory_type}"
= f.text_field :tag_list, :label => "Tags (comma separated)"
- = f.text_field :license
+ - if AppConfig.show_license
+ = f.text_field :license
= f.text_field :homepage_url, :label => "Home Page URL"
- = f.text_field :source_url, :label => "Source Code URL"
+ - if AppConfig.show_feed
+ = f.text_field :feed_url, :label => "Feed URL"
+ - if AppConfig.show_source
+ = f.text_field :source_url, :label => "Source Code URL"
= f.text_field :author_name, :label => "Author's Name"
- = f.text_field :author_contact, :label => "Author's URL"
+ = f.text_field :author_contact, :label => "Author's Contact"
.actions
View
2  app/views/projects/index.atom.builder
@@ -1,5 +1,5 @@
atom_feed do |feed|
- feed.title "Open Source Rails"
+ feed.title "#{AppConfig.site_name}"
feed.updated((@projects.first.promoted_at)) unless @projects.empty?
View
4 app/views/projects/index.html.haml
@@ -9,8 +9,8 @@
#body_right
= partial "layouts/searchbox"
#submit_app
- = link_to_image "template/submit_app.gif", "#", |
- :label => "Submit a New Application", |
+ = link_to_image "#{AppConfig.submit_image}", "#", |
+ :label => "Submit a New #{AppConfig.directory_type}", |
:class => "submit toggle", :rel => "#new_project_tab_form" |
= render :partial => "projects/parts/mini_form"
View
6 app/views/projects/parts/_about_project.html.haml
@@ -30,6 +30,12 @@
= br
= link_to h(project.homepage_url), project.homepage_url
+ - unless project.feed_url.blank?
+ = br
+ %strong Feed:
+ = br
+ = link_to h(project.feed_url), project.feed_url
+
- unless project.source_url.blank?
= br
%strong Source Code:
View
2  app/views/projects/parts/_grid.html.haml
@@ -14,7 +14,7 @@
- if projects.empty?
%p.empty
- if params[:q].blank?
- = local_assigns[:empty_message] || "No applications currently exist in the gallery"
+ = local_assigns[:empty_message] || "No #{AppConfig.directory_type.downcase}s currently exist in the gallery"
= br*2
View
4 app/views/projects/parts/_mini_form.html.haml
@@ -3,9 +3,9 @@
#new_project_tab_form.hidden
- right_box "add" do
- %h3.add Submit a New Application
+ %h3.add== Submit a New #{AppConfig.directory_type}
- build_form_for project, :html => {:class => "mini-form"} do |f|
- = f.text_field :title, :label => "Application Name"
+ = f.text_field :title, :label => "#{AppConfig.directory_type} Name"
= f.text_field :short_description, :label => "Short Description"
= f.check_box :is_creator, :label => "Is it yours?", :field => {:class => "left"}, :separator => ""
View
6 app/views/projects/parts/_submit_panel.html.haml
@@ -1,9 +1,9 @@
- if local_assigns[:project]
.submit-actions.details.rounded.text-center
- %h2 This Project Has Not Yet Been Submitted
+ %h2== This #{AppConfig.directory_type} Has Not Yet Been Submitted
= link_to image_tag("big-submit-button.png"), |
submit_project_url(project), :method => :put, |
- :confirm => "This will submit the application for other people to see. Press OK to Continue." |
+ :confirm => "This will submit the #{AppConfig.directory_type.downcase} for other people to see. Press OK to Continue." |
- = delete_link image_tag("big-delete-button.png"), project_url(project), :confirm => "This will delete the application and all associated files, screenshots, and links. Press OK to Continue."
+ = delete_link image_tag("big-delete-button.png"), project_url(project), :confirm => "This will delete the #{AppConfig.directory_type.downcase} and all associated files, screenshots, and links. Press OK to Continue."
View
4 app/views/projects/parts/_tabs.html.haml
@@ -4,7 +4,7 @@
- if @upcoming.size > 0
= partial "projects/parts/list", :projects => @upcoming
- else
- %p No upcoming applications. Submit one now!
+ %p== No upcoming #{AppConfig.directory_type.downcase}s. Submit one now!
- tab "Bookmarked", "projects_add", :class => "scroll-250" do
#my_bookmarks= partial "bookmarks/bookmark_list", :projects => @my_projects
@@ -21,7 +21,7 @@
%span{:class => css_class, :title => "#{tag.count} projects"}
= display_tag(tag)
- - tab "Top Apps", "top_counts" do
+ - tab "#{AppConfig.top_kind}", "top_counts" do
.counts.first
%strong Top Downloaded
%ul
View
6 app/views/projects/show.html.haml
@@ -27,8 +27,10 @@
= partial "projects/parts/about_project", :project => @project
= partial "projects/tabs/screenshots", :object => @project.screenshots
- = partial "projects/tabs/versions", :object => @project.versions
- = partial "projects/tabs/hosted_applications", :object => @project.hosted_instances
+ - if AppConfig.show_versions
+ = partial "projects/tabs/versions", :object => @project.versions
+ - if AppConfig.show_applications
+ = partial "projects/tabs/hosted_applications", :object => @project.hosted_instances
- if @project.is_submitted?
= partial "projects/tabs/project_activity", :activities => @latest_activities
= approve_button(@project)
View
4 app/views/projects/tabs/_project_activity.html.haml
@@ -5,11 +5,11 @@
- if activities.size > 0
= partial "projects/parts/activity_list", :activities => activities[0...5], :hide_project => true
- else
- %p.empty No recent activity for this project.
+ %p.empty== No recent activity for this #{AppConfig.directory_type.downcase}.
- tab("History (#{activities.size})", "all_activity") do
- if activities.size > 0
= partial "projects/parts/activity_list", :activities => activities.reverse, :hide_project => true
- else
- %p.empty No recent activity for this project.
+ %p.empty== No recent activity for this #{AppConfig.directory_type.downcase}.
View
2  app/views/user_mailer/signup_notification.html.erb
@@ -1,4 +1,4 @@
-Welcome to Open Source Rails. Here is your login information.
+Welcome to <%= AppConfig.site_name %>. Here is your login information.
Username: <%= @user.login %>
Password: <%= @user.password %>
View
2  app/views/users/show.html.haml
@@ -6,7 +6,7 @@
#left_pad
= partial "projects/parts/grid", :projects => @bookmarked_projects, |
:grid_title => pluralize(@bookmarked_projects.size, "Bookmarked Project"), |
- :empty_message => "No applications have been bookmarked yet." |
+ :empty_message => "No #{AppConfig.directory_type.downcase}s have been bookmarked yet." |
= clear
View
2  app/views/versions/_version.html.haml
@@ -21,5 +21,5 @@
= link_to "delete", project_version_url(version.project, version), :method => :delete, :confirm => "Are you sure you want to delete this version?"
- unless version.is_default?
|
- = link_to "set as default", set_project_version_url(version.project, version), :method => :put, :confirm => "Are you sure you want to set this version as the default download for this application?"
+ = link_to "set as default", set_project_version_url(version.project, version), :method => :put, :confirm => "Are you sure you want to set this version as the default download for this #{AppConfig.directory_type.downcase}?"
View
31 config/app_config.yml
@@ -1,31 +0,0 @@
-# Set Site Details
-site_name: "Open Source Rails"
-site_url: "http://www.opensourcerails.com"
-version: "v1.0"
-require_email_activation: true
-
-blog_url: http://blog.opensourcerails.com
-
-file_storage: s3
-
-# SEO Stuff
-default_meta_keywords: "open source ruby on rails"
-default_meta_description: "Open Source Rails is a community site dedicated to tracking the best open source Ruby on Rails applications."
-
-# Paging Sizes
-projects_per_page: 6
-
-# Set Avatar Sizes
-screenshot_sizes:
- medium: "225x225#"
- thumb: "70x70#"
-
-# Set default avatar
-screenshot_default: "/images/default_screenshots/:style.png"
-
-spam_question: What is 3 plus 2?
-spam_answer:
- - "5"
- - "five"
-
-show_morph: false
View
54 config/database.yml
@@ -1,54 +0,0 @@
-# MySQL (default setup). Versions 4.1 and 5.0 are recommended.
-#
-# Install the MySQL driver:
-# gem install mysql
-# On Mac OS X:
-# sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
-# On Mac OS X Leopard:
-# sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
-# This sets the ARCHFLAGS environment variable to your native architecture
-# On Windows:
-# gem install mysql
-# Choose the win32 build.
-# Install MySQL and put its /bin directory on your path.
-#
-# And be sure to use new-style password hashing:
-# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
-development:
- adapter: mysql
- encoding: utf8
- database: opensrcrails_development
- username: root
- password:
- host: localhost
-
-blog_development:
- adapter: mysql
- encoding: utf8
- database: opensourcerails_blog
- username: root
- password: root
- host: localhost
- socket: /Applications/MAMP/tmp/mysql/mysql.sock
-
-# Warning: The database defined as 'test' will be erased and
-# re-generated from your development database when you run 'rake'.
-# Do not set this db to the same as development or production.
-test:
- adapter: mysql
- encoding: utf8
- database: opensrcrails_test
- username: root
- password:
- host: localhost
-
-production:
- adapter: mysql
- encoding: utf8
- database: opensrcrails_production
- username: root
- password:
- host: localhost
-
-
-
View
96 config/deploy.rb
@@ -1,16 +1,16 @@
# ------------
# APP SPECIFIC SETTINGS
# ------------
-set :application, "opensrcrails"
-set :repository, "git@github.com:jcnetdev/opensourcerails.git"
-set :server_name, "www.opensourcerails.com"
+set :application, "home-chefs.com"
+set :repository, "git@github.com:psq/opensourcerails.git"
+set :server_name, "www.home-chefs.com"
set :scm, "git"
set :checkout, "export"
set :deploy_via, :remote_cache
-set :base_path, "/var/www"
-set :deploy_to, "/var/www/production/#{application}"
+set :base_path, "/home/psq"
+set :deploy_to, "/home/psq/#{application}"
set :apache_site_folder, "/etc/apache2/sites-enabled"
set :keep_releases, 3
@@ -26,7 +26,7 @@
role :app, server_name
role :db, server_name, :primary => true
-set :use_sudo, true
+set :use_sudo, false
# saves space by only keeping last 3 when running cleanup
set :keep_releases, 3
@@ -59,36 +59,39 @@
restart
end
- desc "restart apache"
- task :restart_apache do
- sudo "/etc/init.d/apache2 stop"
- sudo "/etc/init.d/apache2 start"
- end
-
- desc "start apache cluster"
- task :start_apache do
- sudo "/etc/init.d/apache2 start"
- end
-
- desc "stop apache cluster"
- task :stop_apache do
- sudo "/etc/init.d/apache2 stop"
- end
+ # desc "restart apache"
+ # task :restart_apache do
+ # sudo "/etc/init.d/apache2 stop"
+ # sudo "/etc/init.d/apache2 start"
+ # end
+ #
+ # desc "start apache cluster"
+ # task :start_apache do
+ # sudo "/etc/init.d/apache2 start"
+ # end
+ #
+ # desc "stop apache cluster"
+ # task :stop_apache do
+ # sudo "/etc/init.d/apache2 stop"
+ # end
end
before "deploy:restart", "admin:migrate"
+
after "deploy", "live:send_request"
-after "deploy:setup", "init:set_permissions"
-after "deploy:setup", "init:database_yml"
-after "deploy:setup", "init:create_database"
-after "deploy:setup", "init:create_vhost"
-after "deploy:setup", "init:enable_site"
+# after "deploy:setup", "init:set_permissions"
+after "deploy:setup", "init:create_shared"
+# after "deploy:setup", "init:upload_config"
+# after "deploy:setup", "init:database_yml"
+# after "deploy:setup", "init:create_database"
+# after "deploy:setup", "init:create_vhost"
+# after "deploy:setup", "init:enable_site"
namespace :init do
desc "setting proper permissions for deploy user"
task :set_permissions do
- sudo "chown -R deploy /var/www/production"
+ # sudo "chown -R deploy /var/www/production"
end
desc "create mysql db"
@@ -101,11 +104,23 @@
desc "enable site"
task :enable_site do
- sudo "ln -nsf #{shared_path}/config/apache_site.conf #{apache_site_folder}/#{application}"
-
+ # sudo "ln -nsf #{shared_path}/config/apache_site.conf #{apache_site_folder}/#{application}"
end
-
-
+
+ desc "create shared"
+ task :create_shared do
+ run "mkdir -p #{shared_path}/config"
+ run "echo place logo, tracking, database.yml and app_config.yml to #{shared_path}/config"
+ end
+
+ desc "upload config files"
+ task :upload_config do
+ upload("../#{application}/database.yml", "#{shared_path}/config/", :via => :scp)
+ upload("../#{application}/app_config.yml", "#{shared_path}/config/", :via => :scp)
+ upload("../#{application}/logo-hc.png", "#{shared_path}/config/", :via => :scp)
+ upload("../#{application}/_tracking.html.erb", "#{shared_path}/config/", :via => :scp)
+ end
+
desc "create database.yml"
task :database_yml do
set :db_user, Capistrano::CLI.ui.ask("database user: ")
@@ -122,7 +137,6 @@
production:
<<: *login
)
- run "mkdir -p #{shared_path}/config"
put database_configuration, "#{shared_path}/config/database.yml"
end
@@ -149,15 +163,21 @@
namespace :localize do
desc "copy shared configurations to current"
task :copy_shared_configurations, :roles => [:app] do
- %w[database.yml].each do |f|
+ %w[database.yml app_config.yml].each do |f|
run "ln -nsf #{shared_path}/config/#{f} #{release_path}/config/#{f}"
end
+ %w[logo-hc.png].each do |f|
+ run "ln -nsf #{shared_path}/config/#{f} #{release_path}/public/images/#{f}"
+ end
+ %w[_tracking.html.erb].each do |f|
+ run "ln -nsf #{shared_path}/config/#{f} #{release_path}/app/views/layout/#{f}"
+ end
end
desc "installs / upgrades gem dependencies "
task :install_gems, :roles => [:app] do
- sudo "date" # fuck you capistrano
- run "cd #{release_path} && sudo rake RAILS_ENV=production gems:install"
+ # sudo "date" # fuck you capistrano
+ # run "cd #{release_path} && sudo rake RAILS_ENV=production gems:install"
end
task :upload_folders, :roles => [:app] do
@@ -238,11 +258,11 @@
end
task :migrate do
- run "cd #{current_path} && sudo rake RAILS_ENV=production db:migrate"
+ run "cd #{current_path} && rake RAILS_ENV=production db:migrate"
end
task :remote_rake do
rake_command = Capistrano::CLI.ui.ask "Rake Command to run: "
- run "cd #{current_path} && sudo rake RAILS_ENV=production #{rake_command}"
+ run "cd #{current_path} && rake RAILS_ENV=production #{rake_command}"
end
-end
+end
View
13 config/environment.rb
@@ -136,12 +136,15 @@
# Allows easier subdomain selection
# ------
# config.github_gem 'jcnetdev-subdomain-fu', :version => '>= 0.0.2'
-
+
+ config.after_initialize do
+ if defined? ExceptionNotifier
+ ExceptionNotifier.exception_recipients = AppConfig.contact_email
+ ExceptionNotifier.delivery_method = :smtp
+ end
+ end
+
end
ActionMailer::Base.delivery_method = :smtp
-if defined? ExceptionNotifier
- ExceptionNotifier.exception_recipients = %w(opensourcerails@gmail.com)
- ExceptionNotifier.delivery_method = :smtp
-end
View
1  config/environments/production.yml
@@ -1,2 +1 @@
-rss_url: "http://feeds.feedburner.com/OpenSourceRails"
force_all_css: true
View
9 db/migrate/20080806062958_add_feed.rb
@@ -0,0 +1,9 @@
+class AddFeed < ActiveRecord::Migration
+ def self.up
+ add_column "projects", "feed_url", :string
+ end
+
+ def self.down
+ remove_column "projects", "feed_url"
+ end
+end
View
3  db/schema.rb
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20080728120230) do
+ActiveRecord::Schema.define(:version => 20080806062958) do
create_table "activities", :force => true do |t|
t.datetime "created_at"
@@ -96,6 +96,7 @@
t.integer "screenshots_count", :limit => 11, :default => 0
t.integer "instructions_count", :limit => 11, :default => 0
t.datetime "last_changed"
+ t.string "feed_url"
end
create_table "ratings", :force => true do |t|
View
BIN  public/images/big-approve-button-blank.psd
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/big-approve-button.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/big-approve-button.psd
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/big-delete-button.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/big-delete-button.psd
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/big-submit-button.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/big-submit-button.psd
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/template/submit_app.psd
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  public/images/template/submit_site.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2  public/stylesheets/sass/v2/parts/header.sass
@@ -18,7 +18,7 @@
margin-left: 15px
span
- background: url(/images/template/logo.png) no-repeat
+ background: url(/images/template/logo-hc.png) no-repeat
position: absolute
width: 100%
height: 100%
View
2  public/stylesheets/template/style.css
@@ -86,7 +86,7 @@ body{
}
#logo span{
- background: url(/images/template/logo.png) no-repeat;
+/* background: url(/images/template/logo.png) no-repeat;*/
position: absolute;
width: 100%;
height: 100%;
Please sign in to comment.
Something went wrong with that request. Please try again.