hat-trick 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/Changelog CHANGED
@@ -1,3 +1,5 @@
1
+ * 0.2.2 - Lower logging severity to debug for all of the formerly info-level logging output.
2
+
1
3
  * 0.2.1 - Fix a bug where button_to data was shared across multiple users of the app. They are now user-specific, as they should be.
2
4
 
3
5
  * 0.2.0 - Now calls before/after :each callbacks before the step-specific ones
@@ -57,9 +57,9 @@ module HatTrick
57
57
  dynamic_validation_group = false
58
58
 
59
59
  if static_validation_group_exists
60
- Rails.logger.info "Not creating dynamic validation group for #{step_name} because a static one exists"
60
+ Rails.logger.debug "Not creating dynamic validation group for #{step_name} because a static one exists"
61
61
  else
62
- Rails.logger.info "Creating a dynamic validation group for #{step_name}"
62
+ Rails.logger.debug "Creating a dynamic validation group for #{step_name}"
63
63
  dynamic_validation_group = true
64
64
  validation_fields = params.keys # TODO: Try it without these (so only the model keys below)
65
65
  model = model_key
@@ -69,7 +69,7 @@ module HatTrick
69
69
  validation_fields = validation_fields.map(&:to_sym)
70
70
  klass.validation_group(step_name, :fields => validation_fields)
71
71
  end
72
- Rails.logger.info "Setting current validation group for model class #{model_class} to #{step_name}"
72
+ Rails.logger.debug "Setting current validation group for model class #{model_class} to #{step_name}"
73
73
  HatTrick::ModelMethods.set_current_validation_group_for(model_class,
74
74
  step_name,
75
75
  dynamic_validation_group)
@@ -13,10 +13,10 @@ module HatTrick
13
13
  def self.def_action_method_aliases(action_methods)
14
14
  action_methods.each do |meth|
15
15
  unless respond_to?(:"#{meth}_with_hat_trick")
16
- Rails.logger.info "Defining #{meth}_with_hat_trick"
16
+ Rails.logger.debug "Defining #{meth}_with_hat_trick"
17
17
  module_eval <<-RUBY_EVAL
18
18
  def #{meth}_with_hat_trick(*args)
19
- Rails.logger.info "#{meth}_with_hat_trick called"
19
+ Rails.logger.debug "#{meth}_with_hat_trick called"
20
20
  if respond_to?("#{meth}_hook", :include_private)
21
21
  #{meth}_hook(*args)
22
22
  end
@@ -32,10 +32,6 @@ module HatTrick
32
32
 
33
33
  private
34
34
 
35
- def common_hook(*args)
36
- Rails.logger.info "common_hook wizard instance: #{hat_trick_wizard.object_id}"
37
- end
38
-
39
35
  def create_hook(*args)
40
36
  setup_validation_group_for(hat_trick_wizard.current_step)
41
37
  end
data/lib/hat_trick/dsl.rb CHANGED
@@ -214,8 +214,6 @@ module HatTrick
214
214
  wizard_def = self.class.instance_variable_get("@wizard_def")
215
215
  @hat_trick_wizard ||= wizard_def.make_wizard_for(self)
216
216
 
217
- Rails.logger.info "setup_wizard wizard instance: #{@hat_trick_wizard.object_id}"
218
-
219
217
  config_callback = self.class.send(:configure_callback)
220
218
  if config_callback.is_a?(Proc)
221
219
  instance_exec(wizard_def.config, &config_callback)
@@ -232,7 +230,7 @@ module HatTrick
232
230
  end
233
231
 
234
232
  if step_name.present?
235
- Rails.logger.info "Setting current step to: #{step_name}"
233
+ Rails.logger.debug "Setting current step to: #{step_name}"
236
234
  begin
237
235
  @hat_trick_wizard.current_step = step_name
238
236
  rescue StepNotFound => e
@@ -47,10 +47,10 @@ module HatTrick
47
47
  def enable_current_validation_group
48
48
  validation_group = current_step_validation_group
49
49
  if validation_group
50
- Rails.logger.info "Enabling validation group #{validation_group}"
50
+ Rails.logger.debug "Enabling validation group #{validation_group}"
51
51
  enable_validation_group validation_group
52
52
  else
53
- Rails.logger.info "NOT enabling a validation group"
53
+ Rails.logger.debug "NOT enabling a validation group"
54
54
  end
55
55
  end
56
56
  end
@@ -149,14 +149,6 @@ module HatTrick
149
149
  end
150
150
 
151
151
  def run_before_callback(context, model)
152
- log_msg = if model && model.respond_to?(:id)
153
- "Running before callback for #{name} with model id #{model.id}"
154
- elsif model && model.is_a?(ActiveModel::Errors)
155
- "Running before callback for #{name} with errors on model id #{model.instance_variable_get(:@base).id}"
156
- else
157
- "Running before callback for #{name}"
158
- end
159
- Rails.logger.info log_msg
160
152
  run_callbacks(before_callbacks, context, model)
161
153
  end
162
154
 
@@ -1,3 +1,3 @@
1
1
  module HatTrick
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -22,7 +22,7 @@ module HatTrick
22
22
  end
23
23
 
24
24
  def model=(new_model)
25
- Rails.logger.info "Setting model for #{object_id} to #{new_model.inspect}"
25
+ Rails.logger.debug "Setting model for #{object_id} to #{new_model.inspect}"
26
26
  @model = new_model
27
27
  end
28
28
 
@@ -187,7 +187,7 @@ module HatTrick
187
187
  raise "Tried to advance beyond the last step of the wizard"
188
188
  else # we're not on the last step
189
189
  if requested_next_step
190
- Rails.logger.info "Force advancing to step: #{requested_next_step}"
190
+ Rails.logger.debug "Force advancing to step: #{requested_next_step}"
191
191
  self.current_step = requested_next_step
192
192
  run_before_callback
193
193
  # if the step was explicitly requested, we ignore #skipped?
@@ -201,7 +201,7 @@ module HatTrick
201
201
  # make sure we don't loop forever
202
202
  break if current_step == last_step
203
203
  end
204
- Rails.logger.info "Advancing to step: #{current_step}"
204
+ Rails.logger.debug "Advancing to step: #{current_step}"
205
205
  end
206
206
  end
207
207
  end
@@ -227,7 +227,6 @@ module HatTrick
227
227
  end
228
228
  HatTrick::ControllerHooks.def_action_method_aliases(action_methods)
229
229
  action_methods.each do |m|
230
- Rails.logger.info "Aliasing #{m}"
231
230
  controller.class.send(:alias_method_chain, m, :hat_trick)
232
231
  controller.class.send(:private, "#{m}_without_hat_trick")
233
232
  end
@@ -15,7 +15,7 @@ module HatTrick
15
15
  end
16
16
 
17
17
  def make_wizard_for(controller)
18
- Rails.logger.info "Making new wizard instance"
18
+ Rails.logger.debug "Making new wizard instance"
19
19
  wizard = HatTrick::Wizard.new(self)
20
20
  wizard.controller = controller
21
21
  wizard.alias_action_methods
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hat-trick
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
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-06-04 00:00:00.000000000 Z
12
+ date: 2013-06-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec