sassmeister 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e2af8f3692fd6107c9a36b209eefa1c6b05219f0
4
+ data.tar.gz: c41fc24df466bb15cbba605372852c98c7b566af
5
+ SHA512:
6
+ metadata.gz: 8a1def817f4995ae7289ecbdbe3246cd4e1b3fd1500599c79ffe8425eebb1a5324cc9af08cfd3c3585d4e8636a9a7f0419aebee2c7d7530186191b56cdd63ba9
7
+ data.tar.gz: 2a4dd2ec20994d1001cf08ea8c43b7428934fed18d60ae68a6effbd9f929928e98175daa201a3f9e27d01815dc42823fc0192e8d185abd484bb48b318ac05dc0
data/Gemfile ADDED
@@ -0,0 +1,33 @@
1
+ source 'http://rubygems.org'
2
+ ruby '2.3.0'
3
+
4
+ gem 'rack-contrib', '~> 1.4.0'
5
+ gem 'sinatra'
6
+ gem 'unicorn'
7
+
8
+ # The host app should specify its own versions of Sass and Compass
9
+ # gem 'sass'
10
+ # gem 'compass'
11
+
12
+ group :development, :test do
13
+ gem 'rake'
14
+ gem 'pry-remote'
15
+ gem 'thor'
16
+ gem 'rack-test'
17
+ end
18
+
19
+ group :test do
20
+ gem 'fakeredis'
21
+ end
22
+
23
+ group :development, :production do
24
+ gem 'redis'
25
+ end
26
+
27
+ group :production do
28
+ gem 'newrelic_rpm'
29
+ end
30
+
31
+ group :application do
32
+ # Sass library gems go here
33
+ end
@@ -0,0 +1,57 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ coderay (1.1.0)
5
+ fakeredis (0.5.0)
6
+ redis (~> 3.0)
7
+ git-version-bump (0.15.1)
8
+ kgio (2.9.2)
9
+ method_source (0.8.2)
10
+ newrelic_rpm (3.8.0.218)
11
+ pry (0.9.12.6)
12
+ coderay (~> 1.0)
13
+ method_source (~> 0.8)
14
+ slop (~> 3.4)
15
+ pry-remote (0.1.8)
16
+ pry (~> 0.9)
17
+ slop (~> 3.0)
18
+ rack (1.5.2)
19
+ rack-contrib (1.4.0)
20
+ git-version-bump (~> 0.15)
21
+ rack (~> 1.4)
22
+ rack-protection (1.5.3)
23
+ rack
24
+ rack-test (0.6.2)
25
+ rack (>= 1.0)
26
+ raindrops (0.13.0)
27
+ rake (10.3.1)
28
+ redis (3.2.1)
29
+ sinatra (1.4.5)
30
+ rack (~> 1.4)
31
+ rack-protection (~> 1.4)
32
+ tilt (~> 1.3, >= 1.3.4)
33
+ slop (3.5.0)
34
+ thor (0.19.1)
35
+ tilt (1.4.1)
36
+ unicorn (4.8.2)
37
+ kgio (~> 2.6)
38
+ rack
39
+ raindrops (~> 0.7)
40
+
41
+ PLATFORMS
42
+ ruby
43
+
44
+ DEPENDENCIES
45
+ fakeredis
46
+ newrelic_rpm
47
+ pry-remote
48
+ rack-contrib (~> 1.4.0)
49
+ rack-test
50
+ rake
51
+ redis
52
+ sinatra
53
+ thor
54
+ unicorn
55
+
56
+ BUNDLED WITH
57
+ 1.11.2
@@ -0,0 +1,22 @@
1
+ # Sass 3.2 service for SassMeister.com
2
+
3
+ This app is simply a service that compiles Sass using Sass v3.2 for [SassMeister.com][sassmeister]. It is not intended to run by itself.
4
+
5
+ ## Author
6
+ SassMeister is written by [Jed Foster][jedfoster].
7
+
8
+ The name was inspired by a [Seattle Sass Meetup][meetup] presentation from [PeepCode Screencasts][peepcode].
9
+
10
+ ## License
11
+ Copyright (c) 2012-2013 Jed Foster<br>
12
+
13
+ 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:
14
+
15
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
16
+
17
+ 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.
18
+
19
+ [sassmeister]: http://sassmeister.com
20
+ [jedfoster]: http://jedfoster.com
21
+ [meetup]: http://www.meetup.com/SASSlang/
22
+ [peepcode]: [https://peepcode.com]
@@ -0,0 +1,27 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+
3
+ Gem::Specification.new do |s|
4
+ # Release Specific Information
5
+ s.version = '0.0.2'
6
+ s.date = "2016-05-12"
7
+
8
+ # Gem Details
9
+ s.name = "sassmeister"
10
+ s.authors = ["Jed Foster"]
11
+ s.summary = %q{Sass compiler and Sinatra routing for SassMeister.com}
12
+ s.description = %q{Sass compiler and Sinatra routing for SassMeister.com}
13
+ s.email = "jed@jedfoster.com"
14
+ s.homepage = "https://github.com/jedfoster/SassMeister"
15
+
16
+ # Gem Files
17
+
18
+ s.files = Dir.glob("./*")
19
+ s.require_paths = ["."]
20
+
21
+ # Gem Bookkeeping
22
+ s.rubygems_version = %q{1.3.6}
23
+ s.add_dependency("dalli", ["~> 2.6.4"])
24
+ s.add_dependency("memcachier", ["~> 0.0.2"])
25
+ s.add_dependency("rack-cache", ["~> 1.4"])
26
+ end
27
+
@@ -0,0 +1,80 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(File.realpath(__FILE__)), 'lib'))
2
+ $LOAD_PATH.unshift(File.join(Dir.pwd, 'lib'))
3
+
4
+ require 'rubygems'
5
+ require 'bundler'
6
+ Bundler.setup :default, :application, ENV['RACK_ENV']
7
+
8
+ require 'sinatra/base'
9
+ require 'sassmeister/utilities'
10
+ require 'yaml'
11
+ require 'benchmark'
12
+ require 'json'
13
+
14
+ class SassMeisterApp < Sinatra::Base
15
+ helpers SassMeister::Utilities
16
+
17
+ configure :production do
18
+ require 'newrelic_rpm'
19
+ end
20
+
21
+ before do
22
+ @plugins = plugins
23
+
24
+ request.body.rewind
25
+
26
+ if request.post?
27
+ @payload = request.body.read
28
+ @payload = JSON.parse @payload, symbolize_names: true
29
+ @payload[:syntax].downcase! if @payload[:syntax]
30
+ @payload[:original_syntax].downcase! if @payload[:original_syntax]
31
+ end
32
+
33
+ content_type 'application/json'
34
+
35
+ if request.get?
36
+ last_modified app_last_modified.httpdate
37
+
38
+ cache_control :public, max_age: 2592000 # 30 days, in seconds
39
+ end
40
+ end
41
+
42
+
43
+ get '/' do
44
+ JSON.generate({
45
+ sass: Gem.loaded_specs['sass'].version,
46
+ engine: 'Ruby'
47
+ })
48
+ end
49
+
50
+
51
+ get %r{/extensions(?:\.json)*} do
52
+ extension_list.to_json.to_s
53
+ end
54
+
55
+
56
+ post '/compile' do
57
+ css = ''
58
+
59
+ time = Benchmark.realtime do
60
+ css = sass_compile @payload[:input], @payload[:syntax], @payload[:output_style]
61
+ end
62
+
63
+ json_response css, time
64
+ end
65
+
66
+
67
+ post '/convert' do
68
+ css = ''
69
+
70
+ time = Benchmark.realtime do
71
+ css = sass_convert @payload[:original_syntax], @payload[:syntax], @payload[:input]
72
+ end
73
+
74
+ json_response css, time
75
+ end
76
+
77
+
78
+ run! if app_file == $0
79
+ end
80
+
metadata ADDED
@@ -0,0 +1,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sassmeister
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Jed Foster
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-05-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: dalli
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 2.6.4
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 2.6.4
27
+ - !ruby/object:Gem::Dependency
28
+ name: memcachier
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.0.2
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.0.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: rack-cache
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.4'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.4'
55
+ description: Sass compiler and Sinatra routing for SassMeister.com
56
+ email: jed@jedfoster.com
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - "./Gemfile"
62
+ - "./Gemfile.lock"
63
+ - "./README.md"
64
+ - "./sassmeister.gemspec"
65
+ - "./sassmeister.rb"
66
+ homepage: https://github.com/jedfoster/SassMeister
67
+ licenses: []
68
+ metadata: {}
69
+ post_install_message:
70
+ rdoc_options: []
71
+ require_paths:
72
+ - "."
73
+ required_ruby_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ requirements: []
84
+ rubyforge_project:
85
+ rubygems_version: 2.5.1
86
+ signing_key:
87
+ specification_version: 4
88
+ summary: Sass compiler and Sinatra routing for SassMeister.com
89
+ test_files: []