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 +4 -4
- data/README.md +12 -2
- data/lib/vignette/object_extensions.rb +1 -1
- data/lib/vignette/version.rb +1 -1
- data/spec/lib/vignette/object_extensions_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66e0ea38c02b8c4f418c7c33dba373493ffc404b
|
4
|
+
data.tar.gz: a337a2691497d9f323ab0827a1082025088950bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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:
|
data/lib/vignette/version.rb
CHANGED