Skip to content

Commit

Permalink
rename CTT2013 class to CTT2013::Application
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeymuranov committed May 13, 2014
1 parent ab49b06 commit cb7b56a
Show file tree
Hide file tree
Showing 23 changed files with 28 additions and 25 deletions.
6 changes: 4 additions & 2 deletions application.rb
Expand Up @@ -36,7 +36,9 @@

require 'active_record'

class CTT2013 < Sinatra::Base
require_relative 'init'

class CTT2013::Application < Sinatra::Base
# Settings
# ========

Expand Down Expand Up @@ -109,5 +111,5 @@ class CTT2013 < Sinatra::Base
require_relative 'route_handlers/init'

if __FILE__ == $0
CTT2013.run!
CTT2013::Application.run!
end
2 changes: 1 addition & 1 deletion config.ru
Expand Up @@ -22,4 +22,4 @@ require File.expand_path('application.rb', File.dirname(__FILE__))
# filter.
use ActiveRecord::ConnectionAdapters::ConnectionManagement

run CTT2013.new
run CTT2013::Application.new
2 changes: 1 addition & 1 deletion helpers/collection_filtering_helpers.rb
Expand Up @@ -2,7 +2,7 @@

require './lib/nested_arrays'

class CTT2013
class CTT2013::Application
module CollectionFilteringHelpers
def smart_filtering_fields(filtering_by,
filtering_values,
Expand Down
2 changes: 1 addition & 1 deletion helpers/data_presentation_helpers.rb
@@ -1,6 +1,6 @@
# encoding: UTF-8 (magic comment)

class CTT2013
class CTT2013::Application
module DataPresentationHelpers
module_function

Expand Down
2 changes: 1 addition & 1 deletion helpers/form_helpers.rb
@@ -1,6 +1,6 @@
# encoding: UTF-8 (magic comment)

class CTT2013
class CTT2013::Application
module FormHelpers

def input_tag(type, name, value = nil, options = {})
Expand Down
2 changes: 1 addition & 1 deletion helpers/google_maps_helpers.rb
@@ -1,6 +1,6 @@
# encoding: UTF-8 (magic comment)

class CTT2013
class CTT2013::Application
module GoogleMapsHelpers
module_function
def map_url_for_address(address)
Expand Down
2 changes: 1 addition & 1 deletion helpers/html_helpers.rb
@@ -1,6 +1,6 @@
# encoding: UTF-8 (magic comment)

class CTT2013
class CTT2013::Application
module HTMLHelpers
module_function

Expand Down
2 changes: 1 addition & 1 deletion helpers/init.rb
@@ -1,6 +1,6 @@
# encoding: UTF-8 (magic comment)

class CTT2013
class CTT2013::Application
require_relative 'url_helpers'
helpers URLHelpers

Expand Down
2 changes: 1 addition & 1 deletion helpers/localisation_helpers.rb
Expand Up @@ -2,7 +2,7 @@

require 'i18n' # Internationalisation

class CTT2013
class CTT2013::Application
module LocalisationHelpers

module_function
Expand Down
2 changes: 1 addition & 1 deletion helpers/model_presentation_helpers.rb
@@ -1,6 +1,6 @@
# encoding: UTF-8 (magic comment)

class CTT2013
class CTT2013::Application
module ModelPresentationHelpers
module AbstractSmarterModelHelpers
def title_from_model_name(model)
Expand Down
2 changes: 1 addition & 1 deletion helpers/url_helpers.rb
Expand Up @@ -2,7 +2,7 @@

require 'i18n' # Internationalisation

class CTT2013
class CTT2013::Application
module URLHelpers
# Patched url helper to work around missing sub URI part
def fixed_url(path)
Expand Down
2 changes: 1 addition & 1 deletion helpers/view_pagination_helpers.rb
@@ -1,6 +1,6 @@
# encoding: UTF-8 (magic comment)

class CTT2013
class CTT2013::Application
module ViewPaginationHelpers
def paginating_form(page_count = 1, paginating_parameters = {}, options = {})
per_page = paginating_parameters[:per_page] || 1
Expand Down
2 changes: 1 addition & 1 deletion helpers/view_presentation_choice_helpers.rb
@@ -1,6 +1,6 @@
# encoding: UTF-8 (magic comment)

class CTT2013
class CTT2013::Application
module ViewPresentationChoiceHelpers
def presentation_choice_form(available_formats, current_format, options = {})
params_key_prefix = options[:params_key_prefix] || 'view'
Expand Down
1 change: 1 addition & 0 deletions init.rb
@@ -0,0 +1 @@
CTT2013 = Module.new
4 changes: 2 additions & 2 deletions lib/for_sass.rb
Expand Up @@ -7,12 +7,12 @@
#
module ::Sass::Script::Functions
def banner_url
url = CTT2013::URLHelpers.simple_fixed_url('/images/bannerToulouse.jpg')
url = CTT2013::Application::URLHelpers.simple_fixed_url('/images/bannerToulouse.jpg')
::Sass::Script::String.new("url('#{ url }');")
end

def footer_home_button_background_url
url = CTT2013::URLHelpers.simple_fixed_url('/images/capitole.jpg')
url = CTT2013::Application::URLHelpers.simple_fixed_url('/images/capitole.jpg')
::Sass::Script::String.new("url('#{ url }');")
end
end
2 changes: 1 addition & 1 deletion models/init.rb
Expand Up @@ -6,7 +6,7 @@

require_relative 'models'

class CTT2013
class CTT2013::Application
environment = settings.environment

ActiveRecord::Base.logger = Logger.new("log/#{ environment }.log")
Expand Down
2 changes: 1 addition & 1 deletion route_handlers/constants.rb
@@ -1,6 +1,6 @@
# encoding: UTF-8 (magic comment)

class CTT2013
class CTT2013::Application

# Pages
# -----
Expand Down
2 changes: 1 addition & 1 deletion route_handlers/filters.rb
@@ -1,6 +1,6 @@
# encoding: UTF-8 (magic comment)

class CTT2013 < Sinatra::Base
class CTT2013::Application < Sinatra::Base

# Set locale
before '/:loc/*' do |loc, path|
Expand Down
2 changes: 1 addition & 1 deletion route_handlers/organiser_connexion.rb
@@ -1,6 +1,6 @@
# encoding: UTF-8 (magic comment)

class CTT2013 < Sinatra::Base
class CTT2013::Application < Sinatra::Base

# == Authentication User model
# ============================
Expand Down
2 changes: 1 addition & 1 deletion route_handlers/params_processing.rb
@@ -1,6 +1,6 @@
# encoding: UTF-8 (magic comment)

class CTT2013
class CTT2013::Application
private

def view_parameters_from_params(submitted_view_parameters = params['view'])
Expand Down
2 changes: 1 addition & 1 deletion route_handlers/private_methods.rb
@@ -1,6 +1,6 @@
# encoding: UTF-8 (magic comment)

class CTT2013
class CTT2013::Application

private

Expand Down
2 changes: 1 addition & 1 deletion route_handlers/public.rb
@@ -1,6 +1,6 @@
# encoding: UTF-8 (magic comment)

class CTT2013 < Sinatra::Base
class CTT2013::Application < Sinatra::Base

# Handlers
# ========
Expand Down
4 changes: 2 additions & 2 deletions tests/tests.rb
Expand Up @@ -4,11 +4,11 @@

ENV['RACK_ENV'] = 'test'

describe 'Test CTT2013 application' do
describe 'Test CTT2013::Application application' do
include Rack::Test::Methods

def self.app
CTT2013
CTT2013::Application
end

def app
Expand Down

0 comments on commit cb7b56a

Please sign in to comment.