ri_cal 0.5.3 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +11 -0
- data/Manifest.txt +9 -4
- data/README.txt +1 -4
- data/lib/ri_cal.rb +1 -1
- data/lib/ri_cal/component/calendar.rb +0 -1
- data/lib/ri_cal/core_extensions/string/conversions.rb +1 -11
- data/lib/ri_cal/core_extensions/time/conversions.rb +0 -17
- data/lib/ri_cal/core_extensions/time/week_day_predicates.rb +0 -33
- data/lib/ri_cal/fast_date_time.rb +214 -0
- data/lib/ri_cal/occurrence_enumerator.rb +3 -3
- data/lib/ri_cal/property_value/date.rb +19 -25
- data/lib/ri_cal/property_value/date_time.rb +25 -10
- data/lib/ri_cal/property_value/date_time/time_machine.rb +8 -30
- data/lib/ri_cal/property_value/date_time/timezone_support.rb +1 -1
- data/{profiling/profile1.rb → performance/paris_eastern/subject.rb} +13 -20
- data/performance/penultimate_weekday/subject.rb +15 -0
- data/{profiling/ical_files/profile3.ics → performance/psm_big_enum/ical.ics} +0 -0
- data/performance/psm_big_enum/subject.rb +16 -0
- data/{profiling/profile2.rb → performance/utah_cycling/subject.rb} +8 -18
- data/ri_cal.gemspec +3 -3
- data/script/benchmark_subject +23 -0
- data/script/profile_subject +27 -0
- data/spec/ri_cal/component/event_spec.rb +2 -1
- data/spec/ri_cal/core_extensions/time/week_day_predicates_spec.rb +1 -1
- data/spec/ri_cal/fast_date_time_spec.rb +67 -0
- data/spec/ri_cal/occurrence_enumerator_spec.rb +343 -343
- data/tasks/spec.rake +27 -0
- metadata +11 -6
- data/profiling/profile3.rb +0 -31
data/tasks/spec.rake
CHANGED
@@ -47,4 +47,31 @@ if RUBY_VERSION.match(/^1\.8\./)
|
|
47
47
|
t.rcov_opts = ['--exclude', 'spec']
|
48
48
|
end
|
49
49
|
end
|
50
|
+
|
51
|
+
namespace :performance do
|
52
|
+
desc 'Run all benchmarks'
|
53
|
+
task :benchmark do
|
54
|
+
bench_script = File.join(File.dirname(__FILE__), '..', '/script', 'benchmark_subject')
|
55
|
+
bench_file = File.join(File.dirname(__FILE__), '..', '/performance_data', 'benchmarks.out')
|
56
|
+
cat = ">"
|
57
|
+
FileList[File.join(File.dirname(__FILE__), '..', '/performance', '*')].each do |f|
|
58
|
+
cmd = "#{bench_script} #{File.basename(f)} #{cat} #{bench_file}"
|
59
|
+
puts cmd
|
60
|
+
`#{cmd}`
|
61
|
+
cat = '>>'
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
desc 'Run all profiles'
|
66
|
+
task :profile do
|
67
|
+
bench_script = File.join(File.dirname(__FILE__), '..', '/script', 'profile_subject')
|
68
|
+
FileList[File.join(File.dirname(__FILE__), '..', '/performance', '*')].each do |f|
|
69
|
+
cmd = "#{bench_script} #{File.basename(f)}"
|
70
|
+
puts cmd
|
71
|
+
`#{cmd}`
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
76
|
+
|
50
77
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ri_cal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- author=Rick DeNatale
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-06-
|
12
|
+
date: 2009-06-05 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -114,6 +114,7 @@ files:
|
|
114
114
|
- lib/ri_cal/core_extensions/time/conversions.rb
|
115
115
|
- lib/ri_cal/core_extensions/time/tzid_access.rb
|
116
116
|
- lib/ri_cal/core_extensions/time/week_day_predicates.rb
|
117
|
+
- lib/ri_cal/fast_date_time.rb
|
117
118
|
- lib/ri_cal/floating_timezone.rb
|
118
119
|
- lib/ri_cal/invalid_property_value.rb
|
119
120
|
- lib/ri_cal/invalid_timezone_identifer.rb
|
@@ -157,15 +158,18 @@ files:
|
|
157
158
|
- lib/ri_cal/property_value/uri.rb
|
158
159
|
- lib/ri_cal/property_value/utc_offset.rb
|
159
160
|
- lib/ri_cal/required_timezones.rb
|
160
|
-
-
|
161
|
-
-
|
162
|
-
-
|
163
|
-
-
|
161
|
+
- performance/paris_eastern/subject.rb
|
162
|
+
- performance/penultimate_weekday/subject.rb
|
163
|
+
- performance/psm_big_enum/ical.ics
|
164
|
+
- performance/psm_big_enum/subject.rb
|
165
|
+
- performance/utah_cycling/subject.rb
|
164
166
|
- ri_cal.gemspec
|
165
167
|
- sample_ical_files/from_ical_dot_app/test1.ics
|
168
|
+
- script/benchmark_subject
|
166
169
|
- script/console
|
167
170
|
- script/destroy
|
168
171
|
- script/generate
|
172
|
+
- script/profile_subject
|
169
173
|
- script/txt2html
|
170
174
|
- spec/ri_cal/component/alarm_spec.rb
|
171
175
|
- spec/ri_cal/component/calendar_spec.rb
|
@@ -179,6 +183,7 @@ files:
|
|
179
183
|
- spec/ri_cal/core_extensions/string/conversions_spec.rb
|
180
184
|
- spec/ri_cal/core_extensions/time/calculations_spec.rb
|
181
185
|
- spec/ri_cal/core_extensions/time/week_day_predicates_spec.rb
|
186
|
+
- spec/ri_cal/fast_date_time_spec.rb
|
182
187
|
- spec/ri_cal/occurrence_enumerator_spec.rb
|
183
188
|
- spec/ri_cal/parser_spec.rb
|
184
189
|
- spec/ri_cal/property_value/date_spec.rb
|
data/profiling/profile3.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
require File.expand_path(File.join(File.dirname(__FILE__), %w[.. lib ri_cal]))
|
2
|
-
require 'rubygems'
|
3
|
-
require "benchmark"
|
4
|
-
|
5
|
-
calendar_file = File.open(File.join(File.dirname(__FILE__), *%w[ical_files profile3.ics]), 'r')
|
6
|
-
calendar = RiCal.parse(calendar_file).first
|
7
|
-
cutoff = Date.parse("20100531")
|
8
|
-
def code_to_profile(calendar, cutoff, out=STDOUT)
|
9
|
-
calendar.events.each do |event|
|
10
|
-
event.occurrences(:before => cutoff).each do |instance|
|
11
|
-
out.puts "Event #{instance.uid.slice(0..5)}, starting #{instance.dtstart}, ending #{instance.dtend}"
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
devnul = Object.new
|
17
|
-
def devnul.puts(string)
|
18
|
-
end
|
19
|
-
|
20
|
-
Benchmark.bmbm do |results|
|
21
|
-
results.report("Benchmark:") { code_to_profile(calendar, cutoff, devnul) }
|
22
|
-
end
|
23
|
-
|
24
|
-
require 'ruby-prof'
|
25
|
-
|
26
|
-
result = RubyProf.profile do
|
27
|
-
code_to_profile(calendar, cutoff)
|
28
|
-
end
|
29
|
-
|
30
|
-
printer = RubyProf::FlatPrinter.new(result)
|
31
|
-
printer.print(STDOUT, 0)
|