wombleton-holidays 0.9.8 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.8
1
+ 0.9.9
@@ -252,6 +252,8 @@ private
252
252
  # Found sub region wild-card
253
253
  regions.delete_if do |reg|
254
254
  if reg.to_s =~ /_$/
255
+ prefix = reg.to_s.split('_').first
256
+ raise UnknownRegionError unless @@regions.include?(prefix.to_sym) or begin require "holidays/#{prefix}"; rescue LoadError; false; end
255
257
  regions << @@regions.select { |dr| dr.to_s =~ Regexp.new("^#{reg}") }
256
258
  true
257
259
  end
@@ -261,7 +263,7 @@ private
261
263
 
262
264
  require "holidays/north_america" if regions.include?(:us) # special case for north_america/US cross-linking
263
265
 
264
- raise UnknownRegionError unless regions.all? { |r| r == :any or @@regions.include?(r) or begin require "holidays/#{r.to_s.split('_').first}"; rescue LoadError; false; end }
266
+ raise UnknownRegionError unless regions.all? { |r| r == :any or @@regions.include?(r) or begin require "holidays/#{r.to_s}"; rescue LoadError; false; end }
265
267
  regions
266
268
  end
267
269
 
@@ -1,6 +1,4 @@
1
1
  require File.dirname(__FILE__) + '/test_helper'
2
- require 'holidays/gb'
3
- require 'holidays/ie'
4
2
 
5
3
  class MultipleRegionsTests < Test::Unit::TestCase
6
4
  def setup
@@ -11,6 +9,10 @@ class MultipleRegionsTests < Test::Unit::TestCase
11
9
  h = Holidays.on(Date.civil(2008,12,26), :ie)
12
10
  assert_equal 'St. Stephen\'s Day', h[0][:name]
13
11
 
12
+ h = Holidays.on(Date.civil(2008,5,9), :gb_)
13
+ assert_equal 'Liberation Day', (h[0] || {})[:name]
14
+
15
+
14
16
  h = Holidays.on(Date.civil(2008,5,9), :je)
15
17
  assert_equal 'Liberation Day', h[0][:name]
16
18
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{wombleton-holidays}
8
- s.version = "0.9.8"
8
+ s.version = "0.9.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alex Dunae", "Rowan Crawford"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 8
9
- version: 0.9.8
8
+ - 9
9
+ version: 0.9.9
10
10
  platform: ruby
11
11
  authors:
12
12
  - Alex Dunae