diff --git a/Gemfile b/Gemfile index a0c33b2..8c26c78 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rails', '4.0.4' +gem 'rails', '4.1.0' # Use sqlite3 as the database for Active Record gem 'sqlite3' @@ -54,20 +54,21 @@ gem 'colorpicker', '~> 0.0.5' # Memcached gem "dalli", "~> 2.7.0" -group :doc do - # bundle exec rake doc:rails generates the API under doc/api. - gem 'sdoc', require: false -end +# bundle exec rake doc:rails generates the API under doc/api. +gem 'sdoc', require: false + +# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring +gem 'spring', group: :development group :test do # Easier test writing - gem "shoulda-matchers" + gem "shoulda-matchers", require: false # not requiring is necessary to avoid warnings from minitest 5, with version 2.6 this might get fixed # Test coverage - gem 'simplecov', :require => false + gem 'simplecov', require: false # Simple Mocks - gem 'mocha', :require => 'mocha/api' + gem 'mocha', require: 'mocha/api' end group :development, :test do @@ -107,8 +108,5 @@ end # Use unicorn as the app server # gem 'unicorn' -# Use Capistrano for deployment -# gem 'capistrano', group: :development - # Use debugger # gem 'debugger', group: [:development, :test] diff --git a/Gemfile.lock b/Gemfile.lock index 9afcfe2..2f111ee 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,38 +1,40 @@ GEM remote: https://rubygems.org/ specs: - actionmailer (4.0.4) - actionpack (= 4.0.4) + actionmailer (4.1.0) + actionpack (= 4.1.0) + actionview (= 4.1.0) mail (~> 2.5.4) - actionpack (4.0.4) - activesupport (= 4.0.4) - builder (~> 3.1.0) - erubis (~> 2.7.0) + actionpack (4.1.0) + actionview (= 4.1.0) + activesupport (= 4.1.0) rack (~> 1.5.2) rack-test (~> 0.6.2) - activemodel (4.0.4) - activesupport (= 4.0.4) - builder (~> 3.1.0) - activerecord (4.0.4) - activemodel (= 4.0.4) - activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.4) - arel (~> 4.0.0) - activerecord-deprecated_finders (1.0.3) - activesupport (4.0.4) + actionview (4.1.0) + activesupport (= 4.1.0) + builder (~> 3.1) + erubis (~> 2.7.0) + activemodel (4.1.0) + activesupport (= 4.1.0) + builder (~> 3.1) + activerecord (4.1.0) + activemodel (= 4.1.0) + activesupport (= 4.1.0) + arel (~> 5.0.0) + activesupport (4.1.0) i18n (~> 0.6, >= 0.6.9) - minitest (~> 4.2) - multi_json (~> 1.3) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) thread_safe (~> 0.1) - tzinfo (~> 0.3.37) - arel (4.0.2) + tzinfo (~> 1.1) + arel (5.0.0) bcrypt (3.1.7) better_errors (1.1.0) coderay (>= 1.0.0) erubis (>= 2.6.6) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) - builder (3.1.4) + builder (3.2.2) capistrano (3.1.0) i18n rake (>= 10.0.0) @@ -133,7 +135,7 @@ GEM metaclass (0.0.4) mime-types (1.25.1) mini_portile (0.5.3) - minitest (4.7.5) + minitest (5.3.2) mocha (1.0.0) metaclass (~> 0.0.1) modernizr-rails (2.7.1) @@ -156,17 +158,19 @@ GEM rack (1.5.2) rack-test (0.6.2) rack (>= 1.0) - rails (4.0.4) - actionmailer (= 4.0.4) - actionpack (= 4.0.4) - activerecord (= 4.0.4) - activesupport (= 4.0.4) + rails (4.1.0) + actionmailer (= 4.1.0) + actionpack (= 4.1.0) + actionview (= 4.1.0) + activemodel (= 4.1.0) + activerecord (= 4.1.0) + activesupport (= 4.1.0) bundler (>= 1.3.0, < 2.0) - railties (= 4.0.4) - sprockets-rails (~> 2.0.0) - railties (4.0.4) - actionpack (= 4.0.4) - activesupport (= 4.0.4) + railties (= 4.1.0) + sprockets-rails (~> 2.0) + railties (4.1.0) + actionpack (= 4.1.0) + activesupport (= 4.1.0) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) rake (10.3.1) @@ -203,12 +207,13 @@ GEM multi_json simplecov-html (~> 0.8.0) simplecov-html (0.8.0) + spring (1.1.2) sprockets (2.11.0) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sprockets-rails (2.0.1) + sprockets-rails (2.1.1) actionpack (>= 3.0) activesupport (>= 3.0) sprockets (~> 2.8) @@ -236,8 +241,8 @@ GEM execjs rails (>= 3.1) railties (>= 3.1) - tzinfo (0.3.39) - uglifier (2.5.0) + tzinfo (1.1.0) + thread_safe (~> 0.1) execjs (>= 0.3.0) json (>= 1.8.0) warden (1.2.3) @@ -274,12 +279,13 @@ DEPENDENCIES modernizr-rails pg (~> 0.17.0) poltergeist (~> 1.5.0) - rails (= 4.0.4) + rails (= 4.1.0) rspec-rails sass-rails (~> 4.0.1) sdoc shoulda-matchers simplecov + spring sqlite3 therubyracer turbolinks diff --git a/Rakefile b/Rakefile index d3193b6..ba6b733 100644 --- a/Rakefile +++ b/Rakefile @@ -3,4 +3,4 @@ require File.expand_path('../config/application', __FILE__) -Mezuro::Application.load_tasks +Rails.application.load_tasks diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 0051445..d7bfd39 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -5,13 +5,15 @@ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. * - * You're free to add application-wide styles to this file and they'll appear at the top of the - * compiled file, but it's generally better to create a new file per style scope. + * You're free to add application-wide styles to this file and they'll appear at the bottom of the + * compiled file so the styles you add here take precedence over styles defined in any styles + * defined in the other CSS/SCSS files in this directory. It is generally better to create a new + * file per style scope. * *= boilerplate/main.css *= boilerplate/normalize.css *= require jquery.ui.all - *= require_self - *= require_tree . *= require colorpicker + *= require_tree . + *= require_self */ diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index fde816d..7b00a15 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -16,7 +16,7 @@ - <%= stylesheet_link_tag "application", :media => "all" %> + <%= stylesheet_link_tag 'application', :media => 'all' %> @@ -101,8 +101,8 @@ diff --git a/bin/rails b/bin/rails index 728cd85..7feb6a3 100755 --- a/bin/rails +++ b/bin/rails @@ -1,4 +1,8 @@ #!/usr/bin/env ruby +begin + load File.expand_path("../spring", __FILE__) +rescue LoadError +end APP_PATH = File.expand_path('../../config/application', __FILE__) require_relative '../config/boot' require 'rails/commands' diff --git a/bin/rake b/bin/rake index 1724048..8017a02 100755 --- a/bin/rake +++ b/bin/rake @@ -1,4 +1,8 @@ #!/usr/bin/env ruby +begin + load File.expand_path("../spring", __FILE__) +rescue LoadError +end require_relative '../config/boot' require 'rake' Rake.application.run diff --git a/bin/spring b/bin/spring new file mode 100755 index 0000000..253ec37 --- /dev/null +++ b/bin/spring @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby + +# This file loads spring without using Bundler, in order to be fast +# It gets overwritten when you run the `spring binstub` command + +unless defined?(Spring) + require "rubygems" + require "bundler" + + if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m) + ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR) + ENV["GEM_HOME"] = "" + Gem.paths = ENV + + gem "spring", match[1] + require "spring/binstub" + end +end diff --git a/config/application.rb b/config/application.rb index 706eb50..84d90b4 100644 --- a/config/application.rb +++ b/config/application.rb @@ -4,7 +4,7 @@ require 'rails/all' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. -Bundler.require(:default, Rails.env) +Bundler.require(*Rails.groups) module Mezuro class Application < Rails::Application diff --git a/config/boot.rb b/config/boot.rb index 3596736..5e5f0c1 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,4 +1,4 @@ # Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) +require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE']) diff --git a/config/environment.rb b/config/environment.rb index 183d3ce..31a8b9e 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -2,4 +2,4 @@ require File.expand_path('../application', __FILE__) # Initialize the Rails application -Mezuro::Application.initialize! +Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb index cc7ead5..2423382 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,4 +1,4 @@ -Mezuro::Application.configure do +Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb # In the development environment your application's code is reloaded on @@ -19,7 +19,7 @@ Mezuro::Application.configure do # Print deprecation notices to the Rails logger config.active_support.deprecation = :log - # Raise an error on page load if there are pending migrations + # Raise an error on page load if there are pending migrations config.active_record.migration_error = :page_load # Debug mode disables concatenation and preprocessing of assets. @@ -32,4 +32,12 @@ Mezuro::Application.configure do # Enables page caching config.action_controller.perform_caching = true + + # Adds additional error checking when serving assets at runtime. + # Checks for improperly declared sprockets dependencies. + # Raises helpful error messages. + config.assets.raise_runtime_errors = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true end diff --git a/config/environments/production.rb b/config/environments/production.rb index ed29f80..758ad6a 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,4 +1,4 @@ -Mezuro::Application.configure do +Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. @@ -66,7 +66,7 @@ Mezuro::Application.configure do # config.action_mailer.raise_delivery_errors = false # Enable locale fallbacks for I18n (makes lookups for any locale fall back to - # the I18n.default_locale when a translation can not be found). + # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true # Send deprecation notices to registered listeners. @@ -81,6 +81,9 @@ Mezuro::Application.configure do # Root URL for ActionMailer config.action_mailer.default_url_options = { :host => 'mezuro.org' } + # Do not dump schema after migrations. + config.active_record.dump_schema_after_migration = false + # Kalibro URL KalibroGatekeeperClient.configure_with(Rails.root.join('config', 'kalibro_gatekeeper.yml')) end diff --git a/config/environments/test.rb b/config/environments/test.rb index e9fa214..fc32096 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,4 +1,4 @@ -Mezuro::Application.configure do +Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb # The test environment is used exclusively to run your application's @@ -39,4 +39,7 @@ Mezuro::Application.configure do # Enables page caching config.action_controller.perform_caching = true + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true end diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb new file mode 100644 index 0000000..7f70458 --- /dev/null +++ b/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.action_dispatch.cookies_serializer = :json diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb deleted file mode 100644 index cfbfbd1..0000000 --- a/config/initializers/secret_token.rb +++ /dev/null @@ -1,12 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key is used for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -# You can use `rake secret` to generate a secure secret key. - -# Make sure your secret_key_base is kept private -# if you're sharing your code publicly. -Mezuro::Application.config.secret_key_base = '911af0f72528665828e90df909cbb42098b26a622cdc41456f89020a89c861b8f7b8c4c94924e2c791e5be6c8996453fd8ea99ab5b6c054a292b735518ef9e17' diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index 4332651..0cb6f5f 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,3 +1,3 @@ # Be sure to restart your server when you modify this file. -Mezuro::Application.config.session_store :cookie_store, key: '_mezuro_session' +Rails.application.config.session_store :cookie_store, key: '_mezuro_session' diff --git a/config/routes.rb b/config/routes.rb index 8d6ac86..34b4b89 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,4 @@ -Mezuro::Application.routes.draw do +Rails.application.routes.draw do devise_for :users get 'users/:user_id/projects' => 'users#projects', as: :user_projects diff --git a/config/secrets.yml b/config/secrets.yml new file mode 100644 index 0000000..afce183 --- /dev/null +++ b/config/secrets.yml @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rake secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: de0ecd5dc49c9135f04c7c98998af35119cbb014d420046505a344c2dc479a5ff2b28d4037c776dd0cb3c3ba512243e71c20fb1f094796ddc5fa92641e103c58 + +test: + secret_key_base: 3dca9eabe30fd729be04dbd035fca4774072d0cf9307d1dd93630e6dc27d72edde2ff4b9b027199b446ce9978b4f14acd6b6ee112ac05bf187bb2058ec31dc12 + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> diff --git a/public/404.html b/public/404.html index a0daa0c..b612547 100644 --- a/public/404.html +++ b/public/404.html @@ -2,17 +2,23 @@
You may have mistyped the address or the page may have moved.
+You may have mistyped the address or the page may have moved.
+If you are the application owner check the logs for more information.
If you are the application owner check the logs for more information.
diff --git a/public/422.html b/public/422.html index fbb4b84..a21f82b 100644 --- a/public/422.html +++ b/public/422.html @@ -2,17 +2,23 @@Maybe you tried to change something you didn't have access to.
+Maybe you tried to change something you didn't have access to.
+If you are the application owner check the logs for more information.
If you are the application owner check the logs for more information.
diff --git a/public/500.html b/public/500.html index e9052d3..061abc5 100644 --- a/public/500.html +++ b/public/500.html @@ -2,17 +2,23 @@If you are the application owner check the logs for more information.
If you are the application owner check the logs for more information.
diff --git a/public/robots.txt b/public/robots.txt index 1a3a5e4..3c9c7c0 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -1,4 +1,4 @@ -# See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file +# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file # # To ban all spiders from the entire site uncomment the next two lines: # User-agent: * diff --git a/spec/controllers/repositories_controller_spec.rb b/spec/controllers/repositories_controller_spec.rb index 1f423ca..1d527f0 100644 --- a/spec/controllers/repositories_controller_spec.rb +++ b/spec/controllers/repositories_controller_spec.rb @@ -173,7 +173,11 @@ describe RepositoriesController do it { should redirect_to(projects_url) } it { should respond_with(:redirect) } - it { should set_the_flash[:notice].to("You're not allowed to do this operation") } + it 'should set the flash' do + pending 'incompability between shoulda-matchers and Rails 4.1.0.rc1' do + should set_the_flash[:notice].to("You're not allowed to do this operation") + end + end end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c05c70d..f9cfdcf 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -24,6 +24,7 @@ ENV["RAILS_ENV"] ||= 'test' require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' require 'rspec/autorun' +require 'shoulda-matchers' # requiring here is necessary to avoid warnings from minitest 5, with version 2.6 this might get fixed # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirectories. -- libgit2 0.21.2