lite-statistics 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +7 -0
  2. data/.fasterer.yml +19 -0
  3. data/.gitignore +11 -0
  4. data/.rspec +4 -0
  5. data/.rubocop.yml +24 -0
  6. data/.travis.yml +24 -0
  7. data/CHANGELOG.md +11 -0
  8. data/CODE_OF_CONDUCT.md +74 -0
  9. data/Gemfile +6 -0
  10. data/Gemfile.lock +119 -0
  11. data/LICENSE.txt +21 -0
  12. data/README.md +165 -0
  13. data/Rakefile +8 -0
  14. data/_config.yml +1 -0
  15. data/benchmarks/descriptive_statistics.rb +60 -0
  16. data/bin/console +15 -0
  17. data/bin/setup +8 -0
  18. data/docs/.DS_Store +0 -0
  19. data/docs/descriptive/COEFFICIENT_OF_VARIATION.md +19 -0
  20. data/docs/descriptive/FREQUENCIES.md +22 -0
  21. data/docs/descriptive/KURTOSIS.md +19 -0
  22. data/docs/descriptive/MAX.md +17 -0
  23. data/docs/descriptive/MEAN.md +19 -0
  24. data/docs/descriptive/MEDIAN.md +17 -0
  25. data/docs/descriptive/MIDRANGE.md +19 -0
  26. data/docs/descriptive/MIN.md +17 -0
  27. data/docs/descriptive/MODE.md +17 -0
  28. data/docs/descriptive/PERCENTILE_FROM_VALUE.md +19 -0
  29. data/docs/descriptive/PROPORTIONS.md +22 -0
  30. data/docs/descriptive/RANGE.md +17 -0
  31. data/docs/descriptive/SIZE.md +19 -0
  32. data/docs/descriptive/SKEWNESS.md +19 -0
  33. data/docs/descriptive/STANDARD_DEVIATION.md +19 -0
  34. data/docs/descriptive/STANDARD_ERROR.md +19 -0
  35. data/docs/descriptive/SUM.md +17 -0
  36. data/docs/descriptive/SUMMARY.md +25 -0
  37. data/docs/descriptive/VALUE_FROM_PERCENTILE.md +19 -0
  38. data/docs/descriptive/VARIANCE.md +19 -0
  39. data/docs/descriptive/ZSCORE.md +24 -0
  40. data/lib/generators/lite/statistics/install_generator.rb +17 -0
  41. data/lib/generators/lite/statistics/templates/install.rb +5 -0
  42. data/lib/lite/statistics.rb +9 -0
  43. data/lib/lite/statistics/base.rb +19 -0
  44. data/lib/lite/statistics/configuration.rb +29 -0
  45. data/lib/lite/statistics/descriptive.rb +361 -0
  46. data/lib/lite/statistics/enumerable.rb +24 -0
  47. data/lib/lite/statistics/version.rb +9 -0
  48. data/lite-statistics.gemspec +48 -0
  49. metadata +202 -0
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Enumerable
4
+
5
+ Lite::Statistics::Descriptive::CALCULATIONS.each do |name|
6
+ next if %i[max min sum].include?(name)
7
+
8
+ define_method(name) { |*args| Lite::Statistics::Descriptive.send(name, self, *args) }
9
+ end
10
+
11
+ alias average mean
12
+ alias coefficient_of_variation sample_coefficient_of_variation
13
+ alias kurtosis sample_kurtosis
14
+ alias midextreme midrange
15
+ alias percentile percentile_from_value
16
+ alias percentile_rank value_from_percentile
17
+ alias skewness sample_skewness
18
+ alias standard_deviation sample_standard_deviation
19
+ alias standard_error sample_standard_error
20
+ alias summary sample_summary
21
+ alias variance sample_variance
22
+ alias zscore sample_zscore
23
+
24
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Lite
4
+ module Statistics
5
+
6
+ VERSION ||= '1.0.0'
7
+
8
+ end
9
+ end
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'lite/statistics/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'lite-statistics'
9
+ spec.version = Lite::Statistics::VERSION
10
+ spec.authors = ['Juan Gomez']
11
+ spec.email = %w[j.gomez@drexed.com]
12
+
13
+ spec.summary = 'Generate statistics from collections of data points'
14
+ spec.homepage = 'http://drexed.github.io/lite-statistics'
15
+ spec.license = 'MIT'
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata.merge(
21
+ 'allowed_push_host' => 'https://rubygems.org',
22
+ 'changelog_uri' => 'https://github.com/drexed/lite-statistics/blob/master/CHANGELOG.md',
23
+ 'homepage_uri' => spec.homepage,
24
+ 'source_code_uri' => 'https://github.com/drexed/lite-statistics'
25
+ )
26
+ else
27
+ raise 'RubyGems 2.0 or newer is required to protect against ' \
28
+ 'public gem pushes.'
29
+ end
30
+
31
+ # Specify which files should be added to the gem when it is released.
32
+ # The `git ls-files -z` loads the files in the StatisticsGem that have been added into git.
33
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
34
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
35
+ end
36
+ spec.bindir = 'exe'
37
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
38
+ spec.require_paths = %w[lib]
39
+
40
+ spec.add_development_dependency 'bundler'
41
+ spec.add_development_dependency 'fasterer'
42
+ spec.add_development_dependency 'generator_spec'
43
+ spec.add_development_dependency 'rake'
44
+ spec.add_development_dependency 'rspec'
45
+ spec.add_development_dependency 'rubocop'
46
+ spec.add_development_dependency 'rubocop-performance'
47
+ spec.add_development_dependency 'rubocop-rspec'
48
+ end
metadata ADDED
@@ -0,0 +1,202 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lite-statistics
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Juan Gomez
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-07-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: fasterer
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: generator_spec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
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'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop-performance
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ description:
126
+ email:
127
+ - j.gomez@drexed.com
128
+ executables: []
129
+ extensions: []
130
+ extra_rdoc_files: []
131
+ files:
132
+ - ".fasterer.yml"
133
+ - ".gitignore"
134
+ - ".rspec"
135
+ - ".rubocop.yml"
136
+ - ".travis.yml"
137
+ - CHANGELOG.md
138
+ - CODE_OF_CONDUCT.md
139
+ - Gemfile
140
+ - Gemfile.lock
141
+ - LICENSE.txt
142
+ - README.md
143
+ - Rakefile
144
+ - _config.yml
145
+ - benchmarks/descriptive_statistics.rb
146
+ - bin/console
147
+ - bin/setup
148
+ - docs/.DS_Store
149
+ - docs/descriptive/COEFFICIENT_OF_VARIATION.md
150
+ - docs/descriptive/FREQUENCIES.md
151
+ - docs/descriptive/KURTOSIS.md
152
+ - docs/descriptive/MAX.md
153
+ - docs/descriptive/MEAN.md
154
+ - docs/descriptive/MEDIAN.md
155
+ - docs/descriptive/MIDRANGE.md
156
+ - docs/descriptive/MIN.md
157
+ - docs/descriptive/MODE.md
158
+ - docs/descriptive/PERCENTILE_FROM_VALUE.md
159
+ - docs/descriptive/PROPORTIONS.md
160
+ - docs/descriptive/RANGE.md
161
+ - docs/descriptive/SIZE.md
162
+ - docs/descriptive/SKEWNESS.md
163
+ - docs/descriptive/STANDARD_DEVIATION.md
164
+ - docs/descriptive/STANDARD_ERROR.md
165
+ - docs/descriptive/SUM.md
166
+ - docs/descriptive/SUMMARY.md
167
+ - docs/descriptive/VALUE_FROM_PERCENTILE.md
168
+ - docs/descriptive/VARIANCE.md
169
+ - docs/descriptive/ZSCORE.md
170
+ - lib/generators/lite/statistics/install_generator.rb
171
+ - lib/generators/lite/statistics/templates/install.rb
172
+ - lib/lite/statistics.rb
173
+ - lib/lite/statistics/base.rb
174
+ - lib/lite/statistics/configuration.rb
175
+ - lib/lite/statistics/descriptive.rb
176
+ - lib/lite/statistics/enumerable.rb
177
+ - lib/lite/statistics/version.rb
178
+ - lite-statistics.gemspec
179
+ homepage: http://drexed.github.io/lite-statistics
180
+ licenses:
181
+ - MIT
182
+ metadata: {}
183
+ post_install_message:
184
+ rdoc_options: []
185
+ require_paths:
186
+ - lib
187
+ required_ruby_version: !ruby/object:Gem::Requirement
188
+ requirements:
189
+ - - ">="
190
+ - !ruby/object:Gem::Version
191
+ version: '0'
192
+ required_rubygems_version: !ruby/object:Gem::Requirement
193
+ requirements:
194
+ - - ">="
195
+ - !ruby/object:Gem::Version
196
+ version: '0'
197
+ requirements: []
198
+ rubygems_version: 3.0.4
199
+ signing_key:
200
+ specification_version: 4
201
+ summary: Generate statistics from collections of data points
202
+ test_files: []