carve_range 0.1.2 → 0.1.3
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 +4 -4
- data/README.md +4 -2
- data/lib/carve_range/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f1fc0699cdfbdcfb0195fa944a2b40158069f056
|
|
4
|
+
data.tar.gz: f0c2e8eff52acff66b1561e11a8ff9ea218bc537
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2199597a6e02a17e878516d4701198c956e5314ca0ccc56ec68888877269fd49c513392e8e6013deb13e8c490e26d05a07ec502756ec7f1164faf8a3295eeb35
|
|
7
|
+
data.tar.gz: ea696651bb8374b735af1369b2917b2dde75ab1e3eeff8bf2d0350a3a23456b7e7e83afa2c01ca92a765b9f0e4f22019611ff6f63f6e7074dd87c2cc99127931
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CarveRange
|
|
2
2
|
|
|
3
|
-
Takes two date ranges (A,B) and returns an array of date ranges in A that do not overlap with date range B, and
|
|
3
|
+
Takes two date ranges (A,B) and returns an array of date ranges in A that do not overlap with date range B, and includes B.
|
|
4
4
|
|
|
5
5
|
## Example 1
|
|
6
6
|
|
|
@@ -48,10 +48,12 @@ Carve(A,B): [#######]
|
|
|
48
48
|
|
|
49
49
|
## Use Case
|
|
50
50
|
|
|
51
|
-
Your tracking your activity in a calendar for a month. For days 1-30, you Went Jogging, so you create an Event that Starts At Day 1 and
|
|
51
|
+
Your tracking your activity in a calendar for a month. For days 1-30, you Went Jogging, so you create an Event that Starts At Day 1 and Ends At day 30. Oops! You double-check your journal and realize that Day 15-18 you said you went Jogging, but actually you Stayed Home.
|
|
52
52
|
|
|
53
53
|
You can "carve" the 1 Event (that contains a Start Date and and End Date) with this gem such that you could get 3 Events. The first event is Days 1-14 (you Went Jogging those days). The second event is Days 15-18 (you Stayed Home those days). The third event is Days 19-30 (you Went Jogging those days).
|
|
54
54
|
|
|
55
|
+
This gem could take the first Event's date range (Date Range A) and another Date Range (Event you want to add to the calendar, Days 15-18, Date Range B) and return [Date Range A' (1-14), Date Range A'' (19-30), Date Range B (15-18)].
|
|
56
|
+
|
|
55
57
|
## Installation
|
|
56
58
|
|
|
57
59
|
Add this line to your application's Gemfile:
|
data/lib/carve_range/version.rb
CHANGED