hitimes 1.1.1-x86-mswin32 → 1.2.0-x86-mswin32

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.
Files changed (49) hide show
  1. data/CONTRIBUTING.md +45 -0
  2. data/{HISTORY → HISTORY.rdoc} +14 -1
  3. data/LICENSE +11 -8
  4. data/Manifest.txt +44 -0
  5. data/{README → README.rdoc} +18 -5
  6. data/Rakefile +20 -62
  7. data/ext/hitimes/{extconf.rb → c/extconf.rb} +3 -3
  8. data/ext/hitimes/{hitimes_ext.c → c/hitimes.c} +1 -1
  9. data/ext/hitimes/{hitimes_instant_clock_gettime.c → c/hitimes_instant_clock_gettime.c} +0 -0
  10. data/ext/hitimes/c/hitimes_instant_osx.c +45 -0
  11. data/ext/hitimes/{hitimes_instant_windows.c → c/hitimes_instant_windows.c} +0 -0
  12. data/ext/hitimes/{hitimes_interval.c → c/hitimes_interval.c} +15 -7
  13. data/ext/hitimes/{hitimes_interval.h → c/hitimes_interval.h} +5 -5
  14. data/ext/hitimes/{hitimes_stats.c → c/hitimes_stats.c} +0 -0
  15. data/ext/hitimes/{hitimes_stats.h → c/hitimes_stats.h} +0 -0
  16. data/ext/hitimes/java/src/hitimes/Hitimes.java +54 -0
  17. data/ext/hitimes/java/src/hitimes/HitimesInterval.java +181 -0
  18. data/ext/hitimes/java/src/hitimes/HitimesService.java +16 -0
  19. data/ext/hitimes/java/src/hitimes/HitimesStats.java +112 -0
  20. data/lib/hitimes.rb +15 -5
  21. data/lib/hitimes/1.8/hitimes.so +0 -0
  22. data/lib/hitimes/1.9/hitimes.so +0 -0
  23. data/lib/hitimes/version.rb +1 -50
  24. data/spec/hitimes_spec.rb +14 -0
  25. data/spec/interval_spec.rb +24 -21
  26. data/spec/metric_spec.rb +8 -10
  27. data/spec/mutex_stats_spec.rb +8 -6
  28. data/spec/paths_spec.rb +1 -3
  29. data/spec/spec_helper.rb +7 -3
  30. data/spec/stats_spec.rb +26 -28
  31. data/spec/timed_metric_spec.rb +33 -33
  32. data/spec/timed_value_metric_spec.rb +45 -46
  33. data/spec/value_metric_spec.rb +21 -23
  34. data/spec/version_spec.rb +4 -30
  35. data/tasks/default.rake +267 -0
  36. data/tasks/extension.rake +31 -101
  37. data/tasks/this.rb +209 -0
  38. metadata +89 -88
  39. data/ext/hitimes/hitimes_instant_osx.c +0 -16
  40. data/gemspec.rb +0 -64
  41. data/lib/hitimes/1.8/hitimes_ext.so +0 -0
  42. data/lib/hitimes/1.9/hitimes_ext.so +0 -0
  43. data/tasks/announce.rake +0 -42
  44. data/tasks/config.rb +0 -109
  45. data/tasks/distribution.rake +0 -93
  46. data/tasks/documentation.rake +0 -32
  47. data/tasks/rspec.rake +0 -33
  48. data/tasks/rubyforge.rake +0 -55
  49. data/tasks/utils.rb +0 -80
data/tasks/utils.rb DELETED
@@ -1,80 +0,0 @@
1
- require 'hitimes/version'
2
-
3
- #-------------------------------------------------------------------------------
4
- # Additions to the Configuration class that are useful
5
- #-------------------------------------------------------------------------------
6
- class Configuration
7
- class << self
8
- def exist?( name )
9
- Configuration::Table.has_key?( name )
10
- end
11
-
12
- def for_if_exist?( name )
13
- if self.exist?( name ) then
14
- self.for( name )
15
- end
16
- end
17
- end
18
- end
19
-
20
- #-------------------------------------------------------------------------------
21
- # some useful utilitiy methods for the tasks
22
- #-------------------------------------------------------------------------------
23
- module Utils
24
- class << self
25
-
26
- # Try to load the given _library_ using the built-in require, but do not
27
- # raise a LoadError if unsuccessful. Returns +true+ if the _library_ was
28
- # successfully loaded; returns +false+ otherwise.
29
- #
30
- def try_require( lib )
31
- require lib
32
- true
33
- rescue LoadError
34
- false
35
- end
36
-
37
- # partition an rdoc file into sections, and return the text of the section
38
- # given.
39
- def section_of(file, section_name)
40
- File.read(file).split(/^(?==)/).each do |section|
41
- lines = section.split("\n")
42
- return lines[1..-1].join("\n").strip if lines.first =~ /#{section_name}/i
43
- end
44
- nil
45
- end
46
-
47
- # Get an array of all the changes in the application for a particular
48
- # release. This is done by looking in the history file and grabbing the
49
- # information for the most recent release. The history file is assumed to
50
- # be in RDoc format and version release are 2nd tier sections separated by
51
- # '== Version X.Y.Z'
52
- #
53
- # returns:: A hash of notes keyed by version number
54
- #
55
- def release_notes_from(history_file)
56
- releases = {}
57
- File.read(history_file).split(/^(?=== Version)/).each do |section|
58
- lines = section.split("\n")
59
- md = %r{Version ((\w+\.)+\w+)}.match(lines.first)
60
- next unless md
61
- releases[md[1]] = lines[1..-1].join("\n").strip
62
- end
63
- return releases
64
- end
65
-
66
- # return a hash of useful information for the latest release
67
- # urls, subject, title, description and latest release notes
68
- #
69
- def announcement
70
- cfg = Configuration.for("project")
71
- {
72
- :subject => "#{cfg.name} #{Hitimes::VERSION} Released",
73
- :title => "#{cfg.name} version #{Hitimes::VERSION} has been released.",
74
- :urls => "#{cfg.homepage}",
75
- :description => "#{cfg.description.rstrip}",
76
- :release_notes => Utils.release_notes_from(cfg.history)[Hitimes::VERSION].rstrip
77
- }
78
- end
79
- end
80
- end # << self