Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

First.

  • Loading branch information...
commit 4cf74b1c657aa5d2383c4b5644b22f9c1266f828 0 parents
@jbarnette jbarnette authored
17 .gitignore
@@ -0,0 +1,17 @@
+*.gem
+*.rbc
+.bundle
+.config
+.yardoc
+Gemfile.lock
+InstalledFiles
+_yardoc
+coverage
+doc/
+lib/bundler/man
+pkg
+rdoc
+spec/reports
+test/tmp
+test/version_tmp
+tmp
2  Gemfile
@@ -0,0 +1,2 @@
+source :rubygems
+gemspec
4 README.md
@@ -0,0 +1,4 @@
+# Appetizer UI
+
+An painfully opinionated Appetizer add-on for writing thin webapps
+using Sinatra, Sass, and CoffeeScript.
1  Rakefile
@@ -0,0 +1 @@
+require "bundler/gem_tasks"
19 appetizer-ui.gemspec
@@ -0,0 +1,19 @@
+Gem::Specification.new do |gem|
+ gem.authors = ["Audiosocket"]
+ gem.email = ["it@audiosocket.com"]
+ gem.description = "A painfully opinionated Appetizer extension for web apps."
+ gem.summary = "Helpers for rich clients using Sinatra, Sass, and CoffeeScript."
+ gem.homepage = "https://github.com/audiosocket/appetizer-ui"
+
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ gem.files = `git ls-files`.split("\n")
+ gem.test_files = `git ls-files -- test/*`.split("\n")
+ gem.name = "appetizer-ui"
+ gem.require_paths = ["lib"]
+ gem.version = "0.0.0"
+
+ gem.add_dependency "appetizer", "0.0.0"
+ gem.add_dependency "sinatra", "~> 1.3"
+ gem.add_dependency "rack-ssl", "~> 1.3"
+ gem.add_dependency "sass", "~> 3.1"
+end
34 lib/appetizer/ui.rb
@@ -0,0 +1,34 @@
+require "appetizer/setup"
+require "sass"
+require "sinatra/base"
+
+module Appetizer
+ module UI
+ def self.registered app
+ app.configure :production do
+ require "rack/ssl"
+ app.use Rack::SSL
+ end
+
+ app.configure :development do
+ app.use Rack::CommonLogger, App.log
+
+ begin
+ require "sinatra/reloader"
+ app.register Sinatra::Reloader
+ app.also_reload "lib/**/*.rb"
+ rescue LoadError
+ warn "Want reloads? Add sinatra-reloader to your Gemfile."
+ end
+ end
+
+ app.set :scss, cache_location: "tmp/sass-cache", style: :compact
+
+ app.get "/css/:name.css" do |name|
+ scss :"css/#{name}"
+ end
+ end
+ end
+end
+
+Sinatra.register Appetizer::UI
Please sign in to comment.
Something went wrong with that request. Please try again.