bmabey-database_cleaner 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -1,7 +1,11 @@
1
1
  (In Git)
2
2
 
3
- === New features
4
3
  === Bufixes
4
+ === New features
5
+
6
+ == 0.2.1 2009-05-08
7
+ === Bufixes
8
+ * Removed extraneous TruncationBase class definition. (Ben Mabey)
5
9
 
6
10
  == 0.2.0 2009-05-08 - The Datamapper Release
7
11
 
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- :patch: 0
2
+ :patch: 1
3
3
  :major: 0
4
4
  :minor: 2
@@ -91,45 +91,4 @@ module DatabaseCleaner
91
91
 
92
92
  end
93
93
 
94
-
95
- class TruncationBase
96
-
97
- def initialize(options = {})
98
- if !options.empty? && !(options.keys - [:only, :except]).empty?
99
- raise ArgumentError, "The only valid options are :only and :except. You specified #{options.keys.join(',')}."
100
- end
101
- if options.has_key?(:only) && options.has_key?(:except)
102
- raise ArgumentError, "You may only specify either :only or :either. Doing both doesn't really make sense does it?"
103
- end
104
-
105
- @only = options[:only]
106
- @tables_to_exclude = (options[:except] || [])
107
- if migration_storage = migration_storage_name
108
- @tables_to_exclude << migration_storage
109
- end
110
- end
111
-
112
- def start
113
- # no-op
114
- end
115
-
116
- def clean
117
- raise NotImplementedError
118
- end
119
-
120
-
121
- private
122
-
123
- def tables_to_truncate
124
- raise NotImplementedError
125
- end
126
-
127
- # overwrite in subclasses
128
- # default implementation given because migration storage need not be present
129
- def migration_storage_name
130
- nil
131
- end
132
-
133
- end
134
-
135
94
  end
@@ -1,40 +1,41 @@
1
- class TruncationBase
2
-
3
- def initialize(options = {})
4
- if !options.empty? && !(options.keys - [:only, :except]).empty?
5
- raise ArgumentError, "The only valid options are :only and :except. You specified #{options.keys.join(',')}."
6
- end
7
- if options.has_key?(:only) && options.has_key?(:except)
8
- raise ArgumentError, "You may only specify either :only or :either. Doing both doesn't really make sense does it?"
1
+ module DatabaseCleaner
2
+ class TruncationBase
3
+
4
+ def initialize(options = {})
5
+ if !options.empty? && !(options.keys - [:only, :except]).empty?
6
+ raise ArgumentError, "The only valid options are :only and :except. You specified #{options.keys.join(',')}."
7
+ end
8
+ if options.has_key?(:only) && options.has_key?(:except)
9
+ raise ArgumentError, "You may only specify either :only or :either. Doing both doesn't really make sense does it?"
10
+ end
11
+
12
+ @only = options[:only]
13
+ @tables_to_exclude = (options[:except] || [])
14
+ if migration_storage = migration_storage_name
15
+ @tables_to_exclude << migration_storage
16
+ end
9
17
  end
10
18
 
11
- @only = options[:only]
12
- @tables_to_exclude = (options[:except] || [])
13
- if migration_storage = migration_storage_name
14
- @tables_to_exclude << migration_storage
19
+ def start
20
+ # no-op
15
21
  end
16
- end
17
22
 
18
- def start
19
- # no-op
20
- end
23
+ def clean
24
+ raise NotImplementedError
25
+ end
21
26
 
22
- def clean
23
- raise NotImplementedError
24
- end
25
27
 
28
+ private
26
29
 
27
- private
30
+ def tables_to_truncate
31
+ raise NotImplementedError
32
+ end
28
33
 
29
- def tables_to_truncate
30
- raise NotImplementedError
31
- end
34
+ # overwrite in subclasses
35
+ # default implementation given because migration storage need not be present
36
+ def migration_storage_name
37
+ nil
38
+ end
32
39
 
33
- # overwrite in subclasses
34
- # default implementation given because migration storage need not be present
35
- def migration_storage_name
36
- nil
37
40
  end
38
-
39
41
  end
40
-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bmabey-database_cleaner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Mabey