kiss 1.8.7 → 1.8.8

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.8.7
1
+ 1.8.8
Binary file
@@ -6,8 +6,8 @@ class Kiss
6
6
 
7
7
  class << self
8
8
  _attr_reader :subdir, :part, :name, :path, :parent_class, :object_options, :aliases
9
+ alias_method :action_path, :path
9
10
  attr_reader :layout, :breadcrumbs, :authentication_required, :base_url
10
-
11
11
  dsl_accessor :breadcrumb, :object_breadcrumb
12
12
 
13
13
  def inherited(subclass)
@@ -17,11 +17,7 @@ class Kiss
17
17
  @_child_classes = {}
18
18
  end
19
19
 
20
- def action_path
21
- self.path
22
- end
23
-
24
- def get_subclass_from_path(path, request, params)
20
+ def action_instance_for_path(path, request, params)
25
21
  action_subdir = ''
26
22
  action_path = '/'
27
23
  action_found = false
@@ -48,7 +44,7 @@ class Kiss
48
44
 
49
45
  if part =~ /\A([\w\-\.\+\%]+)\=([\w\-\.\+\%]+)\Z/
50
46
  params[$1.url_unescape] = $2.url_unescape
51
- action_path += '/'
47
+ action_path += '/' + part
52
48
  next
53
49
  end
54
50
 
@@ -253,8 +249,9 @@ class Kiss
253
249
 
254
250
  attr_accessor :layout, :title
255
251
 
256
- _attr_reader :request, :controller, :forms, :action, :action_path, :template,
252
+ _attr_reader :request, :controller, :forms, :action, :path, :template,
257
253
  :extension, :args, :params, :output, :output_options
254
+ alias_method :action_path, :path
258
255
 
259
256
  def arg(index)
260
257
  @_args[index]
@@ -278,7 +275,7 @@ class Kiss
278
275
  def initialize(request, action_path, extension, collection, object, object_part, object_display_name, breadcrumbs, args, params = {})
279
276
  @_request = request
280
277
  @_controller = request.controller
281
- @_action_path = action_path
278
+ @_path = action_path
282
279
  @_extension = extension
283
280
  @_object = object
284
281
  @_object_part = object_part
@@ -646,10 +643,5 @@ class Kiss
646
643
  def action
647
644
  self
648
645
  end
649
-
650
- def path
651
- self.class.path
652
- end
653
- alias_method :action_path, :path
654
646
  end
655
647
  end
@@ -125,7 +125,7 @@ class Kiss
125
125
  :current_section, :current_columns
126
126
  dsl_accessor :name, :url, :action, :method, :enctype, :errors, :cancel, :mark_required,
127
127
  :id, :class, :style, :html, :error_class, :field_error_class, :objects_save_order,
128
- :object, :prepend_html, :append_html, :year, :timezone
128
+ :object, :prepend_html, :append_html, :year, :timezone, :attach_field_errors
129
129
 
130
130
  # Create DSL methods for component types
131
131
  self.class_eval(
@@ -138,7 +138,8 @@ class Kiss
138
138
  attrs = args.to_attrs
139
139
  add_field({
140
140
  :type => type,
141
- :name => name
141
+ :name => name,
142
+ :attach_errors => @_attach_field_errors
142
143
  }.merge(attrs), &block)
143
144
  end
144
145
 
@@ -171,6 +172,8 @@ class Kiss
171
172
 
172
173
  @_components = []
173
174
  @_fields = Hashay.new
175
+ @_attach_field_errors = false
176
+ @_has_field_errors = false
174
177
  @_object_fields = {}
175
178
  @_default_values ||= {}
176
179
  @_params = {}
@@ -112,7 +112,7 @@ class Kiss
112
112
 
113
113
  def add_error(message)
114
114
  (@_attach_errors ? @_errors : form.errors) << message
115
- @_form.has_field_errors = true
115
+ @_form.field_errors << message
116
116
  nil
117
117
  end
118
118
 
@@ -10,8 +10,7 @@ class Kiss
10
10
  @_session['login'] = {}
11
11
  end
12
12
 
13
- @_persist_data = @_session['login']
14
- self.merge!(@_persist_data)
13
+ self.merge!(@_session['login'])
15
14
  end
16
15
 
17
16
  def expired?
@@ -19,7 +18,7 @@ class Kiss
19
18
  end
20
19
 
21
20
  def persist(data = {})
22
- @_persist_data.merge!(data)
21
+ @_session['login'].merge!(data)
23
22
  self.merge!(data)
24
23
  end
25
24
 
@@ -191,7 +191,7 @@ EOT
191
191
  @@action_class ||= Kiss::Action.get_root_class(@_controller, @_controller.action_dir)
192
192
 
193
193
  # return action handler (instance of action class)
194
- @@action_class.get_subclass_from_path(path, self, params)
194
+ @@action_class.action_instance_for_path(path, self, params)
195
195
  end
196
196
 
197
197
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 8
8
- - 7
9
- version: 1.8.7
8
+ - 8
9
+ version: 1.8.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - Shawn Van Ittersum
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-03-18 00:00:00 -07:00
17
+ date: 2012-07-12 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency