From 22d58885ad50b6640a2ee862c365d3671e5e6a2f Mon Sep 17 00:00:00 2001 From: Ricky Barrette Date: Mon, 21 Jan 2013 12:52:03 -0500 Subject: [PATCH 1/4] Removed unneeded locale info fixed default time --- config/locales/en.yml | 208 +----------------------------------------- 1 file changed, 3 insertions(+), 205 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index 8d9d2b1..96edd01 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,210 +1,8 @@ en: - date: - abbr_day_names: - - Sun - - Mon - - Tue - - Wed - - Thu - - Fri - - Sat - abbr_month_names: - - - - Jan - - Feb - - Mar - - Apr - - May - - Jun - - Jul - - Aug - - Sep - - Oct - - Nov - - Dec - day_names: - - Sunday - - Monday - - Tuesday - - Wednesday - - Thursday - - Friday - - Saturday - formats: - default: ! '%Y-%m-%d' - long: ! '%B %d, %Y' - short: ! '%b %d' - month_names: - - - - January - - February - - March - - April - - May - - June - - July - - August - - September - - October - - November - - December - order: - - :year - - :month - - :day - datetime: - distance_in_words: - about_x_hours: - one: about 1 hour - other: about %{count} hours - about_x_months: - one: about 1 month - other: about %{count} months - about_x_years: - one: about 1 year - other: about %{count} years - almost_x_years: - one: almost 1 year - other: almost %{count} years - half_a_minute: half a minute - less_than_x_minutes: - one: less than a minute - other: less than %{count} minutes - less_than_x_seconds: - one: less than 1 second - other: less than %{count} seconds - over_x_years: - one: over 1 year - other: over %{count} years - x_days: - one: 1 day - other: ! '%{count} days' - x_minutes: - one: 1 minute - other: ! '%{count} minutes' - x_months: - one: 1 month - other: ! '%{count} months' - x_seconds: - one: 1 second - other: ! '%{count} seconds' - prompts: - day: Day - hour: Hour - minute: Minute - month: Month - second: Seconds - year: Year - errors: &errors - format: ! '%{attribute} %{message}' - messages: - accepted: must be accepted - blank: can't be blank - confirmation: doesn't match confirmation - empty: can't be empty - equal_to: must be equal to %{count} - even: must be even - exclusion: is reserved - greater_than: must be greater than %{count} - greater_than_or_equal_to: must be greater than or equal to %{count} - inclusion: is not included in the list - invalid: is invalid - less_than: must be less than %{count} - less_than_or_equal_to: must be less than or equal to %{count} - not_a_number: is not a number - not_an_integer: must be an integer - odd: must be odd - record_invalid: ! 'Validation failed: %{errors}' - taken: has already been taken - too_long: - one: is too long (maximum is 1 character) - other: is too long (maximum is %{count} characters) - too_short: - one: is too short (minimum is 1 character) - other: is too short (minimum is %{count} characters) - wrong_length: - one: is the wrong length (should be 1 character) - other: is the wrong length (should be %{count} characters) - template: - body: ! 'There were problems with the following fields:' - header: - one: 1 error prohibited this %{model} from being saved - other: ! '%{count} errors prohibited this %{model} from being saved' - helpers: - select: - prompt: Please select - submit: - create: Create %{model} - submit: Save %{model} - update: Update %{model} - number: - currency: - format: - delimiter: ! ',' - format: ! '%u%n' - precision: 2 - separator: . - significant: false - strip_insignificant_zeros: false - unit: $ - format: - delimiter: ! ',' - precision: 3 - separator: . - significant: false - strip_insignificant_zeros: false - human: - decimal_units: - format: ! '%n %u' - units: - billion: Billion - million: Million - quadrillion: Quadrillion - thousand: Thousand - trillion: Trillion - unit: '' - format: - delimiter: '' - precision: 3 - significant: true - strip_insignificant_zeros: true - storage_units: - format: ! '%n %u' - units: - byte: - one: Byte - other: Bytes - gb: GB - kb: KB - mb: MB - tb: TB - percentage: - format: - delimiter: '' - precision: - format: - delimiter: '' - support: - array: - last_word_connector: ! ', and ' - two_words_connector: ! ' and ' - words_connector: ! ', ' - time: - am: am - formats: - default: ! '%a, %d %b %Y %H:%M:%S %z' - long: ! '%B %d, %Y %H:%M' - short: ! '%d %b %H:%M' - pm: pm - # remove these aliases after 'activemodel' and 'activerecord' namespaces are removed from Rails repository - # activemodel: - # errors: - # <<: *errors - # activerecord: - # errors: - # <<: *errors - name: "Forum" description: "A place to discuss things" welcome_header: "Welcome to Forum" welcome_msg: "A place to discuss things" + time: + formats: + default: ! '%b %d %Y' From 8468c6cfb5fd9dd8f22df0e30c9a0509e78f0da8 Mon Sep 17 00:00:00 2001 From: Ricky Barrette Date: Mon, 21 Jan 2013 12:53:05 -0500 Subject: [PATCH 2/4] updated .gitignore --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index eb3489a..fd382f8 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,8 @@ # Ignore all logfiles and tempfiles. /log/*.log /tmp + +.buildpath +.project +.sass-cache/ +public/assets/ From 40ff30c822ce1217303552f198d76def617203b3 Mon Sep 17 00:00:00 2001 From: Ricky Barrette Date: Mon, 21 Jan 2013 12:55:44 -0500 Subject: [PATCH 3/4] WIP working on serving js in production --- app/views/layouts/application.html.erb | 4 ++-- config/application.rb | 4 +++- config/environments/production.rb | 9 ++++++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 8ce95f0..af65846 100755 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -2,9 +2,9 @@ <%= content_for?(:title) ? yield(:title) : (t :name) %> - <%= stylesheet_link_tag "application", "forum-monster" %> + <%= stylesheet_link_tag :application %> <%= csrf_meta_tag %> - <%= javascript_include_tag(:application) %> + <%= javascript_include_tag :application %> <%= yield(:head) %> diff --git a/config/application.rb b/config/application.rb index 405caba..fbe473e 100644 --- a/config/application.rb +++ b/config/application.rb @@ -59,6 +59,8 @@ module Community # Version of your assets, change this if you want to expire all your assets config.assets.version = '1.0' - config.assets.precompile += ['*.css', '*.js'] + config.assets.initialize_on_precompile = false + + config.assets.precompile += %w('*.css', '*.js') end end diff --git a/config/environments/production.rb b/config/environments/production.rb index 6148edc..f126d8a 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -14,17 +14,24 @@ Community::Application.configure do # Compress JavaScripts and CSS config.assets.compress = true + # Choose the compressors to use + config.assets.js_compressor = :uglifier + # config.assets.css_compressor = :yui + # Don't fallback to assets pipeline if a precompiled asset is missed config.assets.compile = false # Generate digests for assets URLs config.assets.digest = true + # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) + # config.assets.precompile += %w( ) + # Defaults to nil and saved in location specified by config.assets.prefix # config.assets.manifest = YOUR_PATH # Specifies the header that your server uses for sending files - # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache + config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. From b83721ed5668c57bad45e49eddaa2c120363fe97 Mon Sep 17 00:00:00 2001 From: Ricky Barrette Date: Mon, 21 Jan 2013 17:30:55 -0500 Subject: [PATCH 4/4] Changed development database to sqlite3 --- Gemfile | 4 ++++ Gemfile.lock | 4 +++- config/database.yml | 21 ++++++++++----------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Gemfile b/Gemfile index 86144a2..55cfd13 100644 --- a/Gemfile +++ b/Gemfile @@ -28,6 +28,10 @@ group :production do gem 'unicorn' end +group :development do + gem 'sqlite3' +end + # To use ActiveModel has_secure_password # gem 'bcrypt-ruby', '~> 3.0.0' diff --git a/Gemfile.lock b/Gemfile.lock index 44c0403..6268e86 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -59,7 +59,7 @@ GEM i18n (0.6.1) journey (1.0.4) json (1.7.6) - kgio (2.7.4) + kgio (2.8.0) mail (2.4.4) i18n (>= 0.4.0) mime-types (~> 1.16) @@ -105,6 +105,7 @@ GEM multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) + sqlite3 (1.3.7) thor (0.16.0) tilt (1.3.3) treetop (1.4.12) @@ -135,5 +136,6 @@ DEPENDENCIES mysql2 rails (= 3.2.11) sass-rails (~> 3.2.3) + sqlite3 uglifier (>= 1.0.3) unicorn diff --git a/config/database.yml b/config/database.yml index 3b395ff..2004b66 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,20 +1,19 @@ +# SQLite version 3.x +# gem install sqlite:w3 development: - adapter: mysql2 - database: forum/dev - host: localhost - username: forum - password: forum + adapter: sqlite3 + database: db/development.sqlite3 + pool: 5 + timeout: 5000 # 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: mysql2 - database: forum/test - host: localhost - username: forum - password: forum - + adapter: sqlite3 + database: db/test.sqlite3 + pool: 5 + timeout: 5000 production: adapter: mysql2 database: forum