flux_capacitor 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: 5bdc364e1a19df5645ef0291b4c8fb231f7a5c91
4
- data.tar.gz: 1fd589797273708272ef7db6908eeee460fc5b3c
3
+ metadata.gz: 49cda02b4b59eeec057fe99708c69c9d33550ba7
4
+ data.tar.gz: 4106e315fe782950583290ac3c3e35e8b6227684
5
5
  SHA512:
6
- metadata.gz: e33a47111b4fa40fd04b6e28894c89f0a4b5db3e295e21e42369dbe6d34181e822fa9447c1190ccf55c2e628a718ef1957d9b2242738495d8e4cdb79d81ce882
7
- data.tar.gz: 3e5be9ef3e76884bb73b8ba2bf6a6399724775899b44ab62b391726cf8f2f75f07d6e9c7929a046187cc71e25b074f45be57dfe08ea2112eb62d9e3b545e88ed
6
+ metadata.gz: d7aba405e5ccf1bf730e30eb3f873568b3de30ce4054fde39c01dfa5615c466f6908354509dd545ec37ab098ec34ae86471d5b05a6d194ebb133cbe514e1c7f6
7
+ data.tar.gz: 5c07cf434a1de885608a0fe5cbe2fa3b2f24a996be6de0df6e2f9104e1ff6e554669b1fe5df9ad2993a277b322ec45ade27f2bf53185ab4edf0201d5606680a6
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # FluxCapacitor
1
+ [![Gem Version](https://badge.fury.io/rb/flux_capacitor.svg)](https://badge.fury.io/rb/flux_capacitor)
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/flux_capacitor`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ # FluxCapacitor
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ Sometimes you want to change a feature or deploy a new feature but doing so all at once might take down some service. Enter Flux Capacitor. It allows you to gradually include more historical content in the new feature while allowing all future content to start out with the new feature already live.
6
6
 
7
7
  ## Installation
8
8
 
@@ -25,9 +25,11 @@ Or install it yourself as:
25
25
  ```ruby
26
26
  require 'flux_capacitor'
27
27
 
28
- pivot = DateTime.parse('2017/08/14 00:00:00-000') # Everything after this date will have the new feature. This is the point in time when your new feature will start to go live
29
- oldest = MyModel.first.created_at # If you are using active record finding your oldest item is pretty easy, otherwise if you know the date of your first item, just use that
30
- end_point = DateTime.parse('2017/09/14') # At this point the feature should be fully rolled out and it is safe to remove the Flux Capacitor. This dictates how quickly the feature rolls out. If you are concerned about overloading a required service set this to farther in the future to lower load
28
+ pivot = DateTime.parse('2017/08/14 00:00:00-000') # when do you want to start rolling out the feature
29
+ oldest = MyModel.first.created_at # If you are using active record finding your oldest item is pretty easy
30
+ # otherwise if you know the date of your first item, just use that
31
+ end_point = DateTime.parse('2017/09/14') # The point where the feature is fully rolled out/safe to remove the Flux Capacitor.
32
+ # This dictates how quickly the feature rolls out. If you are concerned about overloading a required service set this to farther in the future
31
33
 
32
34
  FEATURE_1_CAPACITOR = Flux::Capacitor.new(pivot, end_point, oldest)
33
35
 
@@ -1,3 +1,3 @@
1
1
  module Flux
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -5,10 +5,9 @@ require 'murmurhash3'
5
5
  module Flux
6
6
 
7
7
  class Capacitor
8
- attr_reader :pivot, :pivot_ts, :time_dilation
8
+ attr_reader :pivot, :time_dilation
9
9
  def initialize (start_time, completion_target, oldest_target = Capacitor.oldest_string_time(start_time))
10
10
  @pivot = start_time
11
- @pivot_ts = pivot.strftime("%s").to_i
12
11
  time_to_complete = seconds_between(completion_target, pivot)
13
12
  dilation = seconds_between(pivot, oldest_target).to_f / time_to_complete.to_f
14
13
  @time_dilation = dilation
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flux_capacitor
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
  - Raphael Eidus