middleman-autoprefixer 1.1.3 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: acb455c280c231f1c3b3324d9ee58e0cba92a990
4
- data.tar.gz: eb965bb697a9e2af325504b8391d9d473d3add6f
3
+ metadata.gz: e99201bfb9d6070d524adf6247780bf8f0f3c640
4
+ data.tar.gz: 5163bf4b91ad663d1e616cc1c8c85ae4e8cb9f25
5
5
  SHA512:
6
- metadata.gz: 23f30bdc6e54f1bcf9884bf8d7a3cfaa255eb87e02e13f41dad1dda6686463795a7e61324fa07d06340927ea5bde320cf8517ce08120489cb912f67aebbb5d4c
7
- data.tar.gz: 9c70493d013af8b86bbb09be03826afe72253aeafdc51fb04cd0dca2cae4810cc16e20d2d2bd4d6b2e8ada374241587ef69c8c2064e07a4382a776f719b1cb71
6
+ metadata.gz: 207128bde7ed69868234f2d9734c09b75c92e103cef6c9b9838d4fd3cef958e2f579656d229d25435f85a2da616782fe3b0ef2dfdc38050353b7f4709fe0c355
7
+ data.tar.gz: 63a169bb83c8e947762b18fdb94a628ad6430ce1f0cf6e8868197ba470092a23b7e5cf5749f5f4e0db584dfe8ccbef6ec27b65974bd95cfcb1ef00a82d2a5a25
@@ -9,7 +9,9 @@ Feature: Postprocessing stylesheets with Autoprefixer in different configuration
9
9
  Scenario: Passing options in a block
10
10
  Given the Server is running at "block-app"
11
11
  When I go to "/stylesheets/page.css"
12
- Then I should see "-webkit-linear-gradient"
12
+ Then I should see "-webkit-flex"
13
+ And I should see "-moz-box"
14
+ And I should see "-webkit-linear-gradient"
13
15
  And I should see "-moz-linear-gradient"
14
16
 
15
17
  Scenario: Passing options in a hash
@@ -1,3 +1,5 @@
1
- body {
2
- background: linear-gradient(to bottom, #fff, #000);
1
+ @supports not (display: flex) {
2
+ body {
3
+ background: linear-gradient(to bottom, #fff, #000);
4
+ }
3
5
  }
@@ -1,6 +1,8 @@
1
- require 'middleman-autoprefixer/version'
2
- require 'middleman-autoprefixer/extension'
1
+ require 'middleman-core'
2
+
3
+ require_relative 'middleman-autoprefixer/version'
4
+ require_relative 'middleman-autoprefixer/extension'
3
5
 
4
6
  ::Middleman::Extensions.register(:autoprefixer) do
5
- ::Middleman::Autoprefixer
7
+ ::Middleman::Autoprefixer::Extension
6
8
  end
@@ -1,18 +1,18 @@
1
- require_relative 'options'
2
1
  require_relative 'processor'
3
2
 
4
3
  module Middleman
5
4
  module Autoprefixer
6
- class << self
7
- def registered(app, options_hash = {}, &block)
8
- @@options = Options.new(options_hash)
9
- yield @@options if block_given?
5
+ class Extension < ::Middleman::Extension
6
+ option :browsers
7
+ option :cascade
10
8
 
11
- app.after_configuration do
12
- Processor.new(*@@options.params).configure(sprockets)
13
- end
9
+ def initialize(app, options_hash = {}, &block)
10
+ super
11
+ end
12
+
13
+ def after_configuration
14
+ Processor.new(options).configure(app.sprockets)
14
15
  end
15
- alias :included :registered
16
16
  end
17
17
  end
18
18
  end
@@ -3,6 +3,10 @@ require 'autoprefixer-rails'
3
3
  module Middleman
4
4
  module Autoprefixer
5
5
  class Processor < AutoprefixerRails::Processor
6
+ def initialize(options)
7
+ super *to_processor_arguments(options)
8
+ end
9
+
6
10
  def postprocess(context, content)
7
11
  begin
8
12
  process(content).css
@@ -18,6 +22,15 @@ module Middleman
18
22
  def configure(sprockets_env)
19
23
  sprockets_env.register_postprocessor 'text/css', :autoprefixer, &method(:postprocess)
20
24
  end
25
+
26
+ private
27
+
28
+ def to_processor_arguments(options)
29
+ [
30
+ Array(options.browsers),
31
+ options.to_h.except(:browsers).reject { |_, value| value.nil? }
32
+ ]
33
+ end
21
34
  end
22
35
  end
23
36
  end
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module Autoprefixer
3
- VERSION = '1.1.3'.freeze
3
+ VERSION = '2.0.0'.freeze
4
4
  end
5
5
  end
@@ -1 +1 @@
1
- require 'middleman-autoprefixer'
1
+ require_relative 'middleman-autoprefixer'
@@ -16,14 +16,14 @@ Gem::Specification.new do |spec|
16
16
  spec.test_files = `git ls-files -- {features,fixtures}/*`.split($/)
17
17
  spec.require_paths = ['lib']
18
18
 
19
- spec.add_dependency 'middleman-core', '~> 3.2'
20
- spec.add_dependency 'middleman-sprockets', '~> 3.2'
21
- spec.add_dependency 'autoprefixer-rails', '~> 1.3.1'
19
+ spec.add_dependency 'middleman-core', '>= 3.3.3'
20
+ spec.add_dependency 'middleman-sprockets', '>= 3.3.3'
21
+ spec.add_dependency 'autoprefixer-rails', '~> 2.0.0'
22
22
 
23
- spec.add_development_dependency 'bundler', '~> 1.5'
24
- spec.add_development_dependency 'rake', '~> 10.1'
23
+ spec.add_development_dependency 'middleman', '>= 3.3.3'
24
+ spec.add_development_dependency 'cucumber', '~> 1.3.14'
25
+ spec.add_development_dependency 'aruba', '~> 0.5.4'
25
26
 
26
- spec.add_development_dependency 'middleman', '~> 3.2'
27
- spec.add_development_dependency 'cucumber', '~> 1.3.14'
28
- spec.add_development_dependency 'aruba', '~> 0.5.4'
27
+ spec.add_development_dependency 'bundler', '>= 1.6'
28
+ spec.add_development_dependency 'rake', '>= 10.3'
29
29
  end
metadata CHANGED
@@ -1,127 +1,127 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-autoprefixer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Porada
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-22 00:00:00.000000000 Z
11
+ date: 2014-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman-core
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '3.2'
19
+ version: 3.3.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '3.2'
26
+ version: 3.3.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: middleman-sprockets
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '3.2'
33
+ version: 3.3.3
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: '3.2'
40
+ version: 3.3.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: autoprefixer-rails
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.3.1
47
+ version: 2.0.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.3.1
54
+ version: 2.0.0
55
55
  - !ruby/object:Gem::Dependency
56
- name: bundler
56
+ name: middleman
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '1.5'
61
+ version: 3.3.3
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '1.5'
68
+ version: 3.3.3
69
69
  - !ruby/object:Gem::Dependency
70
- name: rake
70
+ name: cucumber
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '10.1'
75
+ version: 1.3.14
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '10.1'
82
+ version: 1.3.14
83
83
  - !ruby/object:Gem::Dependency
84
- name: middleman
84
+ name: aruba
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '3.2'
89
+ version: 0.5.4
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '3.2'
96
+ version: 0.5.4
97
97
  - !ruby/object:Gem::Dependency
98
- name: cucumber
98
+ name: bundler
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 1.3.14
103
+ version: '1.6'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 1.3.14
110
+ version: '1.6'
111
111
  - !ruby/object:Gem::Dependency
112
- name: aruba
112
+ name: rake
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: 0.5.4
117
+ version: '10.3'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 0.5.4
124
+ version: '10.3'
125
125
  description:
126
126
  email:
127
127
  - dominik@porada.co
@@ -154,7 +154,6 @@ files:
154
154
  - fixtures/hash-app/source/stylesheets/page.scss
155
155
  - lib/middleman-autoprefixer.rb
156
156
  - lib/middleman-autoprefixer/extension.rb
157
- - lib/middleman-autoprefixer/options.rb
158
157
  - lib/middleman-autoprefixer/processor.rb
159
158
  - lib/middleman-autoprefixer/version.rb
160
159
  - lib/middleman_extension.rb
@@ -1,25 +0,0 @@
1
- module Middleman
2
- module Autoprefixer
3
- class Options
4
- attr_writer :browsers
5
- attr_reader :config
6
-
7
- def initialize(options_hash = {})
8
- @browsers = options_hash[:browsers]
9
- @config = options_hash.slice(:cascade)
10
- end
11
-
12
- def browsers
13
- Array(@browsers)
14
- end
15
-
16
- def cascade=(value)
17
- @config.merge!(cascade: value)
18
- end
19
-
20
- def params
21
- [browsers, config]
22
- end
23
- end
24
- end
25
- end