database_cleaner 1.7.0 → 1.8.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTE.markdown +1 -2
- data/Gemfile.lock +130 -91
- data/History.rdoc +1 -1
- data/README.markdown +71 -226
- data/Rakefile +12 -8
- data/adapters/database_cleaner-active_record/lib/database_cleaner-active_record.rb +1 -0
- data/adapters/database_cleaner-active_record/lib/database_cleaner/active_record.rb +6 -0
- data/{lib → adapters/database_cleaner-active_record/lib}/database_cleaner/active_record/base.rb +13 -4
- data/{lib → adapters/database_cleaner-active_record/lib}/database_cleaner/active_record/deletion.rb +19 -19
- data/{lib → adapters/database_cleaner-active_record/lib}/database_cleaner/active_record/transaction.rb +0 -0
- data/{lib → adapters/database_cleaner-active_record/lib}/database_cleaner/active_record/truncation.rb +22 -19
- data/adapters/database_cleaner-active_record/lib/database_cleaner/active_record/version.rb +5 -0
- data/adapters/database_cleaner-couch_potato/lib/database_cleaner-couch_potato.rb +1 -0
- data/adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato.rb +11 -0
- data/{lib → adapters/database_cleaner-couch_potato/lib}/database_cleaner/couch_potato/base.rb +0 -0
- data/{lib → adapters/database_cleaner-couch_potato/lib}/database_cleaner/couch_potato/truncation.rb +0 -0
- data/adapters/database_cleaner-couch_potato/lib/database_cleaner/couch_potato/version.rb +5 -0
- data/adapters/database_cleaner-data_mapper/lib/database_cleaner-data_mapper.rb +1 -0
- data/adapters/database_cleaner-data_mapper/lib/database_cleaner/data_mapper.rb +4 -0
- data/{lib → adapters/database_cleaner-data_mapper/lib}/database_cleaner/data_mapper/base.rb +4 -0
- data/{lib → adapters/database_cleaner-data_mapper/lib}/database_cleaner/data_mapper/transaction.rb +0 -0
- data/{lib → adapters/database_cleaner-data_mapper/lib}/database_cleaner/data_mapper/truncation.rb +4 -3
- data/adapters/database_cleaner-data_mapper/lib/database_cleaner/data_mapper/version.rb +5 -0
- data/adapters/database_cleaner-mongo/lib/database_cleaner-mongo.rb +1 -0
- data/adapters/database_cleaner-mongo/lib/database_cleaner/mongo.rb +10 -0
- data/{lib → adapters/database_cleaner-mongo/lib}/database_cleaner/mongo/base.rb +0 -0
- data/{lib → adapters/database_cleaner-mongo/lib}/database_cleaner/mongo/truncation.rb +0 -0
- data/{lib → adapters/database_cleaner-mongo/lib}/database_cleaner/mongo/truncation_mixin.rb +0 -0
- data/adapters/database_cleaner-mongo/lib/database_cleaner/mongo/version.rb +5 -0
- data/adapters/database_cleaner-mongo_mapper/lib/database_cleaner-mongo_mapper.rb +1 -0
- data/adapters/database_cleaner-mongo_mapper/lib/database_cleaner/mongo_mapper.rb +4 -0
- data/{lib → adapters/database_cleaner-mongo_mapper/lib}/database_cleaner/mongo_mapper/base.rb +4 -0
- data/{lib → adapters/database_cleaner-mongo_mapper/lib}/database_cleaner/mongo_mapper/truncation.rb +0 -0
- data/adapters/database_cleaner-mongo_mapper/lib/database_cleaner/mongo_mapper/version.rb +5 -0
- data/adapters/database_cleaner-mongoid/lib/database_cleaner-mongoid.rb +1 -0
- data/{lib → adapters/database_cleaner-mongoid/lib}/database_cleaner/mongo2/truncation_mixin.rb +0 -0
- data/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid.rb +10 -0
- data/{lib → adapters/database_cleaner-mongoid/lib}/database_cleaner/mongoid/base.rb +0 -0
- data/{lib → adapters/database_cleaner-mongoid/lib}/database_cleaner/mongoid/truncation.rb +0 -0
- data/adapters/database_cleaner-mongoid/lib/database_cleaner/mongoid/version.rb +5 -0
- data/adapters/database_cleaner-moped/lib/database_cleaner-moped.rb +1 -0
- data/adapters/database_cleaner-moped/lib/database_cleaner/moped.rb +10 -0
- data/{lib → adapters/database_cleaner-moped/lib}/database_cleaner/moped/base.rb +1 -1
- data/{lib → adapters/database_cleaner-moped/lib}/database_cleaner/moped/truncation.rb +0 -0
- data/{lib → adapters/database_cleaner-moped/lib}/database_cleaner/moped/truncation_base.rb +4 -0
- data/adapters/database_cleaner-moped/lib/database_cleaner/moped/version.rb +5 -0
- data/adapters/database_cleaner-neo4j/lib/database_cleaner-neo4j.rb +1 -0
- data/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j.rb +6 -0
- data/{lib → adapters/database_cleaner-neo4j/lib}/database_cleaner/neo4j/base.rb +4 -0
- data/{lib → adapters/database_cleaner-neo4j/lib}/database_cleaner/neo4j/deletion.rb +0 -0
- data/{lib → adapters/database_cleaner-neo4j/lib}/database_cleaner/neo4j/transaction.rb +0 -0
- data/{lib → adapters/database_cleaner-neo4j/lib}/database_cleaner/neo4j/truncation.rb +0 -0
- data/adapters/database_cleaner-neo4j/lib/database_cleaner/neo4j/version.rb +5 -0
- data/adapters/database_cleaner-ohm/lib/database_cleaner-ohm.rb +1 -0
- data/adapters/database_cleaner-ohm/lib/database_cleaner/ohm.rb +10 -0
- data/{lib → adapters/database_cleaner-ohm/lib}/database_cleaner/ohm/truncation.rb +4 -0
- data/adapters/database_cleaner-ohm/lib/database_cleaner/ohm/version.rb +5 -0
- data/adapters/database_cleaner-redis/lib/database_cleaner-redis.rb +1 -0
- data/adapters/database_cleaner-redis/lib/database_cleaner/redis.rb +4 -0
- data/{lib → adapters/database_cleaner-redis/lib}/database_cleaner/redis/base.rb +4 -0
- data/{lib → adapters/database_cleaner-redis/lib}/database_cleaner/redis/truncation.rb +0 -0
- data/adapters/database_cleaner-redis/lib/database_cleaner/redis/version.rb +5 -0
- data/adapters/database_cleaner-sequel/lib/database_cleaner-sequel.rb +1 -0
- data/adapters/database_cleaner-sequel/lib/database_cleaner/sequel.rb +6 -0
- data/{lib → adapters/database_cleaner-sequel/lib}/database_cleaner/sequel/base.rb +4 -0
- data/{lib → adapters/database_cleaner-sequel/lib}/database_cleaner/sequel/deletion.rb +0 -0
- data/{lib → adapters/database_cleaner-sequel/lib}/database_cleaner/sequel/transaction.rb +0 -0
- data/{lib → adapters/database_cleaner-sequel/lib}/database_cleaner/sequel/truncation.rb +16 -15
- data/adapters/database_cleaner-sequel/lib/database_cleaner/sequel/version.rb +5 -0
- data/lib/database_cleaner.rb +36 -1
- data/lib/database_cleaner/base.rb +85 -103
- data/lib/database_cleaner/configuration.rb +93 -83
- data/lib/database_cleaner/deprecation.rb +21 -0
- data/lib/database_cleaner/null_strategy.rb +6 -6
- data/lib/database_cleaner/orm_autodetector.rb +31 -0
- data/lib/database_cleaner/safeguard.rb +38 -3
- data/lib/database_cleaner/spec.rb +2 -0
- data/lib/database_cleaner/spec/database_helper.rb +82 -0
- data/lib/database_cleaner/spec/shared_examples.rb +15 -0
- data/lib/database_cleaner/version.rb +3 -0
- metadata +111 -46
- data/VERSION.yml +0 -4
- data/lib/database_cleaner/mongo2/base.rb +0 -16
@@ -0,0 +1 @@
|
|
1
|
+
require "database_cleaner/neo4j"
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
require "database_cleaner/ohm"
|
@@ -0,0 +1 @@
|
|
1
|
+
require "database_cleaner/redis"
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
require "database_cleaner/sequel"
|
File without changes
|
File without changes
|
@@ -14,39 +14,40 @@ module DatabaseCleaner
|
|
14
14
|
def clean
|
15
15
|
return unless dirty?
|
16
16
|
|
17
|
+
tables = tables_to_truncate(db)
|
18
|
+
|
19
|
+
# Count rows before truncating
|
20
|
+
if pre_count?
|
21
|
+
tables = pre_count_tables(tables)
|
22
|
+
end
|
23
|
+
|
17
24
|
case db.database_type
|
18
25
|
when :postgres
|
19
26
|
# PostgreSQL requires all tables with FKs to be truncates in the same command, or have the CASCADE keyword
|
20
27
|
# appended. Bulk truncation without CASCADE is:
|
21
28
|
# * Safer. Tables outside of tables_to_truncate won't be affected.
|
22
29
|
# * Faster. Less roundtrips to the db.
|
23
|
-
unless
|
24
|
-
|
25
|
-
db.run "TRUNCATE TABLE #{
|
30
|
+
unless tables.empty?
|
31
|
+
tables_sql = tables.map { |t| %("#{t}") }.join(',')
|
32
|
+
db.run "TRUNCATE TABLE #{tables_sql} RESTART IDENTITY;"
|
26
33
|
end
|
27
34
|
else
|
28
|
-
|
29
|
-
|
30
|
-
if pre_count?
|
31
|
-
# Count rows before truncating
|
32
|
-
pre_count_truncate_tables(db, tables)
|
33
|
-
else
|
34
|
-
# Truncate each table normally
|
35
|
-
truncate_tables(db, tables)
|
36
|
-
end
|
35
|
+
truncate_tables(db, tables)
|
37
36
|
end
|
38
37
|
end
|
39
38
|
|
40
39
|
private
|
41
40
|
|
42
|
-
def
|
43
|
-
tables
|
44
|
-
truncate_tables(db, tables)
|
41
|
+
def pre_count_tables tables
|
42
|
+
tables.reject { |table| db[table.to_sym].count == 0 }
|
45
43
|
end
|
46
44
|
|
47
45
|
def truncate_tables(db, tables)
|
48
46
|
tables.each do |table|
|
49
47
|
db[table.to_sym].truncate
|
48
|
+
if db.database_type == :sqlite && db.table_exists?(:sqlite_sequence)
|
49
|
+
db[:sqlite_sequence].where(name: table).delete
|
50
|
+
end
|
50
51
|
end
|
51
52
|
end
|
52
53
|
|
data/lib/database_cleaner.rb
CHANGED
@@ -1,12 +1,47 @@
|
|
1
1
|
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__))) unless $LOAD_PATH.include?(File.expand_path(File.dirname(__FILE__)))
|
2
|
+
require 'database_cleaner/version'
|
2
3
|
require 'database_cleaner/configuration'
|
4
|
+
require 'database_cleaner/deprecation'
|
5
|
+
require 'forwardable'
|
3
6
|
|
4
7
|
module DatabaseCleaner
|
5
8
|
class << self
|
6
|
-
|
9
|
+
extend Forwardable
|
10
|
+
delegate [
|
11
|
+
:[],
|
12
|
+
:app_root=,
|
13
|
+
:app_root,
|
14
|
+
:logger=,
|
15
|
+
:logger,
|
16
|
+
:cleaners,
|
17
|
+
:cleaners=,
|
18
|
+
:strategy=,
|
19
|
+
:orm=,
|
20
|
+
:start,
|
21
|
+
:clean,
|
22
|
+
:clean_with,
|
23
|
+
:cleaning,
|
24
|
+
|
25
|
+
# TODO remove in 2.0
|
26
|
+
:clean!,
|
27
|
+
:clean_with!,
|
28
|
+
:init_cleaners,
|
29
|
+
:add_cleaner,
|
30
|
+
:connections,
|
31
|
+
:remove_duplicates,
|
32
|
+
] => :configuration
|
33
|
+
|
34
|
+
attr_accessor :allow_remote_database_url, :allow_production, :url_whitelist
|
7
35
|
|
8
36
|
def can_detect_orm?
|
37
|
+
DatabaseCleaner.deprecate "Calling `DatabaseCleaner.can_detect_orm?` is deprecated, and will be removed in database_cleaner 2.0 with no replacement."
|
9
38
|
DatabaseCleaner::Base.autodetect_orm
|
10
39
|
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def configuration
|
44
|
+
@configuration ||= Configuration.new
|
45
|
+
end
|
11
46
|
end
|
12
47
|
end
|
@@ -1,166 +1,148 @@
|
|
1
|
+
require 'database_cleaner/deprecation'
|
1
2
|
require 'database_cleaner/null_strategy'
|
2
3
|
require 'database_cleaner/safeguard'
|
4
|
+
require 'database_cleaner/orm_autodetector'
|
5
|
+
require 'active_support/core_ext/string/inflections'
|
6
|
+
require 'forwardable'
|
7
|
+
|
3
8
|
module DatabaseCleaner
|
4
9
|
class Base
|
5
10
|
include Comparable
|
6
11
|
|
7
12
|
def <=>(other)
|
8
|
-
|
13
|
+
[orm, db] <=> [other.orm, other.db]
|
9
14
|
end
|
10
15
|
|
11
|
-
def initialize(desired_orm = nil,opts = {})
|
12
|
-
|
13
|
-
|
14
|
-
else
|
15
|
-
self.orm = desired_orm
|
16
|
-
end
|
16
|
+
def initialize(desired_orm = nil, opts = {})
|
17
|
+
@orm_autodetector = ORMAutodetector.new
|
18
|
+
self.orm = desired_orm
|
17
19
|
self.db = opts[:connection] || opts[:model] if opts.has_key?(:connection) || opts.has_key?(:model)
|
18
|
-
|
20
|
+
self.strategy = orm_module && orm_module.default_strategy
|
19
21
|
Safeguard.new.run
|
20
22
|
end
|
21
23
|
|
22
24
|
def db=(desired_db)
|
23
|
-
|
24
|
-
@db = desired_db
|
25
|
-
end
|
26
|
-
|
27
|
-
def strategy_db=(desired_db)
|
28
|
-
if strategy.respond_to? :db=
|
29
|
-
strategy.db = desired_db
|
30
|
-
elsif desired_db!= :default
|
31
|
-
raise ArgumentError, "You must provide a strategy object that supports non default databases when you specify a database"
|
32
|
-
end
|
25
|
+
@db = self.strategy_db = desired_db
|
33
26
|
end
|
34
27
|
|
35
28
|
def db
|
36
29
|
@db ||= :default
|
37
30
|
end
|
38
31
|
|
39
|
-
def
|
32
|
+
def strategy=(args)
|
40
33
|
strategy, *strategy_args = args
|
41
|
-
|
42
|
-
|
34
|
+
@strategy = if strategy.is_a?(Symbol)
|
35
|
+
create_strategy(*args)
|
36
|
+
elsif strategy_args.empty?
|
37
|
+
strategy
|
38
|
+
else
|
39
|
+
raise ArgumentError, "You must provide a strategy object, or a symbol for a known strategy along with initialization params."
|
40
|
+
end
|
43
41
|
|
44
|
-
|
45
|
-
|
46
|
-
set_strategy_db strategy, self.db
|
42
|
+
set_strategy_db @strategy, db
|
43
|
+
end
|
47
44
|
|
48
|
-
|
49
|
-
strategy
|
45
|
+
def strategy
|
46
|
+
@strategy ||= NullStrategy.new
|
50
47
|
end
|
51
48
|
|
52
|
-
|
49
|
+
attr_reader :orm
|
53
50
|
|
54
|
-
def
|
55
|
-
|
56
|
-
|
57
|
-
elsif desired_db != :default
|
58
|
-
raise ArgumentError, "You must provide a strategy object that supports non default databases when you specify a database"
|
59
|
-
end
|
51
|
+
def orm=(desired_orm)
|
52
|
+
@orm = (desired_orm || :autodetect).to_sym
|
53
|
+
@orm = @orm_autodetector.orm if @orm == :autodetect
|
60
54
|
end
|
61
55
|
|
62
|
-
|
63
|
-
|
64
|
-
if strategy.is_a?(Symbol)
|
65
|
-
@strategy = create_strategy(*args)
|
66
|
-
elsif strategy_args.empty?
|
67
|
-
@strategy = strategy
|
68
|
-
else
|
69
|
-
raise ArgumentError, "You must provide a strategy object, or a symbol for a known strategy along with initialization params."
|
70
|
-
end
|
56
|
+
extend Forwardable
|
57
|
+
delegate [:start, :clean, :cleaning] => :strategy
|
71
58
|
|
72
|
-
|
73
|
-
|
74
|
-
|
59
|
+
def clean_with(*args)
|
60
|
+
strategy = create_strategy(*args)
|
61
|
+
set_strategy_db strategy, db
|
62
|
+
strategy.clean
|
63
|
+
strategy
|
75
64
|
end
|
76
65
|
|
77
|
-
|
78
|
-
@strategy ||= NullStrategy
|
79
|
-
end
|
66
|
+
# TODO remove the following methods in 2.0
|
80
67
|
|
81
|
-
def
|
82
|
-
|
68
|
+
def auto_detected?
|
69
|
+
DatabaseCleaner.deprecate "Calling `DatabaseCleaner[...].auto_detected?` is deprecated, and will be removed in database_cleaner 2.0 with no replacement."
|
70
|
+
@orm_autodetector.autodetected?
|
83
71
|
end
|
84
72
|
|
85
|
-
def
|
86
|
-
|
73
|
+
def autodetect_orm
|
74
|
+
DatabaseCleaner.deprecate "Calling `DatabaseCleaner[...].autodetect_orm` is deprecated, and will be removed in database_cleaner 2.0 with no replacement."
|
75
|
+
@orm_autodetector.orm
|
87
76
|
end
|
88
77
|
|
89
|
-
def
|
90
|
-
|
78
|
+
def clean!
|
79
|
+
DatabaseCleaner.deprecate "Calling `DatabaseCleaner[...].clean!` is deprecated, and will be removed in database_cleaner 2.0. Use `DatabaseCleaner[...].clean instead."
|
80
|
+
clean
|
91
81
|
end
|
92
82
|
|
93
|
-
def
|
94
|
-
|
83
|
+
def clean_with!
|
84
|
+
DatabaseCleaner.deprecate "Calling `DatabaseCleaner[...].clean_with!` is deprecated, and will be removed in database_cleaner 2.0. Use `DatabaseCleaner[...].clean_with instead."
|
85
|
+
clean_with
|
95
86
|
end
|
96
87
|
|
97
|
-
|
88
|
+
# TODO privatize the following methods in 2.0
|
98
89
|
|
99
|
-
def
|
100
|
-
|
90
|
+
def strategy_db=(desired_db)
|
91
|
+
if called_externally?(caller)
|
92
|
+
DatabaseCleaner.deprecate "Calling `DatabaseCleaner[...].strategy_db=` is deprecated, and will be removed in database_cleaner 2.0. Use `DatabaseCleaner[...].db=` instead."
|
93
|
+
end
|
94
|
+
set_strategy_db(strategy, desired_db)
|
101
95
|
end
|
102
96
|
|
103
|
-
def
|
104
|
-
|
97
|
+
def set_strategy_db(strategy, desired_db)
|
98
|
+
if called_externally?(caller)
|
99
|
+
DatabaseCleaner.deprecate "Calling `DatabaseCleaner[...].set_strategy_db=` is deprecated, and will be removed in database_cleaner 2.0. Use `DatabaseCleaner[...].db=` instead."
|
100
|
+
end
|
101
|
+
if strategy.respond_to? :db=
|
102
|
+
strategy.db = desired_db
|
103
|
+
elsif desired_db != :default
|
104
|
+
raise ArgumentError, "You must provide a strategy object that supports non default databases when you specify a database"
|
105
|
+
end
|
105
106
|
end
|
106
107
|
|
107
|
-
def
|
108
|
-
if
|
109
|
-
|
110
|
-
elsif defined? ::DataMapper
|
111
|
-
:data_mapper
|
112
|
-
elsif defined? ::MongoMapper
|
113
|
-
:mongo_mapper
|
114
|
-
elsif defined? ::Mongoid
|
115
|
-
:mongoid
|
116
|
-
elsif defined? ::CouchPotato
|
117
|
-
:couch_potato
|
118
|
-
elsif defined? ::Sequel
|
119
|
-
:sequel
|
120
|
-
elsif defined? ::Moped
|
121
|
-
:moped
|
122
|
-
elsif defined? ::Ohm
|
123
|
-
:ohm
|
124
|
-
elsif defined? ::Redis
|
125
|
-
:redis
|
126
|
-
elsif defined? ::Neo4j
|
127
|
-
:neo4j
|
108
|
+
def create_strategy(*args)
|
109
|
+
if called_externally?(caller)
|
110
|
+
DatabaseCleaner.deprecate "Calling `DatabaseCleaner[...].create_strategy` is deprecated, and will be removed in database_cleaner 2.0. Use `DatabaseCleaner[...].strategy=` instead."
|
128
111
|
end
|
112
|
+
strategy, *strategy_args = args
|
113
|
+
orm_strategy(strategy).new(*strategy_args)
|
129
114
|
end
|
130
115
|
|
131
116
|
private
|
132
117
|
|
133
118
|
def orm_module
|
134
|
-
|
119
|
+
return unless [:active_record, :data_mapper, :mongo, :mongoid, :mongo_mapper, :moped, :couch_potato, :sequel, :ohm, :redis, :neo4j].include?(orm)
|
120
|
+
$LOAD_PATH.unshift File.expand_path("#{File.dirname(__FILE__)}/../../adapters/database_cleaner-#{orm}/lib")
|
121
|
+
require "database_cleaner/#{orm}"
|
122
|
+
DatabaseCleaner.const_get(orm.to_s.camelize)
|
135
123
|
end
|
136
124
|
|
137
125
|
def orm_strategy(strategy)
|
138
|
-
require "database_cleaner/#{orm.to_s}/#{strategy.to_s}"
|
139
126
|
orm_module.const_get(strategy.to_s.capitalize)
|
140
|
-
rescue
|
141
|
-
if
|
142
|
-
|
143
|
-
|
144
|
-
|
127
|
+
rescue NameError
|
128
|
+
if orm != :active_record
|
129
|
+
DatabaseCleaner.deprecate <<-TEXT
|
130
|
+
The #{orm_module} adapter has been extracted to its own gem: database_cleaner-#{orm}, and will be removed from database_cleaner in 2.0. To silence this message, please replace `gem "database_cleaner"` with `gem "database_cleaner-#{orm}"` in your Gemfile.
|
131
|
+
TEXT
|
145
132
|
end
|
133
|
+
require_orm_strategy(orm, strategy)
|
134
|
+
retry
|
146
135
|
end
|
147
136
|
|
148
|
-
def
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
137
|
+
def require_orm_strategy(orm, strategy)
|
138
|
+
$LOAD_PATH.unshift File.expand_path("#{File.dirname(__FILE__)}/../../adapters/database_cleaner-#{orm}/lib")
|
139
|
+
require "database_cleaner/#{orm}/#{strategy}"
|
140
|
+
rescue LoadError
|
141
|
+
raise UnknownStrategySpecified, "The '#{strategy}' strategy does not exist for the #{orm} ORM! Available strategies: #{orm_module.available_strategies.join(', ')}"
|
153
142
|
end
|
154
143
|
|
155
|
-
def
|
156
|
-
|
157
|
-
when :active_record, :data_mapper, :sequel
|
158
|
-
self.strategy = :transaction
|
159
|
-
when :mongo_mapper, :mongoid, :couch_potato, :moped, :ohm, :redis
|
160
|
-
self.strategy = :truncation
|
161
|
-
when :neo4j
|
162
|
-
self.strategy = :transaction
|
163
|
-
end
|
144
|
+
def called_externally?(caller)
|
145
|
+
__FILE__ != caller.first.split(":").first
|
164
146
|
end
|
165
147
|
end
|
166
148
|
end
|