broadcast_calendar 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- broadcast_calendar (1.0.0)
4
+ broadcast_calendar (1.1.1)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.homepage = %q{http://github.com/subelsky/broadcast_calendar}
13
13
  s.rdoc_options = ["--charset=UTF-8"]
14
14
  s.require_paths = ["lib"]
15
- s.summary = %q{eturns the beginning and ending Gregorian (civil) dates for months in the broadcast calendar.}
15
+ s.summary = %q{Returns the beginning and ending Gregorian (civil) dates for months in the broadcast calendar.}
16
16
  s.description = %q{Library tht returns the beginning and ending Gregorian (civil) dates for months in the broadcast calendar.}
17
17
  s.test_files = `git ls-files spec`.split("\n")
18
18
  s.add_development_dependency 'rspec'
@@ -19,6 +19,10 @@ module BroadcastCalendar
19
19
  beginning..ending
20
20
  end
21
21
 
22
+ def weeks_for(month,year)
23
+ dates_for(month,year).each_slice(7).collect { |s| s.first..s.last }
24
+ end
25
+
22
26
  def month_and_year_for(date)
23
27
  range = dates_for(date.month,date.year)
24
28
 
@@ -1,3 +1,3 @@
1
1
  module BroadcastCalendar
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
@@ -63,4 +63,21 @@ describe BroadcastCalendar do
63
63
  end
64
64
  end
65
65
  end
66
+
67
+ it "returns broadcast weeks for a given month and year" do
68
+ weeks = BroadcastCalendar.weeks_for(7,2011)
69
+ weeks[0].should == (Date.new(2011,6,27)..Date.new(2011,7,3))
70
+ weeks[1].should == (Date.new(2011,7,4)..Date.new(2011,7,10))
71
+ weeks[2].should == (Date.new(2011,7,11)..Date.new(2011,7,17))
72
+ weeks[3].should == (Date.new(2011,7,18)..Date.new(2011,7,24))
73
+ weeks[4].should == (Date.new(2011,7,25)..Date.new(2011,7,31))
74
+
75
+ weeks = BroadcastCalendar.weeks_for(8,2010)
76
+ weeks[0].should == (Date.new(2010,7,26)..Date.new(2010,8,1))
77
+ weeks[1].should == (Date.new(2010,8,2)..Date.new(2010,8,8))
78
+ weeks[2].should == (Date.new(2010,8,9)..Date.new(2010,8,15))
79
+ weeks[3].should == (Date.new(2010,8,16)..Date.new(2010,8,22))
80
+ weeks[4].should == (Date.new(2010,8,23)..Date.new(2010,8,29))
81
+ end
82
+
66
83
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: broadcast_calendar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-07-03 00:00:00.000000000 -04:00
13
- default_executable:
12
+ date: 2011-08-25 00:00:00.000000000Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rspec
17
- requirement: &2153830380 !ruby/object:Gem::Requirement
16
+ requirement: &2157378300 !ruby/object:Gem::Requirement
18
17
  none: false
19
18
  requirements:
20
19
  - - ! '>='
@@ -22,7 +21,7 @@ dependencies:
22
21
  version: '0'
23
22
  type: :development
24
23
  prerelease: false
25
- version_requirements: *2153830380
24
+ version_requirements: *2157378300
26
25
  description: Library tht returns the beginning and ending Gregorian (civil) dates
27
26
  for months in the broadcast calendar.
28
27
  email: mike@subelsky.com
@@ -45,7 +44,6 @@ files:
45
44
  - lib/broadcast_calendar/version.rb
46
45
  - spec/broadcast_calendar_spec.rb
47
46
  - spec/spec_helper.rb
48
- has_rdoc: true
49
47
  homepage: http://github.com/subelsky/broadcast_calendar
50
48
  licenses:
51
49
  - MIT
@@ -68,10 +66,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
66
  version: '0'
69
67
  requirements: []
70
68
  rubyforge_project:
71
- rubygems_version: 1.6.2
69
+ rubygems_version: 1.8.8
72
70
  signing_key:
73
71
  specification_version: 3
74
- summary: eturns the beginning and ending Gregorian (civil) dates for months in the
72
+ summary: Returns the beginning and ending Gregorian (civil) dates for months in the
75
73
  broadcast calendar.
76
74
  test_files:
77
75
  - spec/broadcast_calendar_spec.rb