when_exe 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1957,7 +1957,12 @@ module When::Coordinates
1957
1957
  end
1958
1958
  } unless When::Parts::MethodCash.escape(name)
1959
1959
  return @note.send(name, *(args + [self]), &block)
1960
- elsif respond_to?(:forwarded_formula, true)
1960
+ elsif When::Ephemeris::Formula.method_defined?(name)
1961
+ unless respond_to?(:forwarded_formula, true)
1962
+ instance_eval('class << self; include When::Ephemeris::Formula::Methods; end')
1963
+ @formula ||= When::Ephemeris::Formula.new({:location=>@location})
1964
+ @formula = When.Resource(Array(@formula), '_ep:')
1965
+ end
1961
1966
  instance_eval %Q{
1962
1967
  def #{name}(*args, &block)
1963
1968
  forward = forwarded_formula("#{name}", args[0])
@@ -52,6 +52,7 @@
52
52
  # * NAMESPACE Property を追加
53
53
  # * LOCALE Property を追加
54
54
  # * SUMMARY Property で[...]表現を多言語対応文字列として解釈する
55
+ # * RFC6350 ( http://tools.ietf.org/html/rfc6350 ) 方式にも対応
55
56
  # === Content Lines
56
57
  # RFC 5545 3.1 Content Lines では、記述が75文字を超える場合、改行してインデントする。
57
58
  # 本ライブラリでは文字数によらず、BEGIN:の次の行を基準にして、より深いインデントがある場合は、
@@ -6,5 +6,5 @@
6
6
  =end
7
7
 
8
8
  module When
9
- VERSION = "0.3.3"
9
+ VERSION = "0.3.4"
10
10
  end
data/test/test.rb CHANGED
@@ -40,7 +40,7 @@ require './test/tmreference'
40
40
  require './test/tmposition'
41
41
  require './test/calendartypes'
42
42
  require './test/inspect'
43
- #require './test/googlecalendar'
43
+ require './test/googlecalendar'
44
44
  require './test/region/m17n'
45
45
  require './test/region/residue'
46
46
  require './test/region/civil'
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  =begin
3
- Copyright (C) 2012-2013 Takashi SUGA
3
+ Copyright (C) 2012-2014 Takashi SUGA
4
4
 
5
5
  You may use and/or modify this file according to the license
6
6
  described in the LICENSE.txt file included in this archive.
@@ -51,22 +51,28 @@ END:VTIMEZONE
51
51
  RECURRENCE
52
52
 
53
53
  HOLIDAYS = [
54
- ["元日", "2012-01-01T00:00:00.00+09:00", "2012-01-02T00:00:00.00+09:00"],
55
- ["成人の日", "2012-01-09T00:00:00.00+09:00", "2012-01-10T00:00:00.00+09:00"],
56
- ["建国記念の日", "2012-02-11T00:00:00.00+09:00", "2012-02-12T00:00:00.00+09:00"],
57
- ["昭和の日", "2012-04-29T00:00:00.00+09:00", "2012-04-30T00:00:00.00+09:00"],
58
- # ["振替休日", "2012-04-30T00:00:00.00+09:00", "2012-05-01T00:00:00.00+09:00"],
59
- ["憲法記念日", "2012-05-03T00:00:00.00+09:00", "2012-05-04T00:00:00.00+09:00"],
60
- ["みどりの日", "2012-05-04T00:00:00.00+09:00", "2012-05-05T00:00:00.00+09:00"],
61
- ["こどもの日", "2012-05-05T00:00:00.00+09:00", "2012-05-06T00:00:00.00+09:00"],
62
- ["海の日", "2012-07-16T00:00:00.00+09:00", "2012-07-17T00:00:00.00+09:00"],
63
- ["敬老の日", "2012-09-17T00:00:00.00+09:00", "2012-09-18T00:00:00.00+09:00"],
64
- # ["秋分の日", "2012-09-22T00:00:00.00+09:00", "2012-09-23T00:00:00.00+09:00"],
65
- ["体育の日", "2012-10-08T00:00:00.00+09:00", "2012-10-09T00:00:00.00+09:00"],
66
- ["文化の日", "2012-11-03T00:00:00.00+09:00", "2012-11-04T00:00:00.00+09:00"],
67
- ["勤労感謝の日", "2012-11-23T00:00:00.00+09:00", "2012-11-24T00:00:00.00+09:00"],
68
- ["天皇誕生日", "2012-12-23T00:00:00.00+09:00", "2012-12-24T00:00:00.00+09:00"],
69
- # ["振替休日", "2012-12-24T00:00:00.00+09:00", "2012-12-25T00:00:00.00+09:00"]
54
+ ["元日", "2012-01-01T00:00:00.00+09:00", "2012-01-02T00:00:00.00+09:00"],
55
+ ["元日 振替休日", "2012-01-02T00:00:00.00+09:00", "2012-01-03T00:00:00.00+09:00"],
56
+ ["銀行休業日", "2012-01-02T00:00:00.00+09:00", "2012-01-03T00:00:00.00+09:00"],
57
+ ["銀行休業日", "2012-01-03T00:00:00.00+09:00", "2012-01-04T00:00:00.00+09:00"],
58
+ ["成人の日", "2012-01-09T00:00:00.00+09:00", "2012-01-10T00:00:00.00+09:00"],
59
+ ["建国記念の日", "2012-02-11T00:00:00.00+09:00", "2012-02-12T00:00:00.00+09:00"],
60
+ ["春分の日", "2012-03-20T00:00:00.00+09:00", "2012-03-21T00:00:00.00+09:00"],
61
+ ["昭和の日", "2012-04-29T00:00:00.00+09:00", "2012-04-30T00:00:00.00+09:00"],
62
+ ["昭和の日 振替休日", "2012-04-30T00:00:00.00+09:00", "2012-05-01T00:00:00.00+09:00"],
63
+ ["憲法記念日", "2012-05-03T00:00:00.00+09:00", "2012-05-04T00:00:00.00+09:00"],
64
+ ["みどりの日", "2012-05-04T00:00:00.00+09:00", "2012-05-05T00:00:00.00+09:00"],
65
+ ["こどもの日", "2012-05-05T00:00:00.00+09:00", "2012-05-06T00:00:00.00+09:00"],
66
+ ["海の日", "2012-07-16T00:00:00.00+09:00", "2012-07-17T00:00:00.00+09:00"],
67
+ ["敬老の日", "2012-09-17T00:00:00.00+09:00", "2012-09-18T00:00:00.00+09:00"],
68
+ ["秋分の日", "2012-09-22T00:00:00.00+09:00", "2012-09-23T00:00:00.00+09:00"],
69
+ ["体育の日", "2012-10-08T00:00:00.00+09:00", "2012-10-09T00:00:00.00+09:00"],
70
+ ["文化の日", "2012-11-03T00:00:00.00+09:00", "2012-11-04T00:00:00.00+09:00"],
71
+ ["勤労感謝の日", "2012-11-23T00:00:00.00+09:00", "2012-11-24T00:00:00.00+09:00"],
72
+ ["天皇誕生日", "2012-12-23T00:00:00.00+09:00", "2012-12-24T00:00:00.00+09:00"],
73
+ ["天皇誕生日 振替休日", "2012-12-24T00:00:00.00+09:00", "2012-12-25T00:00:00.00+09:00"],
74
+ ["クリスマス", "2012-12-25T00:00:00.00+09:00", "2012-12-26T00:00:00.00+09:00"],
75
+ ["大晦日", "2012-12-31T00:00:00.00+09:00", "2013-01-01T00:00:00.00+09:00"]
70
76
  ]
71
77
 
72
78
  WEEKLY_EVENTS = [
@@ -84,6 +90,7 @@ RECURRENCE
84
90
  end
85
91
 
86
92
  if const_defined?(:PASSWORD) && Object.const_defined?(:GoogleCalendar)
93
+
87
94
  def test__to_vevent
88
95
  holidays = HOLIDAYS.dup
89
96
  gcal = get_cal(PUBLIC_FEED % ['japanese', 'ja'])
@@ -105,19 +112,21 @@ RECURRENCE
105
112
  end
106
113
  event = When.Resource("examples/JapanHolidays.ics::Ganjitsu").to_gcalevent(gcal)
107
114
  event.save!
108
- holidays = [RULE0]
115
+ holidays = [RULE0] * 2
109
116
  gcal.events(period).each do |event|
110
117
  assert_equal(holidays.shift, event.recurrence)
111
118
  end
112
- assert_equal(0, holidays.size)
119
+ pp 'WARN: event is duplicated.' if holidays.size == 0
120
+ assert_equal(true, (0..1).include?(holidays.size))
113
121
  end
114
122
 
115
123
  def test__enum_for
116
124
  holidays = HOLIDAYS.dup
125
+ holidays.delete_at(2)
117
126
  gcal = get_cal(PUBLIC_FEED % ['japanese', 'ja'])
118
127
  gcal.enum_for({'start-min'=>'2012-01-01', 'start-max'=>'2013-01-01'}).each do |date|
119
- sample = holidays.shift
120
- assert_equal(sample[1] + '...' + sample[2], date.to_s)
128
+ sample = holidays.shift
129
+ assert_equal(sample[1] + '...' + sample[2], date.to_s)
121
130
  end
122
131
  assert_equal(0, holidays.size)
123
132
  end
data/when_exe.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
9
9
  s.email = ["suchowan@box.email.ne.jp"]
10
10
  s.homepage = "http://www.asahi-net.or.jp/~dd6t-sg/"
11
11
  s.summary = %q{A multicultural and multilingualized calendar library based on ISO 8601, ISO 19108 and RFC 5545}
12
- s.description = %q{This library supports ISO 8601, ISO 19108, RFC 5545 and RFC6350. This version is a beta version and in the evaluation stage. So, its APIs may be changed in future.}
12
+ s.description = %q{This library supports ISO 8601, ISO 19108, RFC 5545 and RFC6350. This version is a beta version and in the evaluation stage. So, its APIs may be changed in future. Please refer to http://suchowan.at.webry.info/theme/a543700674.html for the recent history (Sorry only in Japanese).}
13
13
 
14
14
  s.rubyforge_project = "when_exe"
15
15
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: when_exe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-06 00:00:00.000000000Z
12
+ date: 2014-02-10 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: This library supports ISO 8601, ISO 19108, RFC 5545 and RFC6350. This
15
15
  version is a beta version and in the evaluation stage. So, its APIs may be changed
16
- in future.
16
+ in future. Please refer to http://suchowan.at.webry.info/theme/a543700674.html for
17
+ the recent history (Sorry only in Japanese).
17
18
  email:
18
19
  - suchowan@box.email.ne.jp
19
20
  executables: