storefront 0.2.8 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +2 -2
- data/lib/storefront/helpers/widget_helper.rb +9 -2
- metadata +2 -2
data/Rakefile
CHANGED
@@ -5,9 +5,9 @@ require 'rake/gempackagetask'
|
|
5
5
|
spec = Gem::Specification.new do |s|
|
6
6
|
s.name = "storefront"
|
7
7
|
s.authors = ["Lance Pollard"]
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
9
9
|
s.description = "Semantic HTML5 for Rails"
|
10
|
-
s.summary = "
|
10
|
+
s.summary = "A simple and semantic FormBuilder, TableBuilder, Locale Interpolator, and Widget API for Rails 3"
|
11
11
|
s.homepage = "http://github.com/viatropos/storefront"
|
12
12
|
s.email = "lancejpollard@gmail.com"
|
13
13
|
s.rubyforge_project = "storefront"
|
@@ -2,12 +2,13 @@ module Storefront
|
|
2
2
|
module WidgetHelper
|
3
3
|
def widget(*args, &block)
|
4
4
|
options = args.extract_options!
|
5
|
-
|
5
|
+
path = args.shift
|
6
|
+
name = path.to_s.gsub("/", "_")
|
6
7
|
|
7
8
|
if self.respond_to?("#{name}_widget")
|
8
9
|
send("#{name}_widget", name, options, &block)
|
9
10
|
else
|
10
|
-
raise "Please
|
11
|
+
raise "Please define a helper method 'def #{name}_widget(*args)'"
|
11
12
|
end
|
12
13
|
end
|
13
14
|
|
@@ -107,6 +108,12 @@ module Storefront
|
|
107
108
|
end
|
108
109
|
|
109
110
|
protected
|
111
|
+
def render_widget_partial(name, *args)
|
112
|
+
path = name.is_a?(::Symbol) ? ::File.join(storefront_config.widgets_path, name.to_s) : name.to_s
|
113
|
+
locals = args.extract_options!.merge(:yielded_content => block_given? ? capture(&block) : nil)
|
114
|
+
render :partial => path, :locals => locals
|
115
|
+
end
|
116
|
+
|
110
117
|
def widget_options(type, *args)
|
111
118
|
options = args.extract_options!
|
112
119
|
key = args.shift
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: storefront
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.3.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Lance Pollard
|
@@ -115,6 +115,6 @@ rubyforge_project: storefront
|
|
115
115
|
rubygems_version: 1.7.2
|
116
116
|
signing_key:
|
117
117
|
specification_version: 3
|
118
|
-
summary:
|
118
|
+
summary: A simple and semantic FormBuilder, TableBuilder, Locale Interpolator, and Widget API for Rails 3
|
119
119
|
test_files: []
|
120
120
|
|