roger_sass 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MzgzMTQzM2RlYjNhNzIwOTEwNTVjZTIwNWYwMDIyZmE5Nzc3Nzc0NA==
5
+ data.tar.gz: !binary |-
6
+ ZDM3YzUyZDk3MzkxNTBiZjRmM2E1MzY5ODFhYzc4NDlmZDFiODE2Mw==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ YzA5MzUwM2FkOThiNGQzZjJlNDEzZTIyZGNjNmM3ODBkMDk1NWM1MzI3MmJm
10
+ NjdmMDNiMzQ3Y2U4YTc3YmFiYjcwNDc4ZTNlYjE5MmRiZjJhOWVkMGRlYTg5
11
+ NTc0ZDc3MzNkYmI3YzkwZmVkOWI2ZDJlZTg3NTQ5MDFlOTg3ZjE=
12
+ data.tar.gz: !binary |-
13
+ NzNkY2U0NWMyMTc3NzczMjIyMzdkMzlhMDhiZTZhODM5ZGJkMTI2ZmQwODZj
14
+ M2ZjNTBhZGU1ZTA1NDkwZTcwODA1ZTdjNDg4NTliNjdkNTFiNDAzMWIzNDUw
15
+ OGE1MjRiOWYwNTU2MTA3ZTE3OWJkZGFjNTU0Yzk3NWQ2OWQwMTE=
data/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
1
+ # Changelog
2
+
3
+ ## Version 1.0.0
4
+ * First version extracted from Roger
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 DigitPaint
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 all
13
+ 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 THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # Roger Sass
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/roger_sass.png)](http://badge.fury.io/rb/roger_yuicompressor)
4
+
5
+ Sass processor for Roger
6
+
7
+ ## Changes and versions
8
+
9
+ Have a look at the [CHANGELOG](CHANGELOG.md) to see what's new.
10
+
11
+ ## Contributors
12
+
13
+ [View contributors](https://github.com/digitpaint/roger_sass/graphs/contributors)
14
+
15
+ ## License
16
+
17
+ MIT License, see [LICENSE](LICENSE) for more info.
@@ -0,0 +1,45 @@
1
+ module RogerSass
2
+ class Processor < Roger::Release::Processors::Base
3
+ # @param [Hash] options Options as described below, all other options will be passed to Sass.compile_file.
4
+ #
5
+ # @option options [Array] :match An array of shell globs, defaults to ["stylesheets/**/*.scss"]
6
+ # @option options [Array] :skip An array of regexps which will be skipped, defaults to [/_.*\.scss\Z/], Attention! Skipped files will be deleted as well!
7
+ def call(release, options={})
8
+ options = {
9
+ :match => ["stylesheets/**/*.scss"],
10
+ :skip => [/\/_.*\.scss\Z/],
11
+ :style => :expanded
12
+ }.update(options)
13
+
14
+ match = options.delete(:match)
15
+ skip = options.delete(:skip)
16
+
17
+ unless options.has_key?(:load_paths)
18
+ if ::Sass::Plugin.options[:template_location].kind_of?(Hash)
19
+ options[:load_paths] = ::Sass::Plugin.template_location_array.map{|k,v| k }
20
+ else
21
+ options[:load_paths] = [(release.build_path + "stylesheets").to_s]
22
+ end
23
+ end
24
+
25
+ # Sassify SCSS files
26
+ files = release.get_files(match)
27
+ files.each do |f|
28
+ if !skip.detect{|r| r.match(f) }
29
+ release.log(self, "Processing: #{f}")
30
+ # Compile SCSS
31
+ ::Sass.compile_file(f, f.gsub(/\.scss$/, ".css"), options)
32
+ end
33
+ end
34
+
35
+ # Cleanup
36
+ files.each do |f|
37
+ # Remove source file
38
+ File.unlink(f)
39
+ end
40
+
41
+ end
42
+ end
43
+ end
44
+
45
+ Roger::Release::Processors.register(:sass, RogerSass::Processor)
data/lib/roger_sass.rb ADDED
@@ -0,0 +1,7 @@
1
+ module RogerSass; end
2
+
3
+ # Dependencies
4
+ require 'sass'
5
+
6
+ # Load modules
7
+ require File.dirname(__FILE__) + "/roger_sass/processor"
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "roger_sass"
5
+ s.version = "1.0.0"
6
+
7
+ s.authors = ["Flurin Egger"]
8
+ s.email = ["info@digitpaint.nl", "flurin@digitpaint.nl"]
9
+ s.homepage = "http://github.com/digitpaint/roger_sass"
10
+ s.summary = "Processor Sass to process CSS/JS"
11
+ s.licenses = ["MIT"]
12
+
13
+ s.date = Time.now.strftime("%Y-%m-%d")
14
+
15
+ s.files = `git ls-files`.split("\n")
16
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
+ s.require_paths = ["lib"]
19
+
20
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
21
+
22
+ s.add_dependency("roger", [">= 0.11.0"])
23
+ s.add_dependency("sass", [">= 0"])
24
+ end
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: roger_sass
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Flurin Egger
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: roger
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
19
+ version: 0.11.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.11.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: sass
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description:
42
+ email:
43
+ - info@digitpaint.nl
44
+ - flurin@digitpaint.nl
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - CHANGELOG.md
50
+ - LICENSE
51
+ - README.md
52
+ - lib/roger_sass.rb
53
+ - lib/roger_sass/processor.rb
54
+ - roger_sass.gemspec
55
+ homepage: http://github.com/digitpaint/roger_sass
56
+ licenses:
57
+ - MIT
58
+ metadata: {}
59
+ post_install_message:
60
+ rdoc_options: []
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ! '>='
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ requirements: []
74
+ rubyforge_project:
75
+ rubygems_version: 2.1.5
76
+ signing_key:
77
+ specification_version: 4
78
+ summary: Processor Sass to process CSS/JS
79
+ test_files: []