hitimes 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 7f524a821dc9c99b61be2c3af977e825f9ca7ed2
4
- data.tar.gz: ff3e5a216ba2b504f49dd13d612b843c48855bd3
2
+ SHA256:
3
+ metadata.gz: 4e479c2fbfddbd9d35a7f9bcc4580b265f43cd9fa46a7a986e1d10401c58b882
4
+ data.tar.gz: 5751466c5f9a518a607b4f14df5e368dd85d990fccbc665f6d080b5435982b4d
5
5
  SHA512:
6
- metadata.gz: bcf7ba65f863b4ed3376a42ab9adac359ccd751a8b9f97ac3c606792cef80ece1325590e5eda9580da15f84e7817af4c4a8b80e444f7a8e85725e2e93a77f67f
7
- data.tar.gz: 1d25a2c4afedaaa53aed97ad47197121227aab88dbba57faa6ffc32566454617b2821f42289ca63c3dda0dc6c131c81e400aa1e6746f01dfc7b2fef75567b8ce
6
+ metadata.gz: fabe96db83fec72aac45648908229119bce50fdef39e61fc00f426a7d44ba3da791be416b5e44f0c6bd4cae822e241e152f827c490fb46658946a910ffad6579
7
+ data.tar.gz: e1ba6e894dbabf0911df83bbae59a9dfd201b2edfd605a2fe9c27f46e2d5d5bf80105918f3a718df02de0fccf975cc36ada85254b53f949ce78036fe9130d050
data/HISTORY.md CHANGED
@@ -1,4 +1,10 @@
1
1
  # Hitimes Changelog
2
+ ## Version 1.3.1 2019-01-18
3
+
4
+ * Update jruby extension to not use global runtime state (thanks @kares) (#70)
5
+ * Update travis CI config
6
+ * Update documentataion for Ruby 2.6
7
+
2
8
  ## Version 1.3.0 2018-06-15
3
9
 
4
10
  * Add api method `Hitimes.raw_instant` to expose raw OS instant value
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/copiousfreetime/hitimes.svg?branch=master)](https://travis-ci.org/copiousfreetime/hitimes)
4
4
 
5
+ ## Description
6
+
5
7
  A fast, high resolution timer library for recording peformance metrics.
6
8
 
7
9
  * [Homepage](http://github.com/copiousfreetime/hitimes)
@@ -159,14 +161,14 @@ Hitimes also follows [semantic versioning](http://semver.org/).
159
161
 
160
162
  The current officially supported versions of Ruby are:
161
163
 
162
- * MRI Ruby (all platforms) 2.2 - 2.4
163
- * JRuby 1.7.25, 9.0.5.0
164
+ * MRI Ruby (all platforms) 2.3 - 2.6
165
+ * JRuby 9.1.17.0, 9.2.X.X
164
166
 
165
167
  Unofficially supported versions, these have been supported in the past when they
166
168
  were the primary rubies around. In all likelihood they still work, but are not
167
169
  supported.
168
170
 
169
- * MRI Ruby (linux/mac/bsd/unix/etc) - everything from 1.8.7 to 2.1
171
+ * MRI Ruby (linux/mac/bsd/unix/etc) - everything from 1.8.7 to 2.2
170
172
  * MRI Ruby (windows) - 2.0 and up
171
173
  * Ruby 1.8 and 1.9 for windows are supported in hitimes version 1.2.4 or earlier
172
174
  * JRuby - I think everything back to 1.4
@@ -4,7 +4,10 @@
4
4
  #include <mach/mach.h>
5
5
  #include <mach/mach_time.h>
6
6
 
7
- /* All this OSX code is adapted from http://developer.apple.com/library/mac/#qa/qa1398/_index.html */
7
+ /* All this OSX code is adapted from
8
+ * https://developer.apple.com/library/archive/qa/qa1398/_index.html
9
+ */
10
+
8
11
 
9
12
  /*
10
13
  * returns the conversion factor, this value is used to convert
@@ -3,20 +3,18 @@ package hitimes;
3
3
  import java.lang.Math;
4
4
  import java.lang.System;
5
5
 
6
- import org.jruby.anno.JRubyClass;
7
- import org.jruby.anno.JRubyMethod;
8
- import org.jruby.anno.JRubyModule;
9
- import org.jruby.anno.JRubyConstant;
10
- import org.jruby.runtime.Visibility;
11
-
12
6
  import org.jruby.Ruby;
13
7
  import org.jruby.RubyClass;
14
8
  import org.jruby.RubyException;
15
9
  import org.jruby.RubyModule;
16
10
  import org.jruby.RubyObject;
17
-
11
+ import org.jruby.anno.JRubyClass;
12
+ import org.jruby.anno.JRubyMethod;
13
+ import org.jruby.anno.JRubyModule;
14
+ import org.jruby.anno.JRubyConstant;
18
15
  import org.jruby.exceptions.RaiseException;
19
-
16
+ import org.jruby.runtime.ThreadContext;
17
+ import org.jruby.runtime.Visibility;
20
18
  import org.jruby.runtime.builtin.IRubyObject;
21
19
 
22
20
 
@@ -28,15 +26,14 @@ public class Hitimes {
28
26
 
29
27
  public static final double INSTANT_CONVERSION_FACTOR = 1000000000d;
30
28
 
31
- private static final Ruby __ruby__ = Ruby.getGlobalRuntime();
32
-
33
29
  public static RubyClass hitimesIntervalClass;
30
+
34
31
  /**
35
32
  * Create the Hitimes module and add it to the Ruby runtime.
36
33
  */
37
34
  public static RubyModule createHitimesModule( Ruby runtime ) {
38
35
  RubyModule mHitimes = runtime.defineModule("Hitimes");
39
- mHitimes.defineConstant("INSTANT_CONVERSION_FACTOR", __ruby__.newFloat(INSTANT_CONVERSION_FACTOR));
36
+ mHitimes.defineConstant("INSTANT_CONVERSION_FACTOR", runtime.newFloat(INSTANT_CONVERSION_FACTOR));
40
37
  mHitimes.defineAnnotatedMethods( Hitimes.class );
41
38
 
42
39
  RubyClass cStandardError = runtime.getStandardError();
@@ -59,8 +56,8 @@ public class Hitimes {
59
56
 
60
57
 
61
58
  @JRubyMethod( name = "raw_instant", module = true )
62
- public static IRubyObject rawInstant(IRubyObject self) {
63
- return __ruby__.newFixnum( System.nanoTime() );
59
+ public static IRubyObject rawInstant(ThreadContext context, IRubyObject self) {
60
+ return context.runtime.newFixnum( System.nanoTime() );
64
61
  }
65
62
 
66
63
  }
@@ -4,5 +4,5 @@
4
4
  #++
5
5
 
6
6
  module Hitimes
7
- VERSION = "1.3.0"
7
+ VERSION = "1.3.1"
8
8
  end
@@ -28,7 +28,7 @@ class ThisProject
28
28
  @exclude_from_manifest = Regexp.union(/\.(git|DS_Store)/,
29
29
  /^(doc|coverage|pkg|tmp|Gemfile(\.lock)?)/,
30
30
  /^[^\/]+\.gemspec/,
31
- /\.(swp|jar|bundle|so|rvmrc|travis.yml)$/,
31
+ /\.(swp|jar|bundle|so|rvmrc|travis.yml|byebug_history)$/,
32
32
  /~$/)
33
33
  @gemspecs = Hash.new
34
34
  yield self if block_given?
@@ -146,7 +146,7 @@ class ThisProject
146
146
  spec.rdoc_options = [ "--main" , 'README.md',
147
147
  "--markup", "tomdoc" ]
148
148
 
149
- spec.required_ruby_version = '>= 1.9.3'
149
+ spec.required_ruby_version = '>= 2.2.2'
150
150
  end
151
151
  end
152
152
 
@@ -178,9 +178,9 @@ class ThisProject
178
178
  (RUBY_PLATFORM == "java") ? 'java' : Gem::Platform::RUBY
179
179
  end
180
180
 
181
- # Internal: Return the DESCRIPTION section of the README.rdoc file
181
+ # Internal: Return the Description section of the README.rdoc file
182
182
  def description_section
183
- section_of( 'README.md', 'Hitimes')
183
+ section_of( 'README.md', 'Description')
184
184
  end
185
185
 
186
186
  # Internal: Return the summary text from the README
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hitimes
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Hinegardner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-15 00:00:00.000000000 Z
11
+ date: 2019-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -108,10 +108,9 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0.14'
111
- description: "(https://travis-ci.org/copiousfreetime/hitimes.svg?branch=master)](https://travis-ci.org/copiousfreetime/hitimes)
112
- A fast, high resolution timer library for recording peformance metrics. * (http://github.com/copiousfreetime/hitimes)
113
- * (http://github.com.org/copiousfreetime/hitimes) * email jeremy at copiousfreetime
114
- dot org * `git clone url git://github.com/copiousfreetime/hitimes.git`"
111
+ description: A fast, high resolution timer library for recording peformance metrics.
112
+ * (http://github.com/copiousfreetime/hitimes) * (http://github.com.org/copiousfreetime/hitimes)
113
+ * email jeremy at copiousfreetime dot org * `git clone url git://github.com/copiousfreetime/hitimes.git`
115
114
  email: jeremy@copiousfreetime.org
116
115
  executables: []
117
116
  extensions:
@@ -182,18 +181,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
182
181
  requirements:
183
182
  - - ">="
184
183
  - !ruby/object:Gem::Version
185
- version: 1.9.3
184
+ version: 2.2.2
186
185
  required_rubygems_version: !ruby/object:Gem::Requirement
187
186
  requirements:
188
187
  - - ">="
189
188
  - !ruby/object:Gem::Version
190
189
  version: '0'
191
190
  requirements: []
192
- rubyforge_project:
193
- rubygems_version: 2.6.12
191
+ rubygems_version: 3.0.1
194
192
  signing_key:
195
193
  specification_version: 4
196
- summary: "[![Build Status](https://travis-ci.org/copiousfreetime/hitimes.svg?branch=master)](https://travis-ci.org/copiousfreetime/hitimes)"
194
+ summary: A fast, high resolution timer library for recording peformance metrics.
197
195
  test_files:
198
196
  - spec/hitimes_spec.rb
199
197
  - spec/interval_spec.rb