typestrict 0.0.15 → 0.0.16

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.
Files changed (4) hide show
  1. data/History.txt +7 -0
  2. data/lib/base.rb +12 -11
  3. data/lib/typestrict.rb +1 -1
  4. metadata +4 -4
data/History.txt CHANGED
@@ -1,3 +1,10 @@
1
+ === 0.0.16 / 2010-08-20
2
+ * 2 enhancements
3
+
4
+ * Reformed definition of supertypes to account for multiple errors being caught and raised
5
+ * renamed policy enforce_defaults! to enforce_map_defaults!
6
+
7
+
1
8
  === 0.0.12 / 2010-08-16
2
9
  * 3 major enhancements
3
10
 
data/lib/base.rb CHANGED
@@ -164,6 +164,18 @@ module Strict
164
164
  return map
165
165
  end
166
166
 
167
+ def enforce_map_defaults!(matrix, map)
168
+ enforce_primitive!(Hash, matrix, "lib/typestrict")
169
+ enforce_primitive!(Hash, map, "lib/typestrict")
170
+
171
+ matrix.each do |param, default_value|
172
+ if !map.has_key? param
173
+ map[param] = default_value
174
+ end
175
+ end
176
+ return map
177
+ end
178
+
167
179
  def enforce_map_optional!(matrix, map)
168
180
  enforce_primitive!(Hash, matrix, "lib/typestrict")
169
181
  enforce_primitive!(Hash, map, "lib/typestrict")
@@ -179,16 +191,5 @@ module Strict
179
191
  setmode_raise!
180
192
  return map
181
193
  end
182
-
183
- def enforce_defaults!(matrix, map)
184
- enforce_primitive!(Hash, matrix, "lib/typestrict")
185
- enforce_primitive!(Hash, map, "lib/typestrict")
186
-
187
- matrix.each do |param, default|
188
- if !map.has_key? param
189
- map[param] = default
190
- end
191
- end
192
- end
193
194
  end
194
195
  end
data/lib/typestrict.rb CHANGED
@@ -2,7 +2,7 @@ require File.join(File.dirname(__FILE__), 'base')
2
2
  require File.join(File.dirname(__FILE__), 'supertypes')
3
3
 
4
4
  module Strict
5
- VERSION = '0.0.15'
5
+ VERSION = '0.0.16'
6
6
  include Strict::Base
7
7
  include Strict::SuperTypes
8
8
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: typestrict
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 63
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 15
10
- version: 0.0.15
9
+ - 16
10
+ version: 0.0.16
11
11
  platform: ruby
12
12
  authors:
13
13
  - Raeez Lorgat
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-18 00:00:00 -07:00
18
+ date: 2010-08-20 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency