Skip to content

Commit

Permalink
[api][webui] Autoload lib path
Browse files Browse the repository at this point in the history
  • Loading branch information
Moises Deniz Aleman committed Apr 6, 2017
1 parent 9e5b483 commit 0ad62af
Show file tree
Hide file tree
Showing 12 changed files with 3 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/api/app/controllers/application_controller.rb
Expand Up @@ -2,7 +2,6 @@
# Likewise, all the methods added will be available for all controllers.

require_dependency 'opensuse/permission'
require_dependency 'opensuse/backend'
require_dependency 'opensuse/validator'
require_dependency 'api_exception'
require_dependency 'authenticator'
Expand Down
2 changes: 0 additions & 2 deletions src/api/app/jobs/project_create_auto_cleanup_requests.rb
@@ -1,5 +1,3 @@
require 'opensuse/backend'

class ProjectCreateAutoCleanupRequests < ApplicationJob
Description = "This is a humble request to remove this project.
Accepting this request will free resources on our always crowded server.
Expand Down
1 change: 0 additions & 1 deletion src/api/app/models/bs_request.rb
@@ -1,6 +1,5 @@
require 'xmlhash'
require 'event'
require 'opensuse/backend'
require 'workers/accept_requests'

include MaintenanceHelper
Expand Down
1 change: 0 additions & 1 deletion src/api/app/models/configuration.rb
@@ -1,4 +1,3 @@
require 'opensuse/backend'
# The OBS instance configuration
class Configuration < ApplicationRecord
after_save :delayed_write_to_backend
Expand Down
1 change: 0 additions & 1 deletion src/api/app/models/issue_tracker.rb
@@ -1,5 +1,4 @@
require 'xmlrpc/client'
require 'opensuse/backend'

class IssueTracker < ApplicationRecord
has_many :issues, dependent: :destroy
Expand Down
1 change: 0 additions & 1 deletion src/api/app/models/project.rb
@@ -1,4 +1,3 @@
require_dependency 'opensuse/backend'
require_dependency 'has_relationships'

class Project < ApplicationRecord
Expand Down
1 change: 1 addition & 0 deletions src/api/config/application.rb
Expand Up @@ -15,6 +15,7 @@ class Application < Rails::Application

# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)
config.eager_load_paths << Rails.root.join('lib', 'backend')

# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named.
Expand Down
2 changes: 2 additions & 0 deletions src/api/lib/backend/backend.rb
@@ -0,0 +1,2 @@
require_dependency 'connection'
require_dependency 'file'
2 changes: 0 additions & 2 deletions src/api/lib/workers/import_requests.rb
Expand Up @@ -3,8 +3,6 @@ def initialize
end

def perform
require 'opensuse/backend'

lastrq = Backend::Connection.get("/request/_lastid").body.to_i
while lastrq > 0
begin
Expand Down
2 changes: 0 additions & 2 deletions src/api/script/start_test_backend
Expand Up @@ -20,8 +20,6 @@ backend_config = "#{Rails.root}/tmp/backend_config#{backend_dir_suffix}"
backend_data = "#{Rails.root}/tmp/backend_data#{backend_dir_suffix}"
require File.expand_path(File.dirname(__FILE__)) + '/../test/test_helper'

require 'opensuse/backend'

Backend::Connection.do_not_start_test_backend

ENV['PERL5LIB'] = "#{Rails.root}/../backend:#{Rails.root}/../backend/build"
Expand Down
2 changes: 0 additions & 2 deletions src/api/spec/support/backend.rb
@@ -1,5 +1,3 @@
require 'opensuse/backend'

# Allow connections to localhost
WebMock.disable_net_connect!(allow_localhost: true)

Expand Down
2 changes: 0 additions & 2 deletions src/api/test/test_helper.rb
Expand Up @@ -36,8 +36,6 @@

require 'webmock/minitest'

require 'opensuse/backend'

require_relative 'activexml_matcher'
require_relative '../lib/obsapi/test_sphinx'

Expand Down

0 comments on commit 0ad62af

Please sign in to comment.