hitimes 1.1.1-x86-mingw32 → 1.2.2-x86-mingw32

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