split-export 0.3.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/LICENSE +1 -1
- data/Readme.mdown +6 -6
- data/lib/split/export.rb +3 -8
- data/lib/split/export/version.rb +1 -1
- data/spec/export_spec.rb +7 -7
- data/spec/spec_helper.rb +9 -1
- data/split-export.gemspec +8 -5
- metadata +62 -86
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 94516c1df769987886e7bd0b55020f14050073c4
|
4
|
+
data.tar.gz: 3b1152eb551d5b5bb4f5b80341002d2abb1b7eac
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 60d0abd7ec3133040ad118f75bc5a5c81319afe8487594304615623a8bf52899e8ef5a87fab31177e9603563be25f0d164144a0ad60a8c86d3a1a72ac0e0952d
|
7
|
+
data.tar.gz: 5427171a49386e4f5792cacb7afb9de0dc20c8f278cf18122bf5e03582be119ccc1443fd5e327de08f5176d92226bc4120f12df9cad2fd19f3ae5173ce33bea2
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at andrewnez@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/LICENSE
CHANGED
data/Readme.mdown
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# Split
|
1
|
+
# [Split Export](http://libraries.io/rubygems/split-export)
|
2
2
|
|
3
|
-
An extension to [Split](http://github.com/
|
3
|
+
An extension to [Split](http://github.com/splitrb/split) to allow for easy exporting of AB testing data.
|
4
4
|
|
5
5
|
## Requirements
|
6
6
|
|
@@ -28,12 +28,12 @@ and require it in your project:
|
|
28
28
|
|
29
29
|
require 'split/export'
|
30
30
|
csv_data = Split::Export.to_csv
|
31
|
-
File.open('path/to/my.csv, 'w') {|f| f.write(csv_data) }
|
31
|
+
File.open('path/to/my.csv', 'w') {|f| f.write(csv_data) }
|
32
32
|
|
33
33
|
## Development
|
34
34
|
|
35
|
-
Source hosted at [GitHub](http://github.com/
|
36
|
-
Report Issues/Feature requests on [GitHub Issues](http://github.com/
|
35
|
+
Source hosted at [GitHub](http://github.com/splitrb/split-export).
|
36
|
+
Report Issues/Feature requests on [GitHub Issues](http://github.com/splitrb/split-export/issues).
|
37
37
|
|
38
38
|
Tests can be ran with `rake spec`
|
39
39
|
|
@@ -49,4 +49,4 @@ Tests can be ran with `rake spec`
|
|
49
49
|
|
50
50
|
## Copyright
|
51
51
|
|
52
|
-
Copyright (c)
|
52
|
+
Copyright (c) 2013 Andrew Nesbitt. See LICENSE for details.
|
data/lib/split/export.rb
CHANGED
@@ -2,15 +2,10 @@ require 'split'
|
|
2
2
|
require 'csv'
|
3
3
|
require 'bigdecimal'
|
4
4
|
|
5
|
-
if CSV.const_defined? :Reader
|
6
|
-
require 'fastercsv'
|
7
|
-
CSV = FasterCSV
|
8
|
-
end
|
9
|
-
|
10
5
|
module Split
|
11
6
|
module Export
|
12
7
|
extend self
|
13
|
-
|
8
|
+
|
14
9
|
def round(number, precision = 2)
|
15
10
|
BigDecimal.new(number.to_s).round(precision).to_f
|
16
11
|
end
|
@@ -18,7 +13,7 @@ module Split
|
|
18
13
|
def to_csv
|
19
14
|
csv = CSV.generate do |csv|
|
20
15
|
csv << ['Experiment', 'Alternative', 'Participants', 'Completed', 'Conversion Rate', 'Z score', 'Control', 'Winner']
|
21
|
-
Split::
|
16
|
+
Split::ExperimentCatalog.all.each do |experiment|
|
22
17
|
experiment.alternatives.each do |alternative|
|
23
18
|
csv << [experiment.name,
|
24
19
|
alternative.name,
|
@@ -33,4 +28,4 @@ module Split
|
|
33
28
|
end
|
34
29
|
end
|
35
30
|
end
|
36
|
-
end
|
31
|
+
end
|
data/lib/split/export/version.rb
CHANGED
data/spec/export_spec.rb
CHANGED
@@ -2,18 +2,18 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Split::Export do
|
4
4
|
before :each do
|
5
|
-
experiment = Split::
|
6
|
-
blue = Split::Alternative.
|
5
|
+
experiment = Split::ExperimentCatalog.find_or_create('link_color', 'blue', 'red', 'green')
|
6
|
+
blue = Split::Alternative.new('blue', 'link_color')
|
7
7
|
blue.participant_count = 5
|
8
|
-
blue.
|
8
|
+
blue.set_completed_count(3)
|
9
9
|
blue.save
|
10
|
-
red = Split::Alternative.
|
10
|
+
red = Split::Alternative.new('red', 'link_color')
|
11
11
|
red.participant_count = 6
|
12
|
-
red.
|
12
|
+
red.set_completed_count(4)
|
13
13
|
red.save
|
14
14
|
end
|
15
15
|
|
16
16
|
it "should generate a csv of split data" do
|
17
|
-
Split::Export.to_csv.should eql("Experiment,Alternative,Participants,Completed,Conversion Rate,Z score,Control,Winner\nlink_color,blue,5,3,0.6,0.0,true,false\nlink_color,red,6,4,0.667,0.
|
17
|
+
Split::Export.to_csv.should eql("Experiment,Alternative,Participants,Completed,Conversion Rate,Z score,Control,Winner\nlink_color,blue,5,3,0.6,0.0,true,false\nlink_color,red,6,4,0.667,0.0,false,false\nlink_color,green,0,0,0.0,0.0,false,false\n")
|
18
18
|
end
|
19
|
-
end
|
19
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,4 +1,12 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'bundler/setup'
|
3
3
|
require 'split'
|
4
|
-
require 'split/export'
|
4
|
+
require 'split/export'
|
5
|
+
|
6
|
+
RSpec.configure do |config|
|
7
|
+
config.order = 'random'
|
8
|
+
config.before(:each) do
|
9
|
+
Split.configuration = Split::Configuration.new
|
10
|
+
Split.redis.flushall
|
11
|
+
end
|
12
|
+
end
|
data/split-export.gemspec
CHANGED
@@ -7,17 +7,20 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = Split::Export::VERSION
|
8
8
|
s.authors = ["Andrew Nesbitt"]
|
9
9
|
s.email = ["andrewnez@gmail.com"]
|
10
|
-
s.homepage = "https://github.com/
|
11
|
-
s.summary =
|
10
|
+
s.homepage = "https://github.com/splitrb/split-export"
|
11
|
+
s.summary = "Split extension to export your data"
|
12
|
+
s.license = 'MIT'
|
13
|
+
|
14
|
+
s.required_ruby_version = '>= 1.9.2'
|
12
15
|
|
13
16
|
s.files = `git ls-files`.split("\n")
|
14
17
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
15
18
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
16
19
|
s.require_paths = ["lib"]
|
17
20
|
|
18
|
-
s.add_dependency
|
19
|
-
s.add_dependency(%q<fastercsv>, ['>= 1.2.0'])
|
21
|
+
s.add_dependency "split", "~> 1.4.0"
|
20
22
|
|
21
23
|
# Development Dependencies
|
22
|
-
s.add_development_dependency
|
24
|
+
s.add_development_dependency "rspec", "~> 2.6"
|
25
|
+
s.add_development_dependency "rake", "~> 11.1"
|
23
26
|
end
|
metadata
CHANGED
@@ -1,80 +1,66 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: split-export
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease: false
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 3
|
9
|
-
- 0
|
10
|
-
version: 0.3.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Andrew Nesbitt
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2016-04-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
22
14
|
name: split
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 13
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
- 3
|
33
|
-
version: "0.3"
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.4.0
|
34
20
|
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: fastercsv
|
38
21
|
prerelease: false
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
segments:
|
46
|
-
- 1
|
47
|
-
- 2
|
48
|
-
- 0
|
49
|
-
version: 1.2.0
|
50
|
-
type: :runtime
|
51
|
-
version_requirements: *id002
|
52
|
-
- !ruby/object:Gem::Dependency
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.4.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
53
28
|
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.6'
|
34
|
+
type: :development
|
54
35
|
prerelease: false
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.6'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '11.1'
|
65
48
|
type: :development
|
66
|
-
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '11.1'
|
67
55
|
description:
|
68
|
-
email:
|
56
|
+
email:
|
69
57
|
- andrewnez@gmail.com
|
70
58
|
executables: []
|
71
|
-
|
72
59
|
extensions: []
|
73
|
-
|
74
60
|
extra_rdoc_files: []
|
75
|
-
|
76
|
-
|
77
|
-
- .
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- CODE_OF_CONDUCT.md
|
78
64
|
- Gemfile
|
79
65
|
- LICENSE
|
80
66
|
- Rakefile
|
@@ -84,40 +70,30 @@ files:
|
|
84
70
|
- spec/export_spec.rb
|
85
71
|
- spec/spec_helper.rb
|
86
72
|
- split-export.gemspec
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
73
|
+
homepage: https://github.com/splitrb/split-export
|
74
|
+
licenses:
|
75
|
+
- MIT
|
76
|
+
metadata: {}
|
91
77
|
post_install_message:
|
92
78
|
rdoc_options: []
|
93
|
-
|
94
|
-
require_paths:
|
79
|
+
require_paths:
|
95
80
|
- lib
|
96
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
97
|
-
|
98
|
-
requirements:
|
81
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
99
83
|
- - ">="
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
version: "0"
|
105
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
106
|
-
none: false
|
107
|
-
requirements:
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 1.9.2
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
108
88
|
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
|
111
|
-
segments:
|
112
|
-
- 0
|
113
|
-
version: "0"
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
114
91
|
requirements: []
|
115
|
-
|
116
92
|
rubyforge_project:
|
117
|
-
rubygems_version:
|
93
|
+
rubygems_version: 2.5.1
|
118
94
|
signing_key:
|
119
|
-
specification_version:
|
95
|
+
specification_version: 4
|
120
96
|
summary: Split extension to export your data
|
121
|
-
test_files:
|
97
|
+
test_files:
|
122
98
|
- spec/export_spec.rb
|
123
99
|
- spec/spec_helper.rb
|