hitimes 1.0.3-x86-mswin32-60 → 1.2.2-x86-mswin32-60

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. data/.travis.yml +10 -0
  2. data/CONTRIBUTING.md +45 -0
  3. data/HISTORY.md +97 -0
  4. data/LICENSE +11 -8
  5. data/Manifest.txt +45 -0
  6. data/README.md +163 -0
  7. data/Rakefile +23 -62
  8. data/ext/hitimes/c/extconf.rb +24 -0
  9. data/ext/hitimes/{hitimes_ext.c → c/hitimes.c} +1 -1
  10. data/ext/hitimes/{hitimes_instant_clock_gettime.c → c/hitimes_instant_clock_gettime.c} +0 -0
  11. data/ext/hitimes/c/hitimes_instant_osx.c +45 -0
  12. data/ext/hitimes/{hitimes_instant_windows.c → c/hitimes_instant_windows.c} +0 -0
  13. data/ext/hitimes/{hitimes_interval.c → c/hitimes_interval.c} +15 -7
  14. data/ext/hitimes/{hitimes_interval.h → c/hitimes_interval.h} +5 -5
  15. data/ext/hitimes/{hitimes_stats.c → c/hitimes_stats.c} +0 -0
  16. data/ext/hitimes/{hitimes_stats.h → c/hitimes_stats.h} +0 -0
  17. data/ext/hitimes/java/src/hitimes/Hitimes.java +54 -0
  18. data/ext/hitimes/java/src/hitimes/HitimesInterval.java +181 -0
  19. data/ext/hitimes/java/src/hitimes/HitimesService.java +16 -0
  20. data/ext/hitimes/java/src/hitimes/HitimesStats.java +112 -0
  21. data/lib/hitimes.rb +18 -5
  22. data/lib/hitimes/1.9/hitimes.so +0 -0
  23. data/lib/hitimes/2.0/hitimes.so +0 -0
  24. data/lib/hitimes/2.1/hitimes.so +0 -0
  25. data/lib/hitimes/metric.rb +6 -0
  26. data/lib/hitimes/mutexed_stats.rb +5 -1
  27. data/lib/hitimes/stats.rb +5 -1
  28. data/lib/hitimes/timed_metric.rb +1 -2
  29. data/lib/hitimes/timed_value_metric.rb +0 -2
  30. data/lib/hitimes/value_metric.rb +2 -3
  31. data/lib/hitimes/version.rb +1 -50
  32. data/spec/hitimes_spec.rb +14 -0
  33. data/spec/interval_spec.rb +40 -37
  34. data/spec/metric_spec.rb +8 -10
  35. data/spec/mutex_stats_spec.rb +10 -8
  36. data/spec/paths_spec.rb +3 -5
  37. data/spec/spec_helper.rb +9 -4
  38. data/spec/stats_spec.rb +28 -30
  39. data/spec/timed_metric_spec.rb +44 -44
  40. data/spec/timed_value_metric_spec.rb +54 -55
  41. data/spec/value_metric_spec.rb +28 -30
  42. data/spec/version_spec.rb +4 -30
  43. data/tasks/default.rake +254 -0
  44. data/tasks/extension.rake +29 -73
  45. data/tasks/this.rb +200 -0
  46. metadata +173 -105
  47. data/HISTORY +0 -55
  48. data/README +0 -134
  49. data/ext/hitimes/extconf.rb +0 -21
  50. data/ext/hitimes/hitimes_instant_osx.c +0 -16
  51. data/gemspec.rb +0 -57
  52. data/lib/hitimes/1.8/hitimes_ext.so +0 -0
  53. data/lib/hitimes/1.9/hitimes_ext.so +0 -0
  54. data/tasks/announce.rake +0 -39
  55. data/tasks/config.rb +0 -108
  56. data/tasks/distribution.rake +0 -74
  57. data/tasks/documentation.rake +0 -32
  58. data/tasks/rspec.rake +0 -31
  59. data/tasks/rubyforge.rake +0 -55
  60. data/tasks/utils.rb +0 -80
@@ -0,0 +1,200 @@
1
+ require 'pathname'
2
+
3
+ # Public: A Class containing all the metadata and utilities needed to manage a
4
+ # ruby project.
5
+ class ThisProject
6
+ # The name of this project
7
+ attr_accessor :name
8
+
9
+ # The author's name
10
+ attr_accessor :author
11
+
12
+ # The email address of the author(s)
13
+ attr_accessor :email
14
+
15
+ # The homepage of this project
16
+ attr_accessor :homepage
17
+
18
+ # The regex of files to exclude from the manifest
19
+ attr_accessor :exclude_from_manifest
20
+
21
+ # The hash of Gem::Specifications keyed' by platform
22
+ attr_accessor :gemspecs
23
+
24
+ # Public: Initialize ThisProject
25
+ #
26
+ # Yields self
27
+ def initialize(&block)
28
+ @exclude_from_manifest = %r/\.(git|DS_Store)|^(doc|coverage|pkg|tmp|Gemfile(\.lock)?)|^[^\/]+\.gemspec|\.(swp|jar|bundle|so|rvmrc)$|~$/
29
+ @gemspecs = Hash.new
30
+ yield self if block_given?
31
+ end
32
+
33
+ # Public: return the version of ThisProject
34
+ #
35
+ # Search the ruby files in the project looking for the one that has the
36
+ # version string in it. This does not eval any code in the project, it parses
37
+ # the source code looking for the string.
38
+ #
39
+ # Returns a String version
40
+ def version
41
+ [ "lib/#{ name }.rb", "lib/#{ name }/version.rb" ].each do |v|
42
+ path = project_path( v )
43
+ line = path.read[/^\s*VERSION\s*=\s*.*/]
44
+ if line then
45
+ return line.match(/.*VERSION\s*=\s*['"](.*)['"]/)[1]
46
+ end
47
+ end
48
+ end
49
+
50
+ # Internal: Return a section of an RDoc file with the given section name
51
+ #
52
+ # path - the relative path in the project of the file to parse
53
+ # section_name - the section out of the file from which to parse data
54
+ #
55
+ # Retuns the text of the section as an array of paragrphs.
56
+ def section_of( file, section_name )
57
+ re = /^[=#]+ (.*)$/
58
+ sectional = project_path( file )
59
+ parts = sectional.read.split( re )[1..-1]
60
+ parts.map! { |p| p.strip }
61
+
62
+ sections = Hash.new
63
+ Hash[*parts].each do |k,v|
64
+ sections[k] = v.split("\n\n")
65
+ end
66
+ return sections[section_name]
67
+ end
68
+
69
+ # Internal: print out a warning about the give task
70
+ def task_warning( task )
71
+ warn "WARNING: '#{task}' tasks are not defined. Please run 'rake develop'"
72
+ end
73
+
74
+ # Internal: Return the full path to the file that is relative to the project
75
+ # root.
76
+ #
77
+ # path - the relative path of the file from the project root
78
+ #
79
+ # Returns the Pathname of the file
80
+ def project_path( *relative_path )
81
+ project_root.join( *relative_path )
82
+ end
83
+
84
+ # Internal: The absolute path of this file
85
+ #
86
+ # Returns the Pathname of this file.
87
+ def this_file_path
88
+ Pathname.new( __FILE__ ).expand_path
89
+ end
90
+
91
+ # Internal: The root directory of this project
92
+ #
93
+ # This is defined as being the directory that is in the path of this project
94
+ # that has the first Rakefile
95
+ #
96
+ # Returns the Pathname of the directory
97
+ def project_root
98
+ this_file_path.ascend do |p|
99
+ rakefile = p.join( 'Rakefile' )
100
+ return p if rakefile.exist?
101
+ end
102
+ end
103
+
104
+ # Internal: Returns the contents of the Manifest.txt file as an array
105
+ #
106
+ # Returns an Array of strings
107
+ def manifest
108
+ manifest_file = project_path( "Manifest.txt" )
109
+ abort "You need a Manifest.txt" unless manifest_file.readable?
110
+ manifest_file.readlines.map { |l| l.strip }
111
+ end
112
+
113
+ # Internal: Return the files that define the extensions
114
+ #
115
+ # Returns an Array
116
+ def extension_conf_files
117
+ manifest.grep( /extconf.rb\Z/ )
118
+ end
119
+
120
+ # Internal: Returns the gemspace associated with the current ruby platform
121
+ def platform_gemspec
122
+ gemspecs[platform]
123
+ end
124
+
125
+ def core_gemspec
126
+ Gem::Specification.new do |spec|
127
+ spec.name = name
128
+ spec.version = version
129
+ spec.author = author
130
+ spec.email = email
131
+ spec.homepage = homepage
132
+
133
+ spec.summary = summary
134
+ spec.description = description
135
+ spec.license = license
136
+
137
+ spec.files = manifest
138
+ spec.executables = spec.files.grep(/^bin/) { |f| File.basename(f) }
139
+ spec.test_files = spec.files.grep(/^spec/)
140
+
141
+ spec.extra_rdoc_files += spec.files.grep(/(txt|rdoc|md)$/)
142
+ spec.rdoc_options = [ "--main" , 'README.md',
143
+ "--markup", "tomdoc" ]
144
+ end
145
+ end
146
+
147
+ # Internal: Return the gemspec for the ruby platform
148
+ def ruby_gemspec( core = core_gemspec, &block )
149
+ yielding_gemspec( 'ruby', core, &block )
150
+ end
151
+
152
+ # Internal: Return the gemspec for the jruby platform
153
+ def java_gemspec( core = core_gemspec, &block )
154
+ yielding_gemspec( 'java', core, &block )
155
+ end
156
+
157
+ # Internal: give an initial spec and a key, create a new gemspec based off of
158
+ # it.
159
+ #
160
+ # This will force the new gemspecs 'platform' to be that of the key, since the
161
+ # only reason you would have multiple gemspecs at this point is to deal with
162
+ # different platforms.
163
+ def yielding_gemspec( key, core )
164
+ spec = gemspecs[key] ||= core.dup
165
+ spec.platform = key
166
+ yield spec if block_given?
167
+ return spec
168
+ end
169
+
170
+ # Internal: Return the platform of ThisProject at the current moment in time.
171
+ def platform
172
+ (RUBY_PLATFORM == "java") ? 'java' : Gem::Platform::RUBY
173
+ end
174
+
175
+ # Internal: Return the DESCRIPTION section of the README.rdoc file
176
+ def description_section
177
+ section_of( 'README.md', 'DESCRIPTION')
178
+ end
179
+
180
+ # Internal: Return the summary text from the README
181
+ def summary
182
+ description_section.first
183
+ end
184
+
185
+ # Internal: Return the full description text from the README
186
+ def description
187
+ description_section.join(" ").tr("\n", ' ').gsub(/[{}]/,'').gsub(/\[[^\]]+\]/,'') # strip rdoc
188
+ end
189
+
190
+ def license
191
+ "ISC"
192
+ end
193
+
194
+ # Internal: The path to the gemspec file
195
+ def gemspec_file
196
+ project_path( "#{ name }.gemspec" )
197
+ end
198
+ end
199
+
200
+ This = ThisProject.new
metadata CHANGED
@@ -1,88 +1,150 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: hitimes
3
- version: !ruby/object:Gem::Version
4
- version: 1.0.3
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.2.2
5
+ prerelease:
5
6
  platform: x86-mswin32-60
6
- authors:
7
+ authors:
7
8
  - Jeremy Hinegardner
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
-
12
- date: 2009-06-28 00:00:00 -06:00
13
- default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2015-01-06 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: rake
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
21
19
  - - ~>
22
- - !ruby/object:Gem::Version
23
- version: 0.8.1
24
- version:
25
- - !ruby/object:Gem::Dependency
26
- name: configuration
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
30
- requirements:
20
+ - !ruby/object:Gem::Version
21
+ version: '10.4'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '10.4'
30
+ - !ruby/object:Gem::Dependency
31
+ name: minitest
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '5.5'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '5.5'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rdoc
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
31
51
  - - ~>
32
- - !ruby/object:Gem::Version
33
- version: 0.0.5
34
- version:
35
- - !ruby/object:Gem::Dependency
52
+ - !ruby/object:Gem::Version
53
+ version: '4.2'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '4.2'
62
+ - !ruby/object:Gem::Dependency
36
63
  name: json
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: '1.8'
37
70
  type: :development
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
40
- requirements:
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
41
75
  - - ~>
42
- - !ruby/object:Gem::Version
43
- version: 1.1.3
44
- version:
45
- - !ruby/object:Gem::Dependency
76
+ - !ruby/object:Gem::Version
77
+ version: '1.8'
78
+ - !ruby/object:Gem::Dependency
46
79
  name: rake-compiler
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: '0.9'
47
86
  type: :development
48
- version_requirement:
49
- version_requirements: !ruby/object:Gem::Requirement
50
- requirements:
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
51
91
  - - ~>
52
- - !ruby/object:Gem::Version
53
- version: 0.5.0
54
- version:
55
- description: "Hitimes is a fast, high resolution timer library for recording performance metrics. It uses the appropriate C method calls for each system to get the highest granularity time increments possible. It currently supports any of the following systems: * any system with the POSIX call <tt>clock_gettime()</tt>, * Mac OS X * Windows Using Hitimes can be faster than using a series of +Time.new+ calls, and it will have a much higher granularity. It is definitely faster than using +Process.times+."
92
+ - !ruby/object:Gem::Version
93
+ version: '0.9'
94
+ - !ruby/object:Gem::Dependency
95
+ name: simplecov
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ~>
100
+ - !ruby/object:Gem::Version
101
+ version: '0.9'
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: '0.9'
110
+ description: ! 'Hitimes is a fast, high resolution timer library for recording performance
111
+ metrics. It uses the appropriate low method calls for each system to get the highest
112
+ granularity time increments possible. It currently supports any of the following
113
+ systems: * any system with the POSIX call `clock_gettime()` * Mac OS X * Windows
114
+ * JRuby Using Hitimes can be faster than using a series of `Time.new` calls, and
115
+ it will have a much higher granularity. It is definitely faster than using `Process.times`.'
56
116
  email: jeremy@copiousfreetime.org
57
117
  executables: []
58
-
59
118
  extensions: []
60
-
61
- extra_rdoc_files:
62
- - README
63
- - HISTORY
119
+ extra_rdoc_files:
120
+ - CONTRIBUTING.md
121
+ - HISTORY.md
122
+ - Manifest.txt
123
+ - README.md
124
+ files:
125
+ - .travis.yml
126
+ - CONTRIBUTING.md
127
+ - HISTORY.md
64
128
  - LICENSE
65
- - lib/hitimes/metric.rb
66
- - lib/hitimes/mutexed_stats.rb
67
- - lib/hitimes/paths.rb
68
- - lib/hitimes/stats.rb
69
- - lib/hitimes/timed_metric.rb
70
- - lib/hitimes/timed_value_metric.rb
71
- - lib/hitimes/value_metric.rb
72
- - lib/hitimes/version.rb
73
- - lib/hitimes.rb
74
- files:
129
+ - Manifest.txt
130
+ - README.md
131
+ - Rakefile
75
132
  - examples/benchmarks.rb
76
133
  - examples/stats.rb
77
- - ext/hitimes/hitimes_ext.c
78
- - ext/hitimes/hitimes_instant_clock_gettime.c
79
- - ext/hitimes/hitimes_instant_osx.c
80
- - ext/hitimes/hitimes_instant_windows.c
81
- - ext/hitimes/hitimes_interval.c
82
- - ext/hitimes/hitimes_stats.c
83
- - ext/hitimes/hitimes_interval.h
84
- - ext/hitimes/hitimes_stats.h
85
- - ext/hitimes/extconf.rb
134
+ - ext/hitimes/c/extconf.rb
135
+ - ext/hitimes/c/hitimes.c
136
+ - ext/hitimes/c/hitimes_instant_clock_gettime.c
137
+ - ext/hitimes/c/hitimes_instant_osx.c
138
+ - ext/hitimes/c/hitimes_instant_windows.c
139
+ - ext/hitimes/c/hitimes_interval.c
140
+ - ext/hitimes/c/hitimes_interval.h
141
+ - ext/hitimes/c/hitimes_stats.c
142
+ - ext/hitimes/c/hitimes_stats.h
143
+ - ext/hitimes/java/src/hitimes/Hitimes.java
144
+ - ext/hitimes/java/src/hitimes/HitimesInterval.java
145
+ - ext/hitimes/java/src/hitimes/HitimesService.java
146
+ - ext/hitimes/java/src/hitimes/HitimesStats.java
147
+ - lib/hitimes.rb
86
148
  - lib/hitimes/metric.rb
87
149
  - lib/hitimes/mutexed_stats.rb
88
150
  - lib/hitimes/paths.rb
@@ -91,7 +153,7 @@ files:
91
153
  - lib/hitimes/timed_value_metric.rb
92
154
  - lib/hitimes/value_metric.rb
93
155
  - lib/hitimes/version.rb
94
- - lib/hitimes.rb
156
+ - spec/hitimes_spec.rb
95
157
  - spec/interval_spec.rb
96
158
  - spec/metric_spec.rb
97
159
  - spec/mutex_stats_spec.rb
@@ -102,49 +164,55 @@ files:
102
164
  - spec/timed_value_metric_spec.rb
103
165
  - spec/value_metric_spec.rb
104
166
  - spec/version_spec.rb
105
- - README
106
- - HISTORY
107
- - LICENSE
108
- - tasks/announce.rake
109
- - tasks/distribution.rake
110
- - tasks/documentation.rake
167
+ - tasks/default.rake
111
168
  - tasks/extension.rake
112
- - tasks/rspec.rake
113
- - tasks/rubyforge.rake
114
- - tasks/config.rb
115
- - tasks/utils.rb
116
- - Rakefile
117
- - gemspec.rb
118
- - lib/hitimes/1.8/hitimes_ext.so
119
- - lib/hitimes/1.9/hitimes_ext.so
120
- has_rdoc: true
121
- homepage: http://copiousfreetime.rubyforge.org/hitimes/
169
+ - tasks/this.rb
170
+ - lib/hitimes/1.9/hitimes.so
171
+ - lib/hitimes/2.0/hitimes.so
172
+ - lib/hitimes/2.1/hitimes.so
173
+ homepage: http://github.com/copiousfreetime/hitimes
174
+ licenses:
175
+ - ISC
122
176
  post_install_message:
123
- rdoc_options:
124
- - --line-numbers
177
+ rdoc_options:
125
178
  - --main
126
- - README
127
- require_paths:
179
+ - README.md
180
+ - --markup
181
+ - tomdoc
182
+ require_paths:
128
183
  - lib
129
- - ext
130
- required_ruby_version: !ruby/object:Gem::Requirement
131
- requirements:
132
- - - ">="
133
- - !ruby/object:Gem::Version
134
- version: "0"
135
- version:
136
- required_rubygems_version: !ruby/object:Gem::Requirement
137
- requirements:
138
- - - ">="
139
- - !ruby/object:Gem::Version
140
- version: "0"
141
- version:
184
+ required_ruby_version: !ruby/object:Gem::Requirement
185
+ none: false
186
+ requirements:
187
+ - - ! '>='
188
+ - !ruby/object:Gem::Version
189
+ version: '0'
190
+ segments:
191
+ - 0
192
+ hash: 615149870547308045
193
+ required_rubygems_version: !ruby/object:Gem::Requirement
194
+ none: false
195
+ requirements:
196
+ - - ! '>='
197
+ - !ruby/object:Gem::Version
198
+ version: '0'
142
199
  requirements: []
143
-
144
- rubyforge_project: copiousfreetime
145
- rubygems_version: 1.3.1
200
+ rubyforge_project:
201
+ rubygems_version: 1.8.23.2
146
202
  signing_key:
147
- specification_version: 2
148
- summary: Hitimes is a fast, high resolution timer library for recording performance metrics
149
- test_files: []
150
-
203
+ specification_version: 3
204
+ summary: Hitimes is a fast, high resolution timer library for recording performance
205
+ metrics. It uses the appropriate low method calls for each system to get the highest
206
+ granularity time increments possible.
207
+ test_files:
208
+ - spec/hitimes_spec.rb
209
+ - spec/interval_spec.rb
210
+ - spec/metric_spec.rb
211
+ - spec/mutex_stats_spec.rb
212
+ - spec/paths_spec.rb
213
+ - spec/spec_helper.rb
214
+ - spec/stats_spec.rb
215
+ - spec/timed_metric_spec.rb
216
+ - spec/timed_value_metric_spec.rb
217
+ - spec/value_metric_spec.rb
218
+ - spec/version_spec.rb