i_wonder 0.0.7 → 0.0.8

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.
@@ -18,7 +18,6 @@ module IWonder
18
18
  @ab_test = AbTest.new(params[:ab_test])
19
19
 
20
20
  if @ab_test.save
21
- AbTesting::Loader.save_ab_tests
22
21
  redirect_to @ab_test, :notice => "Successfully created ABTest"
23
22
  else
24
23
  render "new"
@@ -34,7 +33,6 @@ module IWonder
34
33
  @ab_test = AbTest.find(params[:id])
35
34
 
36
35
  if @ab_test.update_attributes(params[:ab_test])
37
- AbTesting::Loader.save_ab_tests
38
36
  redirect_to @ab_test, :notice => "Successfully updated ABTest"
39
37
  else
40
38
  render "edit"
@@ -13,8 +13,8 @@ case which_test_group?("<%= @ab_test.sym %>")
13
13
  <% for option_name in @ab_test.test_group_names -%>
14
14
  when "<%= option_name%>"
15
15
  ...
16
+ <% end -%>
16
17
  else
17
18
  "Test Not Found"
18
- <% end -%>
19
19
  end
20
20
  </pre>
@@ -11,6 +11,11 @@ module IWonder
11
11
  def which_test_group?(event_sym)
12
12
  ab_test = IWonder::AbTest.find_by_sym(event_sym.to_s)
13
13
  return false unless ab_test
14
+
15
+ if params[:_force_ab_test] and params[:_to_option] and params[:_force_ab_test]==event_sym.to_s
16
+ return params[:_to_option]
17
+ end
18
+
14
19
  ab_test.which_test_group?(self)
15
20
  end
16
21
 
@@ -14,12 +14,14 @@ module IWonder
14
14
  end
15
15
 
16
16
  def self.load_all
17
- Dir.open(AB_TEST_DATA_DIR) do |dir|
18
- dir.each{|file_name|
19
- if file_name =~ /(.+).xml/
20
- load_sym($1)
21
- end
22
- }
17
+ if File.exists?(I_WONDER_DATA_DIR) and File.exists?(AB_TEST_DATA_DIR)
18
+ Dir.open(AB_TEST_DATA_DIR) do |dir|
19
+ dir.each{|file_name|
20
+ if file_name =~ /(.+).xml/
21
+ load_sym($1)
22
+ end
23
+ }
24
+ end
23
25
  end
24
26
  end
25
27
 
@@ -1,3 +1,3 @@
1
1
  module IWonder
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end