annotate bin/spring @ 25:70d70736faee

Properly rescue 403 and 404.
author edogawaconan <me@myconan.net>
date Fri, 05 Sep 2014 23:38:57 +0900
parents a1c9fadc0904
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
1 #!/usr/bin/env ruby
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
2
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
3 # This file loads spring without using Bundler, in order to be fast
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
4 # It gets overwritten when you run the `spring binstub` command
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
5
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
6 unless defined?(Spring)
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
7 require "rubygems"
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
8 require "bundler"
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
9
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
10 if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
11 ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
12 ENV["GEM_HOME"] = ""
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
13 Gem.paths = ENV
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
14
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
15 gem "spring", match[1]
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
16 require "spring/binstub"
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
17 end
a1c9fadc0904 Initial.
edogawaconan <me@myconan.net>
parents:
diff changeset
18 end