erector-rails4 0.0.6 → 0.0.7

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: c20bfa9a5097c2798f37dd76a0ad33755091cd02
4
- data.tar.gz: 39ce033e53636ba5673f0311335751be5c9d7139
3
+ metadata.gz: 6c970e127c854beb86842b2b0e933b1ac0454943
4
+ data.tar.gz: 29b100b708674e78ee3c9197dc31e0b23aeb00ea
5
5
  SHA512:
6
- metadata.gz: bcd8610d526dd2db3fb72ebad5e8a20aa83e85b847757916b3b481f9013a70b1d8730b660598459a343043e0f54933277405274886d544e9130f8ae316e34c59
7
- data.tar.gz: d8bb332fbc1bb04f00d03e67bbdacf9a189a05acd641c2eeab18c8eed615638f4496b4403a842fed493a18dd940bbee5bccba618209fd981764f24521084c6f2
6
+ metadata.gz: 723e19c720846dab589f91907188d15a8815ccab33986877dc85ce2d8e74077721504f25bd1e7f53f8d7a316d35cfe1d3e6ac726823432d0a51e856a66cc747c
7
+ data.tar.gz: a857dfd076029db035f9c33494f44739e0f88f8f976e002335fa1cd5e6d05910907ff820e1d2bef225a472fbf39969035f8d98855b68d638837c0b033fabad50
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- erector-rails4 (0.0.6)
4
+ erector-rails4 (0.0.7)
5
5
  rails (>= 4.0)
6
6
  treetop (>= 1.2.3)
7
7
 
data/lib/erector/rails.rb CHANGED
@@ -2,6 +2,7 @@ require "erector/rails/template_handler"
2
2
  require "erector/rails/railtie"
3
3
  require "erector/rails/widget_renderer"
4
4
  require "erector/rails/form_builder"
5
+ require "erector/rails/autoload_monkeypatch"
5
6
 
6
7
  module Erector
7
8
  module Rails
@@ -130,7 +131,7 @@ module Erector
130
131
  end
131
132
  end
132
133
 
133
- # Delegate to both Rails and custom helpers via method_missing,
134
+ # Delegate to both Rails and custom helpers via method_missing,
134
135
  # and output return values that are html_safe
135
136
  def method_missing(name, *args, &block)
136
137
  if helpers.respond_to?(name)
@@ -0,0 +1,18 @@
1
+ module ActiveSupport
2
+ module Dependencies
3
+
4
+ def search_for_file(path_suffix)
5
+ path_suffix = path_suffix.sub(/(\.rb)?$/, ".rb")
6
+ underscored_path_suffix = path_suffix.gsub(/\/([\w\.]*$)/, '/_\1')
7
+
8
+ autoload_paths.each do |root|
9
+ path = File.join(root, path_suffix)
10
+ return path if File.file? path
11
+ upath = File.join(root, underscored_path_suffix)
12
+ return upath if File.file? upath
13
+ end
14
+ nil # Gee, I sure wish we had first_match ;-)
15
+ end
16
+
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module Erector
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -0,0 +1,13 @@
1
+ require File.expand_path("#{File.dirname(__FILE__)}/rails_spec_helper")
2
+
3
+ describe 'Autoload' do
4
+
5
+ it 'works for templates' do
6
+ Views::Test::Bare.new
7
+ end
8
+
9
+ it 'works for partials' do
10
+ Views::Test::Erector.new
11
+ end
12
+
13
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erector-rails4
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Chaffee
@@ -208,6 +208,7 @@ files:
208
208
  - lib/erector/output.rb
209
209
  - lib/erector/promise.rb
210
210
  - lib/erector/rails.rb
211
+ - lib/erector/rails/autoload_monkeypatch.rb
211
212
  - lib/erector/rails/form_builder.rb
212
213
  - lib/erector/rails/railtie.rb
213
214
  - lib/erector/rails/template_handler.rb
@@ -263,6 +264,7 @@ files:
263
264
  - spec/dummy/config/routes.rb
264
265
  - spec/dummy/db/seeds.rb
265
266
  - spec/dummy/script/rails
267
+ - spec/dummy/spec/autoload_spec.rb
266
268
  - spec/dummy/spec/form_builder_spec.rb
267
269
  - spec/dummy/spec/rails_helpers_spec.rb
268
270
  - spec/dummy/spec/rails_spec_helper.rb
@@ -356,6 +358,7 @@ test_files:
356
358
  - spec/dummy/config/routes.rb
357
359
  - spec/dummy/db/seeds.rb
358
360
  - spec/dummy/script/rails
361
+ - spec/dummy/spec/autoload_spec.rb
359
362
  - spec/dummy/spec/form_builder_spec.rb
360
363
  - spec/dummy/spec/rails_helpers_spec.rb
361
364
  - spec/dummy/spec/rails_spec_helper.rb