assets_pipeline 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +4 -0
- data/assets_pipeline.gemspec +1 -1
- data/lib/assets_pipeline.rb +5 -0
- data/spec/asset_url_helper_spec.rb +17 -2
- metadata +2 -3
- data/.bundle/config +0 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 0e856eb724e0c8a2b55d853b3b0fa95c1a59e5c9
         | 
| 4 | 
            +
              data.tar.gz: 24862935763686f0c8901de9c6cbfd9026d18956
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 6520dc6f1b2e65cb485a721bebc6d4418cf7075991cc4d673c6a34651063544a52f560e32f5289b0f54abb2bfd98eda14161fe5b230de67ef84545b4bb325a39
         | 
| 7 | 
            +
              data.tar.gz: f49ab82cfd68c038cc6c10da94d1a7e4224b2b031009cb82e4d77052a45bb77ee80a7e64a4b8dcd50355a25c87658f22ee44f1baaf9bdc132113a2c196381524
         | 
    
        data/.gitignore
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    | @@ -4,6 +4,8 @@ | |
| 4 4 |  | 
| 5 5 | 
             
            Asset Pipeline for Rails with your favourite js bundler.
         | 
| 6 6 |  | 
| 7 | 
            +
            **JRuby is not currently supported.**
         | 
| 8 | 
            +
             | 
| 7 9 | 
             
            Install
         | 
| 8 10 | 
             
            =======
         | 
| 9 11 |  | 
| @@ -14,6 +16,8 @@ rails new project --skip-sprockets | |
| 14 16 | 
             
            # config/application.rb
         | 
| 15 17 | 
             
            config.assets_pipeline.manifest_file = 'config/manifest.json' # default: config/manifest.json
         | 
| 16 18 | 
             
            config.assets_pipeline.prefix        = '/assets'              # default: /assets
         | 
| 19 | 
            +
             | 
| 20 | 
            +
            config.assets_pipeline.after_manifest_initialization = -> { puts 'called after mainifest initialization' }
         | 
| 17 21 | 
             
            ``` 
         | 
| 18 22 |  | 
| 19 23 | 
             
            Configuration for js bundler
         | 
    
        data/assets_pipeline.gemspec
    CHANGED
    
    | @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            Gem::Specification.new do |s|
         | 
| 2 2 | 
             
              s.name        = 'assets_pipeline'
         | 
| 3 | 
            -
              s.version     = '0.0. | 
| 3 | 
            +
              s.version     = '0.0.3'
         | 
| 4 4 | 
             
              s.platform    = Gem::Platform::RUBY
         | 
| 5 5 | 
             
              s.authors     = ['Aleksandr Fomin', 'Marat Abdullin', 'Nikolay Sverchkov']
         | 
| 6 6 | 
             
              s.email       = ['ll.wg.bin@gmail.com', 'esend.work@gmail.com', 'ssnikolay@gmail.com']
         | 
    
        data/lib/assets_pipeline.rb
    CHANGED
    
    | @@ -3,6 +3,7 @@ module AssetsPipeline | |
| 3 3 | 
             
                config.assets_pipeline = ::ActiveSupport::OrderedOptions.new
         | 
| 4 4 |  | 
| 5 5 | 
             
                config.assets_pipeline.manifest_file = 'config/manifest.json'
         | 
| 6 | 
            +
                config.assets_pipeline.after_manifest_initialization = nil
         | 
| 6 7 |  | 
| 7 8 | 
             
                if config.respond_to?(:assets)
         | 
| 8 9 | 
             
                  config.assets_pipeline.prefix = config.assets.prefix
         | 
| @@ -16,6 +17,10 @@ module AssetsPipeline | |
| 16 17 | 
             
                  else
         | 
| 17 18 | 
             
                    config.assets_pipeline.manifest = {}
         | 
| 18 19 | 
             
                  end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                  if callback = config.assets_pipeline.after_manifest_initialization
         | 
| 22 | 
            +
                    callback.call
         | 
| 23 | 
            +
                  end
         | 
| 19 24 | 
             
                end
         | 
| 20 25 |  | 
| 21 26 | 
             
                initializer 'load assets_pipeline integration' do
         | 
| @@ -1,14 +1,16 @@ | |
| 1 1 | 
             
            describe ActionView::Helpers::AssetUrlHelper do
         | 
| 2 | 
            -
               | 
| 2 | 
            +
              let(:app) do
         | 
| 3 3 | 
             
                app = Class.new(Rails::Application)
         | 
| 4 4 | 
             
                app.config.eager_load = false
         | 
| 5 5 | 
             
                app.config.assets_pipeline.manifest_file = File.join('spec', 'fixtures', 'manifest.json')
         | 
| 6 | 
            -
                app | 
| 6 | 
            +
                app
         | 
| 7 7 | 
             
              end
         | 
| 8 8 |  | 
| 9 9 | 
             
              let(:helper) { ActionView::Base.new }
         | 
| 10 10 |  | 
| 11 11 | 
             
              describe 'asset_path' do
         | 
| 12 | 
            +
                before { app.initialize! }
         | 
| 13 | 
            +
             | 
| 12 14 | 
             
                context 'when chunk present' do
         | 
| 13 15 | 
             
                  it 'should return javascript' do
         | 
| 14 16 | 
             
                    expect(helper.asset_path(:index, type: :javascript)).to eq '/assets/index-ea0d453146be2145f180.js'
         | 
| @@ -49,4 +51,17 @@ describe ActionView::Helpers::AssetUrlHelper do | |
| 49 51 | 
             
                  expect(helper.stylesheet_link_tag('index', media: 'all')).to match 'assets/index-ea0d453146be2145f180.css'
         | 
| 50 52 | 
             
                end
         | 
| 51 53 | 
             
              end
         | 
| 54 | 
            +
             | 
| 55 | 
            +
              describe 'callback call' do
         | 
| 56 | 
            +
                let(:callback) { spy }
         | 
| 57 | 
            +
             | 
| 58 | 
            +
                before do
         | 
| 59 | 
            +
                  app.config.assets_pipeline.after_manifest_initialization = -> { callback.call }
         | 
| 60 | 
            +
                  app.initialize!
         | 
| 61 | 
            +
                end
         | 
| 62 | 
            +
             | 
| 63 | 
            +
                it 'should run callback' do
         | 
| 64 | 
            +
                  expect(callback).to have_received :call
         | 
| 65 | 
            +
                end
         | 
| 66 | 
            +
              end
         | 
| 52 67 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: assets_pipeline
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.3
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Aleksandr Fomin
         | 
| @@ -10,7 +10,7 @@ authors: | |
| 10 10 | 
             
            autorequire: 
         | 
| 11 11 | 
             
            bindir: bin
         | 
| 12 12 | 
             
            cert_chain: []
         | 
| 13 | 
            -
            date:  | 
| 13 | 
            +
            date: 2017-02-10 00:00:00.000000000 Z
         | 
| 14 14 | 
             
            dependencies:
         | 
| 15 15 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 16 16 | 
             
              name: rails
         | 
| @@ -63,7 +63,6 @@ executables: [] | |
| 63 63 | 
             
            extensions: []
         | 
| 64 64 | 
             
            extra_rdoc_files: []
         | 
| 65 65 | 
             
            files:
         | 
| 66 | 
            -
            - ".bundle/config"
         | 
| 67 66 | 
             
            - ".gitignore"
         | 
| 68 67 | 
             
            - ".rspec"
         | 
| 69 68 | 
             
            - ".travis.yml"
         | 
    
        data/.bundle/config
    DELETED