Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into octokit2
Browse files Browse the repository at this point in the history
  • Loading branch information
jedfoster committed Nov 23, 2013
2 parents 37dc2f2 + 1e5d797 commit b0d0758
Show file tree
Hide file tree
Showing 9 changed files with 126 additions and 29 deletions.
10 changes: 6 additions & 4 deletions Gemfile
@@ -1,6 +1,7 @@
source 'http://rubygems.org'
ruby '1.9.3'

gem 'rack-contrib', :git => 'git://github.com/rack/rack-contrib.git'
gem 'sinatra'
gem 'sinatra-partial'
gem 'unicorn'
Expand All @@ -18,13 +19,13 @@ gem 'compass'
# gem 'pry-remote'
# end

gem 'bourbon-compass'
gem 'bourbon-compass', "~> 3.2.0.beta.1.a"
gem 'breakpoint'
gem 'sassy-buttons'
gem 'singularitygs'
gem 'stipe'
gem 'susy', "~> 1.0.9"
gem 'neat-compass'
gem 'neat-compass', "~> 1.5.0.pre"
gem 'harsh'
gem 'toolkit'
gem 'color-schemer'
Expand Down Expand Up @@ -52,6 +53,7 @@ gem 'stitch'
gem 'breakup'
gem 'singularity-golden-grid'
gem 'compass-placeholders'
gem 'true'
gem 'true', "~> 0.2.0.rc.3"
gem 'SassyLists'
gem 'sassy-maps'
gem 'sassy-maps'
gem 'bitters-compass'
44 changes: 29 additions & 15 deletions Gemfile.lock
@@ -1,3 +1,11 @@
GIT
remote: git://github.com/rack/rack-contrib.git
revision: 951760b1710634623ebbccef8d65df9139bb41c2
specs:
rack-contrib (1.2.0)
rack (>= 0.9.1)
sinatra (~> 1.4.3)

PATH
remote: ../chairman
specs:
Expand All @@ -8,15 +16,20 @@ PATH
GEM
remote: http://rubygems.org/
specs:
SassyLists (0.2.3)
SassyLists (0.4.3)
compass (>= 0.12.1)
sass (>= 3.2.0)
addressable (2.3.5)
bitters-compass (0.9.1)
bourbon-compass (>= 3.1.3)
compass (>= 0.11)
neat-compass (>= 1.4.0)
sass (>= 3.2)
blend-mode (0.0.1)
compass (~> 0.12)
bourbon-compass (3.1.8)
compass (>= 0.11)
sass (>= 3.2.0)
bourbon-compass (3.2.0.beta.1.a)
compass (>= 0.13.alpha.10)
sass (>= 3.3.0.rc.1)
breakpoint (2.0.7)
compass (>= 0.12.1)
sass (>= 3.2.0)
Expand Down Expand Up @@ -52,7 +65,7 @@ GEM
compass (>= 0.11)
faraday (0.8.8)
multipart-post (~> 1.2.0)
ffi (1.9.2)
ffi (1.9.3)
fittext (0.0.5)
compass (>= 0.10.0.rc3)
grid-coordinates (1.2.0)
Expand All @@ -77,12 +90,12 @@ GEM
sass (>= 3.2.0)
sassy-math (>= 1.5)
multipart-post (1.2.0)
neat-compass (1.4.0)
neat-compass (1.5.0.pre)
bourbon-compass (>= 3.1.3)
compass (>= 0.11)
sass (>= 3.2)
newrelic_rpm (3.6.8.168)
normalize-scss (2.1.2)
newrelic_rpm (3.6.9.171)
normalize-scss (2.1.3)
sass (>= 3.2)
octokit (2.5.1)
sawyer (~> 0.5.1)
Expand Down Expand Up @@ -152,10 +165,9 @@ GEM
compass (>= 0.12.2)
sassy-strings (>= 1.0.0)
singularitygs (>= 1.1.2)
true (0.1.5)
compass (>= 0.12.2)
sass (>= 3.2.0)
unicorn (4.6.3)
true (0.2.0.rc.3)
sass (~> 3.3.0.rc.1)
unicorn (4.7.0)
kgio (~> 2.6)
rack
raindrops (~> 0.7)
Expand All @@ -169,8 +181,9 @@ PLATFORMS

DEPENDENCIES
SassyLists
bitters-compass
blend-mode
bourbon-compass
bourbon-compass (~> 3.2.0.beta.1.a)
breakpoint
breakpoint-slicer
breakup
Expand All @@ -190,9 +203,10 @@ DEPENDENCIES
jacket
jammit
modular-scale
neat-compass
neat-compass (~> 1.5.0.pre)
newrelic_rpm
normalize-scss
rack-contrib!
responsive-sass
rwdcalc
salsa
Expand All @@ -212,7 +226,7 @@ DEPENDENCIES
thor
tilt (= 1.3.4)
toolkit
true
true (~> 0.2.0.rc.3)
unicorn
zen-grids
zurb-foundation
18 changes: 18 additions & 0 deletions TESTS.md
Expand Up @@ -2,6 +2,24 @@

Each block of SCSS should return valid CSS with no warnings or errors when tested against it's respective extension.

## Bitters ##

@import "bourbon/bourbon";
@import "neat/neat";
@import "bitters/bitters";

h1[id] {
margin-bottom: .5em;
}

ul.default {
@extend %default-ul;
}

ol.default {
@extend %default-ol;
}


## Blend Modes ##

Expand Down
11 changes: 10 additions & 1 deletion config.ru
@@ -1,7 +1,16 @@
require "bundler/setup"

require 'rack/contrib'
require './lib/rack/static_cache'

require './sassmeister'

# Gzip responses
use Rack::Deflater

# Set Cache-Control and ETag headers
use Rack::StaticCache, :urls => ['/javascripts', '/stylesheets', '/fonts', '/favicon.ico'], :root => "public", :duration => 7
use Rack::ETag

# Run the application
run SassMeisterApp
run SassMeisterApp
8 changes: 8 additions & 0 deletions config/plugins.yml
@@ -1,3 +1,11 @@
Bitters:
:gem: bitters-compass
:import:
- bourbon/bourbon
- neat/neat
- bitters/bitters
:fingerprint: (bitters|bitters/*)
:url: http://bitters.bourbon.io
"Blend Modes":
:gem: blend-mode
:import:
Expand Down
26 changes: 26 additions & 0 deletions lib/rack/static_cache.rb
@@ -0,0 +1,26 @@
module Rack
class StaticCache
def call(env)
path = env["PATH_INFO"]
url = @urls.detect{ |u| path.index(u) == 0 }
unless url.nil?
path.sub!(/-[\d.]+([.][a-zA-Z][\w]+)?$/, '\1') if @versioning_enabled
status, headers, body = @file_server.call(env)
if @no_cache[url].nil?
headers['Cache-Control'] ="public, max-age=#{@duration_in_seconds}"
headers['Expires'] = @duration_in_words
headers.delete 'Etag'
headers.delete 'Pragma'
# headers.delete 'Last-Modified'
end
[status, headers, body]
else
@app.call(env)
end
end

def duration_in_seconds
(60 * 60 * 24 * @cache_duration).floor
end
end
end
15 changes: 9 additions & 6 deletions public/javascripts/SassMeister.js
Expand Up @@ -144,6 +144,9 @@ var SassMeister;

input.setTheme('ace/theme/tomorrow');
input.getSession().setMode('ace/mode/' + syntax.toLowerCase());

input.getSession().setTabSize(2);
input.getSession().setUseSoftTabs(true);

input.setValue(value);
input.clearSelection();
Expand All @@ -157,7 +160,7 @@ var SassMeister;

compile: {
sass: function() {
// _gaq.push(['_trackEvent', 'Form', 'Submit']);
_gaq.push(['_trackEvent', 'Form', 'Submit']);

/* Post the form and handle the returned data */
$.post('/compile', SassMeister.inputs.sass, function( data ) {
Expand All @@ -173,7 +176,7 @@ var SassMeister;
},

html: function() {
// _gaq.push(['_trackEvent', 'Form', 'Submit']);
_gaq.push(['_trackEvent', 'Form', 'Submit']);

if(SassMeister.inputs.html.syntax == 'HTML') {
updateRender({
Expand Down Expand Up @@ -220,7 +223,7 @@ var SassMeister;

gist: {
create: function() {
// _gaq.push(['_trackEvent', 'Gist']);
_gaq.push(['_trackEvent', 'Gist', 'Create']);

var confirmationText = 'is ready';

Expand All @@ -243,7 +246,7 @@ var SassMeister;
},

edit: function() {
// _gaq.push(['_trackEvent', 'Gist']);
_gaq.push(['_trackEvent', 'Gist', 'Edit']);

var postData = {
inputs: SassMeister.inputs,
Expand All @@ -261,12 +264,12 @@ var SassMeister;
},

fork: function() {
_gaq.push(['_trackEvent', 'Gist']);
_gaq.push(['_trackEvent', 'Gist', 'Fork']);

var confirmationText = 'has been forked';

///* Send the data using post and put the results in a div */
$.post('/gist/' + SassMeister.storedInputs.gist_id + '/fork', function( data ) {
$.post('/gist/' + SassMeister.inputs.gist_id + '/fork', function( data ) {
modal('<a href="https://gist.github.com/' + data.id + '" target="_blank">This Gist</a> ' + confirmationText + ', and here\'s the <a href="/gist/' + data.id + '">SassMeister live view.</a> ');

setUrl('/gist/' + data.id);
Expand Down
21 changes: 18 additions & 3 deletions public/javascripts/main.js
Expand Up @@ -9,6 +9,8 @@ if($('body.about, body.thankyou').length < 1 ) {


$('.orientation').on('click', function(event) {
_gaq.push(['_trackEvent', 'UI', 'Orientation']);

$('#source').casement('destroy');
$('#casement').casement('destroy');

Expand All @@ -33,6 +35,7 @@ if($('body.about, body.thankyou').length < 1 ) {


$('.panel-toggle li span').on('click', function(event) {

event.preventDefault();

var selected = $(this).text(),
Expand All @@ -41,17 +44,23 @@ if($('body.about, body.thankyou').length < 1 ) {
$(this).parents('.panel-toggle').find('.selected').text(selected);

if (input == 'sass') {
_gaq.push(['_trackEvent', 'UI', 'SassSyntax']);

SassMeister.inputs.sass.syntax = selected;

SassMeister.convert.sass();
SassMeister.editors.sass.getSession().setMode('ace/mode/' + selected.toLowerCase());
}
if (input == 'css') {
_gaq.push(['_trackEvent', 'UI', 'CSSOutput']);

SassMeister.inputs.sass.output_style = selected;

SassMeister.compile.sass();
}
if (input == 'html') {
_gaq.push(['_trackEvent', 'UI', 'HTMLSyntax']);

SassMeister.inputs.html.syntax = selected;

SassMeister.compile.html();
Expand All @@ -64,16 +73,20 @@ if($('body.about, body.thankyou').length < 1 ) {


$('[data-import]').on('click', function(event) {
_gaq.push(['_trackEvent', 'UI', 'SassExtensions']);

var imports = $(this).data('import').split(','),
eol = ( SassMeister.inputs.sass.syntax == 'SCSS' ? ';' : '' ) + '\n';

$(imports).each(function() {
$(imports).each(function() {
SassMeister.editors.sass.insert( '@import "' + this + '"' + eol);
});
});
});


var toggleCSSPanel = function(state) {
_gaq.push(['_trackEvent', 'UI', 'ToggleCSS']);

$('#source').casement('destroy');
$('#casement').casement('destroy');

Expand All @@ -94,6 +107,8 @@ if($('body.about, body.thankyou').length < 1 ) {


var toggleHTMLPanels = function(state) {
_gaq.push(['_trackEvent', 'UI', 'ToggleHTML']);

$('#source').casement('destroy');
$('#casement').casement('destroy');

Expand Down Expand Up @@ -183,7 +198,7 @@ if($('body.about, body.thankyou').length < 1 ) {
}
}
};

}

})(jQuery);
2 changes: 2 additions & 0 deletions sassmeister.rb
Expand Up @@ -26,6 +26,8 @@ class SassMeisterApp < Sinatra::Base
use Chairman::Routes

helpers SassMeister



configure do
APP_VERSION = '2.0.1'
Expand Down

0 comments on commit b0d0758

Please sign in to comment.