Class: Pluto::Server
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- Pluto::Server
- Includes:
- Models
- Defined in:
- lib/pluto/server.rb
Constant Summary collapse
- PUBLIC_FOLDER =
"#{Pluto.root}/lib/pluto/server/public"
- VIEWS_FOLDER =
"#{Pluto.root}/lib/pluto/server/views"
Class Method Summary collapse
Instance Method Summary collapse
- #feeds_path ⇒ Object
- #items_path ⇒ Object
- #link_to(text, url, opts = {}) ⇒ Object
-
#path_prefix ⇒ Object
Helpers.
- #root_path ⇒ Object
- #root_url ⇒ Object
- #sites_path ⇒ Object
Class Method Details
Instance Method Details
#feeds_path ⇒ Object
50 51 52 |
# File 'lib/pluto/server.rb', line 50 def feeds_path "#{path_prefix}/feeds" end |
#items_path ⇒ Object
54 55 56 |
# File 'lib/pluto/server.rb', line 54 def items_path "#{path_prefix}/items" end |
#link_to(text, url, opts = {}) ⇒ Object
67 68 69 70 71 72 73 |
# File 'lib/pluto/server.rb', line 67 def link_to( text, url, opts={} ) attributes = "" opts.each do |key,value| attributes << "#{key}='#{value}' " end "<a href='#{url}' #{attributes}>#{text}</a>" end |
#path_prefix ⇒ Object
Helpers
42 43 44 |
# File 'lib/pluto/server.rb', line 42 def path_prefix request.env['SCRIPT_NAME'] end |
#root_path ⇒ Object
58 59 60 |
# File 'lib/pluto/server.rb', line 58 def root_path "#{path_prefix}/" end |
#root_url ⇒ Object
62 63 64 |
# File 'lib/pluto/server.rb', line 62 def root_url url( '/' ) end |
#sites_path ⇒ Object
46 47 48 |
# File 'lib/pluto/server.rb', line 46 def sites_path "#{path_prefix}/sites" end |