rubyredrick-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/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: rubyredrick-ri_cal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
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-01 00:00:00 -07:00
12
+ date: 2009-06-05 00:00:00 -07:00
13
13
  default_executable: ri_cal
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -106,6 +106,7 @@ files:
106
106
  - lib/ri_cal/core_extensions/time/conversions.rb
107
107
  - lib/ri_cal/core_extensions/time/tzid_access.rb
108
108
  - lib/ri_cal/core_extensions/time/week_day_predicates.rb
109
+ - lib/ri_cal/fast_date_time.rb
109
110
  - lib/ri_cal/floating_timezone.rb
110
111
  - lib/ri_cal/invalid_property_value.rb
111
112
  - lib/ri_cal/invalid_timezone_identifer.rb
@@ -149,15 +150,18 @@ files:
149
150
  - lib/ri_cal/property_value/uri.rb
150
151
  - lib/ri_cal/property_value/utc_offset.rb
151
152
  - lib/ri_cal/required_timezones.rb
152
- - profiling/ical_files/profile3.ics
153
- - profiling/profile1.rb
154
- - profiling/profile2.rb
155
- - profiling/profile3.rb
153
+ - performance/paris_eastern/subject.rb
154
+ - performance/penultimate_weekday/subject.rb
155
+ - performance/psm_big_enum/ical.ics
156
+ - performance/psm_big_enum/subject.rb
157
+ - performance/utah_cycling/subject.rb
156
158
  - ri_cal.gemspec
157
159
  - sample_ical_files/from_ical_dot_app/test1.ics
160
+ - script/benchmark_subject
158
161
  - script/console
159
162
  - script/destroy
160
163
  - script/generate
164
+ - script/profile_subject
161
165
  - script/txt2html
162
166
  - spec/ri_cal/component/alarm_spec.rb
163
167
  - spec/ri_cal/component/calendar_spec.rb
@@ -171,6 +175,7 @@ files:
171
175
  - spec/ri_cal/core_extensions/string/conversions_spec.rb
172
176
  - spec/ri_cal/core_extensions/time/calculations_spec.rb
173
177
  - spec/ri_cal/core_extensions/time/week_day_predicates_spec.rb
178
+ - spec/ri_cal/fast_date_time_spec.rb
174
179
  - spec/ri_cal/occurrence_enumerator_spec.rb
175
180
  - spec/ri_cal/parser_spec.rb
176
181
  - spec/ri_cal/property_value/date_spec.rb
@@ -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)