any_view 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/{Users/dneighman/Projects/any_view/Gemfile → Gemfile} +0 -0
- data/{Users/dneighman/Projects/any_view/Gemfile.lock → Gemfile.lock} +0 -0
- data/{Users/dneighman/Projects/any_view/LICENSE → LICENSE} +0 -0
- data/{Users/dneighman/Projects/any_view/README.rdoc → README.rdoc} +0 -0
- data/{Users/dneighman/Projects/any_view/Rakefile → Rakefile} +0 -0
- data/{Users/dneighman/Projects/any_view/VERSION → VERSION} +0 -0
- data/any_view-0.2.1.gem +0 -0
- data/{Users/dneighman/Projects/any_view/any_view.gemspec → any_view.gemspec} +2 -2
- data/{Users/dneighman/Projects/any_view/lib → lib}/any_view.rb +0 -0
- data/{Users/dneighman/Projects/any_view/lib → lib}/any_view/asset_tag_helpers.rb +0 -0
- data/{Users/dneighman/Projects/any_view/lib → lib}/any_view/core_ext/array.rb +0 -0
- data/{Users/dneighman/Projects/any_view/lib → lib}/any_view/core_ext/hash.rb +0 -0
- data/{Users/dneighman/Projects/any_view/lib → lib}/any_view/core_ext/string.rb +0 -0
- data/{Users/dneighman/Projects/any_view/lib → lib}/any_view/form_builder/abstract_form_builder.rb +0 -0
- data/{Users/dneighman/Projects/any_view/lib → lib}/any_view/form_builder/standard_form_builder.rb +0 -0
- data/{Users/dneighman/Projects/any_view/lib → lib}/any_view/form_helpers.rb +0 -0
- data/{Users/dneighman/Projects/any_view/lib → lib}/any_view/format_helpers.rb +0 -0
- data/{Users/dneighman/Projects/any_view/lib → lib}/any_view/tag_helpers.rb +0 -0
- data/{Users/dneighman/Projects/any_view/lib → lib}/any_view/tilt_base.rb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/basic_form_for.erb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/builder_type_form_for.erb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/capture_concat.erb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/capture_concat.haml +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/content_for.erb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/content_for.haml +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/content_tag.erb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/content_tag.haml +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/delete_form_for.erb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/field_set_tag.erb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/fields_for.erb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/fields_for.haml +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/fields_for_basic.erb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/fields_for_nil.erb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/form_for.erb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/form_for.haml +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/form_for_nil.erb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/form_tag.erb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/form_tag.haml +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/form_tag_methods.erb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/form_tag_methods.haml +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/link_to.erb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/link_to.haml +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/mail_to.erb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/mail_to.haml +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/multipart.erb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/multipart_form_for.erb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/put_form_for.erb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/fixtures/standard_form_builder.erb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/helper.rb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/test_asset_tag_helpers.rb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/test_form_builder.rb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/test_form_helpers.rb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/test_format_helpers.rb +0 -0
- data/{Users/dneighman/Projects/any_view/test → test}/test_tag_helpers.rb +0 -0
- metadata +68 -61
- data/Users/dneighman/Projects/any_view/// +0 -134
- data/Users/dneighman/Projects/any_view/any_view-0.1.0.gem +0 -0
- data/Users/dneighman/Projects/any_view/any_view-0.2.0pre.gem +0 -0
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/any_view-0.2.1.gem
ADDED
Binary file
|
@@ -4,7 +4,7 @@ require 'bundler'
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = %q{any_view}
|
7
|
-
s.version = "0.2.
|
7
|
+
s.version = "0.2.2"
|
8
8
|
|
9
9
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
10
10
|
s.authors = ["Daniel Neighman"]
|
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.summary = %q{View helpers designed to work just about anywhere}
|
14
14
|
s.homepage = %q{http://github.com/hassox/any_view}
|
15
15
|
s.email = %q{has.sox@gmail.com}
|
16
|
-
s.files = Dir[File.join(
|
16
|
+
s.files = Dir[File.join('.', "**/*")]
|
17
17
|
s.rdoc_options = ["--charset=UTF-8"]
|
18
18
|
s.require_paths = ["lib"]
|
19
19
|
s.rubygems_version = %q{1.3.6}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/{Users/dneighman/Projects/any_view/lib → lib}/any_view/form_builder/abstract_form_builder.rb
RENAMED
File without changes
|
data/{Users/dneighman/Projects/any_view/lib → lib}/any_view/form_builder/standard_form_builder.rb
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: any_view
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 19
|
4
5
|
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
10
11
|
platform: ruby
|
11
12
|
authors:
|
12
13
|
- Daniel Neighman
|
@@ -19,28 +20,32 @@ default_executable:
|
|
19
20
|
dependencies:
|
20
21
|
- !ruby/object:Gem::Dependency
|
21
22
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
22
24
|
requirements:
|
23
25
|
- - ">="
|
24
26
|
- !ruby/object:Gem::Version
|
27
|
+
hash: 3
|
25
28
|
segments:
|
26
29
|
- 0
|
27
30
|
version: "0"
|
28
31
|
name: ruby-debug
|
29
|
-
prerelease: false
|
30
32
|
requirement: *id001
|
33
|
+
prerelease: false
|
31
34
|
type: :runtime
|
32
35
|
- !ruby/object:Gem::Dependency
|
33
36
|
version_requirements: &id002 !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
34
38
|
requirements:
|
35
39
|
- - ">="
|
36
40
|
- !ruby/object:Gem::Version
|
41
|
+
hash: 31
|
37
42
|
segments:
|
38
43
|
- 0
|
39
44
|
- 10
|
40
45
|
version: "0.10"
|
41
46
|
name: tilt
|
42
|
-
prerelease: false
|
43
47
|
requirement: *id002
|
48
|
+
prerelease: false
|
44
49
|
type: :runtime
|
45
50
|
description: View helpers with an absolute minimum of requirements
|
46
51
|
email: has.sox@gmail.com
|
@@ -51,62 +56,60 @@ extensions: []
|
|
51
56
|
extra_rdoc_files: []
|
52
57
|
|
53
58
|
files:
|
54
|
-
-
|
55
|
-
-
|
56
|
-
-
|
57
|
-
-
|
58
|
-
- /
|
59
|
-
- /
|
60
|
-
- /
|
61
|
-
-
|
62
|
-
-
|
63
|
-
-
|
64
|
-
-
|
65
|
-
-
|
66
|
-
-
|
67
|
-
-
|
68
|
-
-
|
69
|
-
-
|
70
|
-
-
|
71
|
-
-
|
72
|
-
- /
|
73
|
-
- /
|
74
|
-
-
|
75
|
-
-
|
76
|
-
-
|
77
|
-
-
|
78
|
-
-
|
79
|
-
-
|
80
|
-
-
|
81
|
-
-
|
82
|
-
-
|
83
|
-
-
|
84
|
-
-
|
85
|
-
-
|
86
|
-
-
|
87
|
-
-
|
88
|
-
-
|
89
|
-
-
|
90
|
-
-
|
91
|
-
-
|
92
|
-
-
|
93
|
-
-
|
94
|
-
-
|
95
|
-
-
|
96
|
-
-
|
97
|
-
-
|
98
|
-
-
|
99
|
-
-
|
100
|
-
-
|
101
|
-
-
|
102
|
-
-
|
103
|
-
-
|
104
|
-
-
|
105
|
-
-
|
106
|
-
-
|
107
|
-
-
|
108
|
-
- /Users/dneighman/Projects/any_view/test/test_tag_helpers.rb
|
109
|
-
- /Users/dneighman/Projects/any_view/VERSION
|
59
|
+
- ./any_view-0.2.1.gem
|
60
|
+
- ./any_view.gemspec
|
61
|
+
- ./Gemfile
|
62
|
+
- ./Gemfile.lock
|
63
|
+
- ./lib/any_view/asset_tag_helpers.rb
|
64
|
+
- ./lib/any_view/core_ext/array.rb
|
65
|
+
- ./lib/any_view/core_ext/hash.rb
|
66
|
+
- ./lib/any_view/core_ext/string.rb
|
67
|
+
- ./lib/any_view/form_builder/abstract_form_builder.rb
|
68
|
+
- ./lib/any_view/form_builder/standard_form_builder.rb
|
69
|
+
- ./lib/any_view/form_helpers.rb
|
70
|
+
- ./lib/any_view/format_helpers.rb
|
71
|
+
- ./lib/any_view/tag_helpers.rb
|
72
|
+
- ./lib/any_view/tilt_base.rb
|
73
|
+
- ./lib/any_view.rb
|
74
|
+
- ./LICENSE
|
75
|
+
- ./Rakefile
|
76
|
+
- ./README.rdoc
|
77
|
+
- ./test/fixtures/basic_form_for.erb
|
78
|
+
- ./test/fixtures/builder_type_form_for.erb
|
79
|
+
- ./test/fixtures/capture_concat.erb
|
80
|
+
- ./test/fixtures/capture_concat.haml
|
81
|
+
- ./test/fixtures/content_for.erb
|
82
|
+
- ./test/fixtures/content_for.haml
|
83
|
+
- ./test/fixtures/content_tag.erb
|
84
|
+
- ./test/fixtures/content_tag.haml
|
85
|
+
- ./test/fixtures/delete_form_for.erb
|
86
|
+
- ./test/fixtures/field_set_tag.erb
|
87
|
+
- ./test/fixtures/fields_for.erb
|
88
|
+
- ./test/fixtures/fields_for.haml
|
89
|
+
- ./test/fixtures/fields_for_basic.erb
|
90
|
+
- ./test/fixtures/fields_for_nil.erb
|
91
|
+
- ./test/fixtures/form_for.erb
|
92
|
+
- ./test/fixtures/form_for.haml
|
93
|
+
- ./test/fixtures/form_for_nil.erb
|
94
|
+
- ./test/fixtures/form_tag.erb
|
95
|
+
- ./test/fixtures/form_tag.haml
|
96
|
+
- ./test/fixtures/form_tag_methods.erb
|
97
|
+
- ./test/fixtures/form_tag_methods.haml
|
98
|
+
- ./test/fixtures/link_to.erb
|
99
|
+
- ./test/fixtures/link_to.haml
|
100
|
+
- ./test/fixtures/mail_to.erb
|
101
|
+
- ./test/fixtures/mail_to.haml
|
102
|
+
- ./test/fixtures/multipart.erb
|
103
|
+
- ./test/fixtures/multipart_form_for.erb
|
104
|
+
- ./test/fixtures/put_form_for.erb
|
105
|
+
- ./test/fixtures/standard_form_builder.erb
|
106
|
+
- ./test/helper.rb
|
107
|
+
- ./test/test_asset_tag_helpers.rb
|
108
|
+
- ./test/test_form_builder.rb
|
109
|
+
- ./test/test_form_helpers.rb
|
110
|
+
- ./test/test_format_helpers.rb
|
111
|
+
- ./test/test_tag_helpers.rb
|
112
|
+
- ./VERSION
|
110
113
|
has_rdoc: true
|
111
114
|
homepage: http://github.com/hassox/any_view
|
112
115
|
licenses: []
|
@@ -117,23 +120,27 @@ rdoc_options:
|
|
117
120
|
require_paths:
|
118
121
|
- lib
|
119
122
|
required_ruby_version: !ruby/object:Gem::Requirement
|
123
|
+
none: false
|
120
124
|
requirements:
|
121
125
|
- - ">="
|
122
126
|
- !ruby/object:Gem::Version
|
127
|
+
hash: 3
|
123
128
|
segments:
|
124
129
|
- 0
|
125
130
|
version: "0"
|
126
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
|
+
none: false
|
127
133
|
requirements:
|
128
134
|
- - ">="
|
129
135
|
- !ruby/object:Gem::Version
|
136
|
+
hash: 3
|
130
137
|
segments:
|
131
138
|
- 0
|
132
139
|
version: "0"
|
133
140
|
requirements: []
|
134
141
|
|
135
142
|
rubyforge_project:
|
136
|
-
rubygems_version: 1.3.
|
143
|
+
rubygems_version: 1.3.7
|
137
144
|
signing_key:
|
138
145
|
specification_version: 3
|
139
146
|
summary: View helpers designed to work just about anywhere
|
@@ -1,134 +0,0 @@
|
|
1
|
-
require 'tilt'
|
2
|
-
|
3
|
-
class Tilt::Template
|
4
|
-
def render_with_any_view(scope=Object.new, locals = {}, &blk)
|
5
|
-
scope.template_type = self.class if scope.respond_to?(:template_type=)
|
6
|
-
render_without_any_view(scope, locals, &blk)
|
7
|
-
end
|
8
|
-
alias_method :render_without_any_view, :render
|
9
|
-
alias_method :render, :render_with_any_view
|
10
|
-
end
|
11
|
-
|
12
|
-
[::Tilt::ERBTemplate, ::Tilt::ErubisTemplate].each do |klass|
|
13
|
-
unless klass.default_output_variable && klass.default_output_variable =~ /\@/
|
14
|
-
klass.default_output_variable = "@_outbuf"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
module AnyView
|
19
|
-
# Provides capture and concat methods for use inside templates with the Tilt gem.
|
20
|
-
module TiltBase
|
21
|
-
class Error < StandardError; end
|
22
|
-
class CaptureMethodNotFound < Error; end
|
23
|
-
class ContentMethodNotFound < Error; end
|
24
|
-
|
25
|
-
def self.included(base)
|
26
|
-
base.class_eval do
|
27
|
-
attr_writer :template_type unless self.method_defined?(:template_type=)
|
28
|
-
attr_reader :template_type unless self.method_defined?(:template_type)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
class << self
|
33
|
-
# Keeps track of the concatenation methods for each template type.
|
34
|
-
# If you have your own template types, then you should add them here
|
35
|
-
def concat_methods
|
36
|
-
@concat_methods ||= {}
|
37
|
-
end
|
38
|
-
|
39
|
-
def capture_methods
|
40
|
-
@capture_methods ||= {}
|
41
|
-
end
|
42
|
-
|
43
|
-
def capture_method_for(template)
|
44
|
-
capture_methods[template]
|
45
|
-
end
|
46
|
-
|
47
|
-
def concat_method_for(template)
|
48
|
-
concat_methods[template]
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
capture_methods[::Tilt::HamlTemplate ] = :_haml_capture
|
53
|
-
capture_methods[::Tilt::ERBTemplate ] = :_erb_capture
|
54
|
-
capture_methods[::Tilt::ErubisTemplate] = :_erb_capture
|
55
|
-
|
56
|
-
concat_methods[ ::Tilt::HamlTemplate ] = :_haml_concat
|
57
|
-
concat_methods[ ::Tilt::ERBTemplate ] = :_erb_concat
|
58
|
-
concat_methods[ ::Tilt::ErubisTemplate] = :_erb_concat
|
59
|
-
|
60
|
-
def capture_content(*args, &blk)
|
61
|
-
opts = args.extract_options!
|
62
|
-
# opts[:template_type] ||= template_type
|
63
|
-
capture_method = AnyView::TiltBase.capture_method_for(template_type)
|
64
|
-
|
65
|
-
raise CaptureMethodNotFound, "Capture Method not found for Template Type: #{opts[:template_type].inspect}" unless capture_method
|
66
|
-
send(capture_method, *args, &blk)
|
67
|
-
end
|
68
|
-
|
69
|
-
def concat_content(string, opts = {})
|
70
|
-
#opts[:template_type] ||= template_type
|
71
|
-
concat_method = AnyView::TiltBase.concat_method_for(template_type)
|
72
|
-
|
73
|
-
raise ConcatMethodNotFound, "Concat Method not found for Template Type: #{opts[:template_type].inspect}" unless concat_method
|
74
|
-
send(concat_method, string)
|
75
|
-
end
|
76
|
-
|
77
|
-
def _haml_capture(*args, &block)
|
78
|
-
with_haml_buffer(Haml::Buffer.new(nil, :encoding => "UTF-8")) do
|
79
|
-
capture_haml(*args, &block)
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
def _erb_capture(*args, &block)
|
84
|
-
_saved_buffer = _erb_buffer
|
85
|
-
_set_erb_buffer ''
|
86
|
-
|
87
|
-
block.call(*args)
|
88
|
-
|
89
|
-
ret = _erb_buffer
|
90
|
-
_set_erb_buffer _saved_buffer
|
91
|
-
ret
|
92
|
-
end
|
93
|
-
|
94
|
-
def _erubis_capture(*args, &block)
|
95
|
-
_saved_buffer = _erubis_buffer
|
96
|
-
_set_erubis_buffer = ''
|
97
|
-
|
98
|
-
block.call(*args)
|
99
|
-
|
100
|
-
ret = _erb_buffer
|
101
|
-
_set_erubis_buffer _saved_buffer
|
102
|
-
end
|
103
|
-
|
104
|
-
def _haml_concat(string)
|
105
|
-
haml_concat(string)
|
106
|
-
end
|
107
|
-
|
108
|
-
def _erb_concat(string)
|
109
|
-
_erb_buffer << string
|
110
|
-
end
|
111
|
-
|
112
|
-
private
|
113
|
-
def _set_erb_buffer(new_buffer)
|
114
|
-
outvar = ::Tilt::ERBTemplate.default_output_variable
|
115
|
-
instance_variable_set(outvar, new_buffer)
|
116
|
-
end
|
117
|
-
|
118
|
-
def _erb_buffer
|
119
|
-
outvar = Tilt::ERBTemplate.default_output_variable
|
120
|
-
instance_variable_get(outvar)
|
121
|
-
end
|
122
|
-
|
123
|
-
def _set_erubis_buffer(new_buffer)
|
124
|
-
outvar = Tilt::ErubisTemplate.default_output_variable
|
125
|
-
instance_variable_set(outvar, new_buffer)
|
126
|
-
end
|
127
|
-
|
128
|
-
def _erubis_buffer
|
129
|
-
outvar = ::Tile::ErubisTemplate.default_output_variable
|
130
|
-
instance_variable_get(outvar)
|
131
|
-
end
|
132
|
-
end
|
133
|
-
end
|
134
|
-
|
Binary file
|
Binary file
|