assets_pipeline 0.0.2 → 0.0.3

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: 2ba90af10456b7b5226abd4ab9485bc6dadccb6f
4
- data.tar.gz: 179b627b67f30b66de27053a1c4caa91cad2a02d
3
+ metadata.gz: 0e856eb724e0c8a2b55d853b3b0fa95c1a59e5c9
4
+ data.tar.gz: 24862935763686f0c8901de9c6cbfd9026d18956
5
5
  SHA512:
6
- metadata.gz: 2c0c9f0c3ab557ed2d662e9993525cb7a5bc79534233eca1928f70b47694f8193b44264ac84598c5e4f29b3a2fe63b3a26d560a510cda0a19e7f4787b5f2f4be
7
- data.tar.gz: 1321f70c1ad85a814578c93e9b08eb372adf947070ecd54c37ebcc87cb0aa53420cf5fb7579a4e843b919c9c058f64d7bac0d10858bc389b23ab3a41a46c4777
6
+ metadata.gz: 6520dc6f1b2e65cb485a721bebc6d4418cf7075991cc4d673c6a34651063544a52f560e32f5289b0f54abb2bfd98eda14161fe5b230de67ef84545b4bb325a39
7
+ data.tar.gz: f49ab82cfd68c038cc6c10da94d1a7e4224b2b031009cb82e4d77052a45bb77ee80a7e64a4b8dcd50355a25c87658f22ee44f1baaf9bdc132113a2c196381524
data/.gitignore CHANGED
@@ -7,3 +7,4 @@ log
7
7
  Gemfile.lock
8
8
  .ruby-version
9
9
  .ruby-gemset
10
+ .bundle
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'assets_pipeline'
3
- s.version = '0.0.2'
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']
@@ -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
- before :all do
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.initialize!
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.2
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: 2016-05-10 00:00:00.000000000 Z
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"
@@ -1,2 +0,0 @@
1
- ---
2
- BUNDLE_JOBS: 4