add script to generate a marshalled cache
This commit is contained in:
Родитель
b91a81fa87
Коммит
70babe1a7b
|
@ -7,3 +7,4 @@ pkg
|
|||
publish
|
||||
coverage
|
||||
Gemfile.lock
|
||||
lib/mime/types.marshal-data
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
Dir.chdir(File.expand_path("../..", __FILE__))
|
||||
$: << "#{Dir.pwd}/lib"
|
||||
require "mime/types"
|
||||
|
||||
# force mime-types to load data before we dump its internals
|
||||
MIME::Types["text/plain"]
|
||||
|
||||
types = MIME::Types.instance_variable_get(:@__types__)
|
||||
|
||||
file = "lib/mime/types.marshal-data"
|
||||
data = Marshal.dump(types)
|
||||
bytes = File.write(file, data)
|
||||
puts "Wrote #{bytes} bytes to #{file}"
|
Загрузка…
Ссылка в новой задаче