planout 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +21 -18
  3. data/lib/planout/version.rb +1 -1
  4. metadata +1 -2
  5. data/.gitignore +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a46fae7c42eb15d3ef908da8a4fc08a2ce74122
4
- data.tar.gz: afc3daae905df1a66d4b33d18e431b21f55542ed
3
+ metadata.gz: d5c5c1dd6ff42017cf545c0907f6787ea1f4d5a3
4
+ data.tar.gz: 1f07fd26a0d23f8bb5a168d72b7ae6ce719c4887
5
5
  SHA512:
6
- metadata.gz: da01c78e222266fdef408b6995b0fb5766605862c2530e1d445265c56ca76297dcf3f9f69f8765b596088de49b168e7cc2812f3c9b61b18197f90c69a7b10d1f
7
- data.tar.gz: 75098dea4f8ca284bfe9bd01237776fc99f636fabb2a28ada74cf2cc0bc24a5940528e945014b69de5ae6961eea96e3dadcd427e0a7398637bfe93b5b314e9da
6
+ metadata.gz: 9811923bb113830dc50b5513e218b927bc4ca300ab8442c68e8ea14855b51f6086f52dc94d235b71da651dadf7dfff9be35978b3dc04d323049e519e5a2fbe9a
7
+ data.tar.gz: 0f86286b2428c19b46ac4f3bdcbff75cff14da944ab96d33dc76214ec7ce91e7a2ba32b62eba72603b23b4ba113cceec3c0cde67b2639bcd52c573c831b9f3ca
data/README.md CHANGED
@@ -22,22 +22,25 @@ $ gem install planout
22
22
 
23
23
  This defines a simple experiment that randomly assigns three variables, foo, bar, and baz.
24
24
  `foo` and `baz` use `userid` as input, while `bar` uses a pair, namely `userid` combined with the value of `foo` from the prior step.
25
- ```Ruby
26
- class VotingExperiment < SimpleExperiment
27
- # Experiment#assign takes params and an input array
28
- def assign(params, **inputs)
29
- userid = inputs[:userid]
30
-
31
- params[:button_color] = UniformChoice.new({
32
- choices: ['ff0000', '#00ff00'],
33
- unit: userid
34
- })
35
-
36
- params[:button_text] = UniformChoice.new({
37
- choices: ["I'm voting", "I'm a voter"],
38
- unit: userid,
39
- salt:'x'
40
- })
25
+
26
+ ```ruby
27
+ module Planout
28
+ class VotingExperiment < SimpleExperiment
29
+ # Experiment#assign takes params and an input array
30
+ def assign(params, **inputs)
31
+ userid = inputs[:userid]
32
+
33
+ params[:button_color] = UniformChoice.new({
34
+ choices: ['ff0000', '#00ff00'],
35
+ unit: userid
36
+ })
37
+
38
+ params[:button_text] = UniformChoice.new({
39
+ choices: ["I'm voting", "I'm a voter"],
40
+ unit: userid,
41
+ salt:'x'
42
+ })
43
+ end
41
44
  end
42
45
  end
43
46
  ```
@@ -45,7 +48,7 @@ end
45
48
  Then, we can examine the assignments produced for a few input userids. Note that since exposure logging is enabled by default, all of the experiments' inputs, configuration information, timestamp, and parameter assignments are pooped out via the Logger class.
46
49
 
47
50
  ```ruby
48
- my_exp = VotingExperiment.new(userid: 14)
51
+ my_exp = Planout::VotingExperiment.new(userid: 14)
49
52
  my_button_color = my_exp.get(:button_color)
50
53
  button_text = my_exp.get(:button_text)
51
54
  puts "button color is #{my_button_color} and button text is #{button_text}."
@@ -54,7 +57,7 @@ puts "button color is #{my_button_color} and button text is #{button_text}."
54
57
  The output of the Ruby script looks something like this:
55
58
 
56
59
  ```ruby
57
- logged data: {"name":"VotingExperiment","time":1404944726,"salt":"VotingExperiment","inputs":{"userid":14},"params":{"button_color":"ff0000","button_text":"I'm a voter"},"event":"exposure"}
60
+ logged data: {"name":"Planout::VotingExperiment","time":1404944726,"salt":"Planout::VotingExperiment","inputs":{"userid":14},"params":{"button_color":"ff0000","button_text":"I'm a voter"},"event":"exposure"}
58
61
 
59
62
  button color is ff0000 and button text is I'm a voter.
60
63
  ```
@@ -1,3 +1,3 @@
1
1
  module Planout
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: planout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eytan Bakshy
@@ -63,7 +63,6 @@ executables: []
63
63
  extensions: []
64
64
  extra_rdoc_files: []
65
65
  files:
66
- - ".gitignore"
67
66
  - Gemfile
68
67
  - LICENSE
69
68
  - README.md
data/.gitignore DELETED
@@ -1,16 +0,0 @@
1
- /.bundle/
2
- /backup/
3
- /.yardoc
4
- /Gemfile.lock
5
- /_yardoc/
6
- /coverage/
7
- /doc/
8
- /pkg/
9
- /spec/reports/
10
- /tmp/
11
- *.bundle
12
- *.so
13
- *.o
14
- *.a
15
- mkmf.log
16
- .DS_Store