I know that in Ruby __FILE__ refers to the current file, but what does it refer to when creating a path such as this and why is it needed as a second argument to expand_path?
set :views, File.expand_path('../../views', __FILE__)
For example, if __FILE__ refers to the current file, but there happens to be more than one file in the views folder, what exactly does __FILE__ refer to?
Since you are using a relative path in
'../../views', you need a reference point to expand the path. The second argument, which happens to be__FILE__in this case, overrides the default reference point, which is the current working directory.Ruby Doc File.expand_path