widgets 0.1.2 → 0.1.3

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.
@@ -1,3 +1,5 @@
1
+ require 'guid'
2
+
1
3
  module ApplicationHelper
2
4
  def widget(name, options={}, &block)
3
5
  id = Guid.new.to_s
@@ -0,0 +1,16 @@
1
+ module ApplicationHelper
2
+ def widget(name, options={}, &block)
3
+ id = Guid.new.to_s
4
+ partial = File.join 'widgets', name.to_s
5
+ attributes = {:id => id, :'data-widget' => name, :style => options.delete(:style), :class => options.delete(:effects)}
6
+ options[:widget_id] = id unless options.include? :widget_id
7
+
8
+ contents = if block_given?
9
+ render :layout => partial, :inline => capture(&block), :locals => options, :formats => [:html]
10
+ else
11
+ render :template => partial, :locals => options
12
+ end
13
+
14
+ content_tag :div, contents, attributes
15
+ end
16
+ end
@@ -1,3 +1,3 @@
1
1
  module Widgets
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
@@ -0,0 +1,3 @@
1
+ module Widgets
2
+ VERSION = '0.1.2'
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: widgets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-05 00:00:00.000000000 Z
12
+ date: 2013-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: guid
@@ -115,8 +115,10 @@ extensions: []
115
115
  extra_rdoc_files: []
116
116
  files:
117
117
  - app/helpers/application_helper.rb
118
+ - app/helpers/application_helper.rb~
118
119
  - lib/tasks/widgets_tasks.rake
119
120
  - lib/widgets/version.rb
121
+ - lib/widgets/version.rb~
120
122
  - lib/widgets.rb
121
123
  - MIT-LICENSE
122
124
  - Rakefile