middleman3-sassc 0.0.1

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: ba23d3b3f9e88e8f896da6564df46baebd5b6cc5
4
+ data.tar.gz: 532922a31b7f5d3f9cd7abb54c86060703b55f4c
5
+ SHA512:
6
+ metadata.gz: 5b14dddc45e35e5870fecb8dba4ea24df9e9fb1115aa6182c8b45f299aad960838d10b7ccbc548af5d90ad054d0827c37e69a89e2da5d2828452fb0319d1e4d6
7
+ data.tar.gz: 9e4aef5ade5a4fd005793137cdf0887b86cf3a191334706bc0840d29103ab0a32dd271712cb9442700c8c83df035ceabaa7a4265b16d9a484929d964135d225a
@@ -0,0 +1,5 @@
1
+ /*.iml
2
+ /*.gem
3
+ /.bundle
4
+ /.idea
5
+ /Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in middleman3-sassc.gemspec
4
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Brad Chen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,30 @@
1
+ # SassC for Middleman 3
2
+
3
+ This gem lets you use SassC with Middleman 3 by monkey patching relevant sass tilt templates.
4
+ (Middleman 4 supports SassC out of box.)
5
+
6
+ ## Installation
7
+
8
+ In `Gemfile`:
9
+ ```ruby
10
+ gem 'middleman3-sassc', '~> 0.0.1'
11
+ ```
12
+
13
+ In `config.rb`:
14
+
15
+ ```ruby
16
+ activate :sassc
17
+ ```
18
+
19
+ ## How do I know if it’s SassC compiling my sass files?
20
+
21
+ There are a few ways to tell:
22
+
23
+ * Sass compilation will be noticeably faster, especially for large projects.
24
+ * SassC does not support Compass, so `@import "compass"` will fail.
25
+ * SassC currently only supports Sass syntax up to 3.2. Using new features will fail.
26
+
27
+ ## License
28
+
29
+ The gem is available as open source under the terms of the
30
+ [MIT License](http://opensource.org/licenses/MIT).
@@ -0,0 +1,6 @@
1
+ require 'middleman-core'
2
+
3
+ Middleman::Extensions.register(:sassc) do
4
+ require 'middleman3-sassc/extension'
5
+ Middleman3::SassC::Extension
6
+ end
@@ -0,0 +1,10 @@
1
+ module Middleman3
2
+ module SassC
3
+ class Extension < Middleman::Extension
4
+ def initialize(*)
5
+ super
6
+ require 'middleman3-sassc/monkey-patches'
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,58 @@
1
+ require 'sassc'
2
+ require 'sassc-rails'
3
+
4
+ module Middleman3
5
+ module SassC
6
+ def self.create_sassc_options(environment, context)
7
+ {
8
+ load_paths: environment.paths,
9
+ importer: ::SassC::Rails::Importer,
10
+ sprockets: {
11
+ context: context,
12
+ environment: environment
13
+ }
14
+ }
15
+ end
16
+ end
17
+ end
18
+
19
+ # Monkey patch Sprockets to use SassC
20
+ module Sprockets::Sass
21
+ class SassTemplate
22
+ def evaluate(context, locals, &block)
23
+ # empty file?
24
+ if data.empty?
25
+ @output = ''
26
+ end
27
+
28
+ @output ||= begin
29
+ @context = context
30
+ options = sass_options
31
+ options = options.merge(::Middleman3::SassC::create_sassc_options(context.environment,
32
+ context))
33
+ ::SassC::Engine.new(data, options).render
34
+ end
35
+ end
36
+ end
37
+ end
38
+
39
+ module Middleman::Renderers::Sass
40
+ class SassPlusCSSFilenameTemplate
41
+ def evaluate(context, _)
42
+ # empty file?
43
+ if data.empty?
44
+ @output = ''
45
+ end
46
+
47
+ @context ||= context
48
+ sprockets = context.sprockets
49
+ @sprockets_context ||= sprockets.context_class.new(sprockets, File.basename(file),
50
+ Pathname.new(file))
51
+
52
+ options = sass_options.merge(::Middleman3::SassC::create_sassc_options(sprockets,
53
+ @sprockets_context))
54
+ @engine = ::SassC::Engine.new(data, options)
55
+ @engine.render
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,5 @@
1
+ module Middleman3
2
+ module SassC
3
+ VERSION = '0.0.1'
4
+ end
5
+ end
@@ -0,0 +1 @@
1
+ require 'middleman3-sassc'
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'middleman3-sassc/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'middleman3-sassc'
8
+ spec.version = Middleman3::SassC::VERSION
9
+ spec.authors = ['Brad Chen']
10
+ spec.email = ['brad.chen@70ms.com']
11
+ spec.homepage = 'https://github.com/70mainstreet/middleman3-sassc'
12
+
13
+ spec.summary = %q{Use SassC in Middleman 3.}
14
+ spec.description = %q{This gem lets you use SassC in Middleman 3. Note that Compass is not available.}
15
+ spec.license = 'MIT'
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_development_dependency 'bundler', '~> 1.10'
22
+ spec.add_development_dependency 'rake', '~> 10.0'
23
+ spec.add_runtime_dependency 'sassc', ['>= 1.7', '< 2']
24
+ spec.add_runtime_dependency 'sassc-rails', ['>= 1.1', '< 2']
25
+ spec.add_runtime_dependency 'middleman-core', ['>= 3.3.0', '< 4.0.0']
26
+ end
metadata ADDED
@@ -0,0 +1,143 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: middleman3-sassc
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Brad Chen
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-10-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: sassc
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '1.7'
48
+ - - "<"
49
+ - !ruby/object:Gem::Version
50
+ version: '2'
51
+ type: :runtime
52
+ prerelease: false
53
+ version_requirements: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: '1.7'
58
+ - - "<"
59
+ - !ruby/object:Gem::Version
60
+ version: '2'
61
+ - !ruby/object:Gem::Dependency
62
+ name: sassc-rails
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '1.1'
68
+ - - "<"
69
+ - !ruby/object:Gem::Version
70
+ version: '2'
71
+ type: :runtime
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '1.1'
78
+ - - "<"
79
+ - !ruby/object:Gem::Version
80
+ version: '2'
81
+ - !ruby/object:Gem::Dependency
82
+ name: middleman-core
83
+ requirement: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: 3.3.0
88
+ - - "<"
89
+ - !ruby/object:Gem::Version
90
+ version: 4.0.0
91
+ type: :runtime
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: 3.3.0
98
+ - - "<"
99
+ - !ruby/object:Gem::Version
100
+ version: 4.0.0
101
+ description: This gem lets you use SassC in Middleman 3. Note that Compass is not
102
+ available.
103
+ email:
104
+ - brad.chen@70ms.com
105
+ executables: []
106
+ extensions: []
107
+ extra_rdoc_files: []
108
+ files:
109
+ - ".gitignore"
110
+ - Gemfile
111
+ - LICENSE.txt
112
+ - README.md
113
+ - lib/middleman3-sassc.rb
114
+ - lib/middleman3-sassc/extension.rb
115
+ - lib/middleman3-sassc/monkey-patches.rb
116
+ - lib/middleman3-sassc/version.rb
117
+ - lib/middleman_extension.rb
118
+ - middleman3-sassc.gemspec
119
+ homepage: https://github.com/70mainstreet/middleman3-sassc
120
+ licenses:
121
+ - MIT
122
+ metadata: {}
123
+ post_install_message:
124
+ rdoc_options: []
125
+ require_paths:
126
+ - lib
127
+ required_ruby_version: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ required_rubygems_version: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ version: '0'
137
+ requirements: []
138
+ rubyforge_project:
139
+ rubygems_version: 2.4.7
140
+ signing_key:
141
+ specification_version: 4
142
+ summary: Use SassC in Middleman 3.
143
+ test_files: []