Class: Wee::ExternalResource

Inherits:
Object
  • Object
show all
Defined in:
lib/wee/external_resource.rb

Direct Known Subclasses

JQuery, RightJS

Instance Method Summary collapse

Constructor Details

#initialize(mount_path = nil) ⇒ ExternalResource

Returns a new instance of ExternalResource.



4
5
6
# File 'lib/wee/external_resource.rb', line 4

def initialize(mount_path=nil)
  @mount_path = mount_path || "/" + self.class.name.to_s.downcase.gsub("::", "_")
end

Instance Method Details

#install(builder) ⇒ Object



8
9
10
11
12
13
# File 'lib/wee/external_resource.rb', line 8

def install(builder)
  rd = resource_dir()
  builder.map(@mount_path) do
    run Rack::File.new(rd)
  end
end

#javascriptsObject



15
16
17
# File 'lib/wee/external_resource.rb', line 15

def javascripts
  []
end

#stylesheetsObject



19
20
21
# File 'lib/wee/external_resource.rb', line 19

def stylesheets
  []
end