simple_split 0.1.0 → 0.1.1

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: 10bbe495f89c5d80168e05747bbdf32cc0ed8911
4
- data.tar.gz: 64f86c88ead59e49ad0b5fc46f0dd3fc22cc98b2
3
+ metadata.gz: 8e870bd860b788a8d5770648e807229436f7e9c9
4
+ data.tar.gz: 5dd6d3bd3febbfba92c5ffe5b11ba2701c83cc97
5
5
  SHA512:
6
- metadata.gz: eec5fe8cf16d9d28f84e62a3c99436aafe17909b5e54ec3bdce9fc30b1272fdbdede0fa36048dbff718a58633255b510c3868282747759fc5b044d4d6bb845d4
7
- data.tar.gz: 8bb9f98d5a22fa4bab376e41e96ebb5cc225543f35997735c12b665b792ebfa75ba084f2132ef4ce56acc1c8c4ec5fd0dfd8703aa2ddedb1eb22d95ddfd1c86b
6
+ metadata.gz: c7547fd08be063d704bd8986b31d5555512d4ea901a7fa8bfce36f445c4a698913ce21d2a657d36f03ac7e157bd17e28f432668cc3d7e93a70e100d00cfe2eb1
7
+ data.tar.gz: 83ee12c738f001fa3fa99df237e5726c989985531b9bbbb7ed72fc88e8abb0db1e6f8b6d1e27e5a0dc5bc192dc5bdba84fdaeeb749afa063cc111ef68398a67e
data/.gitignore CHANGED
@@ -1,6 +1,7 @@
1
1
  /.bundle/
2
2
  /.yardoc
3
3
  /Gemfile.lock
4
+ /bin/
4
5
  /_yardoc/
5
6
  /coverage/
6
7
  /doc/
data/.travis.yml ADDED
@@ -0,0 +1,10 @@
1
+ language: ruby
2
+
3
+ rvm:
4
+ - 2.2.2
5
+
6
+ script: 'bundle exec rake test'
7
+
8
+ addons:
9
+ code_climate:
10
+ repo_token: 45e5207d6d34c78e944b90404be0a316f9d119f93bc03119f601a581137d2556
data/README.md CHANGED
@@ -1,21 +1,22 @@
1
1
 
2
- # simple_split – dead simple A/B testing on Rails
2
+ # simple_split – dead simple A/B testing on Rails [![Gem Version](https://badge.fury.io/rb/simple_split.svg)](http://badge.fury.io/rb/simple_split) [![Code Climate](https://codeclimate.com/github/lexi-lambda/simple_split/badges/gpa.svg)](https://codeclimate.com/github/lexi-lambda/simple_split) [![Build Status](https://travis-ci.org/lexi-lambda/simple_split.svg?branch=master)](https://travis-ci.org/lexi-lambda/simple_split)
3
3
 
4
- The `simple_split` gem provides the absolute simplest possible support for split
5
- testing with Rails that could possibly exist. More feature-complete solutions
6
- like [`split`][split] provide more bells and whistles, but they also do far
7
- more than necessary for simple split testing with good analytics services.
4
+ The `simple_split` gem provides the absolute simplest possible interface for
5
+ split testing via Rails while still providing an expressive set of tools for
6
+ writing and maintaining experiments. More traditional solutions like
7
+ [`split`][split] provide more bells and whistles, but they also do far
8
+ more than is necessary for simple split testing via good analytics services.
8
9
 
9
- Instead, `simple_split` is bare-bones while still supporting flexible testing.
10
+ Instead, `simple_split` is bare bones, but it still supports flexible testing.
10
11
 
11
- - Supports weighted variations
12
+ - Includes optionally-weighted variations
12
13
  - Does not require the use of any data store
13
14
  - Variations already seen by users are tracked via cookies
14
15
 
15
16
  ## Quick Start
16
17
 
17
18
  Add `gem 'simple_split'` to your Gemfile, then run `bundle`. That's it. Now you
18
- can start adding split testing support to your project.
19
+ can start writing A/B tests for your project.
19
20
 
20
21
  All classes that inherit from `ActionView` or `ActionController` have access to
21
22
  the `ab_test` method. It accepts an experiment name and a list of variations.
@@ -25,10 +26,12 @@ ab_test 'experiment_name', 'variation_a', 'variation_b', 'variation_c'
25
26
  ```
26
27
 
27
28
  The result of a call to `ab_test` is a randomly selected variation. If a user
28
- has already seen a particular variation, that variation will always be returned
29
- instead of randomly selecting one.
29
+ has already seen a particular variation, that result will always be returned
30
+ instead of picking a new one.
30
31
 
31
- Weights can be specified using a hash.
32
+ Variations can be weighted by using a hash, where the keys are variation labels
33
+ and the values are numeric weights. If no weight is provided, the default is to
34
+ use `1.0`.
32
35
 
33
36
  ```ruby
34
37
  ab_test 'experiment_name', { 'variation_a' => 1.0, 'variation_b' => 0.2 }
@@ -36,8 +39,9 @@ ab_test 'experiment_name', { 'variation_a' => 1.0, 'variation_b' => 0.2 }
36
39
 
37
40
  ## Credit
38
41
 
39
- This was inspired by the [`simple_abs`][simple_abs] gem, which was already quite
40
- stripped-down, but it didn't quite suit my needs.
42
+ This was inspired by the [`simple_abs`][simple_abs] gem, which also provides a
43
+ stripped-down interface. However, it still persists information to a database,
44
+ and it does not include support for weighted variations.
41
45
 
42
46
  [split]: https://github.com/splitrb/split
43
47
  [simple_abs]: https://github.com/n8/simple_abs
@@ -1,3 +1,3 @@
1
1
  module SimpleSplit
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
data/simple_split.gemspec CHANGED
@@ -13,13 +13,14 @@ Gem::Specification.new do |spec|
13
13
  spec.homepage = 'https://github.com/lexi-lambda/simple_split'
14
14
 
15
15
  spec.files = `git ls-files -z`.split("\x0")
16
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ['lib']
19
19
 
20
20
  spec.add_development_dependency 'bundler', '~> 1.10'
21
21
  spec.add_development_dependency 'rake', '~> 10.0'
22
22
  spec.add_development_dependency 'minitest', '~> 5.7.0'
23
+ spec.add_development_dependency 'codeclimate-test-reporter'
23
24
 
24
25
  spec.add_runtime_dependency 'activesupport', '>= 3.0'
25
26
  spec.add_runtime_dependency 'weighted_randomizer', '>= 0.1.2'
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,9 @@
1
1
  require 'bundler/setup'
2
2
  Bundler.setup
3
3
 
4
+ require 'codeclimate-test-reporter'
5
+ CodeClimate::TestReporter.start
6
+
4
7
  require 'simple_split'
5
8
 
6
9
  require 'minitest/spec'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_split
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexis King
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-13 00:00:00.000000000 Z
11
+ date: 2015-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 5.7.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: codeclimate-test-reporter
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: activesupport
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -83,23 +97,16 @@ dependencies:
83
97
  description:
84
98
  email:
85
99
  - alexis@gophilosophie.com
86
- executables:
87
- - bundler
88
- - console
89
- - rake
90
- - setup
100
+ executables: []
91
101
  extensions: []
92
102
  extra_rdoc_files: []
93
103
  files:
94
104
  - ".gitignore"
95
105
  - ".rubocop.yml"
106
+ - ".travis.yml"
96
107
  - Gemfile
97
108
  - README.md
98
109
  - Rakefile
99
- - bin/bundler
100
- - bin/console
101
- - bin/rake
102
- - bin/setup
103
110
  - lib/simple_split.rb
104
111
  - lib/simple_split/version.rb
105
112
  - simple_split.gemspec
data/bin/bundler DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'bundler' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
- Pathname.new(__FILE__).realpath)
12
-
13
- require 'rubygems'
14
- require 'bundler/setup'
15
-
16
- load Gem.bin_path('bundler', 'bundler')
data/bin/console DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'console' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
- Pathname.new(__FILE__).realpath)
12
-
13
- require 'rubygems'
14
- require 'bundler/setup'
15
-
16
- load Gem.bin_path('simple_split', 'console')
data/bin/rake DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'rake' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
- Pathname.new(__FILE__).realpath)
12
-
13
- require 'rubygems'
14
- require 'bundler/setup'
15
-
16
- load Gem.bin_path('rake', 'rake')
data/bin/setup DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # This file was generated by Bundler.
4
- #
5
- # The application 'setup' is installed as part of a gem, and
6
- # this file is here to facilitate running it.
7
- #
8
-
9
- require 'pathname'
10
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
- Pathname.new(__FILE__).realpath)
12
-
13
- require 'rubygems'
14
- require 'bundler/setup'
15
-
16
- load Gem.bin_path('simple_split', 'setup')