way 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/way.rb +5 -67
- metadata +21 -38
data/lib/way.rb
CHANGED
@@ -1,67 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
if !block && (layout = @options[:layout])
|
8
|
-
layout = find_template(layout)
|
9
|
-
end
|
10
|
-
|
11
|
-
object ||= locals[as]
|
12
|
-
locals[as] = object
|
13
|
-
|
14
|
-
content = @template.render(view, locals) do |*name|
|
15
|
-
view._layout_for(*name, &block)
|
16
|
-
end
|
17
|
-
|
18
|
-
content = layout.render(view, locals){ content } if layout
|
19
|
-
|
20
|
-
if @view.controller && @view.controller.params.has_key?('_way')
|
21
|
-
content << "#{@template.inspect}"
|
22
|
-
end
|
23
|
-
|
24
|
-
content
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
class Base
|
29
|
-
def render_partial options = {}
|
30
|
-
local_assigns = options[:locals] || {}
|
31
|
-
|
32
|
-
case partial_path = options[:partial]
|
33
|
-
when String, Symbol, NilClass
|
34
|
-
if options.has_key?(:collection)
|
35
|
-
render_partial_collection(options)
|
36
|
-
else
|
37
|
-
partial_template = _pick_partial_template(partial_path)
|
38
|
-
partial_content = partial_template.render_partial(self, options[:object], local_assigns)
|
39
|
-
|
40
|
-
if self.controller && self.controller.params.has_key?('_way')
|
41
|
-
partial_content << "app/views/#{partial_template.to_s}"
|
42
|
-
end
|
43
|
-
|
44
|
-
partial_content
|
45
|
-
end
|
46
|
-
when ActionView::Helpers::FormBuilder
|
47
|
-
builder_partial_path = partial_path.class.to_s.demodulize.underscore.sub(/_builder$/, '')
|
48
|
-
local_assigns.merge!(builder_partial_path.to_sym => partial_path)
|
49
|
-
render_partial(:partial => builder_partial_path, :object => options[:object], :locals => local_assigns)
|
50
|
-
else
|
51
|
-
if Array === partial_path ||
|
52
|
-
(defined?(ActiveRecord) &&
|
53
|
-
(ActiveRecord::Associations::AssociationCollection === partial_path ||
|
54
|
-
ActiveRecord::NamedScope::Scope === partial_path))
|
55
|
-
render_partial_collection(options.except(:partial).merge(:collection => partial_path))
|
56
|
-
else
|
57
|
-
object = partial_path
|
58
|
-
render_partial(
|
59
|
-
:partial => ActionController::RecordIdentifier.partial_path(object, controller.class.controller_path),
|
60
|
-
:object => object,
|
61
|
-
:locals => local_assigns
|
62
|
-
)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
1
|
+
if Rails::VERSION::STRING.to_i > 2
|
2
|
+
require 'rails3'
|
3
|
+
else
|
4
|
+
require 'rails2'
|
5
|
+
end
|
metadata
CHANGED
@@ -1,63 +1,46 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: way
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 1
|
7
|
-
- 1
|
8
|
-
- 3
|
9
|
-
version: 1.1.3
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.4
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Caleb Cohoon
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
date: 2012-05-03 00:00:00 -07:00
|
18
|
-
default_executable:
|
12
|
+
date: 2012-05-23 00:00:00.000000000 Z
|
19
13
|
dependencies: []
|
20
|
-
|
21
14
|
description:
|
22
15
|
email: calebcohoon@gmail.com
|
23
16
|
executables: []
|
24
|
-
|
25
17
|
extensions: []
|
26
|
-
|
27
18
|
extra_rdoc_files: []
|
28
|
-
|
29
|
-
files:
|
19
|
+
files:
|
30
20
|
- lib/way.rb
|
31
21
|
- MIT-LICENSE
|
32
|
-
has_rdoc: true
|
33
22
|
homepage:
|
34
23
|
licenses: []
|
35
|
-
|
36
24
|
post_install_message:
|
37
25
|
rdoc_options: []
|
38
|
-
|
39
|
-
require_paths:
|
26
|
+
require_paths:
|
40
27
|
- lib
|
41
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
requirements:
|
50
|
-
- -
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
|
53
|
-
- 0
|
54
|
-
version: "0"
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
none: false
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
36
|
+
requirements:
|
37
|
+
- - ! '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
55
40
|
requirements: []
|
56
|
-
|
57
41
|
rubyforge_project:
|
58
|
-
rubygems_version: 1.
|
42
|
+
rubygems_version: 1.8.23
|
59
43
|
signing_key:
|
60
44
|
specification_version: 3
|
61
45
|
summary: Find partials in your Rails app easily!
|
62
46
|
test_files: []
|
63
|
-
|