premailer-rails 1.8.0 → 1.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +4 -0
  3. data/.travis.yml +10 -15
  4. data/CHANGELOG.md +74 -0
  5. data/Gemfile +10 -4
  6. data/README.md +49 -39
  7. data/VERSION +1 -1
  8. data/example/Gemfile +1 -3
  9. data/example/bin/rails +4 -0
  10. data/example/config.ru +1 -1
  11. data/example/config/application.rb +1 -0
  12. data/example/config/boot.rb +1 -2
  13. data/example/config/environments/development.rb +4 -0
  14. data/example/config/environments/production.rb +9 -0
  15. data/example/config/initializers/assets.rb +2 -0
  16. data/lib/premailer/rails.rb +4 -2
  17. data/lib/premailer/rails/css_helper.rb +45 -16
  18. data/lib/premailer/rails/css_loaders.rb +0 -1
  19. data/lib/premailer/rails/css_loaders/asset_pipeline_loader.rb +19 -10
  20. data/lib/premailer/rails/css_loaders/file_system_loader.rb +24 -2
  21. data/lib/premailer/rails/css_loaders/network_loader.rb +15 -8
  22. data/lib/premailer/rails/customized_premailer.rb +6 -6
  23. data/lib/premailer/rails/hook.rb +16 -8
  24. data/premailer-rails.gemspec +4 -4
  25. data/spec/integration/css_helper_spec.rb +92 -42
  26. data/spec/integration/delivery_spec.rb +13 -0
  27. data/spec/integration/hook_spec.rb +53 -1
  28. data/spec/rails_app/app/assets/config/manifest.js +3 -0
  29. data/spec/rails_app/app/assets/stylesheets/application.css +3 -0
  30. data/spec/rails_app/app/mailers/application_mailer.rb +4 -0
  31. data/spec/rails_app/app/mailers/welcome_mailer.rb +6 -0
  32. data/spec/rails_app/app/views/layouts/mailer.html.erb +11 -0
  33. data/spec/rails_app/app/views/welcome_mailer/welcome_email.html.erb +1 -0
  34. data/spec/rails_app/config.ru +5 -0
  35. data/spec/rails_app/config/application.rb +13 -0
  36. data/spec/rails_app/config/boot.rb +5 -0
  37. data/spec/rails_app/config/environment.rb +2 -0
  38. data/spec/rails_app/config/environments/test.rb +10 -0
  39. data/spec/rails_app/config/initializers/assets.rb +1 -0
  40. data/spec/rails_app/config/routes.rb +3 -0
  41. data/spec/spec_helper.rb +3 -4
  42. data/spec/support/fixtures/html.rb +8 -4
  43. data/spec/support/fixtures/message.rb +56 -0
  44. data/spec/unit/css_loaders/asset_pipeline_loader_spec.rb +19 -4
  45. data/spec/unit/css_loaders/file_system_loader_spec.rb +37 -0
  46. data/spec/unit/css_loaders/network_loader_spec.rb +58 -0
  47. data/spec/unit/customized_premailer_spec.rb +32 -40
  48. metadata +63 -34
  49. data/lib/premailer/rails/css_loaders/cache_loader.rb +0 -19
  50. data/spec/integration/hook_registration_spec.rb +0 -11
  51. data/spec/support/stubs/action_mailer.rb +0 -5
  52. data/spec/support/stubs/rails.rb +0 -51
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1acf912800a7228a1dcf6b89f5412ee87490f975
4
- data.tar.gz: 2ab5e6bf63b3d7a0fa974b5495df7919eaeb9d10
2
+ SHA256:
3
+ metadata.gz: 13055f85c556422022c71564c81f5816ecffd482e4514c1481212fab2c942eb7
4
+ data.tar.gz: 8b9093f66f195ac826382329877be7c9b863650c5bcb0c057bae0cc073b8978d
5
5
  SHA512:
6
- metadata.gz: feef5aa13b18d39709bf2f9fd931eecff8876a11bf3500199f91c2ba06e15853d60787984425371b51ef4fbc60c555a7b8df38ab0e108e4c4766e4e624fba52b
7
- data.tar.gz: dc7c3b13551d5445c58998154a342d79f2b4e0d56fd4b909d1264df3d0511e958d03bbd475f98a387c3c8bdec23fcead519c7a60ac150dff7955f78da46bb884
6
+ metadata.gz: a861465e80d026c7e221b09f0c395be4d4fb26fa3662a233de5ba8295c41f0861b79958f873830fa4bd6333bd21798298155f8cadf1cf7861f08f5348ee3f901
7
+ data.tar.gz: f4cd1b29b3b1a4ee43fe83971b35b6a43896298ab3c1fec8d4fc91e2fc0d1290b353bba0096e2ae45376e394f6ad00142cf3dda7447a72259c7639c01fbd4231
data/.gitignore CHANGED
@@ -2,3 +2,7 @@
2
2
  doc/
3
3
  Gemfile.lock
4
4
  coverage/
5
+ spec/rails_app/log/*
6
+ spec/rails_app/tmp/*
7
+ .ruby-version
8
+ /.bundle
data/.travis.yml CHANGED
@@ -1,21 +1,16 @@
1
+ sudo: false
1
2
  language: ruby
2
- before_install:
3
- - gem install bundler
4
3
  cache: bundler
5
- script: "bundle exec rspec"
4
+ script: bundle exec rspec
6
5
  rvm:
7
- - 2.1.0
8
- - 2.0.0
9
- - 1.9.3
10
- - ruby-head
11
- - jruby-19mode
12
- - rbx-2
6
+ - 2.6.5
7
+ - 2.7.0
13
8
  env:
14
- - "ACTION_MAILER_VERSION=3.1.0"
15
- - "ACTION_MAILER_VERSION=3.2.0"
16
- - "ACTION_MAILER_VERSION=4.0.0"
17
- - "ACTION_MAILER_VERSION=head"
9
+ matrix:
10
+ - ACTION_MAILER_VERSION=5
11
+ - ACTION_MAILER_VERSION=6
12
+ - ACTION_MAILER_VERSION=master
18
13
  matrix:
14
+ fast_finish: true
19
15
  allow_failures:
20
- - env: "ACTION_MAILER_VERSION=head"
21
- - rvm: ruby-head
16
+ - env: ACTION_MAILER_VERSION=master
data/CHANGELOG.md CHANGED
@@ -1,5 +1,79 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.11.1
4
+
5
+ - Check if `Rails.application` is defined (@pabloh, #250)
6
+
7
+ ## v1.11.0
8
+
9
+ - Remove `force_encoding!`
10
+
11
+ ## v1.10.3
12
+
13
+ - Remove upper version constraint for actionmailer
14
+
15
+ ## v1.10.2
16
+
17
+ - Explicitly check for assets_manifest (@derekwheel, #214)
18
+
19
+ ## v1.10.1
20
+
21
+ - Catch error when sprockets can't find asset (@kirs, #209)
22
+
23
+ ## v1.10.0
24
+
25
+ - Drop support for hpricot now that premailer-rails also doesn't support it
26
+ - Use `Rails.application.assets_manifest` instead of `Rails.application.assets` in Asset Pipeline loader (@kirs, #201)
27
+ - Introduce `:strategies` config option that allows to control CSS fetching stragies
28
+
29
+ ## v1.9.7
30
+
31
+ - Use `Rails.root` in `FileSystemLoader` (@stanhu, #195)
32
+
33
+ ## v1.9.6
34
+
35
+ - Handle `relative_url_root` in when loading CSS from file system
36
+
37
+ ## v1.9.5
38
+
39
+ - Mention license in gemspec
40
+
41
+ ## v1.9.4
42
+
43
+ - Improve check for Rails module
44
+ - Preserve body encoding to prevent garbled mails
45
+
46
+ ## v1.9.3
47
+
48
+ - Add support for rails' `relative_url_root` config
49
+ - Fix link tag removal under Hpricot
50
+ - Pass url to `asset_host` if it responds to `call`
51
+ - Fixed issue where urls may conflict with folder names.
52
+
53
+ ## v1.9.2
54
+
55
+ - Update rails dependency to allow rails 5
56
+
57
+ ## v1.9.1
58
+
59
+ - Respect data-premailer="ignore" on link tags
60
+ - Ensure content-transfer-encoding is maintained
61
+
62
+ ## v1.9.0
63
+
64
+ - Improved CSS loading and caching.
65
+ - Fixed incompatibility with newer rails and sprockets versions.
66
+
67
+ ## v1.8.2
68
+
69
+ - `Premailer::Rails::CSSLoaders::NetworkLoader` is more resilient and works even
70
+ if the Rails asset host is set without a URI scheme. (panthomakos)
71
+ - Remove stylesheet links from the HTML that have been processed.
72
+
73
+ ## v1.8.1
74
+
75
+ - Add support for longer fingerprint generated by sprocket 3.
76
+
3
77
  ## v1.8.0
4
78
 
5
79
  - `ActionMailer` interceptors are registered after Rails initialization and no
data/Gemfile CHANGED
@@ -2,17 +2,23 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
- action_mailer_version = ENV.fetch('ACTION_MAILER_VERSION', '4.0')
5
+ rails_version = ENV.fetch('ACTION_MAILER_VERSION', '5')
6
6
 
7
- if action_mailer_version == 'head'
7
+ if rails_version == 'master'
8
8
  git 'git://github.com/rails/rails.git' do
9
- gem 'actionmailer'
9
+ gem 'rails'
10
10
  end
11
+ gem 'sprockets-rails', github: 'rails/sprockets-rails'
12
+ gem 'arel', github: 'rails/arel'
11
13
  else
12
- gem 'actionmailer', "~> #{action_mailer_version}"
14
+ gem 'rails', "~> #{rails_version}"
13
15
  end
14
16
 
17
+ gem 'byebug'
18
+
15
19
  platforms :rbx do
16
20
  gem 'rubysl'
17
21
  gem 'racc'
18
22
  end
23
+
24
+ gem 'tins', '< 1.7' if RUBY_VERSION.split('.').first.to_i < 2
data/README.md CHANGED
@@ -7,7 +7,6 @@ CSS styled emails without the hassle.
7
7
  [![Dependency Status][deps-image]][deps-link]
8
8
  [![Code Climate][gpa-image]][gpa-link]
9
9
  [![Coverage Status][cov-image]][cov-link]
10
- [![Bitdeli Badge][stats-image]][stats-link]
11
10
 
12
11
  ## Introduction
13
12
 
@@ -40,34 +39,34 @@ styled emails without having to set anything up.
40
39
  Whenever premailer-rails processes an email, it collects the URLs of all linked
41
40
  stylesheets (`<link rel="stylesheet" href="css_url">`). Then, for each of these
42
41
  URLs, it tries to get the content through a couple of strategies. As long as
43
- a strategy does not return anything, the next one is used. The strategies and
44
- their order are as follows:
42
+ a strategy does not return anything, the next one is used. The strategies
43
+ available are:
45
44
 
46
- 1. **Cache:** If there's a file in cache matching that URL, the cache content
47
- is returned. The cache right now is rather rudimentary. Whenever a CSS file
48
- is retrieved, it is stored in memory such that subsequent requests to the
49
- same file are faster. The caching is disabled inside Rails in the
50
- development environment.
51
-
52
- 2. **File System:** If there's a file inside `public/` with the same path as in
45
+ - `:filesystem`: If there's a file inside `public/` with the same path as in
53
46
  the URL, it is read from disk. E.g. if the URL is
54
47
  `http://cdn.example.com/assets/email.css` the contents of the file located
55
48
  at `public/assets/email.css` gets returned if it exists.
56
49
 
57
- 3. **Asset Pipeline:** If Rails is available and the asset pipeline is enabled,
50
+ - `:asset_pipeline`: If Rails is available and the asset pipeline is enabled,
58
51
  the file is retrieved through the asset pipeline. E.g. if the URL is
59
52
  `http://cdn.example.com/assets/email-fingerprint123.css`, the file
60
53
  `email.css` is requested from the asset pipeline. That is, the fingerprint
61
54
  and the prefix (in this case `assets` is the prefix) are stripped before
62
55
  requesting it from the asset pipeline.
63
56
 
64
- 4. **Network:** As a last resort, the URL is simply requested and the response
65
- body is used. This is usefull when the assets are not bundled in the
57
+ - `:network`: As a last resort, the URL is simply requested and the response
58
+ body is used. This is useful when the assets are not bundled in the
66
59
  application and only available on a CDN. On Heroku e.g. you can add assets
67
60
  to your `.slugignore` causing your assets to not be available to the app
68
61
  (and thus resulting in a smaller app) and deploy the assets to a CDN such
69
62
  as S3/CloudFront.
70
63
 
64
+ You can configure which strategies you want to use as well as specify their
65
+ order. Refer to the *Configuration* section for more on this.
66
+
67
+ Note that the retrieved CSS is cached when the gem is running with Rails in
68
+ production.
69
+
71
70
  ## Installation
72
71
 
73
72
  Simply add the gem to your `Gemfile`:
@@ -76,19 +75,12 @@ Simply add the gem to your `Gemfile`:
76
75
  gem 'premailer-rails'
77
76
  ```
78
77
 
79
- premailer-rails requires either [nokogiri] or [hpricot]. It doesn't list them as
80
- a dependency so you can choose which one to use. Since hpricot is no longer
81
- maintained, I suggest you to go with nokogiri. Add either one to your `Gemfile`:
82
-
83
- ```ruby
84
- gem 'nokogiri'
85
- # or
86
- gem 'hpricot'
87
- ```
88
-
89
- If both gems are loaded for some reason, premailer chooses hpricot.
90
-
91
- That's it!
78
+ premailer-rails and premailer require a gem that is used to parse the email's
79
+ HTML. For a list of supported gems and how to select which one to use, please
80
+ refer to the [*Adapter*
81
+ section](https://github.com/premailer/premailer#adapters) of premailer. Note
82
+ that there is no hard dependency from either gem so you should add one yourself.
83
+ Also note that this gem is only tested with [nokogiri].
92
84
 
93
85
  ## Configuration
94
86
 
@@ -107,7 +99,8 @@ configs are:
107
99
  ```ruby
108
100
  {
109
101
  input_encoding: 'UTF-8',
110
- generate_text_part: true
102
+ generate_text_part: true,
103
+ strategies: [:filesystem, :asset_pipeline, :network]
111
104
  }
112
105
  ```
113
106
 
@@ -122,6 +115,11 @@ If you're using this gem outside of Rails, you'll need to call
122
115
  is done ideally in some kind of initializer, depending on the framework you're
123
116
  using.
124
117
 
118
+ premailer-rails reads all stylesheet `<link>` tags, inlines the linked CSS
119
+ and removes the tags. If you wish to ignore a certain tag, e.g. one that links to
120
+ external fonts such as Google Fonts, you can add a `data-premailer="ignore"`
121
+ attribute.
122
+
125
123
  ## Usage
126
124
 
127
125
  premailer-rails processes all outgoing emails by default. If you wish to skip
@@ -137,39 +135,51 @@ class UserMailer < ActionMailer::Base
137
135
  end
138
136
  ```
139
137
 
138
+ Note that the mere presence of this header causes premailer to be skipped, i.e.,
139
+ even setting `skip_premailer: false` will cause premailer to be skipped. The
140
+ reason for that is that the `skip_premailer` is a simple header and the value is
141
+ transformed into a string, causing `'false'` to become truthy.
142
+
143
+ Emails are only processed upon delivery, i.e. when calling `#deliver` on the
144
+ email, or when [previewing them in
145
+ rails](http://api.rubyonrails.org/v4.1.0/classes/ActionMailer/Base.html#class-ActionMailer::Base-label-Previewing+emails).
146
+ If you wish to manually trigger the inlining, you can do so by calling the hook:
147
+
148
+ ```ruby
149
+ mail = SomeMailer.some_message(args)
150
+ Premailer::Rails::Hook.perform(mail)
151
+ ```
152
+
153
+ This will modify the email in place, useful e.g. in tests.
154
+
140
155
  ## Small Print
141
156
 
142
157
  ### Author
143
158
 
144
159
  Philipe Fatio ([@fphilipe][fphilipe twitter])
145
160
 
146
- [![Support via Gittip][tip-image]][tip-link]
147
-
148
161
  ### License
149
162
 
150
163
  premailer-rails is released under the MIT license. See the [license file].
151
164
 
152
- [build-image]: https://travis-ci.org/fphilipe/premailer-rails.png
165
+ [build-image]: https://travis-ci.org/fphilipe/premailer-rails.svg
153
166
  [build-link]: https://travis-ci.org/fphilipe/premailer-rails
154
- [gem-image]: https://badge.fury.io/rb/premailer-rails.png
167
+ [gem-image]: https://badge.fury.io/rb/premailer-rails.svg
155
168
  [gem-link]: https://rubygems.org/gems/premailer-rails
156
- [deps-image]: https://gemnasium.com/fphilipe/premailer-rails.png
169
+ [deps-image]: https://gemnasium.com/fphilipe/premailer-rails.svg
157
170
  [deps-link]: https://gemnasium.com/fphilipe/premailer-rails
158
- [gpa-image]: https://codeclimate.com/github/fphilipe/premailer-rails.png
171
+ [gpa-image]: https://codeclimate.com/github/fphilipe/premailer-rails.svg
159
172
  [gpa-link]: https://codeclimate.com/github/fphilipe/premailer-rails
160
- [cov-image]: https://coveralls.io/repos/fphilipe/premailer-rails/badge.png
173
+ [cov-image]: https://coveralls.io/repos/fphilipe/premailer-rails/badge.svg
161
174
  [cov-link]: https://coveralls.io/r/fphilipe/premailer-rails
162
- [stats-image]: https://d2weczhvl823v0.cloudfront.net/fphilipe/premailer-rails/trend.png
163
- [stats-link]: https://bitdeli.com/
164
- [tip-image]: https://rawgithub.com/twolfson/gittip-badge/0.1.0/dist/gittip.png
175
+ [tip-image]: https://rawgithub.com/twolfson/gittip-badge/0.1.0/dist/gittip.svg
165
176
  [tip-link]: https://www.gittip.com/fphilipe/
166
177
 
167
178
  [premailer]: https://github.com/premailer/premailer
168
179
  [actionmailer]: https://github.com/rails/rails/tree/master/actionmailer
169
180
  [nokogiri]: https://github.com/sparklemotion/nokogiri
170
- [hpricot]: https://github.com/hpricot/hpricot
171
181
 
172
- [premailer documentation]: http://rubydoc.info/gems/premailer/1.7.3/Premailer:initialize
182
+ [premailer documentation]: https://www.rubydoc.info/gems/premailer/Premailer:initialize
173
183
 
174
184
  [fphilipe twitter]: https://twitter.com/fphilipe
175
185
  [license file]: LICENSE
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.8.0
1
+ 1.11.1
data/example/Gemfile CHANGED
@@ -1,8 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- gem 'rails', github: 'rails'
4
- gem 'sprockets-rails'
5
-
3
+ gem 'rails', '~> 5.0.0.beta3'
6
4
  gem 'premailer-rails', path: '..'
7
5
  gem 'nokogiri'
8
6
 
data/example/bin/rails ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
data/example/config.ru CHANGED
@@ -1,4 +1,4 @@
1
1
  # This file is used by Rack-based servers to start the application.
2
2
 
3
- require ::File.expand_path('../config/environment', __FILE__)
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
4
  run Rails.application
@@ -2,6 +2,7 @@ require File.expand_path('../boot', __FILE__)
2
2
 
3
3
  require 'action_controller/railtie'
4
4
  require 'action_mailer/railtie'
5
+ require 'sprockets/railtie'
5
6
 
6
7
  Bundler.require(*Rails.groups)
7
8
 
@@ -1,4 +1,3 @@
1
- # Set up gems listed in the Gemfile.
2
1
  ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
2
 
4
- require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
3
+ require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -2,4 +2,8 @@ Rails.application.configure do
2
2
  config.cache_classes = false
3
3
  config.eager_load = false
4
4
  config.consider_all_requests_local = true
5
+ config.action_controller.perform_caching = false
6
+ config.assets.debug = true
7
+ config.assets.digest = true
8
+ config.assets.raise_runtime_errors = true
5
9
  end
@@ -0,0 +1,9 @@
1
+ Rails.application.configure do
2
+ config.cache_classes = true
3
+ config.eager_load = true
4
+ config.consider_all_requests_local = false
5
+ config.action_controller.perform_caching = true
6
+ config.assets.compile = false
7
+ config.assets.digest = true
8
+ config.log_level = :info
9
+ end
@@ -0,0 +1,2 @@
1
+ Rails.application.config.assets.version = '1.0'
2
+ Rails.application.config.assets.precompile += %w( email.css )
@@ -6,13 +6,13 @@ require 'premailer/rails/css_loaders'
6
6
  require 'premailer/rails/css_helper'
7
7
  require 'premailer/rails/customized_premailer'
8
8
  require 'premailer/rails/hook'
9
- require 'premailer/rails/railtie' if defined?(Rails)
10
9
 
11
10
  class Premailer
12
11
  module Rails
13
12
  @config = {
14
13
  input_encoding: 'UTF-8',
15
- generate_text_part: true
14
+ generate_text_part: true,
15
+ strategies: [:filesystem, :asset_pipeline, :network]
16
16
  }
17
17
  class << self
18
18
  attr_accessor :config
@@ -27,3 +27,5 @@ class Premailer
27
27
  end
28
28
  end
29
29
  end
30
+
31
+ require 'premailer/rails/railtie' if defined?(Rails)
@@ -3,36 +3,65 @@ class Premailer
3
3
  module CSSHelper
4
4
  extend self
5
5
 
6
- @cache = {}
7
- attr :cache
6
+ FileNotFound = Class.new(StandardError)
8
7
 
9
- STRATEGIES = [
10
- CSSLoaders::CacheLoader,
11
- CSSLoaders::FileSystemLoader,
12
- CSSLoaders::AssetPipelineLoader,
13
- CSSLoaders::NetworkLoader
14
- ]
8
+ attr_accessor :cache
9
+ self.cache = {}
15
10
 
16
11
  # Returns all linked CSS files concatenated as string.
17
12
  def css_for_doc(doc)
18
- urls = css_urls_in_doc(doc)
19
- urls.map { |url| load_css(url).force_encoding('UTF-8') }.join("\n")
13
+ css_urls_in_doc(doc).map { |url| css_for_url(url) }.join("\n")
14
+ end
15
+
16
+ def css_for_url(url)
17
+ if cache_enabled?
18
+ load_css_with_cache(url)
19
+ else
20
+ load_css(url)
21
+ end
20
22
  end
21
23
 
22
24
  private
23
25
 
24
26
  def css_urls_in_doc(doc)
25
- doc.search('link[@rel="stylesheet"]').map do |link|
27
+ doc.search('link[@rel="stylesheet"]:not([@data-premailer="ignore"])').map do |link|
28
+ if link.respond_to?(:remove)
29
+ link.remove
30
+ else
31
+ link.parent.children.delete(link)
32
+ end
26
33
  link.attributes['href'].to_s
27
34
  end
28
35
  end
29
36
 
37
+ def load_css_with_cache(url)
38
+ self.cache[url] ||= load_css(url)
39
+ end
40
+
41
+ def cache_enabled?
42
+ defined?(::Rails.env) && ::Rails.env.production?
43
+ end
44
+
30
45
  def load_css(url)
31
- @cache[url] =
32
- STRATEGIES.each do |strategy|
33
- css = strategy.load(url)
34
- break css if css
35
- end
46
+ Premailer::Rails.config.fetch(:strategies).each do |strategy|
47
+ css = find_strategy(strategy).load(url)
48
+ return css if css
49
+ end
50
+
51
+ raise FileNotFound, %{File with URL "#{url}" could not be loaded by any strategy.}
52
+ end
53
+
54
+ def find_strategy(key)
55
+ case key
56
+ when :filesystem
57
+ CSSLoaders::FileSystemLoader
58
+ when :asset_pipeline
59
+ CSSLoaders::AssetPipelineLoader
60
+ when :network
61
+ CSSLoaders::NetworkLoader
62
+ else
63
+ key
64
+ end
36
65
  end
37
66
  end
38
67
  end