ztk 1.4.6 → 1.4.7
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/lib/ztk/dsl/base.rb +7 -9
- data/lib/ztk/version.rb +1 -1
- metadata +4 -4
data/lib/ztk/dsl/base.rb
CHANGED
@@ -134,7 +134,6 @@ module ZTK::DSL
|
|
134
134
|
|
135
135
|
# @api private
|
136
136
|
def self.inherited(base)
|
137
|
-
# puts("inherited(#{base})")
|
138
137
|
base.send(:extend, ZTK::DSL::Base::ClassMethods)
|
139
138
|
base.instance_eval do
|
140
139
|
attribute :id
|
@@ -143,25 +142,24 @@ module ZTK::DSL
|
|
143
142
|
|
144
143
|
# @api private
|
145
144
|
def self.included(base)
|
146
|
-
#
|
145
|
+
# NOOP
|
147
146
|
end
|
148
147
|
|
149
148
|
# @api private
|
150
149
|
def self.extended(base)
|
151
|
-
#
|
150
|
+
# NOOP
|
152
151
|
end
|
153
152
|
|
154
153
|
def initialize(id=nil, &block)
|
155
154
|
self.id = (id || self.class.id)
|
155
|
+
self.class.dataset.delete_if{ |d| d.id == self.id }
|
156
156
|
self.class.dataset << self
|
157
157
|
block_given? and ((block.arity < 1) ? instance_eval(&block) : block.call(self))
|
158
158
|
|
159
|
-
primary_key_count = self.class.dataset.count do |d|
|
160
|
-
#
|
161
|
-
|
162
|
-
|
163
|
-
# puts("primary_key_count == #{primary_key_count}")
|
164
|
-
raise StandardError, "Primary key '#{self.id}' already exists!" if (primary_key_count > 1)
|
159
|
+
# primary_key_count = self.class.dataset.count do |d|
|
160
|
+
# d.id == self.id
|
161
|
+
# end
|
162
|
+
# raise StandardError, "Primary key '#{self.id}' already exists!" if (primary_key_count > 1)
|
165
163
|
end
|
166
164
|
|
167
165
|
# Instance Inspect
|
data/lib/ztk/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ztk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: erubis
|
@@ -264,7 +264,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
264
264
|
version: '0'
|
265
265
|
segments:
|
266
266
|
- 0
|
267
|
-
hash:
|
267
|
+
hash: 3653747974308376947
|
268
268
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
269
269
|
none: false
|
270
270
|
requirements:
|
@@ -273,7 +273,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
273
273
|
version: '0'
|
274
274
|
segments:
|
275
275
|
- 0
|
276
|
-
hash:
|
276
|
+
hash: 3653747974308376947
|
277
277
|
requirements: []
|
278
278
|
rubyforge_project:
|
279
279
|
rubygems_version: 1.8.25
|