diff options
author | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2015-04-10 14:34:57 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2015-04-10 14:34:57 +0000 |
commit | 24d139ba971cf61a4b7a01031c4c57bcba29b172 (patch) | |
tree | 45ebed56c7eb371d69fb61ccd538fba5d16629e7 | |
parent | 256d2ae7001f7f84835a34d2f2e727eefcbe0c72 (diff) | |
parent | c9a1634f3183be512e4b94c140a83fa467c238ee (diff) | |
download | gitlab-ce-24d139ba971cf61a4b7a01031c4c57bcba29b172.tar.gz |
Merge branch 'rs-revert-preload-lib' into 'master'
Revert "Preload lib/"
This reverts commit 5511a731bcc05034abacd4ec01ff7d5a2a3b89d3.
The original commit added this because it also enabled threadsafety, a change which was itself later reverted in 66d6c809662980041fce66d182489c025475e7a7, but this got left behind.
I don't fully understand the reasoning behind it so if I'm wrong, please tell me.
My reasoning for reverting it is that it messes with Rails' (and by extension Spring's) class reloading during development. When I was working in `lib/gitlab/markdown` and had to stop and restart the server every time I made a change, I didn't know it at the time, but this was why. That was a huge pain point.
If it's needed for production perhaps we could add a `if Rails.env.production?` clause around it so that it doesn't mess with development.
See merge request !1758
-rw-r--r-- | config/initializers/1_settings.rb | 2 | ||||
-rw-r--r-- | config/initializers/2_app.rb | 5 | ||||
-rw-r--r-- | lib/gitlab.rb | 5 | ||||
-rw-r--r-- | lib/gitlab/contributor.rb (renamed from lib/gitlab/contributors.rb) | 0 | ||||
-rw-r--r-- | lib/gitlab/ldap/user.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/o_auth/auth_hash.rb (renamed from lib/gitlab/oauth/auth_hash.rb) | 0 | ||||
-rw-r--r-- | lib/gitlab/o_auth/user.rb (renamed from lib/gitlab/oauth/user.rb) | 0 | ||||
-rw-r--r-- | lib/gitlab/satellite/satellite.rb | 5 | ||||
-rw-r--r-- | spec/lib/gitlab/o_auth/auth_hash_spec.rb (renamed from spec/lib/gitlab/oauth/auth_hash_spec.rb) | 0 | ||||
-rw-r--r-- | spec/lib/gitlab/o_auth/user_spec.rb (renamed from spec/lib/gitlab/oauth/user_spec.rb) | 0 |
10 files changed, 13 insertions, 6 deletions
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb index de79595d031..e6b00c531ac 100644 --- a/config/initializers/1_settings.rb +++ b/config/initializers/1_settings.rb @@ -1,3 +1,5 @@ +require 'gitlab' # Load lib/gitlab.rb as soon as possible + class Settings < Settingslogic source ENV.fetch('GITLAB_CONFIG') { "#{Rails.root}/config/gitlab.yml" } namespace Rails.env diff --git a/config/initializers/2_app.rb b/config/initializers/2_app.rb index 655590dff0b..688cdf5f4b0 100644 --- a/config/initializers/2_app.rb +++ b/config/initializers/2_app.rb @@ -6,8 +6,3 @@ module Gitlab Settings end end - -# -# Load all libs for threadsafety -# -Dir["#{Rails.root}/lib/**/*.rb"].each { |file| require file } diff --git a/lib/gitlab.rb b/lib/gitlab.rb new file mode 100644 index 00000000000..5fc1862c3e9 --- /dev/null +++ b/lib/gitlab.rb @@ -0,0 +1,5 @@ +require 'gitlab/git' + +module Gitlab + autoload :Satellite, 'gitlab/satellite/satellite' +end diff --git a/lib/gitlab/contributors.rb b/lib/gitlab/contributor.rb index c41e92b620f..c41e92b620f 100644 --- a/lib/gitlab/contributors.rb +++ b/lib/gitlab/contributor.rb diff --git a/lib/gitlab/ldap/user.rb b/lib/gitlab/ldap/user.rb index cfa8692659d..b04f5b4ac37 100644 --- a/lib/gitlab/ldap/user.rb +++ b/lib/gitlab/ldap/user.rb @@ -1,4 +1,4 @@ -require 'gitlab/oauth/user' +require 'gitlab/o_auth/user' # LDAP extension for User model # diff --git a/lib/gitlab/oauth/auth_hash.rb b/lib/gitlab/o_auth/auth_hash.rb index ce52beec78e..ce52beec78e 100644 --- a/lib/gitlab/oauth/auth_hash.rb +++ b/lib/gitlab/o_auth/auth_hash.rb diff --git a/lib/gitlab/oauth/user.rb b/lib/gitlab/o_auth/user.rb index 2f5c217d764..2f5c217d764 100644 --- a/lib/gitlab/oauth/user.rb +++ b/lib/gitlab/o_auth/user.rb diff --git a/lib/gitlab/satellite/satellite.rb b/lib/gitlab/satellite/satellite.rb index f24c6199c44..398643d68de 100644 --- a/lib/gitlab/satellite/satellite.rb +++ b/lib/gitlab/satellite/satellite.rb @@ -1,5 +1,10 @@ module Gitlab module Satellite + autoload :DeleteFileAction, 'gitlab/satellite/files/delete_file_action' + autoload :EditFileAction, 'gitlab/satellite/files/edit_file_action' + autoload :FileAction, 'gitlab/satellite/files/file_action' + autoload :NewFileAction, 'gitlab/satellite/files/new_file_action' + class CheckoutFailed < StandardError; end class CommitFailed < StandardError; end class PushFailed < StandardError; end diff --git a/spec/lib/gitlab/oauth/auth_hash_spec.rb b/spec/lib/gitlab/o_auth/auth_hash_spec.rb index 5eb77b492b2..5eb77b492b2 100644 --- a/spec/lib/gitlab/oauth/auth_hash_spec.rb +++ b/spec/lib/gitlab/o_auth/auth_hash_spec.rb diff --git a/spec/lib/gitlab/oauth/user_spec.rb b/spec/lib/gitlab/o_auth/user_spec.rb index 44cdd1e4fab..44cdd1e4fab 100644 --- a/spec/lib/gitlab/oauth/user_spec.rb +++ b/spec/lib/gitlab/o_auth/user_spec.rb |