27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'lib/caveat_patch_kids.rb', line 27
def bloom
root_dir = Pathname.new(__FILE__).dirname + '..'
sprockets = Sprockets::Environment.new(root_dir)
vendor_assets_dir = root_dir + 'vendor/assets'
scripts_dir = root_dir + 'scripts'
home_dir = Pathname.new("~/.caveat_patch_kids")
unsupported_dir = Pathname.new("~/Library/Application Support/Propane/unsupported/").expand_path
sprockets.append_path vendor_assets_dir.to_s
sprockets.append_path scripts_dir.to_s
sprockets.append_path home_dir.expand_path.to_s
caveat_patchor = sprockets.find_asset('caveatPatchor.js')
prefix, basename = caveat_patchor.pathname.to_s.split('/')[-2..-1]
FileUtils.mkdir_p(unsupported_dir.to_s)
say_status "bloom", "#{unsupported_dir}/#{basename}"
caveat_patchor.write_to "#{unsupported_dir}/#{basename}"
end
|