Permalink
Browse files

Trying hassle again.

  • Loading branch information...
1 parent ba69011 commit ca56f5d18666ad8e1d47047edaea33e4237eb7d8 @metaskills committed Jan 21, 2010
@@ -5,7 +5,7 @@
%head
%meta{"http-equiv" => "Content-Type", :content => "text/html; charset=utf-8"}
%title= params[:page] ? "757 Studio - #{params[:page].titleize}" : '757 Studio'
- = stylesheet_link_tag 'webkit','utility','sass/site'
+ = stylesheet_link_tag 'site','webkit','utility'
= javascript_include_tag 'prototype', 'effects', 'builder', 'application'
= javascript_tag 'Builder.dump();'
@@ -1,22 +0,0 @@
-Copyright (c) 2009, Pedro Belo, Nick Quaranto
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
@@ -1,113 +0,0 @@
-h1. Hassle
-
-Making "SASS":http://sass-lang.com/ less of a hassle on read only filesystems. (like "Heroku":http://heroku.com)
-
-h2. Install
-
-Get it from "Gemcutter.":http://gemcutter.org
-
-<pre>
-gem install hassle -s http://gemcutter.org
-</pre>
-
-h2. Usage
-
-By default, SASS compiles CSS into the @public/@ directory. On platforms like Heroku, "this won't work.":http://docs.heroku.com/constraints#read-only-filesystem Instead, Hassle compiles the SASS for you into @tmp/@ and serves it up via a @Rack::Static@ middleware.
-
-Hassle assumes a few basic things about your setup: There's going to be a @tmp/@ directory where it can write to, and @public/@ is where you store your css. A simple example:
-
-<pre>
-$ tree
-.
-|-- config.ru
-|-- public
-| `-- stylesheets
-| `-- sass
-| `-- application.sass
-`-- tmp
- `-- hassle
- `-- stylesheets
- `-- application.css
-</pre>
-
-With a basic SASS file in @public/stylesheets/sass/application.sass@, you can include it in your views with:
-
-<pre>
-<link href="/stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" />
-</pre>
-
-Hassle will look at the default sass directory (@public/stylesheets/sass@) and other input directories given in @Sass::Plugin.options[:template_location]@. CSS files are then compiled into @tmp/@ one directory higher than where you specified. Here's a small example of customization:
-
-<pre>
-Sass::Plugin.options[:template_location] = "./public/css/templates"
-</pre>
-
-And after Hassle runs...
-
-<pre>
-$ tree
-.
-|-- config.ru
-|-- public
-| `-- css
-| `-- templates
-| `-- screen.sass
-`-- tmp
- `-- hassle
- `-- css
- `-- screen.css
-</pre>
-
-Include this in your views with:
-
-<pre>
-<link href="/css/screen.css" media="screen" rel="stylesheet" type="text/css" />
-</pre>
-
-h2. Integration
-
-Here's how to integrate it with your favorite web framework:
-
-h3. Rails
-
-For Rails: @script/plugin install git://github.com/pedro/hassle@. Done. Once you're in production mode, Hassle will kick in and prepare your SASS for all to enjoy.
-
-h3. Sinatra
-
-Here's a sample config.ru that's "up and running.":http://hassle-sinatra.heroku.com
-
-<pre>
-require 'sinatra'
-require 'hassle'
-require 'haml'
-
-get '/' do
- haml <<EOF
-%html
- %head
- %link{:rel => 'stylesheet', :href => "stylesheets/application.css"}
- %body
- %h1 Hassle!
-EOF
-end
-
-use Hassle
-run Sinatra::Application
-</pre>
-
-And its wonderful SASS file:
-
-<pre>
-$ cat public/stylesheets/sass/application.sass
-h1
- font-size: 11em
- color: purple
-</pre>
-
-h2. Bugs
-
-Found some problems? Post 'em in "Issues":http://github.com/pedro/hassle/issues.
-
-h2. License
-
-Hassle uses the MIT license. Please check the LICENSE file for more details.
@@ -1,44 +0,0 @@
-require 'rake'
-require 'spec/rake/spectask'
-
-desc "Run all specs"
-Spec::Rake::SpecTask.new('spec') do |t|
- t.spec_opts = ['--colour --format progress --loadby mtime --reverse']
- t.spec_files = FileList['spec/*_spec.rb']
-end
-
-begin
- require 'cucumber/rake/task'
-
- Cucumber::Rake::Task.new(:cucumber) do |t|
- t.cucumber_opts = "--format pretty"
- end
-rescue LoadError
- desc 'Cucumber rake task not available'
- task :features do
- abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin'
- end
-end
-
-task :default => [:spec, :cucumber]
-
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = "hassle"
- gem.summary = "Make SASS less of a hassle."
- gem.description = "Makes SASS less of a hassle on read-only filesystems by compiling and serving it up for you."
- gem.homepage = "http://github.com/pedro/hassle"
- gem.authors = ["Pedro Belo", "Nick Quaranto"]
- gem.files = FileList["LICENSE", "README.textile", "lib/hassle.rb", "init.rb"]
- gem.add_dependency('rack')
- gem.add_dependency('haml')
- gem.add_development_dependency('rspec')
- gem.add_development_dependency('cucumber')
- gem.add_development_dependency('rack-test')
- gem.required_rubygems_version = Gem::Requirement.new(">= 1.3.5") if gem.respond_to? :required_rubygems_version=
- end
- Jeweler::RubyforgeTasks.new
-rescue LoadError
- puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
-end
@@ -1 +0,0 @@
-0.0.1
@@ -1,30 +0,0 @@
-Feature: Integration into Rails Apps
- As someone who loves syntactically awesome stylesheets
- I want to be able to use sass when on (mostly) read only file systems and using Rails
- In order to make css less of a hassle
-
- Scenario: Use hassle with Rails in production mode
- Given I have a Rails app
- And I have a file "public/stylesheets/sass/hassle.sass" with:
- """
- h1
- :font-size 42em
- """
- When Hassle is installed as a plugin
- And the Rails app is initialized in "production" mode
- Then I should see the following in "tmp/hassle/stylesheets/hassle.css":
- """
- h1 {
- font-size: 42em; }
- """
-
- Scenario: Use hassle with Rails in development mode
- Given I have a Rails app
- And I have a file "public/stylesheets/sass/hassle.sass" with:
- """
- h1
- :font-size 42em
- """
- When Hassle is installed as a plugin
- And the Rails app is initialized in "development" mode
- Then the file "tmp/hassle/stylesheets/hassle.css" should not exist
@@ -1,27 +0,0 @@
-Given /^I have a Rails app$/ do
- `rails #{TEST_DIR}`
-end
-
-And /^I have a file "(.*)" with:$/ do |path, content|
- FileUtils.mkdir_p(File.join(TEST_DIR, File.dirname(path)))
- File.open(File.join(TEST_DIR, path), "w") do |f|
- f.write content
- end
-end
-
-Then /^I should see the following in "(.*)":$/ do |path, content|
- content.strip.should == File.read(File.join(TEST_DIR, path)).strip
-end
-
-When /^Hassle is installed as a plugin$/ do
- FileUtils.cp_r(ORIGINAL_DIR, File.join(TEST_DIR, "vendor", "plugins", "hassle"))
-end
-
-When /^the Rails app is initialized in "(.*)" mode$/ do |environment|
- ENV["RAILS_ENV"] = environment
- require File.expand_path('./config/environment')
-end
-
-Then /^the file "([^\"]*)" should not exist$/ do |path|
- File.exists?(path).should be_false
-end
@@ -1,15 +0,0 @@
-require 'fileutils'
-
-ORIGINAL_DIR = Dir.pwd
-TEST_DIR = File.join('/', 'tmp', 'hassle')
-
-Before do
- FileUtils.mkdir(TEST_DIR)
- Dir.chdir(TEST_DIR)
-end
-
-After do
- Dir.chdir(TEST_DIR)
- FileUtils.rm_rf(TEST_DIR)
-end
-
@@ -1,59 +0,0 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE
-# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
-# -*- encoding: utf-8 -*-
-
-Gem::Specification.new do |s|
- s.name = %q{hassle}
- s.version = "0.0.1"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 1.3.5") if s.respond_to? :required_rubygems_version=
- s.authors = ["Pedro Belo", "Nick Quaranto"]
- s.date = %q{2009-10-16}
- s.description = %q{Makes SASS less of a hassle on read-only filesystems by compiling and serving it up for you}
- s.extra_rdoc_files = [
- "LICENSE",
- "README.textile"
- ]
- s.files = [
- "LICENSE",
- "README.textile",
- "init.rb",
- "lib/hassle.rb"
- ]
- s.homepage = %q{http://github.com/pedro/hassle}
- s.rdoc_options = ["--charset=UTF-8"]
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.5}
- s.summary = %q{Make SASS less of a hassle}
- s.test_files = [
- "spec/base.rb",
- "spec/hassle_compiler_spec.rb",
- "spec/hassle_spec.rb"
- ]
-
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
-
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<rack>, [">= 0"])
- s.add_runtime_dependency(%q<haml>, [">= 0"])
- s.add_development_dependency(%q<rspec>, [">= 0"])
- s.add_development_dependency(%q<cucumber>, [">= 0"])
- s.add_development_dependency(%q<rack-test>, [">= 0"])
- else
- s.add_dependency(%q<rack>, [">= 0"])
- s.add_dependency(%q<haml>, [">= 0"])
- s.add_dependency(%q<rspec>, [">= 0"])
- s.add_dependency(%q<cucumber>, [">= 0"])
- s.add_dependency(%q<rack-test>, [">= 0"])
- end
- else
- s.add_dependency(%q<rack>, [">= 0"])
- s.add_dependency(%q<haml>, [">= 0"])
- s.add_dependency(%q<rspec>, [">= 0"])
- s.add_dependency(%q<cucumber>, [">= 0"])
- s.add_dependency(%q<rack-test>, [">= 0"])
- end
-end
@@ -1,42 +0,0 @@
-require 'rubygems'
-require 'spec'
-require 'rack/test'
-
-require File.dirname(__FILE__) + '/../lib/hassle'
-
-SASS_OPTIONS = Sass::Plugin.options.dup
-
-def write_sass(location, css_file = "screen")
- FileUtils.mkdir_p(location)
- sass_path = File.join(location, "#{css_file}.sass")
- File.open(sass_path, "w") do |f|
- f.write <<EOF
-%h1
- font-size: 42em
-EOF
- end
-
- File.join(@hassle.css_location(location), "#{css_file}.css") if @hassle
-end
-
-def be_compiled
- simple_matcher("exist") { |given| File.exists?(given) }
- simple_matcher("contain compiled sass") { |given| File.read(given) =~ /h1 \{/ }
-end
-
-def have_tmp_dir_removed(*stylesheets)
- simple_matcher("remove tmp dir") do |given|
- given == stylesheets.map { |css| css.gsub(File.join(Dir.pwd, "tmp", "hassle"), "") }
- end
-end
-
-def have_served_sass
- simple_matcher("return success") { |given| given.status == 200 }
- simple_matcher("compiled sass") { |given| given.body.should =~ /h1 \{/ }
-end
-
-def reset
- Sass::Plugin.options.clear
- Sass::Plugin.options = SASS_OPTIONS
- FileUtils.rm_rf([File.join(Dir.pwd, "public"), File.join(Dir.pwd, "tmp")])
-end
Oops, something went wrong. Retry.

0 comments on commit ca56f5d

Please sign in to comment.