merch_calendar 0.1.0.rc3 → 0.1.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
  SHA1:
3
- metadata.gz: 529c719788c4f0aada0e215af345aa00ec9d055f
4
- data.tar.gz: 79f5749368eff3b9607649efac54ec8a54cacbd8
3
+ metadata.gz: c82e19a6628132edf5ef227e08d270fc8e1aa3ef
4
+ data.tar.gz: 6bcc92b82007ee4cf137435092ac7df7f6f24a33
5
5
  SHA512:
6
- metadata.gz: 1cbcf6b7df354163f93069a82f9f05a60882cd129be90335777c30b39dd735065fa851dce568c13a986d660654a8e610df81cc1ced035340b7e473f63f1fea41
7
- data.tar.gz: f363bb9980350ccc5867679301afb2380d67b99a6bd60cf3472122e922ca62b6c07e5ff1a9733223d1ee5f5a60f3d6e191f601ac28c44d4956c3634f0be5853a
6
+ metadata.gz: a532b4acdd1a97639b1894b53181279f750531fd5ac99b2d5f95d40f9cc5330a26b17f8eb85e5304f8a9477596378c22db4355c0f6f39b6766c93730c5e945fd
7
+ data.tar.gz: 6360b4c0c3c20d6565dae5fc83f2e089c50f6b0fa159a9af99211363316bd3be8bebe5075c5a0bb79253d22a85cd63e53f6dd9e9979c22d6c495569429e8967a
data/Gemfile.lock CHANGED
@@ -1,12 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- merch_calendar (0.1.0.rc3)
4
+ merch_calendar (0.1.0)
5
5
 
6
6
  GEM
7
7
  remote: https://www.rubygems.org/
8
8
  specs:
9
- byebug (9.0.6)
10
9
  coderay (1.1.1)
11
10
  coveralls (0.8.13)
12
11
  json (~> 1.8)
@@ -18,13 +17,10 @@ GEM
18
17
  docile (1.1.5)
19
18
  json (1.8.3)
20
19
  method_source (0.8.2)
21
- pry (0.10.3)
20
+ pry (0.10.4)
22
21
  coderay (~> 1.1.0)
23
22
  method_source (~> 0.8.1)
24
23
  slop (~> 3.4)
25
- pry-byebug (3.4.2)
26
- byebug (~> 9.0)
27
- pry (~> 0.10)
28
24
  rake (10.5.0)
29
25
  rspec (3.4.0)
30
26
  rspec-core (~> 3.4.0)
@@ -57,7 +53,6 @@ DEPENDENCIES
57
53
  coveralls
58
54
  merch_calendar!
59
55
  pry
60
- pry-byebug
61
56
  rake
62
57
  rspec (>= 3.0.0)
63
58
  simplecov
data/README.md CHANGED
@@ -5,7 +5,8 @@
5
5
  [![Code Climate](https://codeclimate.com/github/stitchfix/merch_calendar/badges/gpa.svg)](https://codeclimate.com/github/stitchfix/merch_calendar)
6
6
  [![Coverage Status](https://coveralls.io/repos/stitchfix/merch_calendar/badge.svg)](https://coveralls.io/r/stitchfix/merch_calendar)
7
7
 
8
- This gem allows for finding retail/merchandising weeks for a given date, along with manipulating the retail calendar. This gem is used at [StitchFix](http://www.stitchfix.com/).
8
+ This gem allows for finding retail/merchandising weeks for a given date, along with manipulating the retail calendar.
9
+ This gem is used at [Stitch Fix](http://www.stitchfix.com/).
9
10
 
10
11
  ## Installation
11
12
 
@@ -24,29 +25,27 @@ For converting a date into a `MerchWeek` object.
24
25
 
25
26
  ```ruby
26
27
  merch_week = MerchCalendar::MerchWeek.from_date("2014-01-01")
27
- puts merch_week.year # 2013 (the merch year associated with this date)
28
- puts merch_week.month # 12 (the julian month that the date falls in)
29
- puts merch_week.week # 5 (the week number within the month)
30
- puts merch_week.year_week # 48 (the week number within the year)
31
- puts merch_week.quarter # 2
32
28
 
33
- puts merch_week.start_of_week # <Date: 2013-12-29>
34
- puts merch_week.end_of_week # <Date>
29
+ merch_week.year # 2013 (the merch year associated with this date)
30
+ merch_week.month # 12 (the julian month that the date falls in)
31
+ merch_week.week # 5 (the week number within the month)
32
+ merch_week.year_week # 48 (the week number within the year)
33
+ merch_week.quarter # 2
35
34
 
36
- puts merch_week.start_of_month # <Date>
37
- puts merch_week.end_of_month # <Date>
35
+ merch_week.start_of_week # <Date: 2013-12-29>
36
+ merch_week.end_of_week # <Date: 2014-01-04>
38
37
 
39
- puts merch_week.start_of_quarter # <Date>
40
- puts merch_week.end_of_quarter # <Date>
38
+ merch_week.start_of_month # <Date: 2013-12-01>
39
+ merch_week.end_of_month # <Date: 2014-01-04>
41
40
 
42
- puts merch_week.start_of_year # <Date>
43
- puts merch_week.end_of_year # <Date>
41
+ merch_week.start_of_year # <Date: 2013-02-03>
42
+ merch_week.end_of_year # <Date: 2014-02-01>
44
43
 
45
44
  # Formatting
46
- puts merch_week.to_s # "Dec W5"
47
- puts merch_week.to_s(:short) # "Dec W5"
48
- puts merch_week.to_s(:long) # "2013:48 Dec W5"
49
- puts merch_week.to_s(:elasticsearch) # "2013-12w05"
45
+ merch_week.to_s # "Dec W5"
46
+ merch_week.to_s(:short) # "Dec W5"
47
+ merch_week.to_s(:long) # "2013:48 Dec W5"
48
+ merch_week.to_s(:elasticsearch) # "2013-12w05"
50
49
  ```
51
50
 
52
51
 
@@ -104,7 +103,7 @@ retail_calendar.end_of_week(2017, 4, 1)
104
103
  ```
105
104
 
106
105
  ### Offset fiscal year calendars
107
- Some companies, one of which being Stitch Fix, operate on a fiscal year calendar that is offset of
106
+ Some companies, one of which being Stitch Fix, operate on a fiscal year calendar that is offset from
108
107
  the traditional retail calendar. The `MerchCalendar::FiscalYearCalendar` class allows you to easily
109
108
  offset the start of year to match your fiscal calendar.
110
109
 
@@ -80,7 +80,7 @@ module MerchCalendar
80
80
  private
81
81
 
82
82
  # Offsets the quarter based on the fiscal year quarter offset
83
- # returns: ofset [year, quarter]
83
+ # returns: offset [year, quarter]
84
84
  def offset_quarter(year, quarter)
85
85
  # first quarter in fiscal calendar is Q3 of retail calendar of previous year
86
86
  if quarter >= 1 + @fy_quarter_offset.abs
@@ -91,7 +91,7 @@ module MerchCalendar
91
91
  end
92
92
 
93
93
  # Offsets the month based on the fiscal year quarter offset
94
- # returns: ofset [year, month]
94
+ # returns: offset [year, month]
95
95
  def offset_month(year, month)
96
96
  # 3 - number of months in a quarter
97
97
  month_offset = @fy_quarter_offset * 3
@@ -104,7 +104,7 @@ module MerchCalendar
104
104
  end
105
105
 
106
106
  # Offsets the year based on the fiscal year quarter offset
107
- # returns: ofset year
107
+ # returns: offset year
108
108
  def offset_year(year)
109
109
  if @fy_quarter_offset < 0
110
110
  year -= 1
@@ -1,3 +1,3 @@
1
1
  module MerchCalendar
2
- VERSION = '0.1.0.rc3'
2
+ VERSION = '0.1.0'
3
3
  end
@@ -1,3 +1,4 @@
1
+ require "date"
1
2
 
2
3
  #
3
4
  module MerchCalendar
@@ -23,5 +23,4 @@ Gem::Specification.new do |s|
23
23
  s.add_development_dependency "simplecov"
24
24
  s.add_development_dependency "coveralls"
25
25
  s.add_development_dependency "pry"
26
- s.add_development_dependency "pry-byebug"
27
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: merch_calendar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.rc3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mitch Dempsey
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-07-03 00:00:00.000000000 Z
12
+ date: 2017-07-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -81,20 +81,6 @@ dependencies:
81
81
  - - ">="
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
- - !ruby/object:Gem::Dependency
85
- name: pry-byebug
86
- requirement: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- version: '0'
91
- type: :development
92
- prerelease: false
93
- version_requirements: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - ">="
96
- - !ruby/object:Gem::Version
97
- version: '0'
98
84
  description: Utility for manipulating dates within a 4-5-4 retail calendar
99
85
  email:
100
86
  - opensource@stitchfix.com
@@ -142,9 +128,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
142
128
  version: '0'
143
129
  required_rubygems_version: !ruby/object:Gem::Requirement
144
130
  requirements:
145
- - - ">"
131
+ - - ">="
146
132
  - !ruby/object:Gem::Version
147
- version: 1.3.1
133
+ version: '0'
148
134
  requirements: []
149
135
  rubyforge_project:
150
136
  rubygems_version: 2.6.12