Module: NamedSeeds
- Extended by:
- DSL
- Defined in:
- lib/named_seeds.rb,
lib/named_seeds/dsl.rb,
lib/named_seeds/uuid.rb,
lib/named_seeds/rails.rb,
lib/named_seeds/railtie.rb,
lib/named_seeds/version.rb,
lib/named_seeds/identity.rb
Defined Under Namespace
Modules: DSL, TestHelper, VERSION
Classes: FixtureClassNotFound, Identity, Railtie
Constant Summary
Constants included
from DSL
DSL::MAX_ID
Class Method Summary
collapse
Methods included from DSL
identify
Class Method Details
.load_seed ⇒ Object
14
15
16
|
# File 'lib/named_seeds.rb', line 14
def self.load_seed
Railtie.load_seed
end
|
.reset_cache ⇒ Object
18
19
20
|
# File 'lib/named_seeds.rb', line 18
def self.reset_cache
Identity.reset_cache
end
|
.uuid_v5(name) ⇒ Object
Copy of ActiveSupport’s Digest::UUID extension for v5 UUIDs. Needed to maintain backward compatibility with Rails 4.0 and 4.1.
8
9
10
11
12
13
14
15
16
|
# File 'lib/named_seeds/uuid.rb', line 8
def self.uuid_v5(name)
hash = Digest::SHA1.new
hash.update("k\xA7\xB8\x12\x9D\xAD\x11\xD1\x80\xB4\x00\xC0O\xD40\xC8")
hash.update(name.to_s)
ary = hash.digest.unpack('NnnnnN')
ary[2] = (ary[2] & 0x0FFF) | (5 << 12)
ary[3] = (ary[3] & 0x3FFF) | 0x8000
"%08x-%04x-%04x-%04x-%04x%08x" % ary
end
|
.version ⇒ Object
11
12
13
|
# File 'lib/named_seeds/version.rb', line 11
def self.version
Gem::Version.new VERSION::STRING
end
|
.version_string ⇒ Object
15
16
17
|
# File 'lib/named_seeds/version.rb', line 15
def self.version_string
VERSION::STRING
end
|