Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

First.

  • Loading branch information...
commit 4cf74b1c657aa5d2383c4b5644b22f9c1266f828 0 parents
John Barnette jbarnette authored
17 .gitignore
... ... @@ -0,0 +1,17 @@
  1 +*.gem
  2 +*.rbc
  3 +.bundle
  4 +.config
  5 +.yardoc
  6 +Gemfile.lock
  7 +InstalledFiles
  8 +_yardoc
  9 +coverage
  10 +doc/
  11 +lib/bundler/man
  12 +pkg
  13 +rdoc
  14 +spec/reports
  15 +test/tmp
  16 +test/version_tmp
  17 +tmp
2  Gemfile
... ... @@ -0,0 +1,2 @@
  1 +source :rubygems
  2 +gemspec
4 README.md
Source Rendered
... ... @@ -0,0 +1,4 @@
  1 +# Appetizer UI
  2 +
  3 +An painfully opinionated Appetizer add-on for writing thin webapps
  4 +using Sinatra, Sass, and CoffeeScript.
1  Rakefile
... ... @@ -0,0 +1 @@
  1 +require "bundler/gem_tasks"
19 appetizer-ui.gemspec
... ... @@ -0,0 +1,19 @@
  1 +Gem::Specification.new do |gem|
  2 + gem.authors = ["Audiosocket"]
  3 + gem.email = ["it@audiosocket.com"]
  4 + gem.description = "A painfully opinionated Appetizer extension for web apps."
  5 + gem.summary = "Helpers for rich clients using Sinatra, Sass, and CoffeeScript."
  6 + gem.homepage = "https://github.com/audiosocket/appetizer-ui"
  7 +
  8 + gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
  9 + gem.files = `git ls-files`.split("\n")
  10 + gem.test_files = `git ls-files -- test/*`.split("\n")
  11 + gem.name = "appetizer-ui"
  12 + gem.require_paths = ["lib"]
  13 + gem.version = "0.0.0"
  14 +
  15 + gem.add_dependency "appetizer", "0.0.0"
  16 + gem.add_dependency "sinatra", "~> 1.3"
  17 + gem.add_dependency "rack-ssl", "~> 1.3"
  18 + gem.add_dependency "sass", "~> 3.1"
  19 +end
34 lib/appetizer/ui.rb
... ... @@ -0,0 +1,34 @@
  1 +require "appetizer/setup"
  2 +require "sass"
  3 +require "sinatra/base"
  4 +
  5 +module Appetizer
  6 + module UI
  7 + def self.registered app
  8 + app.configure :production do
  9 + require "rack/ssl"
  10 + app.use Rack::SSL
  11 + end
  12 +
  13 + app.configure :development do
  14 + app.use Rack::CommonLogger, App.log
  15 +
  16 + begin
  17 + require "sinatra/reloader"
  18 + app.register Sinatra::Reloader
  19 + app.also_reload "lib/**/*.rb"
  20 + rescue LoadError
  21 + warn "Want reloads? Add sinatra-reloader to your Gemfile."
  22 + end
  23 + end
  24 +
  25 + app.set :scss, cache_location: "tmp/sass-cache", style: :compact
  26 +
  27 + app.get "/css/:name.css" do |name|
  28 + scss :"css/#{name}"
  29 + end
  30 + end
  31 + end
  32 +end
  33 +
  34 +Sinatra.register Appetizer::UI

0 comments on commit 4cf74b1

Please sign in to comment.
Something went wrong with that request. Please try again.