rubyhexagon 1.6.1 → 1.6.2

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
2
  SHA256:
3
- metadata.gz: 150ab001b3c4f6f809e27d4b98678f1b10a0969893452d8d22aaf4a0c30ab9dd
4
- data.tar.gz: 409bdeb85a0098f29e6e86e4b9a6a29d647f39376e9a5c9ca351a479f2fee68b
3
+ metadata.gz: 1be6d059e334103bb28e5cbff3c4978cb0cdd202e7f5bb095a189efc8af300b0
4
+ data.tar.gz: b928803e414e4a98922ccd5326f20db0daaaa39c23f8223669259ad91a72df1b
5
5
  SHA512:
6
- metadata.gz: f0d20c78165882f8a8299440ed522a0e26a5144a33ba3eaaf1b10c026dd7f66eada80d62670d945f466e5233d05b95416eacbca5c7c50f00174e9f5adc650037
7
- data.tar.gz: c4c7e68bf94943ad78b2b31913bb2852f809ff63eb9ebe66ee0fce14b7bf31ae1023f0417ae44498d7fedd1cc81c0210d2ae272a13abc2558ec6479ad8bf0244
6
+ metadata.gz: 14f25709d60914cc9c7a63bfabc1d4e7fb4deff7aa856f51415f56605423b5d45a75f23130adead64174924a5e273b8747bbb7d6df8778d72be3340b1a5cd42a
7
+ data.tar.gz: 7f15aaf02b37d6481ae8447635687caf018132f3b3b06a064438208fb7e40048fa40bd8df7c906ceccebfd550bdef52abccd5619bf9449ec3a6efece3e171192
data/lib/rubyhexagon.rb CHANGED
@@ -46,7 +46,7 @@ require_relative 'rubyhexagon/search/tag_history'
46
46
  module Rubyhexagon
47
47
  MAJOR = 1
48
48
  MINOR = 6
49
- PATCH = 1
49
+ PATCH = 2
50
50
  NAME = 'rubyhexagon'
51
51
  VERSION = "#{MAJOR}.#{MINOR}.#{PATCH}"
52
52
  end
@@ -84,10 +84,12 @@ module Rubyhexagon
84
84
  @lock_file.truncate(0)
85
85
  @lock_file.print $PROCESS_ID
86
86
  begin
87
+ s = Time.now
87
88
  data = yield
88
89
  # There is a hard limit of 2 requests per second, but to be nice we wait
89
90
  # a whole second between requests.
90
- sleep 1
91
+ w = 1 - (Time.now - s)
92
+ sleep w if w.positive?
91
93
  ensure
92
94
  @lock_file.flock(File::LOCK_UN)
93
95
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyhexagon
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxine Michalski