torid 1.2.3 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/HISTORY.md +4 -0
- data/Rakefile +1 -0
- data/lib/torid.rb +1 -1
- data/lib/torid/clock.rb +6 -0
- data/tasks/default.rake +16 -50
- data/tasks/this.rb +6 -18
- data/test/test_clock.rb +4 -3
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ba896500ff2a3f4d59b713763c65b9176f1253d
|
4
|
+
data.tar.gz: 21e3039eb342abd526bc5d1918bc50a60e645ece
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 144ce568600e2fc4b87b4a934be242fff48d2f03af12d6a0a83a7c10bbc684d18e6454774297791e07df102b7d896a13efe7cbf4f9117af446eaed3514a61369
|
7
|
+
data.tar.gz: 66ca30ee9f65023be20c776bdcf4a8ff6a2cd6b2bc4a9b4bdc4a7a3755fb06b2185bcda9d1b82528ddaff83fd51d46f09337f8d1eec9a5f81fc79458d5c8d12a
|
data/HISTORY.md
CHANGED
data/Rakefile
CHANGED
@@ -12,6 +12,7 @@ This.ruby_gemspec do |spec|
|
|
12
12
|
spec.add_development_dependency( 'rake' , '~> 10.1')
|
13
13
|
spec.add_development_dependency( 'minitest' , '~> 5.0' )
|
14
14
|
spec.add_development_dependency( 'rdoc' , '~> 4.0' )
|
15
|
+
spec.add_development_dependency( 'simplecov', '~> 0.9' )
|
15
16
|
end
|
16
17
|
|
17
18
|
load 'tasks/default.rake'
|
data/lib/torid.rb
CHANGED
data/lib/torid/clock.rb
CHANGED
@@ -15,6 +15,10 @@ module Torid
|
|
15
15
|
|
16
16
|
# Internal: Return the current microsecond UNIX timstamp
|
17
17
|
#
|
18
|
+
# Since this value is outside of any mutex, it is not valid to comopare it
|
19
|
+
# against any value from 'tick'. This is a utility method for use soley
|
20
|
+
# inside of the Clock instance.
|
21
|
+
#
|
18
22
|
# Example:
|
19
23
|
#
|
20
24
|
# Clock.stamp => 1404774462369341
|
@@ -25,6 +29,8 @@ module Torid
|
|
25
29
|
(now.to_f * 1_000_000).floor
|
26
30
|
end
|
27
31
|
|
32
|
+
attr_reader :prev_stamp
|
33
|
+
|
28
34
|
# Internal: Create a new Clock
|
29
35
|
#
|
30
36
|
# prev_stamp - An initial value for the previous timestamp (default:
|
data/tasks/default.rake
CHANGED
@@ -10,21 +10,12 @@ namespace :develop do
|
|
10
10
|
|
11
11
|
# Install all the development and runtime dependencies of this gem using the
|
12
12
|
# gemspec.
|
13
|
-
task :default do
|
13
|
+
task :default => 'Gemfile' do
|
14
14
|
require 'rubygems/dependency_installer'
|
15
15
|
installer = ::Gem::DependencyInstaller.new
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
puts "Installing gem depedencies needed for development"
|
20
|
-
This.platform_gemspec.dependencies.each do |dep|
|
21
|
-
if dep.matching_specs.empty? then
|
22
|
-
puts "Installing : #{dep}"
|
23
|
-
installer.install dep
|
24
|
-
else
|
25
|
-
puts "Skipping : #{dep} -> already installed #{dep.matching_specs.first.full_name}"
|
26
|
-
end
|
27
|
-
end
|
16
|
+
puts "Installing bundler..."
|
17
|
+
installer.install 'bundler'
|
18
|
+
sh 'bundle install'
|
28
19
|
puts "\n\nNow run 'rake test'"
|
29
20
|
end
|
30
21
|
|
@@ -37,14 +28,6 @@ namespace :develop do
|
|
37
28
|
f.puts 'gemspec'
|
38
29
|
end
|
39
30
|
end
|
40
|
-
|
41
|
-
desc "Create a bundler Gemfile"
|
42
|
-
task :using_bundler => 'Gemfile' do
|
43
|
-
puts "Now you can 'bundle'"
|
44
|
-
end
|
45
|
-
|
46
|
-
# Gemfiles are build artifacts
|
47
|
-
CLOBBER << FileList['Gemfile*']
|
48
31
|
end
|
49
32
|
desc "Boostrap development"
|
50
33
|
task :develop => "develop:default"
|
@@ -90,31 +73,16 @@ end
|
|
90
73
|
# Coverage - optional code coverage, rcov for 1.8 and simplecov for 1.9, so
|
91
74
|
# for the moment only rcov is listed.
|
92
75
|
#------------------------------------------------------------------------------
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
t.verbose = true
|
100
|
-
t.rcov_opts << "-x ^/" # remove all the global files
|
101
|
-
t.rcov_opts << "--sort coverage" # so we see the worst files at the top
|
102
|
-
end
|
103
|
-
rescue LoadError
|
104
|
-
This.task_warning( 'rcov' )
|
105
|
-
end
|
106
|
-
else
|
107
|
-
begin
|
108
|
-
require 'simplecov'
|
109
|
-
desc 'Run tests with code coverage'
|
110
|
-
task :coverage do
|
111
|
-
ENV['COVERAGE'] = 'true'
|
112
|
-
Rake::Task[:test].execute
|
113
|
-
end
|
114
|
-
CLOBBER << FileList["coverage"]
|
115
|
-
rescue LoadError
|
116
|
-
This.task_warning( 'simplecov' )
|
76
|
+
begin
|
77
|
+
require 'simplecov'
|
78
|
+
desc 'Run tests with code coverage'
|
79
|
+
task :coverage do
|
80
|
+
ENV['COVERAGE'] = 'true'
|
81
|
+
Rake::Task[:test].execute
|
117
82
|
end
|
83
|
+
CLOBBER << 'coverage' if File.directory?( 'coverage' )
|
84
|
+
rescue LoadError
|
85
|
+
This.task_warning( 'simplecov' )
|
118
86
|
end
|
119
87
|
|
120
88
|
#------------------------------------------------------------------------------
|
@@ -179,9 +147,10 @@ namespace :fixme do
|
|
179
147
|
end
|
180
148
|
|
181
149
|
def outdated_fixme_files
|
182
|
-
local_fixme_files.
|
150
|
+
local_fixme_files.select do |local|
|
183
151
|
upstream = fixme_project_path( local )
|
184
|
-
|
152
|
+
upstream.exist? &&
|
153
|
+
( Digest::SHA256.file( local ) != Digest::SHA256.file( upstream ) )
|
185
154
|
end
|
186
155
|
end
|
187
156
|
|
@@ -231,9 +200,6 @@ task :gemspec do
|
|
231
200
|
end
|
232
201
|
end
|
233
202
|
|
234
|
-
# the gemspec is also a dev artifact and should not be kept around.
|
235
|
-
CLOBBER << This.gemspec_file.to_s
|
236
|
-
|
237
203
|
# .rbc files from ruby 2.0
|
238
204
|
CLOBBER << FileList["**/*.rbc"]
|
239
205
|
|
data/tasks/this.rb
CHANGED
@@ -13,7 +13,7 @@ class ThisProject
|
|
13
13
|
attr_accessor :email
|
14
14
|
|
15
15
|
# The homepage of this project
|
16
|
-
attr_accessor :homepage
|
16
|
+
attr_accessor :homepage
|
17
17
|
|
18
18
|
# The regex of files to exclude from the manifest
|
19
19
|
attr_accessor :exclude_from_manifest
|
@@ -123,7 +123,7 @@ class ThisProject
|
|
123
123
|
|
124
124
|
# Internal: Returns the gemspace associated with the current ruby platform
|
125
125
|
def platform_gemspec
|
126
|
-
gemspecs
|
126
|
+
gemspecs.fetch(platform) { This.ruby_gemspec }
|
127
127
|
end
|
128
128
|
|
129
129
|
def core_gemspec
|
@@ -145,6 +145,8 @@ class ThisProject
|
|
145
145
|
spec.extra_rdoc_files += spec.files.grep(/(txt|rdoc|md)$/)
|
146
146
|
spec.rdoc_options = [ "--main" , 'README.md',
|
147
147
|
"--markup", "tomdoc" ]
|
148
|
+
|
149
|
+
spec.required_ruby_version = '>= 1.9.3'
|
148
150
|
end
|
149
151
|
end
|
150
152
|
|
@@ -171,20 +173,6 @@ class ThisProject
|
|
171
173
|
return spec
|
172
174
|
end
|
173
175
|
|
174
|
-
# Internal: Set the recovery gem development dependency
|
175
|
-
#
|
176
|
-
# These are dynamically set since they cannot be hard coded as there is
|
177
|
-
# no way to ship them correctly in the gemspec
|
178
|
-
#
|
179
|
-
# Returns nothing.
|
180
|
-
def set_coverage_gem
|
181
|
-
if RUBY_VERSION < "1.9.0"
|
182
|
-
platform_gemspec.add_development_dependency( 'rcov', '~> 1.0.0' )
|
183
|
-
else
|
184
|
-
platform_gemspec.add_development_dependency( 'simplecov', '~> 0.9' )
|
185
|
-
end
|
186
|
-
end
|
187
|
-
|
188
176
|
# Internal: Return the platform of ThisProject at the current moment in time.
|
189
177
|
def platform
|
190
178
|
(RUBY_PLATFORM == "java") ? 'java' : Gem::Platform::RUBY
|
@@ -194,8 +182,8 @@ class ThisProject
|
|
194
182
|
def description_section
|
195
183
|
section_of( 'README.md', 'DESCRIPTION')
|
196
184
|
end
|
197
|
-
|
198
|
-
|
185
|
+
|
186
|
+
# Internal: Return the summary text from the README
|
199
187
|
def summary
|
200
188
|
description_section.first
|
201
189
|
end
|
data/test/test_clock.rb
CHANGED
@@ -4,9 +4,10 @@ require 'torid/clock'
|
|
4
4
|
module Torid
|
5
5
|
class ClockTest < ::Minitest::Test
|
6
6
|
def test_tick_is_after_stamp
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
clock = Clock.new
|
8
|
+
stamp = clock.prev_stamp
|
9
|
+
tick = clock.tick
|
10
|
+
assert( tick > stamp, "tick #{tick} is not > than stamp of #{stamp}")
|
10
11
|
end
|
11
12
|
|
12
13
|
def test_tick_follows_clock_not_time
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: torid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Hinegardner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fnv
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '4.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simplecov
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.9'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.9'
|
69
83
|
description: 'Temporally Ordered IDs. Generate universally unique identifiers (UUID)
|
70
84
|
that sort lexically in time order. Torid exists to solve the problem of generating
|
71
85
|
UUIDs that when ordered lexically, they are also ordered temporally. I needed a
|
@@ -119,7 +133,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
119
133
|
requirements:
|
120
134
|
- - ">="
|
121
135
|
- !ruby/object:Gem::Version
|
122
|
-
version:
|
136
|
+
version: 1.9.3
|
123
137
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
138
|
requirements:
|
125
139
|
- - ">="
|
@@ -127,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
141
|
version: '0'
|
128
142
|
requirements: []
|
129
143
|
rubyforge_project:
|
130
|
-
rubygems_version: 2.
|
144
|
+
rubygems_version: 2.4.6
|
131
145
|
signing_key:
|
132
146
|
specification_version: 4
|
133
147
|
summary: Temporally Ordered IDs. Generate universally unique identifiers (UUID) that
|