vignette 0.0.14 → 0.0.15

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f45e9d2eb38a89e35ec4bf6d0cf62d80f77b92ad
4
- data.tar.gz: 8ab414f006635373e0a88eaae142b85f4a205c1c
3
+ metadata.gz: 66e0ea38c02b8c4f418c7c33dba373493ffc404b
4
+ data.tar.gz: a337a2691497d9f323ab0827a1082025088950bd
5
5
  SHA512:
6
- metadata.gz: 0f5b19dea4363391a52e2f7758e03007c0a616d29e15f59f285942d4b15ea3918ff7281160cee2427341bafd0139f7e7c658c97acd97fd13c565a75421c2d183
7
- data.tar.gz: a98445107d11417e51eef0e16566a5cdc1559995ed061a8cc53b01930e02641ba68ccb96ef088620a10984ed14e60594a9c9e5a65946243975f009f5f38e6823
6
+ metadata.gz: 152ca489cb8aa27590be5ebb73851f0480ec0a7d64071a342a846aa814db6e036406f604458e28f472ba599559083ae03dbe6910d82758826b242347436873f1
7
+ data.tar.gz: a7803d620dffa98ee0a0cad175dd61e087830a5f9a44454ed2336fa8d6eabc4f4693329a05b73b16d72c4b49fede8fbecfa8509c9ecdd0a12374e5610f62790b
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Vignette
2
2
 
3
- Vignette makes it dead simple to run reliable A/b tests in your Rails project.
3
+ Vignette makes it dead simple to run reliable A/b tests in your Ruby projects. Vignette integrates seamlessly with Rails by default.
4
4
 
5
5
  ## Examples
6
6
 
@@ -32,7 +32,11 @@ Or install it yourself as:
32
32
 
33
33
  ## Usage
34
34
 
35
- Vignette was crafted to make A/b testing as simple as possible. Simply run the `vignette` function on any Array and get the result from a A/b test. Vignette will store this choice in session, a cookies or nowhere, based on how you configure Vignette. If you're in the request cycle (within an around_filter), Vignette will grab `session` or `cookies` for you. Otherwise, you'll need to specify where to store the result (if you want it consistent for the end-user). Vignette `tests` are identified by a checksum of the Array, and thus, changing the Array results in a new `test`.
35
+ Vignette was crafted to make A/b testing as simple as possible. Simply run the `vignette` function on any Array and get the result from a A/b test. Vignette will store this choice in session, a cookies or a simple Hash object, based on how you configure Vignette.
36
+
37
+ If you run Vignettes from within a Rails request cycle (set up automatically by an `around_filter`), Vignette will grab `session` or `cookies` for you. Otherwise, you'll need to specify where to store the result (if you want it consistent for the end user). You can simply call `Vignette.with_repo(Hash.new)` with wherever you want the current tests stored.
38
+
39
+ Vignette `tests` are identified by a checksum of the Array, and thus, changing the Array results in a new `test`.
36
40
 
37
41
  # To store in session (default)
38
42
  Vignette.init(store: :session)
@@ -64,6 +68,12 @@ The choices for these tests are exposed through the `Vignette.test` method:
64
68
 
65
69
  You may store these values as properties in your analytics system.
66
70
 
71
+ ## Stores
72
+
73
+ You can set anything for the store so long as it can take keys and values based on []= (e.g. `repo["k"] = "v"`). We will handle serialization, etc. That said, if you are using a custom store, it must be unique for each "user". Thus, if you want to keep a global hash object `TESTS`, then you would want to do: `Vignette.with_repo(TESTS[user.id] ||= {})`.
74
+
75
+ If you are in `rails`, then you can simply run `Vignette.set_store(store: :session)` and Vignette will automatically set the repo to be `session` or `cookies` for each request.
76
+
67
77
  ## Naming Tests
68
78
 
69
79
  Vignette tests can also be specifically named, e.g:
@@ -52,7 +52,7 @@ module ObjectExtensions
52
52
  module ActionControllerExtensions
53
53
 
54
54
  def self.included(controller)
55
- controller.around_filter(:with_vignettes)
55
+ controller.prepend_around_filter(:with_vignettes)
56
56
  end
57
57
 
58
58
  private
@@ -1,3 +1,3 @@
1
1
  module Vignette
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
@@ -10,7 +10,7 @@ describe ObjectExtensions do
10
10
  @@filters
11
11
  end
12
12
 
13
- def self.around_filter(filter)
13
+ def self.prepend_around_filter(filter)
14
14
  @@filters << filter
15
15
  end
16
16
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vignette
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoff Hayes