From 63642379c1d1641b2517336a5d759da52c2ca2db Mon Sep 17 00:00:00 2001 From: Alwin Karabiowski Date: Wed, 24 Jul 2013 13:26:15 +0200 Subject: [PATCH] added require all --- companies/company.rb | 5 ----- companies/company_creation_service.rb | 5 ----- companies/company_deletion_service.rb | 3 --- companies/company_finding_service.rb | 2 -- companies/company_replay_service.rb | 4 ---- companies/company_update_service.rb | 4 ---- companies/config.ru | 10 +++++++--- companies/server.rb | 7 ------- spec/spec_helper.rb | 7 ++++++- 9 files changed, 13 insertions(+), 34 deletions(-) diff --git a/companies/company.rb b/companies/company.rb index 5d7187a..d878496 100644 --- a/companies/company.rb +++ b/companies/company.rb @@ -1,8 +1,3 @@ -require 'dm-core' -require 'dm-migrations' -require 'dm-validations' -require 'dm-serializer' - class Company include DataMapper::Resource diff --git a/companies/company_creation_service.rb b/companies/company_creation_service.rb index af14b62..5baa715 100644 --- a/companies/company_creation_service.rb +++ b/companies/company_creation_service.rb @@ -1,8 +1,3 @@ -require 'company.rb' -require 'credit_card_service' -require 'json' -require 'company_update_service' - class CompanyCreationService def self.create(name, creditcard) diff --git a/companies/company_deletion_service.rb b/companies/company_deletion_service.rb index 92413a7..5b41827 100644 --- a/companies/company_deletion_service.rb +++ b/companies/company_deletion_service.rb @@ -1,6 +1,3 @@ -require 'company' -require 'json' - class CompanyDeletionService include TorqueBox::Injectors diff --git a/companies/company_finding_service.rb b/companies/company_finding_service.rb index f3c8958..b45e654 100644 --- a/companies/company_finding_service.rb +++ b/companies/company_finding_service.rb @@ -1,5 +1,3 @@ -require 'company' - class CompanyFindingService include TorqueBox::Messaging::Backgroundable diff --git a/companies/company_replay_service.rb b/companies/company_replay_service.rb index b2d84af..a12943e 100644 --- a/companies/company_replay_service.rb +++ b/companies/company_replay_service.rb @@ -1,7 +1,3 @@ -require 'json' -require 'company' -require 'company_update_service' - class CompanyReplayService def self.replay companies diff --git a/companies/company_update_service.rb b/companies/company_update_service.rb index f10e5c3..c8c85a3 100644 --- a/companies/company_update_service.rb +++ b/companies/company_update_service.rb @@ -1,7 +1,3 @@ -require 'company' -require 'credit_card_service' -require 'json' - class CompanyUpdateService include TorqueBox::Messaging::Backgroundable diff --git a/companies/config.ru b/companies/config.ru index bfc2473..6ed0810 100644 --- a/companies/config.ru +++ b/companies/config.ru @@ -1,6 +1,10 @@ require 'rubygems' -require 'bundler' -require 'sinatra' -require 'server' + +# Require all Gems automatically +require 'bundler/setup' +Bundler.require + +# require everything in the app folder +require_all './*.rb' run Server diff --git a/companies/server.rb b/companies/server.rb index 51be157..ba9212a 100644 --- a/companies/server.rb +++ b/companies/server.rb @@ -1,10 +1,3 @@ -require "company.rb" -require "company_creation_service" -require "company_finding_service" -require "company_deletion_service" -require "company_replay_service" -require "json" - class Server < Sinatra::Base use TorqueBox::Session::ServletStore diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index a37678c..7d637f9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,7 @@ +require 'rubygems' +require 'bundler/setup' +Bundler.require + require 'torquespec' require 'torquebox-core' require 'capybara' @@ -58,4 +62,5 @@ def post_json(path, parameters) ENV["RACK_ENV"] = "testing" -Dir["./spec/helper/**/*.rb"].sort.each {|f| require f} +require_all './spec/helper/**/*.rb' +require_all 'companies/*.rb'