html_mockup-autoprefixer 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YWE5NGFhMmFmNzA5YWE0ZDIxYjM2ZjNhMmFjYjQ3ZjVlMTdhZGI0Zg==
5
+ data.tar.gz: !binary |-
6
+ Nzg4ZjZmZDI5MjFiZTM3YTA0MmRkMjYwZjQ5MzQ0NWUzYTdlZmY3MQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ MzcyNmNhYmQ2M2ZlYjMxYmMwZmUzM2YwYzE3YjQ3OTQwZTkxMjBlNjFlZDE1
10
+ MmQ4OTJmZjQyNDNhMDE3YTQzYjgwNjIwMDVkZGI2NGU1MDM3YWQzZThhOGUz
11
+ MzRiNTQ4YWI0ZDEzMTFmM2VkODNhMGI5ODlhZjdlMWFjN2ViZWY=
12
+ data.tar.gz: !binary |-
13
+ YjA2MmM0M2Q2OTA1YjgzN2U3NjE5NjY0ZThhZjcwZTc2ZTI2YWQxZDFmYWYw
14
+ MzNkMDIzZGVjMzc1ZGZlODQyZDVjZGJhODZhYzUyMDI5NmVmMGRmMTQzMjA2
15
+ ZDM2MWMwOWMxZmFhOWM1ZGJmMzViN2JmMGYxMTllMWViMjNlZjQ=
data/MIT_LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2014 Flurin Egger, DigitPaint (http://www.digitpaint.nl)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,6 @@
1
+ # HtmlMockup Autoprefixer
2
+
3
+ Rack middleware and processor for using autoprefixer in HtmlMockup.
4
+
5
+ ## Copyright & license
6
+ Copyright (c) 2014 Flurin Egger, Digitpaint, MIT Style License. (see MIT-LICENSE)
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "html_mockup-autoprefixer"
5
+ s.version = "0.0.1"
6
+
7
+ s.authors = ["Flurin Egger"]
8
+ s.email = ["info@digitpaint.nl", "flurin@digitpaint.nl"]
9
+ s.homepage = "http://github.com/digitpaint/html_mockup"
10
+ s.summary = "Rack middleware and processor for using autoprefixer in HtmlMockup."
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("html_mockup", ["~> 0.8.0"])
23
+ s.add_dependency("autoprefixer-rails", ["~> 0.8.0"])
24
+ end
@@ -0,0 +1,20 @@
1
+ module HtmlMockupAutoprefixer
2
+ class Middleware
3
+ def initialize(app)
4
+ @app = app
5
+ end
6
+
7
+ def call(env)
8
+ status, headers, body = @app.call(env)
9
+ if status == 200 && headers["Content-Type"].to_s.include?("text/css")
10
+ body_str = []
11
+ body.each{|f| body_str << f }
12
+ body_str = body_str.join
13
+
14
+ Rack::Response.new(AutoprefixerRails.compile(body_str), status, headers).finish
15
+ else
16
+ [status, headers, body]
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,28 @@
1
+ module HtmlMockupAutoprefixer
2
+ class Processor
3
+ # @option options [Array] :match An array of shell globs, defaults to ["stylesheets/**/*.scss"]
4
+ # @option options [Array] :skip An array of regexps which will be skipped, defaults to [/_.*\.scss\Z/], Attention! Skipped files will be deleted as well!
5
+ def call(release, options={})
6
+ options = {
7
+ :match => ["stylesheets/**/*.css"],
8
+ :skip => []
9
+ }.update(options)
10
+
11
+ match = options.delete(:match)
12
+ skip = options.delete(:skip)
13
+
14
+ # Prefix CSS files
15
+ files = release.get_files(match)
16
+ files.each do |f|
17
+ if !skip.detect{|r| r.match(f) }
18
+ release.log(self, "Processing: #{f}")
19
+ # Compile SCSS
20
+ content = File.read(f)
21
+ File.open(f, "w") do |fh|
22
+ fh.write AutoprefixerRails.compile(content)
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,9 @@
1
+ module HtmlMockupAutoprefixer
2
+ end
3
+
4
+ # Dependencies
5
+ require 'autoprefixer-rails'
6
+
7
+ # Load modules
8
+ require File.dirname(__FILE__) + "/html_mockup-autoprefixer/middleware"
9
+ require File.dirname(__FILE__) + "/html_mockup-autoprefixer/processor"
metadata ADDED
@@ -0,0 +1,79 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: html_mockup-autoprefixer
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Flurin Egger
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-02-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: html_mockup
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 0.8.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.8.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: autoprefixer-rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 0.8.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.8.0
41
+ description:
42
+ email:
43
+ - info@digitpaint.nl
44
+ - flurin@digitpaint.nl
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - MIT_LICENSE
50
+ - README.md
51
+ - html_mockup-autoprefixer.gemspec
52
+ - lib/html_mockup-autoprefixer.rb
53
+ - lib/html_mockup-autoprefixer/middleware.rb
54
+ - lib/html_mockup-autoprefixer/processor.rb
55
+ homepage: http://github.com/digitpaint/html_mockup
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.0.6
76
+ signing_key:
77
+ specification_version: 4
78
+ summary: Rack middleware and processor for using autoprefixer in HtmlMockup.
79
+ test_files: []