roger_autoprefixer 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmRlMTIwZTcwMWE5YjU3ZTcwYzJkOGM2MTM0MDBkMTQ0M2ZlMTNkNg==
4
+ ZjQyZDUwZjJmYTM4NDRhZTM3OWMyOGQyM2Y3OGJmZmVjZWYwMzBjYg==
5
5
  data.tar.gz: !binary |-
6
- MTExNDdlMTI1YzJkOGE2ZDZhNWI2YmRiYjAwY2QwOTFiZjA2ODkwMQ==
6
+ ZjA2OWY1NmY3NTJhYTQ4N2JiNDVmNjliNGJhYWJkOTllN2E2ZTlmZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDEzMzk2ZjNhZTFhYzE1NzQ1NTgzOWIyYzlkZTc3YzEwNDVjMDg4Zjg0ZWE1
10
- ZjEwOTFkNzBjNmY3ZGZhYTc2MDEyOWQxYjc5ZjkwMzM1ZTk0OWNhNDU0MWE0
11
- MTgwYmE3Y2ViMDY2YmZjOTQxM2M3OTYzOTg5YWVkNTIwYWM4N2I=
9
+ MDFhYjgzMDhmMjlhZDY1YjZkZjY5YzQ3MTA2MDJkY2VhNDBjY2FmY2U4Njdk
10
+ NzkyMGYzOWJiOTVmNDY1OTIxZWU1MjlhZjJkNzczMjkxZThmOWVjNDI4ZjFk
11
+ MTZjNTc2NzM5Y2NiNTkzZTBiYzFmOTY0OGU1ZmUzODk5YjM2ZDA=
12
12
  data.tar.gz: !binary |-
13
- MjE0NDY0NmU3ZWY4ZTQ1N2YyMjU4Mjg2ZDhmYzE3YmM0OGVkM2FlNDRhMTA2
14
- ZWEwYjRiN2QyMjNhZmRmNjZiMTJiZmZmMjk0ZjNmMTRhODAxZWQwMTk2ZWMy
15
- OTUwMDgyMjViNjU1NWFmNmE0MDJkYmViMTE3ZGE2YTczNWVkOTY=
13
+ MTEyOWJmYmI0YWVkNGNhZWIyOTI3ZmM2OTkxYjhlZGNlNGZlMjQyZGY3OWI2
14
+ YTUyZmRmNDIyYmVkMTZmYjU4ZjVlNTMwN2Y1YTU5OWMzY2JhMWYyNDA4YmMx
15
+ OGRiNjM5MmEzMTA4N2JhNWYxMmM2MjdiZDZiYzY4NzI4MzdiMTg=
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## Version 1.1.0
4
+ * Major update for AutoprefixerRails
5
+ * Add option to pass :browsers to Autoprefixer in Middleware and Processor
6
+
3
7
  ## Version 1.0.2
4
8
  * Be a little bit more relaxed about Roger versions
5
9
 
@@ -1,9 +1,14 @@
1
1
  module RogerAutoprefixer
2
2
  class Middleware
3
+ # Middleware
4
+ #
5
+ # @option options [Array] :skip Array of regexp Skip certain URL's
6
+ # @option options [Array] :browsers Browsers to do autporefixing for passed to AutoprefixerRails
3
7
  def initialize(app, options={})
4
8
  @app = app
5
9
  @options = {
6
- :skip => []
10
+ :skip => [],
11
+ :browsers => nil
7
12
  }.update(options)
8
13
  end
9
14
 
@@ -17,8 +22,16 @@ module RogerAutoprefixer
17
22
 
18
23
  # This is a dirty little hack to always enforce UTF8
19
24
  body_str.force_encoding("UTF-8")
25
+
26
+ prefixer_options = {
27
+ :from => env["PATH_INFO"]
28
+ }
29
+
30
+ if @options[:browsers]
31
+ prefixer_options[:browsers] = @options[:browsers]
32
+ end
20
33
 
21
- Rack::Response.new(AutoprefixerRails.compile(body_str), status, headers).finish
34
+ Rack::Response.new(AutoprefixerRails.process(body_str, prefixer_options).css, status, headers).finish
22
35
  else
23
36
  [status, headers, body]
24
37
  end
@@ -4,14 +4,23 @@ module RogerAutoprefixer
4
4
  class Processor
5
5
  # @option options [Array] :match An array of shell globs, defaults to ["stylesheets/**/*.scss"]
6
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
+ # @option options [Array] :browsers Browsers to do autporefixing for passed to AutoprefixerRails
7
8
  def call(release, options={})
8
9
  options = {
9
10
  :match => ["stylesheets/**/*.css"],
10
- :skip => []
11
+ :skip => [],
12
+ :browsers => nil
11
13
  }.update(options)
12
14
 
13
15
  match = options.delete(:match)
14
16
  skip = options.delete(:skip)
17
+
18
+ # Setup prefixer options
19
+ prefixer_options = {}
20
+
21
+ if options[:browsers]
22
+ prefixer_options[:browsers] = options[:browsers]
23
+ end
15
24
 
16
25
  # Prefix CSS files
17
26
  files = release.get_files(match)
@@ -21,7 +30,7 @@ module RogerAutoprefixer
21
30
  # Compile SCSS
22
31
  content = File.read(f)
23
32
  File.open(f, "w") do |fh|
24
- fh.write AutoprefixerRails.compile(content)
33
+ fh.write AutoprefixerRails.process(content, prefixer_options.dup.update({:from => f})).css
25
34
  end
26
35
  end
27
36
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "roger_autoprefixer"
5
- s.version = "1.0.2"
5
+ s.version = "1.1.0"
6
6
 
7
7
  s.authors = ["Flurin Egger"]
8
8
  s.email = ["info@digitpaint.nl", "flurin@digitpaint.nl"]
@@ -20,5 +20,5 @@ Gem::Specification.new do |s|
20
20
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
21
21
 
22
22
  s.add_dependency("roger", [">= 0.11.0"])
23
- s.add_dependency("autoprefixer-rails", ["~> 0.8.0"])
23
+ s.add_dependency("autoprefixer-rails", [">= 5.0.0"])
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roger_autoprefixer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flurin Egger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-09 00:00:00.000000000 Z
11
+ date: 2015-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: roger
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: autoprefixer-rails
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ~>
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.8.0
33
+ version: 5.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.8.0
40
+ version: 5.0.0
41
41
  description:
42
42
  email:
43
43
  - info@digitpaint.nl