jekyll-assets 0.14.0 → 1.0.0.pre.alpha0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +0 -6
  3. data/Guardfile +1 -1
  4. data/HISTORY.md +9 -0
  5. data/README.md +3 -125
  6. data/jekyll-assets.gemspec +6 -6
  7. data/lib/jekyll/assets.rb +14 -0
  8. data/lib/jekyll/{assets_plugin → assets}/asset_path.rb +1 -1
  9. data/lib/jekyll/{assets_plugin → assets}/configuration.rb +1 -1
  10. data/lib/jekyll/{assets_plugin → assets}/environment.rb +3 -34
  11. data/lib/jekyll/{assets_plugin → assets}/filters.rb +3 -3
  12. data/lib/jekyll/{assets_plugin → assets}/patches.rb +0 -0
  13. data/lib/jekyll/{assets_plugin → assets}/patches/asset_patch.rb +2 -2
  14. data/lib/jekyll/{assets_plugin → assets}/patches/bundled_asset_patch.rb +1 -1
  15. data/lib/jekyll/{assets_plugin → assets}/patches/context_patch.rb +1 -1
  16. data/lib/jekyll/{assets_plugin → assets}/patches/index_patch.rb +2 -2
  17. data/lib/jekyll/{assets_plugin → assets}/patches/processed_asset_patch.rb +1 -1
  18. data/lib/jekyll/{assets_plugin → assets}/patches/site_patch.rb +5 -5
  19. data/lib/jekyll/{assets_plugin → assets}/renderer.rb +1 -1
  20. data/lib/jekyll/{assets_plugin → assets}/tag.rb +3 -3
  21. data/lib/jekyll/assets/version.rb +5 -0
  22. data/spec/lib/jekyll/{assets_plugin → assets}/configuration_spec.rb +1 -1
  23. data/spec/lib/jekyll/{assets_plugin → assets}/environment_spec.rb +1 -1
  24. data/spec/lib/jekyll/{assets_plugin → assets}/filters_spec.rb +2 -2
  25. data/spec/lib/jekyll/{assets_plugin → assets}/patches/site_patch_spec.rb +3 -3
  26. data/spec/lib/jekyll/{assets_plugin → assets}/renderer_spec.rb +1 -1
  27. data/spec/lib/jekyll/{assets_plugin → assets}/tag_spec.rb +2 -2
  28. data/spec/spec_helper.rb +22 -15
  29. metadata +35 -50
  30. data/lib/jekyll-assets.rb +0 -2
  31. data/lib/jekyll-assets/bootstrap.rb +0 -7
  32. data/lib/jekyll-assets/bourbon.rb +0 -4
  33. data/lib/jekyll-assets/compass.rb +0 -1
  34. data/lib/jekyll-assets/font-awesome.rb +0 -8
  35. data/lib/jekyll-assets/neat.rb +0 -4
  36. data/lib/jekyll-assets/rails-assets.rb +0 -8
  37. data/lib/jekyll/assets_plugin.rb +0 -4
  38. data/lib/jekyll/assets_plugin/version.rb +0 -5
  39. data/spec/lib/jekyll-assets/bootstrap_spec.rb +0 -9
  40. data/spec/lib/jekyll-assets/bourbon_spec.rb +0 -9
  41. data/spec/lib/jekyll-assets/compass_spec.rb +0 -9
  42. data/spec/lib/jekyll-assets/font-awesome_spec.rb +0 -10
  43. data/spec/lib/jekyll-assets/neat_spec.rb +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf03f1b3026830cb23f34e9b0a81488df68fd46f
4
- data.tar.gz: 3a5d3c9cef7200210cd60c9f91f0f22b360af288
3
+ metadata.gz: 1ca5a553bcf01804b3d3421e2c65f2472c0c892c
4
+ data.tar.gz: b57af1592b7ce80e83ff811039a39ac07e890bac
5
5
  SHA512:
6
- metadata.gz: 366b58cf0cf02cb41c7a95a6d167fb16d23e1e8d8ffdb6a89561dcfb68d1d823ea622bdb6255fa8955289655983a500d56be68734cd977bf5e2bdd43ac1f16e2
7
- data.tar.gz: f4d412a6a92d0c4cd39b604e81a2afcc78090ff4be70c82e961564edd71906c172e1dc649d2fc92d744d12444885b9a03c18b965f36c23240f1388ee51a88dc4
6
+ metadata.gz: ea97b3caf077a4a9234a5b4d826096478cf41ee160d701609e3cc1d866a5ba2d6783e469dbc2eeb8e14397f206b1fd1c0849a5c8b7645b641209814f8c57977d
7
+ data.tar.gz: 73f729d20a3354e09a535bf3f773a53e8fb8ffa359e99b5093b26a098e6212e6b78a044bf2a03693adc8099100f558d6da71e9db8a439b5cd19a675e1070fe6a
data/Gemfile CHANGED
@@ -9,12 +9,6 @@ group :development do
9
9
 
10
10
  gem "coveralls", :require => false
11
11
  gem "simplecov", :require => false
12
-
13
- gem "compass"
14
- gem "bourbon"
15
- gem "neat"
16
- gem "bootstrap-sass", "~> 3.2"
17
- gem "font-awesome-sass", "~> 4.2"
18
12
  end
19
13
 
20
14
  # Specify your gem's dependencies in jekyll-assets.gemspec
data/Guardfile CHANGED
@@ -1,6 +1,6 @@
1
1
  notification :off
2
2
 
3
- guard "rspec" do
3
+ guard "rspec", :cmd => "bundle exec rspec" do
4
4
  watch(/^spec\/.+_spec\.rb$/)
5
5
  watch(/^lib\/(.+)\.rb$/) { |m| "spec/lib/#{m[1]}_spec.rb" }
6
6
  watch("spec/spec_helper.rb") { "spec" }
data/HISTORY.md CHANGED
@@ -1,6 +1,15 @@
1
1
  ### master (unreleased)
2
2
 
3
3
 
4
+
5
+ ### 1.0.0-alpha0 (2015-03-14)
6
+
7
+ * Remove all built-in vendors. (@ixti)
8
+ * Remove support of `require "jekyll-assets"`.
9
+ Use `require "jekyll/assets"`instead. (@ixti)
10
+ * Add environment init hooks (@zmbush)
11
+
12
+
4
13
  ### 0.14.0 (2015-03-09)
5
14
 
6
15
  * Add support for resizing image assets. See #130. (Thanks @zmbush)
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Jekyll::AssetsPlugin
1
+ # Jekyll::Assets
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/jekyll-assets.svg)](http://badge.fury.io/rb/jekyll-assets)
4
4
  [![Build Status](https://travis-ci.org/ixti/jekyll-assets.svg?branch=master)](http://travis-ci.org/ixti/jekyll-assets)
@@ -22,10 +22,6 @@ Jekyll plugin, that adds Rails-alike assets pipeline, that means that:
22
22
  configuration option for other variants.
23
23
  - Produce gzipped versions of assets. See `gzip` configuration option for
24
24
  details.
25
- - [Compass][compass], [Bourbon][bourbon] and [Neat][neat] built-in support.
26
- See "Custom Vendors" below.
27
- - [Rails Assets][rails_assets] support
28
- - [Autoprefixer][autoprefixer] support
29
25
 
30
26
  [compass]: http://compass-style.org/
31
27
  [bourbon]: http://bourbon.io/
@@ -74,7 +70,7 @@ First of all make sure to require it. Common practice is to add following line
74
70
  into `_plugins/ext.rb` file:
75
71
 
76
72
  ``` ruby
77
- require "jekyll-assets"
73
+ require "jekyll/assets"
78
74
  ```
79
75
 
80
76
  Once plugin installed, you'll have following Liquid tags available:
@@ -314,7 +310,7 @@ but copyrights info. In this case you can define and use your own compressor.
314
310
  To do so, first let's define new compressor in `_plugins/ext.rb`:
315
311
 
316
312
  ``` ruby
317
- require "jekyll-assets"
313
+ require "jekyll/assets"
318
314
  require "sprockets"
319
315
 
320
316
  Sprockets.register_compressor 'application/javascript',
@@ -373,124 +369,6 @@ That's it, now jekyll-assets will try to look for assets inside `/my/vendor`
373
369
  path first.
374
370
 
375
371
 
376
- ### Built-in Vendors Support
377
-
378
- For your comfort jekyll-assets has built-in support for some popular libraries.
379
-
380
-
381
- #### Compass Support
382
-
383
- Require `jekyll-assets/compass` to enable, e.g.:
384
-
385
- ``` ruby
386
- require "jekyll-assets"
387
- require "jekyll-assets/compass"
388
- ```
389
-
390
- Now you can add `@import "compass"` in your SASS assets to get Compass goodies.
391
-
392
- *Note* that if you want to use other than default Compass plugins/frameworks,
393
- you must require them BEFORE `jekyll-assets/compass`.
394
-
395
-
396
- #### Bootstrap Support
397
-
398
- Require `jekyll-assets/bootstrap` to enable, e.g.:
399
-
400
- ``` ruby
401
- require "jekyll-assets"
402
-
403
- # bootstrap requires minimum precision of 10, see https://github.com/twbs/bootstrap-sass/issues/409
404
- ::Sass::Script::Number.precision = [10, ::Sass::Script::Number.precision].max
405
-
406
- require "jekyll-assets/bootstrap"
407
- ```
408
-
409
- Now you can add `@import "bootstrap"` in your SASS assets to get Bootstrap goodies.
410
-
411
-
412
- #### Bourbon Support
413
-
414
- Require `jekyll-assets/bourbon` to enable, e.g.:
415
-
416
- ``` ruby
417
- require "jekyll-assets"
418
- require "jekyll-assets/bourbon"
419
- ```
420
-
421
- Now you can add `@import "bourbon"` in your SASS assets to get Bourbon goodies.
422
-
423
-
424
- #### Font Awesome
425
-
426
- Require `jekyll-assets/font-awesome` to enable, e.g.:
427
-
428
- ``` ruby
429
- require "jekyll-assets"
430
- require "jekyll-assets/font-awesome"
431
- ```
432
-
433
- Now you can add `@import "font-awesome"` in your SASS assets to get Font Awesome goodies.
434
-
435
-
436
- #### Neat Support
437
-
438
- Require `jekyll-assets/neat` to enable, e.g.:
439
-
440
- ``` ruby
441
- require "jekyll-assets"
442
- require "jekyll-assets/neat"
443
- ```
444
-
445
- Now you can add `@import "neat"` in your SASS assets to get Neat goodies.
446
-
447
-
448
- ### Rails Assets Support
449
-
450
- [Rails Assets][rails_assets] allows you to easily install Bower dependencies via Bundler.
451
-
452
- Install your Bower dependencies in the `rails_assets` group in your `Gemfile`:
453
-
454
- ``` ruby
455
- group :rails_assets do
456
- gem "rails-assets-jquery"
457
- gem "rails-assets-angular"
458
- end
459
- ```
460
-
461
- Require `jekyll-assets/rails-assets` to enable, e.g.:
462
-
463
- ``` ruby
464
- require "jekyll-assets"
465
- require "jekyll-assets/rails-assets"
466
- ```
467
-
468
- Now you can `require` these dependencies in your assets, e.g. `site.js`:
469
-
470
- ``` javascript
471
- //= require jquery
472
- //= require angular
473
- ```
474
-
475
- ## Autoprefixer
476
-
477
- To enable Autoprefixer, add `autoprefixer-rails` to your `Gemfile`:
478
-
479
- ``` ruby
480
- gem "autoprefixer-rails"
481
- ```
482
-
483
- You can configure it by creating an `autoprefixer.yml` file in your `source`
484
- directory (by default your project's root):
485
-
486
- ``` yaml
487
- browsers:
488
- - "last 1 version"
489
- - "> 1%"
490
- - "Explorer 10"
491
- ```
492
-
493
-
494
372
  ## The Directive Processor
495
373
 
496
374
  *Note:* This section extracted from [Sprockets][sprockets] README.
@@ -1,16 +1,16 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "jekyll/assets_plugin/version"
4
+ require "jekyll/assets/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "jekyll-assets"
8
- spec.version = Jekyll::AssetsPlugin::VERSION
9
- spec.homepage = "http://ixti.github.com/jekyll-assets"
10
- spec.authors = ["Aleksey V Zapparov"]
11
- spec.email = %w(ixti@member.fsf.org)
8
+ spec.version = Jekyll::Assets::VERSION
9
+ spec.homepage = "http://jekyll-assets.github.com/jekyll-assets"
10
+ spec.authors = ["Aleksey V Zapparov", "Zachary Bush"]
11
+ spec.email = %w(ixti@member.fsf.org zach@zmbush.com)
12
12
  spec.license = "MIT"
13
- spec.summary = "jekyll-assets-#{Jekyll::AssetsPlugin::VERSION}"
13
+ spec.summary = "jekyll-assets-#{Jekyll::Assets::VERSION}"
14
14
  spec.description = <<-DESC
15
15
  Jekyll plugin, that allows you to write javascript/css assets in
16
16
  other languages such as CoffeeScript, Sass, Less and ERB, concatenate
@@ -0,0 +1,14 @@
1
+ require "jekyll/assets/patches"
2
+ require "jekyll/assets/filters"
3
+ require "jekyll/assets/tag"
4
+ require "jekyll/assets/version"
5
+
6
+ module Jekyll
7
+ module Assets
8
+ HOOKS = []
9
+
10
+ def self.configure(&blk)
11
+ HOOKS << blk
12
+ end
13
+ end
14
+ end
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
- module AssetsPlugin
2
+ module Assets
3
3
  class AssetPath
4
4
  attr_writer :anchor, :query
5
5
 
@@ -2,7 +2,7 @@
2
2
  require "ostruct"
3
3
 
4
4
  module Jekyll
5
- module AssetsPlugin
5
+ module Assets
6
6
  class Configuration
7
7
  DEFAULTS = {
8
8
  :dirname => "assets",
@@ -8,10 +8,8 @@ require "sprockets-sass"
8
8
  require "sprockets-helpers"
9
9
 
10
10
  module Jekyll
11
- module AssetsPlugin
11
+ module Assets
12
12
  class Environment < Sprockets::Environment
13
- AUTOPREFIXER_CONFIG_FILES = %w(autoprefixer.yml _autoprefixer.yml)
14
-
15
13
  class AssetNotFound < StandardError
16
14
  def initialize(path)
17
15
  super "Couldn't find file '#{path}'"
@@ -33,13 +31,12 @@ module Jekyll
33
31
  self.js_compressor = site.assets_config.js_compressor
34
32
  self.css_compressor = site.assets_config.css_compressor
35
33
 
34
+ Jekyll::Assets::HOOKS.each { |block| block.call(self) }
35
+
36
36
  if site.assets_config.cache_assets?
37
37
  self.cache = Sprockets::Cache::FileStore.new cache_path
38
38
  end
39
39
 
40
- # load css autoprefix post-processor
41
- install_autoprefixer!
42
-
43
40
  # reset cache if config changed
44
41
  self.version = site.assets_config.marshal_dump
45
42
 
@@ -60,34 +57,6 @@ module Jekyll
60
57
  def find_asset(path, *args)
61
58
  super || fail(AssetNotFound, path)
62
59
  end
63
-
64
- private
65
-
66
- def browsers
67
- config = autoprefixer_config
68
- opts = { :safe => config.delete(:safe) }
69
-
70
- [config, opts]
71
- end
72
-
73
- def autoprefixer_config
74
- config_file = AUTOPREFIXER_CONFIG_FILES
75
- .map { |f| Pathname.new(@site.source).join f }
76
- .find(&:exist?)
77
-
78
- return {} unless config_file
79
-
80
- YAML.load_file(config_file).reduce({}) do |h, (k, v)|
81
- h.update(k.to_sym => v)
82
- end
83
- end
84
-
85
- def install_autoprefixer!
86
- require "autoprefixer-rails"
87
- AutoprefixerRails.install(self, *browsers)
88
- rescue LoadError
89
- nil
90
- end
91
60
  end
92
61
  end
93
62
  end
@@ -1,8 +1,8 @@
1
1
  # internal
2
- require "jekyll/assets_plugin/renderer"
2
+ require "jekyll/assets/renderer"
3
3
 
4
4
  module Jekyll
5
- module AssetsPlugin
5
+ module Assets
6
6
  module Filters
7
7
  %w(asset asset_path image javascript stylesheet).each do |name|
8
8
  module_eval <<-RUBY, __FILE__, __LINE__
@@ -16,4 +16,4 @@ module Jekyll
16
16
  end
17
17
  end
18
18
 
19
- Liquid::Template.register_filter Jekyll::AssetsPlugin::Filters
19
+ Liquid::Template.register_filter Jekyll::Assets::Filters
File without changes
@@ -3,7 +3,7 @@ require "sprockets"
3
3
  require "mini_magick"
4
4
 
5
5
  module Jekyll
6
- module AssetsPlugin
6
+ module Assets
7
7
  module Patches
8
8
  module AssetPatch
9
9
  def self.included(base)
@@ -99,4 +99,4 @@ module Jekyll
99
99
  end
100
100
  end
101
101
 
102
- Sprockets::Asset.send :include, Jekyll::AssetsPlugin::Patches::AssetPatch
102
+ Sprockets::Asset.send :include, Jekyll::Assets::Patches::AssetPatch
@@ -2,7 +2,7 @@
2
2
  require "sprockets"
3
3
 
4
4
  module Jekyll
5
- module AssetsPlugin
5
+ module Assets
6
6
  module Patches
7
7
  module BundledAssetPatch
8
8
  def jekyll_assets
@@ -2,7 +2,7 @@
2
2
  require "set"
3
3
 
4
4
  module Jekyll
5
- module AssetsPlugin
5
+ module Assets
6
6
  module Patches
7
7
  module ContextPatch
8
8
  def site
@@ -2,7 +2,7 @@
2
2
  require "sprockets"
3
3
 
4
4
  module Jekyll
5
- module AssetsPlugin
5
+ module Assets
6
6
  module Patches
7
7
  module IndexPatch
8
8
  def self.included(base)
@@ -22,4 +22,4 @@ module Jekyll
22
22
  end
23
23
  end
24
24
 
25
- Sprockets::Index.send :include, Jekyll::AssetsPlugin::Patches::IndexPatch
25
+ Sprockets::Index.send :include, Jekyll::Assets::Patches::IndexPatch
@@ -5,7 +5,7 @@ require "set"
5
5
  require "sprockets"
6
6
 
7
7
  module Jekyll
8
- module AssetsPlugin
8
+ module Assets
9
9
  module Patches
10
10
  module ProcessedAssetPatch
11
11
  def self.included(base)
@@ -5,12 +5,12 @@ require "digest/md5"
5
5
  require "jekyll"
6
6
 
7
7
  # internal
8
- require "jekyll/assets_plugin/configuration"
9
- require "jekyll/assets_plugin/environment"
10
- require "jekyll/assets_plugin/asset_path"
8
+ require "jekyll/assets/configuration"
9
+ require "jekyll/assets/environment"
10
+ require "jekyll/assets/asset_path"
11
11
 
12
12
  module Jekyll
13
- module AssetsPlugin
13
+ module Assets
14
14
  module Patches
15
15
  module SitePatch
16
16
  def self.included(base)
@@ -59,4 +59,4 @@ module Jekyll
59
59
  end
60
60
  end
61
61
 
62
- Jekyll::Site.send :include, Jekyll::AssetsPlugin::Patches::SitePatch
62
+ Jekyll::Site.send :include, Jekyll::Assets::Patches::SitePatch
@@ -2,7 +2,7 @@
2
2
  require "fastimage"
3
3
 
4
4
  module Jekyll
5
- module AssetsPlugin
5
+ module Assets
6
6
  class Renderer
7
7
  STYLESHEET = '<link rel="stylesheet" href="%{path}"%{attrs}>'
8
8
  JAVASCRIPT = '<script src="%{path}"%{attrs}></script>'
@@ -2,10 +2,10 @@
2
2
  require "liquid"
3
3
 
4
4
  # internal
5
- require "jekyll/assets_plugin/renderer"
5
+ require "jekyll/assets/renderer"
6
6
 
7
7
  module Jekyll
8
- module AssetsPlugin
8
+ module Assets
9
9
  class Tag < Liquid::Tag
10
10
  def render(context)
11
11
  Renderer.new(context, @markup).send :"render_#{@tag_name}"
@@ -15,5 +15,5 @@ module Jekyll
15
15
  end
16
16
 
17
17
  %w(asset asset_path image javascript stylesheet).each do |tag|
18
- Liquid::Template.register_tag tag, Jekyll::AssetsPlugin::Tag
18
+ Liquid::Template.register_tag tag, Jekyll::Assets::Tag
19
19
  end
@@ -0,0 +1,5 @@
1
+ module Jekyll
2
+ module Assets
3
+ VERSION = "1.0.0-alpha0"
4
+ end
5
+ end
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe Jekyll::AssetsPlugin::Configuration do
3
+ RSpec.describe Jekyll::Assets::Configuration do
4
4
  let(:options) { {} }
5
5
  subject(:config) { described_class.new(@site, options) }
6
6
 
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe Jekyll::AssetsPlugin::Environment do
3
+ RSpec.describe Jekyll::Assets::Environment do
4
4
  context "#asset_path of context" do
5
5
  it "properly handles query params" do
6
6
  css = @site.assets["vapor.css"].to_s
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe Jekyll::AssetsPlugin::Filters do
3
+ RSpec.describe Jekyll::Assets::Filters do
4
4
  let(:context) { { :registers => { :site => @site } } }
5
5
 
6
6
  def render(content)
@@ -12,7 +12,7 @@ RSpec.describe Jekyll::AssetsPlugin::Filters do
12
12
  end
13
13
 
14
14
  def render_tag(template, path, attrs = "")
15
- template = Jekyll::AssetsPlugin::Renderer.const_get template
15
+ template = Jekyll::Assets::Renderer.const_get template
16
16
  format template, :path => path, :attrs => attrs
17
17
  end
18
18
 
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  # rubocop:disable LineLength
4
4
 
5
- RSpec.describe Jekyll::AssetsPlugin::Patches::SitePatch do
5
+ RSpec.describe Jekyll::Assets::Patches::SitePatch do
6
6
  let(:site) do
7
7
  Jekyll::Site.new Jekyll.configuration({
8
8
  "source" => fixtures_path.to_s,
@@ -28,7 +28,7 @@ RSpec.describe Jekyll::AssetsPlugin::Patches::SitePatch do
28
28
  context "when requested file not found" do
29
29
  it "raises a NotFound error" do
30
30
  expect { site.assets["should_fail.css"] }
31
- .to raise_error Jekyll::AssetsPlugin::Environment::AssetNotFound
31
+ .to raise_error Jekyll::Assets::Environment::AssetNotFound
32
32
  end
33
33
  end
34
34
 
@@ -114,7 +114,7 @@ RSpec.describe Jekyll::AssetsPlugin::Patches::SitePatch do
114
114
 
115
115
  context "#assets_config" do
116
116
  subject { site.assets_config }
117
- it { is_expected.to be_an_instance_of Jekyll::AssetsPlugin::Configuration }
117
+ it { is_expected.to be_an_instance_of Jekyll::Assets::Configuration }
118
118
 
119
119
  it "populated with `assets` section of config" do
120
120
  expect(site.assets_config.dirname).not_to eq "foobar"
@@ -3,7 +3,7 @@ require "ostruct"
3
3
 
4
4
  require "spec_helper"
5
5
 
6
- RSpec.describe Jekyll::AssetsPlugin::Renderer do
6
+ RSpec.describe Jekyll::Assets::Renderer do
7
7
  let(:assets_config) { Hash.new }
8
8
 
9
9
  let(:site) do
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- RSpec.describe Jekyll::AssetsPlugin::Tag do
3
+ RSpec.describe Jekyll::Assets::Tag do
4
4
  let(:context) { { :registers => { :site => @site } } }
5
5
 
6
6
  def render(content)
@@ -12,7 +12,7 @@ RSpec.describe Jekyll::AssetsPlugin::Tag do
12
12
  end
13
13
 
14
14
  def render_tag(template, path, attrs = "")
15
- template = Jekyll::AssetsPlugin::Renderer.const_get template
15
+ template = Jekyll::Assets::Renderer.const_get template
16
16
  attrs = " #{attrs}" unless attrs.empty?
17
17
 
18
18
  format template, :path => path, :attrs => attrs
data/spec/spec_helper.rb CHANGED
@@ -9,7 +9,7 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
9
9
 
10
10
  SimpleCov.start
11
11
 
12
- require_relative "../lib/jekyll-assets"
12
+ require_relative "../lib/jekyll/assets"
13
13
 
14
14
  require "jekyll"
15
15
  require "liquid"
@@ -20,6 +20,25 @@ require "sprockets"
20
20
  Dir[File.expand_path("../support", __FILE__) + "/**/*.rb"]
21
21
  .each { |f| require f }
22
22
 
23
+ # rubocop:disable Metrics/AbcSize
24
+ def start_site
25
+ if Gem::Version.new("2") <= Gem::Version.new(Jekyll::VERSION)
26
+ Jekyll.logger.log_level = :warn
27
+ else
28
+ Jekyll.logger.log_level = Jekyll::Stevenson::WARN
29
+ end
30
+
31
+ @dest = fixtures_path.join("_site")
32
+ @site = Jekyll::Site.new(Jekyll.configuration({
33
+ "source" => fixtures_path.to_s,
34
+ "destination" => @dest.to_s
35
+ }))
36
+
37
+ @dest.rmtree if @dest.exist?
38
+ @site.process
39
+ end
40
+ # rubocop:enable Metrics/AbcSize
41
+
23
42
  RSpec.configure do |config|
24
43
  config.include FixturesHelpers
25
44
  config.extend FixturesHelpers
@@ -27,20 +46,8 @@ RSpec.configure do |config|
27
46
  config.disable_monkey_patching!
28
47
 
29
48
  config.before(:all) do
30
- if Gem::Version.new("2") <= Gem::Version.new(Jekyll::VERSION)
31
- Jekyll.logger.log_level = :warn
32
- else
33
- Jekyll.logger.log_level = Jekyll::Stevenson::WARN
34
- end
35
-
36
- @dest = fixtures_path.join("_site")
37
- @site = Jekyll::Site.new(Jekyll.configuration({
38
- "source" => fixtures_path.to_s,
39
- "destination" => @dest.to_s
40
- }))
41
-
42
- @dest.rmtree if @dest.exist?
43
- @site.process
49
+ Jekyll::Assets::HOOKS.clear
50
+ start_site
44
51
  end
45
52
 
46
53
  config.after(:all) do
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 1.0.0.pre.alpha0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aleksey V Zapparov
8
+ - Zachary Bush
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-03-09 00:00:00.000000000 Z
12
+ date: 2015-03-14 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: jekyll
@@ -128,6 +129,7 @@ description: |2
128
129
  them, respecting dependencies, minify and many more.
129
130
  email:
130
131
  - ixti@member.fsf.org
132
+ - zach@zmbush.com
131
133
  executables: []
132
134
  extensions: []
133
135
  extra_rdoc_files: []
@@ -145,28 +147,21 @@ files:
145
147
  - README.md
146
148
  - Rakefile
147
149
  - jekyll-assets.gemspec
148
- - lib/jekyll-assets.rb
149
- - lib/jekyll-assets/bootstrap.rb
150
- - lib/jekyll-assets/bourbon.rb
151
- - lib/jekyll-assets/compass.rb
152
- - lib/jekyll-assets/font-awesome.rb
153
- - lib/jekyll-assets/neat.rb
154
- - lib/jekyll-assets/rails-assets.rb
155
- - lib/jekyll/assets_plugin.rb
156
- - lib/jekyll/assets_plugin/asset_path.rb
157
- - lib/jekyll/assets_plugin/configuration.rb
158
- - lib/jekyll/assets_plugin/environment.rb
159
- - lib/jekyll/assets_plugin/filters.rb
160
- - lib/jekyll/assets_plugin/patches.rb
161
- - lib/jekyll/assets_plugin/patches/asset_patch.rb
162
- - lib/jekyll/assets_plugin/patches/bundled_asset_patch.rb
163
- - lib/jekyll/assets_plugin/patches/context_patch.rb
164
- - lib/jekyll/assets_plugin/patches/index_patch.rb
165
- - lib/jekyll/assets_plugin/patches/processed_asset_patch.rb
166
- - lib/jekyll/assets_plugin/patches/site_patch.rb
167
- - lib/jekyll/assets_plugin/renderer.rb
168
- - lib/jekyll/assets_plugin/tag.rb
169
- - lib/jekyll/assets_plugin/version.rb
150
+ - lib/jekyll/assets.rb
151
+ - lib/jekyll/assets/asset_path.rb
152
+ - lib/jekyll/assets/configuration.rb
153
+ - lib/jekyll/assets/environment.rb
154
+ - lib/jekyll/assets/filters.rb
155
+ - lib/jekyll/assets/patches.rb
156
+ - lib/jekyll/assets/patches/asset_patch.rb
157
+ - lib/jekyll/assets/patches/bundled_asset_patch.rb
158
+ - lib/jekyll/assets/patches/context_patch.rb
159
+ - lib/jekyll/assets/patches/index_patch.rb
160
+ - lib/jekyll/assets/patches/processed_asset_patch.rb
161
+ - lib/jekyll/assets/patches/site_patch.rb
162
+ - lib/jekyll/assets/renderer.rb
163
+ - lib/jekyll/assets/tag.rb
164
+ - lib/jekyll/assets/version.rb
170
165
  - spec/fixtures/.gitignore
171
166
  - spec/fixtures/_assets/alert.js
172
167
  - spec/fixtures/_assets/app.css.erb
@@ -195,20 +190,15 @@ files:
195
190
  - spec/fixtures/_posts/2012-10-19-hello-world.md
196
191
  - spec/fixtures/_posts/2015-02-02-duplicates.md
197
192
  - spec/fixtures/index.html
198
- - spec/lib/jekyll-assets/bootstrap_spec.rb
199
- - spec/lib/jekyll-assets/bourbon_spec.rb
200
- - spec/lib/jekyll-assets/compass_spec.rb
201
- - spec/lib/jekyll-assets/font-awesome_spec.rb
202
- - spec/lib/jekyll-assets/neat_spec.rb
203
- - spec/lib/jekyll/assets_plugin/configuration_spec.rb
204
- - spec/lib/jekyll/assets_plugin/environment_spec.rb
205
- - spec/lib/jekyll/assets_plugin/filters_spec.rb
206
- - spec/lib/jekyll/assets_plugin/patches/site_patch_spec.rb
207
- - spec/lib/jekyll/assets_plugin/renderer_spec.rb
208
- - spec/lib/jekyll/assets_plugin/tag_spec.rb
193
+ - spec/lib/jekyll/assets/configuration_spec.rb
194
+ - spec/lib/jekyll/assets/environment_spec.rb
195
+ - spec/lib/jekyll/assets/filters_spec.rb
196
+ - spec/lib/jekyll/assets/patches/site_patch_spec.rb
197
+ - spec/lib/jekyll/assets/renderer_spec.rb
198
+ - spec/lib/jekyll/assets/tag_spec.rb
209
199
  - spec/spec_helper.rb
210
200
  - spec/support/fixtures_helpers.rb
211
- homepage: http://ixti.github.com/jekyll-assets
201
+ homepage: http://jekyll-assets.github.com/jekyll-assets
212
202
  licenses:
213
203
  - MIT
214
204
  metadata: {}
@@ -223,15 +213,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
223
213
  version: '0'
224
214
  required_rubygems_version: !ruby/object:Gem::Requirement
225
215
  requirements:
226
- - - ">="
216
+ - - ">"
227
217
  - !ruby/object:Gem::Version
228
- version: '0'
218
+ version: 1.3.1
229
219
  requirements: []
230
220
  rubyforge_project:
231
221
  rubygems_version: 2.2.2
232
222
  signing_key:
233
223
  specification_version: 4
234
- summary: jekyll-assets-0.14.0
224
+ summary: jekyll-assets-1.0.0-alpha0
235
225
  test_files:
236
226
  - spec/fixtures/.gitignore
237
227
  - spec/fixtures/_assets/alert.js
@@ -261,16 +251,11 @@ test_files:
261
251
  - spec/fixtures/_posts/2012-10-19-hello-world.md
262
252
  - spec/fixtures/_posts/2015-02-02-duplicates.md
263
253
  - spec/fixtures/index.html
264
- - spec/lib/jekyll-assets/bootstrap_spec.rb
265
- - spec/lib/jekyll-assets/bourbon_spec.rb
266
- - spec/lib/jekyll-assets/compass_spec.rb
267
- - spec/lib/jekyll-assets/font-awesome_spec.rb
268
- - spec/lib/jekyll-assets/neat_spec.rb
269
- - spec/lib/jekyll/assets_plugin/configuration_spec.rb
270
- - spec/lib/jekyll/assets_plugin/environment_spec.rb
271
- - spec/lib/jekyll/assets_plugin/filters_spec.rb
272
- - spec/lib/jekyll/assets_plugin/patches/site_patch_spec.rb
273
- - spec/lib/jekyll/assets_plugin/renderer_spec.rb
274
- - spec/lib/jekyll/assets_plugin/tag_spec.rb
254
+ - spec/lib/jekyll/assets/configuration_spec.rb
255
+ - spec/lib/jekyll/assets/environment_spec.rb
256
+ - spec/lib/jekyll/assets/filters_spec.rb
257
+ - spec/lib/jekyll/assets/patches/site_patch_spec.rb
258
+ - spec/lib/jekyll/assets/renderer_spec.rb
259
+ - spec/lib/jekyll/assets/tag_spec.rb
275
260
  - spec/spec_helper.rb
276
261
  - spec/support/fixtures_helpers.rb
data/lib/jekyll-assets.rb DELETED
@@ -1,2 +0,0 @@
1
- # rubocop: disable FileName
2
- require "jekyll/assets_plugin"
@@ -1,7 +0,0 @@
1
- require "sprockets"
2
-
3
- gemspec = Gem::Specification.find_by_name "bootstrap-sass"
4
-
5
- %w(images fonts javascripts stylesheets).each do |asset|
6
- Sprockets.append_path File.join(gemspec.gem_dir, "assets", asset)
7
- end
@@ -1,4 +0,0 @@
1
- require "sprockets"
2
-
3
- bourbon_root = Gem::Specification.find_by_name("bourbon").gem_dir
4
- Sprockets.append_path File.join(bourbon_root, "app", "assets", "stylesheets")
@@ -1 +0,0 @@
1
- require "compass"
@@ -1,8 +0,0 @@
1
- # rubocop: disable Style/FileName
2
- require "sprockets"
3
-
4
- gemspec = Gem::Specification.find_by_name "font-awesome-sass"
5
-
6
- %w(fonts stylesheets).each do |asset|
7
- Sprockets.append_path File.join(gemspec.gem_dir, "assets", asset)
8
- end
@@ -1,4 +0,0 @@
1
- require "sprockets"
2
-
3
- neat_root = Gem::Specification.find_by_name("neat").gem_dir
4
- Sprockets.append_path File.join(neat_root, "app", "assets", "stylesheets")
@@ -1,8 +0,0 @@
1
- # rubocop: disable Style/FileName
2
- Bundler.require(:rails_assets)
3
-
4
- if defined? RailsAssets
5
- RailsAssets.components.flat_map(&:load_paths).each do |path|
6
- Sprockets.append_path(path)
7
- end
8
- end
@@ -1,4 +0,0 @@
1
- require "jekyll/assets_plugin/patches"
2
- require "jekyll/assets_plugin/filters"
3
- require "jekyll/assets_plugin/tag"
4
- require "jekyll/assets_plugin/version"
@@ -1,5 +0,0 @@
1
- module Jekyll
2
- module AssetsPlugin
3
- VERSION = "0.14.0"
4
- end
5
- end
@@ -1,9 +0,0 @@
1
- require "spec_helper"
2
- require "jekyll-assets/bootstrap"
3
-
4
- RSpec.describe "Bootstrap integration" do
5
- it "globally appends bootstrap paths into Sprockets environment" do
6
- expect(@site.assets["vendor/with_bootstrap.css"].to_s)
7
- .to match(/bootstrap\//)
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- require "spec_helper"
2
- require "jekyll-assets/bourbon"
3
-
4
- RSpec.describe "Bourbon integration" do
5
- it "globally appends bourbon paths into Sprockets environment" do
6
- expect(@site.assets["vendor/with_bourbon.css"].to_s)
7
- .to match(/linear-gradient/)
8
- end
9
- end
@@ -1,9 +0,0 @@
1
- require "spec_helper"
2
- require "jekyll-assets/compass"
3
-
4
- RSpec.describe "Compass integration" do
5
- it "globally appends compass paths into Sprockets environment" do
6
- expect(@site.assets["vendor/with_compass.css"].to_s)
7
- .to match(/linear-gradient/)
8
- end
9
- end
@@ -1,10 +0,0 @@
1
- # rubocop: disable Style/FileName
2
-
3
- require "spec_helper"
4
- require "jekyll-assets/font-awesome"
5
-
6
- RSpec.describe "Font Awesome integration" do
7
- it "globally appends font awesome paths into Sprockets environment" do
8
- expect(@site.assets["font-awesome.css"].to_s).to match(/fa-github/)
9
- end
10
- end
@@ -1,8 +0,0 @@
1
- require "spec_helper"
2
- require "jekyll-assets/neat"
3
-
4
- RSpec.describe "Neat integration" do
5
- it "globally appends neat paths into Sprockets environment" do
6
- expect(@site.assets["vendor/with_neat.css"].to_s).to match(/max-width/)
7
- end
8
- end