ztk 1.4.6 → 1.4.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/ztk/dsl/base.rb +7 -9
  2. data/lib/ztk/version.rb +1 -1
  3. 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
- # puts("included(#{base})")
145
+ # NOOP
147
146
  end
148
147
 
149
148
  # @api private
150
149
  def self.extended(base)
151
- # puts("extended(#{base})")
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
- # puts("d.id == #{d.id.inspect} / self.id == #{self.id.inspect}")
161
- d.id == self.id
162
- end
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
@@ -1,6 +1,6 @@
1
1
  module ZTK
2
2
 
3
3
  # ZTK Version String
4
- VERSION = "1.4.6"
4
+ VERSION = "1.4.7"
5
5
 
6
6
  end
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.6
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-04 00:00:00.000000000 Z
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: -4478842353570464598
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: -4478842353570464598
276
+ hash: 3653747974308376947
277
277
  requirements: []
278
278
  rubyforge_project:
279
279
  rubygems_version: 1.8.25