holidays 0.9.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/CHANGELOG +3 -0
  2. data/LICENSE +1 -1
  3. data/README +1 -1
  4. data/lib/holidays.rb +1 -1
  5. data/rakefile.rb +113 -0
  6. metadata +3 -2
data/CHANGELOG CHANGED
@@ -1,5 +1,8 @@
1
1
  = Ruby Holidays Gem CHANGELOG
2
2
 
3
+ == 0.9.2
4
+ * Included rakefile in Gem (thank you James Herdman).
5
+
3
6
  == 0.9.1
4
7
  * au.yaml was being included incorrectly in US holiday definitions. Thanks to Glenn Vanderburg (http://vanderburg.org/) for the fix.
5
8
 
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  ==== Ruby Holidays Gem License
2
2
 
3
- Copyright (c) 2007 Alex Dunae
3
+ Copyright (c) 2007-08 Alex Dunae
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README CHANGED
@@ -71,6 +71,6 @@ Lookup Canada Day in different regions.
71
71
  * Source: http://code.dunae.ca/svn/holidays
72
72
  * Docs: http://code.dunae.ca/holidays/doc
73
73
 
74
- By Alex Dunae (dunae.ca, e-mail 'code' at the same domain), 2007.
74
+ By Alex Dunae (dunae.ca, e-mail 'code' at the same domain), 2007-08.
75
75
 
76
76
  Made on Vancouver Island.
@@ -42,7 +42,7 @@ module Holidays
42
42
  # Exception thrown when an unknown region is requested.
43
43
  class UnkownRegionError < ArgumentError; end
44
44
 
45
- VERSION = '0.9.0'
45
+ VERSION = '0.9.2'
46
46
 
47
47
  @@regions = []
48
48
  @@holidays_by_month = {}
@@ -0,0 +1,113 @@
1
+ require 'rake'
2
+ require 'rake/testtask'
3
+ require 'rake/rdoctask'
4
+ require 'rake/gempackagetask'
5
+ require 'yaml'
6
+ require 'fileutils'
7
+ require 'lib/holidays'
8
+ require 'data/build_defs'
9
+
10
+ desc 'Run all tests'
11
+ task :test => ["test:lib", "test:defs"]
12
+
13
+ namespace :test do
14
+ desc 'Run the unit tests.'
15
+ Rake::TestTask.new(:lib) do |t|
16
+ t.libs << 'lib'
17
+ t.test_files = FileList['test/defs/test*.rb'].exclude('test_helper.rb')
18
+ t.verbose = false
19
+ end
20
+
21
+ desc 'Run the definition tests.'
22
+ Rake::TestTask.new(:defs) do |t|
23
+ t.libs << 'lib'
24
+ t.test_files = FileList['test/test*.rb'].exclude('test_helper.rb')
25
+ t.verbose = false
26
+ end
27
+ end
28
+
29
+ task :doc => ["defs:manifest", :rdoc]
30
+
31
+ desc 'Generate documentation.'
32
+ Rake::RDocTask.new(:rdoc) do |rdoc|
33
+ rdoc.rdoc_dir = 'doc'
34
+ rdoc.title = 'Ruby Holidays Gem'
35
+ rdoc.options << '--all' << '--inline-source' << '--line-numbers'
36
+ rdoc.options << '--charset' << 'utf-8'
37
+ #rdoc.template = 'extras/rdoc_template.rb'
38
+ rdoc.rdoc_files.include('README')
39
+ rdoc.rdoc_files.include('data/SYNTAX')
40
+ rdoc.rdoc_files.include('lib/holidays/MANIFEST')
41
+ rdoc.rdoc_files.include('REFERENCES')
42
+ rdoc.rdoc_files.include('CHANGELOG')
43
+ rdoc.rdoc_files.include('LICENSE')
44
+ rdoc.rdoc_files.include('lib/*.rb')
45
+ end
46
+
47
+ spec = Gem::Specification.new do |s|
48
+ s.name = 'holidays'
49
+ s.version = '0.9.2'
50
+ s.author = 'Alex Dunae'
51
+ s.homepage = 'http://code.dunae.ca/holidays'
52
+ s.platform = Gem::Platform::RUBY
53
+ s.description = <<-EOF
54
+ A collection of Ruby methods to deal with statutory and other holidays. You deserve a holiday!
55
+ EOF
56
+ s.summary = 'A collection of Ruby methods to deal with statutory and other holidays. You deserve a holiday!'
57
+ s.files = FileList["{lib}/**/*", "{data}/**/*", "*.rb"].to_a
58
+ s.test_files = FileList['test/defs/test*.rb'].exclude('test_helper.rb')
59
+ s.has_rdoc = true
60
+ s.extra_rdoc_files = ['README', 'data/SYNTAX', 'lib/holidays/MANIFEST', 'REFERENCES', 'CHANGELOG', 'LICENSE']
61
+ s.rdoc_options << '--all' << '--inline-source' << '--line-numbers' << '--charset' << 'utf-8'
62
+ end
63
+
64
+ desc 'Build the gem.'
65
+ Rake::GemPackageTask.new(spec) do |pkg|
66
+ pkg.need_zip = true
67
+ pkg.need_tar = true
68
+ end
69
+
70
+ desc 'Definition file tasks'
71
+ namespace :defs do
72
+ DATA_PATH = 'data'
73
+
74
+ desc 'Build holiday definition files'
75
+ task :build_all do
76
+ # load the index
77
+ def_index = YAML.load_file("#{DATA_PATH}/index.yaml")
78
+
79
+ # create a dir for the generated tests
80
+ FileUtils.mkdir_p('test/defs')
81
+
82
+ def_index['defs'].each do |region, files|
83
+ puts "Building #{region} definition module:"
84
+ files = files.collect { |f| "#{DATA_PATH}/#{f}" }
85
+ files.uniq!
86
+
87
+ module_src, test_src = parse_holiday_defs(region, files)
88
+ File.open("lib/holidays/#{region.to_s}.rb","w") do |file|
89
+ file.puts module_src
90
+ end
91
+ unless test_src.empty?
92
+ File.open("test/defs/test_defs_#{region.to_s}.rb","w") do |file|
93
+ file.puts test_src
94
+ end
95
+ end
96
+ puts "Done.\n\n"
97
+ end
98
+ end
99
+
100
+ desc 'Build the definition manifest.'
101
+ task :manifest do
102
+ File.open("lib/holidays/MANIFEST","w") do |file|
103
+ file.puts <<-EOH
104
+ ==== Regional definitions
105
+ The following definition files are included in this installation:
106
+
107
+ EOH
108
+ FileList.new('lib/holidays/*.rb').each do |str|
109
+ file.puts('* ' + str.gsub(/^lib\/|\.rb$/, ''))
110
+ end
111
+ end
112
+ end
113
+ end
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: holidays
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.9.1
7
- date: 2008-01-14 00:00:00 -08:00
6
+ version: 0.9.2
7
+ date: 2008-07-23 00:00:00 -07:00
8
8
  summary: A collection of Ruby methods to deal with statutory and other holidays. You deserve a holiday!
9
9
  require_paths:
10
10
  - lib
@@ -73,6 +73,7 @@ files:
73
73
  - data/united_nations.yaml
74
74
  - data/us.yaml
75
75
  - data/za.yaml
76
+ - rakefile.rb
76
77
  - README
77
78
  - REFERENCES
78
79
  - CHANGELOG