montecasting 0.2.4 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62e9dea601665301368b538de29341cb7fe12db57499dae979d4081c2974a6f6
4
- data.tar.gz: 8abb36be3898932f678a36346eda94768b27046790a8ee6011495265c9ff0fb5
3
+ metadata.gz: 29d07448cb37c51be4f64b64748275f08f37ccf44a53bca3f52d1819220e49fb
4
+ data.tar.gz: 6d8b6f3d353d528a9d904956d4c6a86fc84d20585356ab394f99d3a7c6b3285a
5
5
  SHA512:
6
- metadata.gz: bd6d268c96fc2c0f819b906b88eb4f2606af694ba4d242280455b400cf0c265af0cc479d3573800fd151c63f52566ddffc4d97212c52d2f8c206116e41a6da94
7
- data.tar.gz: b4b0fcd58333d0220320fc82711fee7712ec50fd18e8f6f689160e9edc1c9c2dc96919ef4132c16267cc33c8396b8194745b863b6f614e331fd96de19c729024
6
+ metadata.gz: 7f4ca5dcb825735d1d055c34cf16d2d6b9e119620b779ae107ad9cc01b6f49c8f8c8db3e5e05f76c03cba37235c7a093b4073aed90a7aaedd6d887bfcca231d2
7
+ data.tar.gz: 6b7b7806b3c97b9b2f8a05510621e07ecc2cd1277c294defa6a64d0e73293f723b90036f1bf20af755f735846635762c4554dce19f009ee2abc6b05029333a3a
data/.idea/workspace.xml CHANGED
@@ -12,12 +12,12 @@
12
12
  <option name="LAST_RESOLUTION" value="IGNORE" />
13
13
  </component>
14
14
  <component name="FileEditorManager">
15
- <leaf>
15
+ <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
16
16
  <file pinned="false" current-in-tab="false">
17
17
  <entry file="file://$PROJECT_DIR$/lib/montecasting.rb">
18
18
  <provider selected="true" editor-type-id="text-editor">
19
- <state relative-caret-position="721">
20
- <caret line="33" column="5" lean-forward="true" selection-start-line="33" selection-start-column="5" selection-end-line="33" selection-end-column="5" />
19
+ <state relative-caret-position="968">
20
+ <caret line="44" lean-forward="true" selection-start-line="44" selection-end-line="44" />
21
21
  </state>
22
22
  </provider>
23
23
  </entry>
@@ -25,22 +25,17 @@
25
25
  <file pinned="false" current-in-tab="false">
26
26
  <entry file="file://$PROJECT_DIR$/lib/montecasting/array.rb">
27
27
  <provider selected="true" editor-type-id="text-editor">
28
- <state relative-caret-position="374">
29
- <caret line="17" selection-start-line="17" selection-end-line="17" />
28
+ <state relative-caret-position="418">
29
+ <caret line="19" column="19" selection-start-line="19" selection-start-column="19" selection-end-line="19" selection-end-column="19" />
30
30
  </state>
31
31
  </provider>
32
32
  </entry>
33
33
  </file>
34
- <file pinned="false" current-in-tab="false">
35
- <entry file="file://$PROJECT_DIR$/spec/spec_helper.rb">
36
- <provider selected="true" editor-type-id="text-editor" />
37
- </entry>
38
- </file>
39
34
  <file pinned="false" current-in-tab="false">
40
35
  <entry file="file://$PROJECT_DIR$/spec/montecasting_spec.rb">
41
36
  <provider selected="true" editor-type-id="text-editor">
42
- <state relative-caret-position="418">
43
- <caret line="19" lean-forward="true" selection-start-line="19" selection-end-line="19" />
37
+ <state relative-caret-position="66">
38
+ <caret line="3" column="135" lean-forward="true" selection-start-line="3" selection-start-column="113" selection-end-line="3" selection-end-column="135" />
44
39
  </state>
45
40
  </provider>
46
41
  </entry>
@@ -57,7 +52,7 @@
57
52
  <file pinned="false" current-in-tab="false">
58
53
  <entry file="file://$APPLICATION_HOME_DIR$/rubystubs26/time.rb">
59
54
  <provider selected="true" editor-type-id="text-editor">
60
- <state relative-caret-position="1493">
55
+ <state relative-caret-position="2574">
61
56
  <caret line="117" column="13" selection-start-line="117" selection-start-column="13" selection-end-line="117" selection-end-column="13" />
62
57
  </state>
63
58
  </provider>
@@ -66,8 +61,20 @@
66
61
  <file pinned="false" current-in-tab="false">
67
62
  <entry file="file://$PROJECT_DIR$/montecasting.gemspec">
68
63
  <provider selected="true" editor-type-id="text-editor">
69
- <state relative-caret-position="132">
70
- <caret line="6" column="42" selection-start-line="6" selection-start-column="42" selection-end-line="6" selection-end-column="42" />
64
+ <state relative-caret-position="242">
65
+ <caret line="11" column="233" selection-start-line="11" selection-start-column="26" selection-end-line="11" selection-end-column="233" />
66
+ </state>
67
+ </provider>
68
+ </entry>
69
+ </file>
70
+ <file pinned="false" current-in-tab="false">
71
+ <entry file="file://$PROJECT_DIR$/README.md">
72
+ <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
73
+ <state split_layout="SPLIT">
74
+ <first_editor relative-caret-position="1254">
75
+ <caret line="57" column="8" selection-start-line="57" selection-start-column="8" selection-end-line="57" selection-end-column="8" />
76
+ </first_editor>
77
+ <second_editor />
71
78
  </state>
72
79
  </provider>
73
80
  </entry>
@@ -85,8 +92,8 @@
85
92
  <file pinned="false" current-in-tab="true">
86
93
  <entry file="file://$PROJECT_DIR$/lib/montecasting/version.rb">
87
94
  <provider selected="true" editor-type-id="text-editor">
88
- <state relative-caret-position="88">
89
- <caret line="4" column="18" selection-start-line="4" selection-start-column="18" selection-end-line="4" selection-end-column="18" />
95
+ <state relative-caret-position="132">
96
+ <caret line="6" lean-forward="true" selection-start-line="6" selection-end-line="6" />
90
97
  </state>
91
98
  </provider>
92
99
  </entry>
@@ -109,10 +116,11 @@
109
116
  <option value="$PROJECT_DIR$/.gitignore" />
110
117
  <option value="$PROJECT_DIR$/lib/numeric.rb" />
111
118
  <option value="$PROJECT_DIR$/montecasting.gemspec" />
112
- <option value="$PROJECT_DIR$/lib/montecasting/array.rb" />
113
119
  <option value="$PROJECT_DIR$/Gemfile" />
114
- <option value="$PROJECT_DIR$/lib/montecasting.rb" />
120
+ <option value="$PROJECT_DIR$/README.md" />
121
+ <option value="$PROJECT_DIR$/lib/montecasting/array.rb" />
115
122
  <option value="$PROJECT_DIR$/spec/montecasting_spec.rb" />
123
+ <option value="$PROJECT_DIR$/lib/montecasting.rb" />
116
124
  <option value="$PROJECT_DIR$/lib/montecasting/version.rb" />
117
125
  </list>
118
126
  </option>
@@ -128,11 +136,11 @@
128
136
  </list>
129
137
  </option>
130
138
  </component>
131
- <component name="ProjectFrameBounds">
132
- <option name="x" value="119" />
133
- <option name="y" value="23" />
134
- <option name="width" value="2282" />
135
- <option name="height" value="1417" />
139
+ <component name="ProjectFrameBounds" extendedState="6">
140
+ <option name="x" value="164" />
141
+ <option name="y" value="102" />
142
+ <option name="width" value="2382" />
143
+ <option name="height" value="1209" />
136
144
  </component>
137
145
  <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
138
146
  <component name="ProjectView">
@@ -140,6 +148,7 @@
140
148
  <foldersAlwaysOnTop value="true" />
141
149
  </navigator>
142
150
  <panes>
151
+ <pane id="Scope" />
143
152
  <pane id="ProjectPane">
144
153
  <subPane>
145
154
  <expand>
@@ -176,7 +185,6 @@
176
185
  <select />
177
186
  </subPane>
178
187
  </pane>
179
- <pane id="Scope" />
180
188
  </panes>
181
189
  </component>
182
190
  <component name="PropertiesComponent">
@@ -185,6 +193,11 @@
185
193
  <property name="nodejs_npm_path_reset_for_default_project" value="true" />
186
194
  <property name="settings.editor.selected.configurable" value="org.jetbrains.plugins.ruby.settings.RubyActiveModuleSdkConfigurable" />
187
195
  </component>
196
+ <component name="RecentsManager">
197
+ <key name="MoveFile.RECENT_KEYS">
198
+ <recent name="$PROJECT_DIR$/lib/montecasting" />
199
+ </key>
200
+ </component>
188
201
  <component name="RunDashboard">
189
202
  <option name="ruleStates">
190
203
  <list>
@@ -245,7 +258,8 @@
245
258
  <option name="number" value="Default" />
246
259
  <option name="presentableId" value="Default" />
247
260
  <updated>1567089679850</updated>
248
- <workItem from="1567089680950" duration="17370000" />
261
+ <workItem from="1567089680950" duration="18608000" />
262
+ <workItem from="1567414586349" duration="1889000" />
249
263
  </task>
250
264
  <task id="LOCAL-00001" summary="Ruby Gem for Project Forecasting Methods">
251
265
  <created>1567089862211</created>
@@ -282,7 +296,21 @@
282
296
  <option name="project" value="LOCAL" />
283
297
  <updated>1567180594715</updated>
284
298
  </task>
285
- <option name="localTasksCounter" value="6" />
299
+ <task id="LOCAL-00006" summary="Ruby Gem for Project Forecasting Methods">
300
+ <created>1567181534230</created>
301
+ <option name="number" value="00006" />
302
+ <option name="presentableId" value="LOCAL-00006" />
303
+ <option name="project" value="LOCAL" />
304
+ <updated>1567181534230</updated>
305
+ </task>
306
+ <task id="LOCAL-00007" summary="Ruby Gem for Project Forecasting Methods">
307
+ <created>1567417423329</created>
308
+ <option name="number" value="00007" />
309
+ <option name="presentableId" value="LOCAL-00007" />
310
+ <option name="project" value="LOCAL" />
311
+ <updated>1567417423329</updated>
312
+ </task>
313
+ <option name="localTasksCounter" value="8" />
286
314
  <servers />
287
315
  </component>
288
316
  <component name="TestHistory">
@@ -291,31 +319,40 @@
291
319
  </history-entry>
292
320
  </component>
293
321
  <component name="TimeTrackingManager">
294
- <option name="totallyTimeSpent" value="17370000" />
322
+ <option name="totallyTimeSpent" value="20497000" />
323
+ </component>
324
+ <component name="TodoView">
325
+ <todo-panel id="selected-file">
326
+ <is-autoscroll-to-source value="true" />
327
+ </todo-panel>
328
+ <todo-panel id="all">
329
+ <are-packages-shown value="true" />
330
+ <is-autoscroll-to-source value="true" />
331
+ </todo-panel>
295
332
  </component>
296
333
  <component name="ToolWindowManager">
297
- <frame x="119" y="23" width="2282" height="1417" extended-state="0" />
334
+ <frame x="0" y="23" width="2560" height="1417" extended-state="6" />
298
335
  <editor active="true" />
299
336
  <layout>
300
- <window_info id="Favorites" side_tool="true" />
301
- <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.26741073" />
337
+ <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.1965846" />
302
338
  <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
303
- <window_info anchor="bottom" id="Docker" show_stripe_button="false" />
304
- <window_info anchor="bottom" id="Database Changes" />
305
- <window_info anchor="bottom" id="Version Control" />
306
- <window_info anchor="bottom" id="Terminal" sideWeight="0.49955356" weight="0.32925898" />
307
- <window_info anchor="bottom" id="Event Log" sideWeight="0.50044644" side_tool="true" weight="0.32925898" />
339
+ <window_info id="Favorites" order="2" side_tool="true" />
308
340
  <window_info anchor="bottom" id="Message" order="0" />
309
341
  <window_info anchor="bottom" id="Find" order="1" />
310
342
  <window_info anchor="bottom" id="Run" order="2" sideWeight="0.49955356" weight="0.32925898" />
311
343
  <window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
312
344
  <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
313
345
  <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
314
- <window_info anchor="bottom" id="TODO" order="6" />
315
- <window_info anchor="right" id="Database" />
346
+ <window_info anchor="bottom" id="TODO" order="6" weight="0.32925898" />
347
+ <window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
348
+ <window_info anchor="bottom" id="Database Changes" order="8" />
349
+ <window_info anchor="bottom" id="Version Control" order="9" />
350
+ <window_info anchor="bottom" id="Terminal" order="10" sideWeight="0.49955356" visible="true" weight="0.30634072" />
351
+ <window_info anchor="bottom" id="Event Log" order="11" sideWeight="0.50044644" side_tool="true" weight="0.32925898" />
316
352
  <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
317
353
  <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
318
354
  <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
355
+ <window_info anchor="right" id="Database" order="3" />
319
356
  </layout>
320
357
  <layout-to-restore>
321
358
  <window_info id="Favorites" order="0" side_tool="true" />
@@ -360,7 +397,7 @@
360
397
  </state>
361
398
  </provider>
362
399
  </entry>
363
- <entry file="file://$PROJECT_DIR$/lib/numeric.rb">
400
+ <entry file="file://$PROJECT_DIR$/lib/montecasting/numeric.rb">
364
401
  <provider selected="true" editor-type-id="text-editor">
365
402
  <state relative-caret-position="242">
366
403
  <caret line="11" column="3" selection-start-line="11" selection-start-column="3" selection-end-line="11" selection-end-column="3" />
@@ -370,24 +407,34 @@
370
407
  <entry file="file://$PROJECT_DIR$/spec/spec_helper.rb">
371
408
  <provider selected="true" editor-type-id="text-editor" />
372
409
  </entry>
373
- <entry file="file://$PROJECT_DIR$/lib/montecasting/array.rb">
410
+ <entry file="file://$PROJECT_DIR$/Gemfile">
374
411
  <provider selected="true" editor-type-id="text-editor">
375
- <state relative-caret-position="374">
376
- <caret line="17" selection-start-line="17" selection-end-line="17" />
412
+ <state relative-caret-position="88">
413
+ <caret line="4" selection-start-line="4" selection-end-line="4" />
377
414
  </state>
378
415
  </provider>
379
416
  </entry>
380
417
  <entry file="file://$APPLICATION_HOME_DIR$/rubystubs26/time.rb">
381
418
  <provider selected="true" editor-type-id="text-editor">
382
- <state relative-caret-position="1493">
419
+ <state relative-caret-position="2574">
383
420
  <caret line="117" column="13" selection-start-line="117" selection-start-column="13" selection-end-line="117" selection-end-column="13" />
384
421
  </state>
385
422
  </provider>
386
423
  </entry>
387
- <entry file="file://$PROJECT_DIR$/Gemfile">
424
+ <entry file="file://$PROJECT_DIR$/montecasting.gemspec">
388
425
  <provider selected="true" editor-type-id="text-editor">
389
- <state relative-caret-position="88">
390
- <caret line="4" selection-start-line="4" selection-end-line="4" />
426
+ <state relative-caret-position="242">
427
+ <caret line="11" column="233" selection-start-line="11" selection-start-column="26" selection-end-line="11" selection-end-column="233" />
428
+ </state>
429
+ </provider>
430
+ </entry>
431
+ <entry file="file://$PROJECT_DIR$/README.md">
432
+ <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
433
+ <state split_layout="SPLIT">
434
+ <first_editor relative-caret-position="1254">
435
+ <caret line="57" column="8" selection-start-line="57" selection-start-column="8" selection-end-line="57" selection-end-column="8" />
436
+ </first_editor>
437
+ <second_editor />
391
438
  </state>
392
439
  </provider>
393
440
  </entry>
@@ -397,31 +444,31 @@
397
444
  <entry file="file://$PROJECT_DIR$/.rspec_status">
398
445
  <provider selected="true" editor-type-id="text-editor" />
399
446
  </entry>
400
- <entry file="file://$PROJECT_DIR$/spec/montecasting_spec.rb">
447
+ <entry file="file://$PROJECT_DIR$/lib/montecasting/array.rb">
401
448
  <provider selected="true" editor-type-id="text-editor">
402
449
  <state relative-caret-position="418">
403
- <caret line="19" lean-forward="true" selection-start-line="19" selection-end-line="19" />
450
+ <caret line="19" column="19" selection-start-line="19" selection-start-column="19" selection-end-line="19" selection-end-column="19" />
404
451
  </state>
405
452
  </provider>
406
453
  </entry>
407
454
  <entry file="file://$PROJECT_DIR$/lib/montecasting.rb">
408
455
  <provider selected="true" editor-type-id="text-editor">
409
- <state relative-caret-position="721">
410
- <caret line="33" column="5" lean-forward="true" selection-start-line="33" selection-start-column="5" selection-end-line="33" selection-end-column="5" />
456
+ <state relative-caret-position="968">
457
+ <caret line="44" lean-forward="true" selection-start-line="44" selection-end-line="44" />
411
458
  </state>
412
459
  </provider>
413
460
  </entry>
414
- <entry file="file://$PROJECT_DIR$/montecasting.gemspec">
461
+ <entry file="file://$PROJECT_DIR$/spec/montecasting_spec.rb">
415
462
  <provider selected="true" editor-type-id="text-editor">
416
- <state relative-caret-position="132">
417
- <caret line="6" column="42" selection-start-line="6" selection-start-column="42" selection-end-line="6" selection-end-column="42" />
463
+ <state relative-caret-position="66">
464
+ <caret line="3" column="135" lean-forward="true" selection-start-line="3" selection-start-column="113" selection-end-line="3" selection-end-column="135" />
418
465
  </state>
419
466
  </provider>
420
467
  </entry>
421
468
  <entry file="file://$PROJECT_DIR$/lib/montecasting/version.rb">
422
469
  <provider selected="true" editor-type-id="text-editor">
423
- <state relative-caret-position="88">
424
- <caret line="4" column="18" selection-start-line="4" selection-start-column="18" selection-end-line="4" selection-end-column="18" />
470
+ <state relative-caret-position="132">
471
+ <caret line="6" lean-forward="true" selection-start-line="6" selection-end-line="6" />
425
472
  </state>
426
473
  </provider>
427
474
  </entry>
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- montecasting (0.2.3)
4
+ montecasting (0.2.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -35,4 +35,4 @@ RUBY VERSION
35
35
  ruby 2.6.3p62
36
36
 
37
37
  BUNDLED WITH
38
- 2.0.1
38
+ 2.0.2
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # Montecasting
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/montecasting`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Montecasting will provide a set of forecasting techniques to be used on software project management or product development.
6
4
 
7
5
  ## Installation
8
6
 
@@ -21,9 +19,46 @@ Or install it yourself as:
21
19
  $ gem install montecasting
22
20
 
23
21
  ## Usage
24
-
25
- TODO: Write usage instructions here
26
-
22
+ #### Metrics
23
+
24
+ Montecasting::Metrics.variance array_of_time = []
25
+
26
+ Montecasting::Metrics.wip_limit array_of_time = [], start_date, end_date
27
+
28
+ Montecasting::Metrics.thoughtput number_or_items, start_date, end_date
29
+
30
+ Montecasting::Metrics.week_days start_date, end_date
31
+
32
+ #### Charts
33
+ All methods in this section will be returned in a format that, so far, has been tested using rickshaw JavaScript toolkit for creating interactive real-time graphs.
34
+ Checkout https://github.com/shutterstock/rickshaw for more information.
35
+
36
+ > Montecasting::Charts.chart_cycle_time array_of_time = [], round_to = 0.5
37
+ > [[{:x=>0, :y=>0},
38
+ {:x=>1, :y=>1},
39
+ {:x=>2, :y=>2},
40
+ {:x=>3, :y=>3},
41
+ {:x=>4, :y=>4},
42
+ ...
43
+ {:x=>15, :y=>15}],
44
+ [{:x=>0, :y=>5},
45
+ {:x=>1, :y=>20},
46
+ {:x=>2, :y=>8},
47
+ {:x=>3, :y=>3},
48
+ {:x=>4, :y=>0},
49
+ ...
50
+ {:x=>15, :y=>1}],
51
+ [{:x=>0, :y=>0.0},
52
+ {:x=>1, :y=>13.5},
53
+ {:x=>2, :y=>67.6},
54
+ {:x=>3, :y=>89.2},
55
+ {:x=>4, :y=>97.3},
56
+ ...
57
+ {:x=>15, :y=>97.3}]]
58
+
59
+ #### Forecasting
60
+ Nothing implemented yet :-)
61
+
27
62
  ## Development
28
63
 
29
64
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -8,14 +8,6 @@ class Array
8
8
  }
9
9
  end
10
10
 
11
- def each_sum_done key_status = [:done]
12
- counter = 0
13
- each {|issue|
14
- counter += yield issue if key_status.include? issue.status.to_sym
15
- }
16
- counter
17
- end
18
-
19
11
  def each_sum
20
12
  counter = 0
21
13
  each {|issue|
File without changes
@@ -2,5 +2,5 @@ module Montecasting
2
2
  # MAJOR version when you make incompatible API changes,
3
3
  # MINOR version when you add functionality in a backwards compatible manner, and
4
4
  # PATCH version when you make backwards compatible bug fixes.
5
- VERSION = "0.2.4"
5
+ VERSION = "0.3.0"
6
6
  end
data/lib/montecasting.rb CHANGED
@@ -1,22 +1,29 @@
1
1
  require "montecasting/version"
2
- require_relative 'numeric'
2
+ require_relative 'montecasting/numeric'
3
3
  require_relative 'montecasting/array'
4
4
 
5
5
  module Montecasting
6
6
 
7
7
  #Metrics class will contains methods to get specific product development metrics pr
8
8
  class Metrics
9
- def self.variance array_of_units = []
9
+ def self.variance array_of_times = []
10
+ return unless array_of_times.all? {|i| i.is_a?(Numeric) }
10
11
  variance = 0
11
- avg = array_of_units.map{|i| i.abs}.average
12
- array_of_units.each {|spt|
12
+ avg = array_of_times.map{|i| i.abs}.average
13
+ array_of_times.each {|spt|
13
14
  variance += ((avg - spt) ** 2)
14
15
  }
15
16
  Math.sqrt(variance)
16
17
  end
17
18
 
18
- def self.wip_limit(array_of_cycle_time, start_date, end_date = DateTime.now)
19
- (array_of_cycle_time.map(&:abs).average * throughput(array_of_cycle_time.count,start_date,end_date))
19
+ def self.median array_of_times = []
20
+ return unless array_of_times.all? {|i| i.is_a?(Numeric) }
21
+ array_of_times.map{|i| i.abs}.median
22
+ end
23
+
24
+ def self.wip_limit(array_of_times, start_date, end_date = DateTime.now)
25
+ return unless array_of_times.all? {|i| i.is_a?(Numeric) }
26
+ (array_of_times.map(&:abs).average * throughput(array_of_times.count,start_date,end_date))
20
27
  end
21
28
 
22
29
  def self.throughput number_of_issues, start_date, end_date = DateTime.now
@@ -26,6 +33,11 @@ module Montecasting
26
33
  def self.week_days start_date, enddate = DateTime.now
27
34
  (start_date..enddate).select { |day| !day.sunday? && !day.saturday? }
28
35
  end
36
+
37
+ def self.percent_of_items_at array_of_times, time_units = 0
38
+ return unless array_of_times.all? {|i| i.is_a?(Numeric) }
39
+ array_of_times.select { |time| time < time_units}.count.percent_of(array_of_times.count)
40
+ end
29
41
  end
30
42
 
31
43
  # Here will place all those method to generate forecasting charts
@@ -37,10 +49,10 @@ module Montecasting
37
49
  #Charts class will contains all those methods to charts data, using rickshaw JS library it's pretty straight forward.
38
50
  class Charts
39
51
 
40
- def self.chart_cycle_time array_of_cycle_times = [], round_to = 0.5
41
- return unless array_of_cycle_times.all? {|i| i.is_a?(Numeric) }
52
+ def self.chart_cycle_time array_of_times = [], round_to = 0.5
53
+ return unless array_of_times.all? {|i| i.is_a?(Numeric) }
42
54
  data = Array.new {Array.new}
43
- ct_sorted = array_of_cycle_times.sort.map {|ct| ct.abs.to_f.round(round_to) }
55
+ ct_sorted = array_of_times.sort.map {|ct| ct.abs.to_f.round(round_to) }
44
56
  max_index = ct_sorted.last
45
57
  data[0] = [*0..max_index].map {|index| {x: index, y: index}}
46
58
  data[1] = [*0..max_index].map {|index| {x: index, y: ct_sorted.count {|elem| elem.eql? index }}}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: montecasting
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduard Garcia Castello
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-30 00:00:00.000000000 Z
11
+ date: 2019-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -75,8 +75,8 @@ files:
75
75
  - bin/setup
76
76
  - lib/montecasting.rb
77
77
  - lib/montecasting/array.rb
78
+ - lib/montecasting/numeric.rb
78
79
  - lib/montecasting/version.rb
79
- - lib/numeric.rb
80
80
  - montecasting.gemspec
81
81
  homepage: https://github.com/eddygarcas/montecasting
82
82
  licenses: