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 +4 -4
- data/features/autoprefixer.feature +3 -1
- data/fixtures/block-app/source/stylesheets/page.scss +4 -2
- data/lib/middleman-autoprefixer.rb +5 -3
- data/lib/middleman-autoprefixer/extension.rb +9 -9
- data/lib/middleman-autoprefixer/processor.rb +13 -0
- data/lib/middleman-autoprefixer/version.rb +1 -1
- data/lib/middleman_extension.rb +1 -1
- data/middleman-autoprefixer.gemspec +8 -8
- metadata +33 -34
- data/lib/middleman-autoprefixer/options.rb +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e99201bfb9d6070d524adf6247780bf8f0f3c640
|
4
|
+
data.tar.gz: 5163bf4b91ad663d1e616cc1c8c85ae4e8cb9f25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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-
|
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,6 +1,8 @@
|
|
1
|
-
require 'middleman-
|
2
|
-
|
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
|
7
|
-
|
8
|
-
|
9
|
-
yield @@options if block_given?
|
5
|
+
class Extension < ::Middleman::Extension
|
6
|
+
option :browsers
|
7
|
+
option :cascade
|
10
8
|
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
data/lib/middleman_extension.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
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',
|
20
|
-
spec.add_dependency 'middleman-sprockets',
|
21
|
-
spec.add_dependency 'autoprefixer-rails',
|
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 '
|
24
|
-
spec.add_development_dependency '
|
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 '
|
27
|
-
spec.add_development_dependency '
|
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:
|
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-
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
54
|
+
version: 2.0.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: middleman
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
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:
|
68
|
+
version: 3.3.3
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: cucumber
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
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:
|
82
|
+
version: 1.3.14
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: aruba
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
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:
|
96
|
+
version: 0.5.4
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: bundler
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 1.
|
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.
|
110
|
+
version: '1.6'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: rake
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - "
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version:
|
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:
|
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
|