calendar_helper 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/.gemtest +0 -0
  2. data/History.txt +5 -1
  3. data/Rakefile +1 -0
  4. data/lib/calendar_helper.rb +36 -34
  5. metadata +21 -34
data/.gemtest ADDED
File without changes
data/History.txt CHANGED
@@ -1,4 +1,8 @@
1
- === 2.2.3 / 2010-05-21
1
+ === 0.2.4 / 2010-05-21
2
+
3
+ * Calendar Title can be customized [Benjamin Lieb]
4
+
5
+ === 0.2.3 / 2010-05-21
2
6
 
3
7
  * Don't crash if time zone is nil
4
8
  * Upgrade to latest Hoe
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'rubygems'
2
+ require 'isolate/now'
2
3
  require 'rake'
3
4
  require 'rake/rdoctask'
4
5
  require 'hoe'
@@ -3,7 +3,7 @@ require 'date'
3
3
  # CalendarHelper allows you to draw a databound calendar with fine-grained CSS formatting
4
4
  module CalendarHelper
5
5
 
6
- VERSION = '0.2.3'
6
+ VERSION = '0.2.4'
7
7
 
8
8
  # Returns an HTML calendar. In its simplest form, this method generates a plain
9
9
  # calendar (which can then be customized using CSS) for a given month and year.
@@ -15,28 +15,29 @@ module CalendarHelper
15
15
  # :month # The month number to show the calendar for.
16
16
  #
17
17
  # The following are optional, available for customizing the default behaviour:
18
- # :table_class => "calendar" # The class for the <table> tag.
19
- # :month_name_class => "monthName" # The class for the name of the month, at the top of the table.
20
- # :other_month_class => "otherMonth" # Not implemented yet.
21
- # :day_name_class => "dayName" # The class is for the names of the weekdays, at the top.
22
- # :day_class => "day" # The class for the individual day number cells.
23
- # This may or may not be used if you specify a block (see below).
24
- # :abbrev => (0..2) # This option specifies how the day names should be abbreviated.
25
- # Use (0..2) for the first three letters, (0..0) for the first, and
26
- # (0..-1) for the entire name.
27
- # :first_day_of_week => 0 # Renders calendar starting on Sunday. Use 1 for Monday, and so on.
28
- # :accessible => true # Turns on accessibility mode. This suffixes dates within the
29
- # # calendar that are outside the range defined in the <caption> with
30
- # # <span class="hidden"> MonthName</span>
31
- # # Defaults to false.
32
- # # You'll need to define an appropriate style in order to make this disappear.
33
- # # Choose your own method of hiding content appropriately.
18
+ # :table_class => "calendar" # The class for the <table> tag.
19
+ # :month_name_class => "monthName" # The class for the name of the month, at the top of the table.
20
+ # :other_month_class => "otherMonth" # Not implemented yet.
21
+ # :day_name_class => "dayName" # The class is for the names of the weekdays, at the top.
22
+ # :day_class => "day" # The class for the individual day number cells.
23
+ # This may or may not be used if you specify a block (see below).
24
+ # :abbrev => (0..2) # This option specifies how the day names should be abbreviated.
25
+ # Use (0..2) for the first three letters, (0..0) for the first, and
26
+ # (0..-1) for the entire name.
27
+ # :first_day_of_week => 0 # Renders calendar starting on Sunday. Use 1 for Monday, and so on.
28
+ # :accessible => true # Turns on accessibility mode. This suffixes dates within the
29
+ # # calendar that are outside the range defined in the <caption> with
30
+ # # <span class="hidden"> MonthName</span>
31
+ # # Defaults to false.
32
+ # # You'll need to define an appropriate style in order to make this disappear.
33
+ # # Choose your own method of hiding content appropriately.
34
34
  #
35
- # :show_today => false # Highlights today on the calendar using the CSS class 'today'.
36
- # # Defaults to true.
37
- # :previous_month_text => nil # Displayed left of the month name if set
38
- # :next_month_text => nil # Displayed right of the month name if set
39
- # :month_header => false # If you use false, the current month header will disappear.
35
+ # :show_today => false # Highlights today on the calendar using the CSS class 'today'.
36
+ # # Defaults to true.
37
+ # :previous_month_text => nil # Displayed left of the month name if set
38
+ # :next_month_text => nil # Displayed right of the month name if set
39
+ # :month_header => false # If you use false, the current month header will disappear.
40
+ # :calendar_title => Date::MONTHNAMES[options[:month]] # Pass in a custom title for the calendar. Defaults to month name
40
41
  #
41
42
  # For more customization, you can pass a code block to this method, that will get one argument, a Date object,
42
43
  # and return a values for the individual table cells. The block can return an array, [cell_text, cell_attrs],
@@ -72,18 +73,19 @@ module CalendarHelper
72
73
  block ||= Proc.new {|d| nil}
73
74
 
74
75
  defaults = {
75
- :table_class => 'calendar',
76
- :month_name_class => 'monthName',
77
- :other_month_class => 'otherMonth',
78
- :day_name_class => 'dayName',
79
- :day_class => 'day',
80
- :abbrev => (0..2),
81
- :first_day_of_week => 0,
82
- :accessible => false,
83
- :show_today => true,
76
+ :table_class => 'calendar',
77
+ :month_name_class => 'monthName',
78
+ :other_month_class => 'otherMonth',
79
+ :day_name_class => 'dayName',
80
+ :day_class => 'day',
81
+ :abbrev => (0..2),
82
+ :first_day_of_week => 0,
83
+ :accessible => false,
84
+ :show_today => true,
84
85
  :previous_month_text => nil,
85
- :next_month_text => nil,
86
- :month_header => true
86
+ :next_month_text => nil,
87
+ :month_header => true,
88
+ :calendar_title => Date::MONTHNAMES[options[:month]]
87
89
  }
88
90
  options = defaults.merge options
89
91
 
@@ -110,7 +112,7 @@ module CalendarHelper
110
112
  else
111
113
  colspan=7
112
114
  end
113
- cal << %(<th colspan="#{colspan}" class="#{options[:month_name_class]}">#{Date::MONTHNAMES[options[:month]]}</th>)
115
+ cal << %(<th colspan="#{colspan}" class="#{options[:month_name_class]}">#{options[:calendar_title]}</th>)
114
116
  cal << %(<th colspan="2">#{options[:next_month_text]}</th>) if options[:next_month_text]
115
117
  cal << %(</tr>)
116
118
  end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calendar_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ prerelease:
5
+ version: 0.2.4
5
6
  platform: ruby
6
7
  authors:
7
8
  - Geoffrey Grosenbach
@@ -9,49 +10,31 @@ autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
12
 
12
- date: 2010-05-21 00:00:00 -07:00
13
+ date: 2011-04-04 00:00:00 -07:00
13
14
  default_executable:
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: open4
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
20
21
  requirements:
21
22
  - - ">="
22
23
  - !ruby/object:Gem::Version
23
24
  version: "0"
24
- version:
25
- - !ruby/object:Gem::Dependency
26
- name: rubyforge
27
- type: :development
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 2.0.3
34
- version:
35
- - !ruby/object:Gem::Dependency
36
- name: gemcutter
37
- type: :development
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- version: 0.3.0
44
- version:
25
+ type: :runtime
26
+ version_requirements: *id001
45
27
  - !ruby/object:Gem::Dependency
46
28
  name: hoe
47
- type: :development
48
- version_requirement:
49
- version_requirements: !ruby/object:Gem::Requirement
29
+ prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
50
32
  requirements:
51
33
  - - ">="
52
34
  - !ruby/object:Gem::Version
53
- version: 2.5.0
54
- version:
35
+ version: 2.9.4
36
+ type: :development
37
+ version_requirements: *id002
55
38
  description: |-
56
39
  A simple helper for creating an HTML calendar. The "calendar" method will be automatically available to your Rails view templates, or can be used with Sinatra or other webapps.
57
40
 
@@ -79,6 +62,7 @@ files:
79
62
  - init.rb
80
63
  - lib/calendar_helper.rb
81
64
  - test/test_calendar_helper.rb
65
+ - .gemtest
82
66
  has_rdoc: true
83
67
  homepage:
84
68
  licenses: []
@@ -90,21 +74,24 @@ rdoc_options:
90
74
  require_paths:
91
75
  - lib
92
76
  required_ruby_version: !ruby/object:Gem::Requirement
77
+ none: false
93
78
  requirements:
94
79
  - - ">="
95
80
  - !ruby/object:Gem::Version
81
+ hash: -4579174070457573062
82
+ segments:
83
+ - 0
96
84
  version: "0"
97
- version:
98
85
  required_rubygems_version: !ruby/object:Gem::Requirement
86
+ none: false
99
87
  requirements:
100
88
  - - ">="
101
89
  - !ruby/object:Gem::Version
102
90
  version: "0"
103
- version:
104
91
  requirements: []
105
92
 
106
93
  rubyforge_project: calendar_helper
107
- rubygems_version: 1.3.5
94
+ rubygems_version: 1.6.2
108
95
  signing_key:
109
96
  specification_version: 3
110
97
  summary: A simple helper for creating an HTML calendar