cal 0.5.0 → 0.5.1

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.
@@ -22,14 +22,14 @@ module Cal
22
22
  new month.year, month.number, options
23
23
  end
24
24
 
25
- def from_param(param)
25
+ def from_param(param, options = {})
26
26
  year, month_number = if param.present?
27
27
  param.split '-'
28
28
  else
29
29
  now = Date.current
30
30
  [now.year, now.month]
31
31
  end
32
- new year, month_number
32
+ new year, month_number, options
33
33
  end
34
34
  end
35
35
 
@@ -1,5 +1,5 @@
1
1
  module Cal
2
2
 
3
- VERSION = "0.5.0"
3
+ VERSION = "0.5.1"
4
4
 
5
5
  end
@@ -7,7 +7,7 @@ describe Cal::MonthlyCalendar do
7
7
 
8
8
  describe "from_month" do
9
9
  it "returns a calendar for the month's year and month number" do
10
- subject.from_month(Cal::Month.new(2012, 11)).should == subject.new(2012, 11)
10
+ subject.from_month(Cal::Month.new(2012, 11), :start_week_on => :tuesday).should == subject.new(2012, 11, :start_week_on => :tuesday)
11
11
  end
12
12
 
13
13
  it "raises an error without something that can be converted to a month" do
@@ -19,8 +19,8 @@ describe Cal::MonthlyCalendar do
19
19
 
20
20
  describe "from_param" do
21
21
  it "is the calendar for the given param" do
22
- calendar = subject.new 2012, 5
23
- subject.from_param(calendar.to_param).should == calendar
22
+ calendar = subject.new 2012, 5, :start_week_on => :tuesday
23
+ subject.from_param(calendar.to_param, :start_week_on => :tuesday).should == calendar
24
24
  end
25
25
 
26
26
  context "with a blank param" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: