hitimes 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) 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} +20 -6
  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/version.rb +1 -50
  22. data/spec/hitimes_spec.rb +14 -0
  23. data/spec/interval_spec.rb +24 -21
  24. data/spec/metric_spec.rb +8 -10
  25. data/spec/mutex_stats_spec.rb +8 -6
  26. data/spec/paths_spec.rb +1 -3
  27. data/spec/spec_helper.rb +7 -3
  28. data/spec/stats_spec.rb +26 -28
  29. data/spec/timed_metric_spec.rb +33 -33
  30. data/spec/timed_value_metric_spec.rb +45 -46
  31. data/spec/value_metric_spec.rb +21 -23
  32. data/spec/version_spec.rb +4 -30
  33. data/tasks/default.rake +267 -0
  34. data/tasks/extension.rake +31 -101
  35. data/tasks/this.rb +209 -0
  36. metadata +139 -143
  37. data/ext/hitimes/hitimes_instant_osx.c +0 -16
  38. data/gemspec.rb +0 -64
  39. data/tasks/announce.rake +0 -42
  40. data/tasks/config.rb +0 -109
  41. data/tasks/distribution.rake +0 -93
  42. data/tasks/documentation.rake +0 -32
  43. data/tasks/rspec.rake +0 -33
  44. data/tasks/rubyforge.rake +0 -55
  45. data/tasks/utils.rb +0 -80
@@ -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