minor style fixes, prepared environment variables for deploy on heroku

This commit is contained in:
Thomas Buchöster
2011-07-02 16:49:00 +02:00
committed by Thomas Buchöster
parent 495b6822f1
commit e0226b4cc0
11 changed files with 20 additions and 14 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ GEM
faraday (0.6.1) faraday (0.6.1)
addressable (~> 2.2.4) addressable (~> 2.2.4)
multipart-post (~> 1.1.0) multipart-post (~> 1.1.0)
rack (>= 1.1.0, < 2) rack (< 2, >= 1.1.0)
gem_plugin (0.2.3) gem_plugin (0.2.3)
haml (3.1.2) haml (3.1.2)
haml-rails (0.3.4) haml-rails (0.3.4)
+1 -1
View File
@@ -10,7 +10,7 @@
%li="#{user.playlist.count} Playlists" %li="#{user.playlist.count} Playlists"
.tabs.tabs_js.w02 .tabs.tabs_js.w02
%ul.nav %ul.nav
%li profile %li favourite artists
- if user == current_user - if user == current_user
%li settings %li settings
.content .content
-1
View File
@@ -5,7 +5,6 @@ Bundler.require(:default, Rails.env) if defined?(Bundler)
module Nineminutes module Nineminutes
class Application < Rails::Application class Application < Rails::Application
config.autoload_paths += %W(#{config.root}/lib)
# enable caching in development mode # enable caching in development mode
config.action_controller.perform_caching = true config.action_controller.perform_caching = true
+4 -1
View File
@@ -1 +1,4 @@
APP_CONFIG = HashWithIndifferentAccess.new(YAML.load(File.open(File.join(Rails.root, 'config', 'config.yml')))) APP_CONFIG = HashWithIndifferentAccess.new(YAML.load(File.open(File.join(Rails.root, 'config', 'config.yml'))))
APP_CONFIG.each do |key, value|
ENV[key] = value
end
+5 -6
View File
@@ -184,14 +184,13 @@ Devise.setup do |config|
# config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo' # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
# Facebook-Setting for Heroku # Facebook-Setting for Heroku
# config.omniauth :facebook, 'APP_ID', 'APP_SECRET', if Rails.env =~ /production/
# {:scope => 'email, offline_access', :client_options => {:ssl => {:ca_file => '/usr/lib/ssl/certs/ca-certificates.crt'}}} config.omniauth :facebook, ENV['facebook']['app_id'], ENV['facebook']['secret']
{:scope => 'email, offline_access', :client_options => {:ssl => {:ca_file => '/usr/lib/ssl/certs/ca-certificates.crt'}}}
if Rails.env =~ /development/
config.omniauth :facebook, APP_CONFIG['facebook']['app_id'], APP_CONFIG['facebook']['secret']
else else
config.omniauth :facebook, 'APP_ID', 'APP_SECRET' config.omniauth :facebook, ENV['facebook']['app_id'], ENV['facebook']['secret']
end end
config.omniauth :open_id, OpenID::Store::Filesystem.new('/tmp') config.omniauth :open_id, OpenID::Store::Filesystem.new('/tmp')
# config.omniauth :google_apps, OpenID::Store::Filesystem.new('/tmp'), :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id' # config.omniauth :google_apps, OpenID::Store::Filesystem.new('/tmp'), :name => 'google', :identifier => 'https://www.google.com/accounts/o8/id'
# config.omniauth :twitter, 'CONSUMER_KEY', 'CONSUMER_SECRET' # config.omniauth :twitter, 'CONSUMER_KEY', 'CONSUMER_SECRET'
+1 -1
View File
@@ -1,3 +1,3 @@
ActionDispatch::Callbacks.to_prepare do ActionDispatch::Callbacks.to_prepare do
LastFM::Request::api_key = APP_CONFIG['lastfm_api_key'] LastFM::Request::api_key = ENV['lastfm_api_key']
end end
+1 -1
View File
@@ -1,3 +1,3 @@
output_style = RAILS_ENV == "production" ? :compressed : :nested output_style = ::Rails.env == "production" ? :compressed : :nested
Sass::Plugin.options[:style] = output_style Sass::Plugin.options[:style] = output_style
+1 -1
View File
@@ -4,4 +4,4 @@
# If you change this key, all old signed cookies will become invalid! # If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random, # Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks. # no regular words or you'll be exposed to dictionary attacks.
Nineminutes::Application.config.secret_token = APP_CONFIG['secret_token'] Nineminutes::Application.config.secret_token = ENV['secret_token']
+1 -1
View File
@@ -67,7 +67,7 @@ module LastFM
private private
def self.create_and_queue_request method, node, block, request_params def self.create_and_queue_request method, node, block, request_params
request = Typhoeus::Request.new(base_uri, :params => request_params) # :timeout => APP_CONFIG["request_timeout"], request = Typhoeus::Request.new(base_uri, :params => request_params) # :timeout => ENV["request_timeout"],
handle_response request, method, node, block handle_response request, method, node, block
puts "=> lastfm: '#{current_class_name}.#{method}' request is queued" if @@hydra.queue request puts "=> lastfm: '#{current_class_name}.#{method}' request is queued" if @@hydra.queue request
+1
View File
@@ -8,6 +8,7 @@ var charts_path = "/charts";
var search_path = "/search/"; var search_path = "/search/";
var search_autocomplete_path = "/autocomplete/"; var search_autocomplete_path = "/autocomplete/";
var user_path = "/users/"; var user_path = "/users/";
var profile_path = "/profile";
var register_path = "/register"; var register_path = "/register";
var login_path = "/login"; var login_path = "/login";
var logout_path = "/logout"; var logout_path = "/logout";
+4
View File
@@ -134,6 +134,9 @@ function init_site(link){
set_active_navigation(charts_path); set_active_navigation(charts_path);
break; break;
case user_path: case user_path:
init_tabs();
set_active_navigation(profile_path);
break;
case register_path: case register_path:
init_tabs(); init_tabs();
set_active_navigation(register_path); set_active_navigation(register_path);
@@ -141,6 +144,7 @@ function init_site(link){
case login_path: case login_path:
init_tabs(); init_tabs();
set_active_navigation(home_path); set_active_navigation(home_path);
break;
} }
} }