jader 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTkxODNlMDNjMWVlMWY4OGVhNTg0YzQwY2I3NWE5YjBmZGFiZDU0MA==
4
+ NzNjZWU5MTA0ZWY5MmU4MjZlZDQwNDM4M2MwZGIxODA3ZThhMTVhNA==
5
5
  data.tar.gz: !binary |-
6
- YTgxYTJjOTcyNTY3ODVlMjg5OGU1NTc5ZTdkM2FmMjg4YmMxMDM2Mw==
6
+ OGNjOTc3N2U1Mzk1N2JlMjFkNDA4ODJhY2JhYTM0YzMxYzFlYzE1MQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OWY5NWFlMGZjYTk0NjVjYTBlZDgyYzc5YTFlYzRkN2E4MDI0NTMwOWJmMDU2
10
- MTFiYmNjZGNkMTAwNDRjMjQ2NWE4NDRlNGYwMzlkNjFhMWQ1Y2Q3ODY0ZjI3
11
- OGI0NzFiMWVjOGM0OTFhMzdmZDhhMGJhZGE2NDM1NzY1NzJhMTU=
9
+ ZDk4NTJjMjRiOGJlMDlmN2JlODU0YmYxMWFhNzQ1NGIwZGEzOWQ4ZDZmODlj
10
+ YzUwNWZiNDBhNzY1ZjkzNGFmZDg1MjJjNjliYzg5Y2Y5YTMxNWFlOTJkZWNk
11
+ NjIzYjJkZDgxNzA4NWIzMDdjZTk3ZTY4YzllZjc2MGJmNDEyOTU=
12
12
  data.tar.gz: !binary |-
13
- OGExMWIyMGQ0Y2Q4NjZlNTljMjNmMDM0NDlmN2NjNmE2ZTUwODExODc2MDNk
14
- ZDBkZTcwM2ZkMWM2MTcwYTFhOGYzNjViYzI4OTVmMDVkMzU1ODM0ZjlmNzll
15
- YThkZDE1ZWFhN2UwZDFhMTkxMDYwYTUxYmZjZGNmNzY5MWFmMzk=
13
+ NTQ3YzRlNjA3M2M2Y2NjMzE2YTg1OTY1ZjQzZWMwZDA0YzY3MTk1N2VjZjUy
14
+ NmE5ZDNjZDEyMTc3YTJmNjQyZTY5M2I0OTg5NTFjYzUxYjRjM2Q0OGJiNTJm
15
+ ZGE4YWE2YjQ4N2JmMzQzNjUwOTRiNWViZWQxMjMzZGNhY2JmYWQ=
data/README.md CHANGED
@@ -306,6 +306,9 @@ Jader.configure do |config|
306
306
  config.views_path = Rails.root.join('app','assets','javascripts','views')
307
307
  # Use some javascript from a file that's not available in the asset pipeline
308
308
  config.includes << IO.read(Rails.root.join('app','assets','javascripts','includes','util.js'))
309
+ # In Rails 3 applications, prepend views_path using a controller before filter.
310
+ # This is set to false by default
311
+ config.prepend_view_path = true
309
312
  # wait for assets to be ready
310
313
  Rails.application.config.after_initialize do
311
314
  # include javascripts available only from asset pipeline
@@ -7,4 +7,6 @@ require 'jader/serialize'
7
7
  require 'jader/engine' if defined?(::Rails)
8
8
 
9
9
  ActionView::Template.register_template_handler :jade, Jader::Renderer
10
- ActionView::Template.register_template_handler 'jst.jade', Jader::Renderer
10
+ ActionView::Template.register_template_handler 'jst.jade', Jader::Renderer
11
+
12
+ Jader.configure do |config|; end
@@ -18,13 +18,14 @@ module Jader
18
18
 
19
19
  # Jader configuration class
20
20
  class Configuration
21
- attr_accessor :mixins_path, :views_path, :includes
21
+ attr_accessor :mixins_path, :views_path, :includes, :prepend_view_path
22
22
 
23
23
  # Initialize Jader::Configuration class with default values
24
24
  def initialize
25
25
  @mixins_path = nil
26
26
  @views_path = nil
27
27
  @includes = []
28
+ @prepend_view_path = false
28
29
  end
29
30
  end
30
31
  end
@@ -4,15 +4,18 @@ require 'sprockets/engines'
4
4
  module Jader
5
5
  class Engine < Rails::Engine
6
6
  initializer "jade.configure_rails_initialization", :before => 'sprockets.environment', :group => :all do |app|
7
- next unless app.config.assets.enabled
8
- Sprockets.register_engine '.jade', ::Jader::Template
7
+ sprockets_env = app.assets || Sprockets
8
+ sprockets_env.register_engine '.jade', ::Jader::Template
9
9
  end
10
10
 
11
11
  initializer 'jader.prepend_views_path', :after => :add_view_paths do |app|
12
12
  next if Jader::configuration.nil? or Jader::configuration.views_path.nil?
13
- ActionController::Base.class_eval do
14
- before_filter do |controller|
15
- prepend_view_path Jader::configuration.views_path
13
+ app.config.paths['app/views'].unshift(Jader::configuration.views_path)
14
+ if Jader::configuration.prepend_view_path
15
+ ActionController::Base.class_eval do
16
+ before_filter do |controller|
17
+ prepend_view_path Jader::configuration.views_path
18
+ end
16
19
  end
17
20
  end
18
21
  end
@@ -1,3 +1,3 @@
1
1
  module Jader
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
@@ -2,4 +2,5 @@ Jader.configure do |config|
2
2
  config.mixins_path = Rails.root.join('app','assets','javascripts','mixins')
3
3
  config.views_path = Rails.root.join('app','assets','javascripts','views')
4
4
  config.includes << IO.read(Rails.root.join('app','assets','javascripts','includes','util.js'))
5
+ config.prepend_view_path = true
5
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zohar Arad
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-09 00:00:00.000000000 Z
12
+ date: 2014-06-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: libv8