Commit 746ebe7b by ivan Lan

Add autoload to shotengai.rb

parent fbaf667c
example_id | status | run_time | example_id | status | run_time |
------------------------------------------ | ------ | --------------- | ------------------------------------------ | ------ | --------------- |
./spec/shotengai/models_spec.rb[1:1:1:1] | passed | 0.36006 seconds | ./spec/shotengai/models_spec.rb[1:1:1:1] | failed | 0.20529 seconds |
./spec/shotengai/models_spec.rb[1:1:1:2] | passed | 0.19221 seconds | ./spec/shotengai/models_spec.rb[1:1:1:2] | failed | 0.16928 seconds |
./spec/shotengai/models_spec.rb[1:1:2:1] | passed | 0.19696 seconds | ./spec/shotengai/models_spec.rb[1:1:2:1] | failed | 0.16917 seconds |
./spec/shotengai/models_spec.rb[1:1:2:2] | passed | 0.17745 seconds | ./spec/shotengai/models_spec.rb[1:1:2:2] | failed | 0.1559 seconds |
./spec/shotengai/models_spec.rb[1:1:2:3] | passed | 0.17437 seconds | ./spec/shotengai/models_spec.rb[1:1:2:3] | failed | 0.16818 seconds |
./spec/shotengai/models_spec.rb[1:1:3:1] | passed | 0.19322 seconds | ./spec/shotengai/models_spec.rb[1:1:3:1] | failed | 0.17072 seconds |
./spec/shotengai/models_spec.rb[1:1:3:2] | passed | 0.1998 seconds | ./spec/shotengai/models_spec.rb[1:1:3:2] | failed | 0.17477 seconds |
./spec/shotengai/models_spec.rb[1:1:3:3] | passed | 0.2012 seconds | ./spec/shotengai/models_spec.rb[1:1:3:3] | failed | 0.16544 seconds |
./spec/shotengai/models_spec.rb[1:1:4:1] | passed | 0.22549 seconds | ./spec/shotengai/models_spec.rb[1:1:4:1] | failed | 0.1618 seconds |
./spec/shotengai/models_spec.rb[1:1:5:1] | passed | 0.19514 seconds | ./spec/shotengai/models_spec.rb[1:1:5:1] | failed | 0.15564 seconds |
./spec/shotengai/models_spec.rb[1:1:5:2:1] | passed | 0.25054 seconds | ./spec/shotengai/models_spec.rb[1:1:5:2:1] | failed | 0.15182 seconds |
./spec/shotengai/models_spec.rb[1:1:5:2:2] | passed | 0.22609 seconds | ./spec/shotengai/models_spec.rb[1:1:5:2:2] | failed | 0.16236 seconds |
./spec/shotengai/models_spec.rb[1:2:1:1] | passed | 0.22996 seconds | ./spec/shotengai/models_spec.rb[1:2:1:1] | failed | 0.17459 seconds |
./spec/shotengai/models_spec.rb[1:2:1:2] | passed | 0.2075 seconds | ./spec/shotengai/models_spec.rb[1:2:1:2] | failed | 0.18331 seconds |
./spec/shotengai/models_spec.rb[1:2:2:1] | passed | 0.46901 seconds | ./spec/shotengai/models_spec.rb[1:2:2:1] | passed | 0.61428 seconds |
./spec/shotengai/models_spec.rb[1:2:2:2] | passed | 0.29917 seconds | ./spec/shotengai/models_spec.rb[1:2:2:2] | failed | 0.15561 seconds |
require "shotengai/version" require "shotengai/version"
require 'rails' require 'rails'
require 'active_record' # require 'active_record'
Dir['./lib/shotengai/*.rb'].each { |f| require f }
module Shotengai module Shotengai
# Your code goes here... # Your code goes here...
autoload :Product, 'shotengai/product'
autoload :Series, 'shotengai/series'
autoload :Snapshot, 'shotengai/snapshot'
autoload :Order, 'shotengai/order'
autoload :Cart, 'shotengai/cart'
autoload :Buyer, 'shotengai/buyer'
autoload :Catalog, 'shotengai/catalog'
autoload :AASM_DLC, 'shotengai/aasm_dlc'
autoload :WebError, 'shotengai/web_error'
end end
...@@ -22,9 +22,9 @@ Gem::Specification.new do |spec| ...@@ -22,9 +22,9 @@ Gem::Specification.new do |spec|
'public gem pushes.' 'public gem pushes.'
end end
spec.files = 'git ls-files -z'.split('\x0').reject do |f| # spec.files = `git ls-files -z`.split('\x0').reject do |f|
f.match(%r{^(test|spec|features)/}) # f.match(%r{^(test|spec|features)/})
end # end
spec.bindir = 'exe' spec.bindir = 'exe'
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ['lib'] spec.require_paths = ['lib']
......
...@@ -269,8 +269,8 @@ RSpec.describe 'Shotengai Models' do ...@@ -269,8 +269,8 @@ RSpec.describe 'Shotengai Models' do
after do after do
ActiveRecord::Migration[5.1].subclasses.each do |migrate| ActiveRecord::Migration[5.1].subclasses.each do |migrate|
migrate.migrate(:down) migrate.migrate(:down)
end end
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment