File tree 5 files changed +19
-10
lines changed
5 files changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ require 'json'
21
21
require_relative '../config/initializers_cli/disable_deprecation_warnings'
22
22
require_relative '../config/initializers_cli/rmt_fast_gettext'
23
23
require_relative '../config/initializers_cli/rmt_fast_gettext_cli_locale'
24
- require 'rmt/cli/smt_importer'
25
24
26
25
no_systems = false
27
26
data_dir = nil
@@ -35,8 +34,8 @@ ActiveRecord::Base.establish_connection(db_config)
35
34
36
35
begin
37
36
Time . zone ||= 'UTC'
38
- script = SMTImporter . new ( data_dir , no_systems )
37
+ script = RMT :: CLI :: SMTImporter . new ( data_dir , no_systems )
39
38
script . run ARGV
40
- rescue SMTImporter ::ImportException
39
+ rescue RMT :: CLI :: SMTImporter ::ImportException
41
40
exit 1
42
41
end
Original file line number Diff line number Diff line change @@ -54,10 +54,9 @@ class Application < Rails::Application
54
54
55
55
# Initialize configuration defaults for originally generated Rails version.
56
56
config . load_defaults 6.0
57
- config . autoloader = :classic
58
57
59
- config . autoload_paths << Rails . root . join ( 'lib' )
60
- config . autoload_paths << Rails . root . join ( 'app' , 'validators' )
58
+ config . eager_load_paths << Rails . root . join ( 'lib' )
59
+ config . eager_load_paths << Rails . root . join ( 'app' , 'validators' )
61
60
62
61
# Settings in config/environments/* take precedence over those specified here.
63
62
# Application configuration can go into files in config/initializers
Original file line number Diff line number Diff line change
1
+ Rails . autoloaders . each do |autoloader |
2
+ autoloader . inflector = Zeitwerk ::Inflector . new
3
+ autoloader . inflector . inflect (
4
+ 'rmt' => 'RMT' ,
5
+ 'cli' => 'CLI' ,
6
+ 'suse' => 'SUSE' ,
7
+ 'scc' => 'SCC' ,
8
+ 'gpg' => 'GPG' ,
9
+ 'smt_importer' => 'SMTImporter'
10
+ )
11
+ end
Original file line number Diff line number Diff line change 1
1
require 'csv'
2
2
require 'ostruct'
3
3
4
- class SMTImporter
4
+ class RMT :: CLI :: SMTImporter
5
5
attr_accessor :data_dir
6
6
attr_accessor :no_systems
7
7
Original file line number Diff line number Diff line change 1
1
require 'rails_helper'
2
2
require 'rmt/cli/smt_importer'
3
3
4
- describe SMTImporter do
4
+ describe RMT :: CLI :: SMTImporter do
5
5
let ( :data_dir ) { File . join ( Dir . pwd , 'spec/fixtures/files/csv' ) }
6
6
let ( :no_systems ) { false }
7
7
let ( :importer ) { described_class . new ( data_dir , no_systems ) }
281
281
282
282
it 'shows the help output when invalid arguments supplied' do
283
283
expect do
284
- expect { importer . parse_cli_arguments [ '--nope-nope' ] } . to raise_exception SMTImporter ::ImportException
284
+ expect { importer . parse_cli_arguments [ '--nope-nope' ] } . to raise_exception RMT :: CLI :: SMTImporter ::ImportException
285
285
end . to output ( <<-OUTPUT . strip_heredoc ) . to_stdout
286
286
Usage: rspec [options]
287
287
-d, --data PATH Path to unpacked SMT data tarball
294
294
describe '#check_products_exist' do
295
295
it 'warns and exits if no product exists' do
296
296
expect do
297
- expect { importer . check_products_exist } . to raise_exception SMTImporter ::ImportException
297
+ expect { importer . check_products_exist } . to raise_exception RMT :: CLI :: SMTImporter ::ImportException
298
298
end . to output ( <<-OUTPUT . strip_heredoc ) . to_stderr
299
299
RMT has not been synced to SCC yet. Please run 'rmt-cli sync' before
300
300
importing data from SMT.
You can’t perform that action at this time.
0 commit comments