action_widget 0.3.2 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
10
10
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
11
11
  gem.name = "action_widget"
12
12
  gem.require_paths = ["lib"]
13
- gem.version = "0.3.2"
14
-
13
+ gem.version = "0.4.0"
14
+
15
15
  gem.add_dependency 'smart_properties', '~> 1.1'
16
16
  end
@@ -2,22 +2,21 @@ require 'smart_properties'
2
2
 
3
3
  module ActionWidget
4
4
  class Base
5
-
6
5
  include SmartProperties
7
-
8
- def render_in_context(view_context, &block)
9
- @view = view_context
10
- render(&block)
6
+
7
+ def initialize(view, *args)
8
+ @view = view
9
+ super(*args)
11
10
  end
12
-
11
+
13
12
  def render
14
13
  raise NotImplementedError, "#{self.class} must implement #render"
15
14
  end
16
-
15
+
17
16
  protected
18
-
17
+
19
18
  attr_reader :view
20
-
19
+
21
20
  undef :capture if method_defined?(:capture)
22
21
 
23
22
  def method_missing(method, *args, &block)
@@ -26,6 +25,7 @@ module ActionWidget
26
25
  # Double check - the NoMethodError might have occurred somewhere else.
27
26
  view.respond_to?(method) ? raise : super
28
27
  end
29
-
28
+
30
29
  end
31
- end
30
+ end
31
+
@@ -1,9 +1,9 @@
1
1
  module ActionWidget
2
2
  module ViewHelper
3
-
3
+
4
4
  def method_missing(name, *args, &block)
5
5
  super unless name =~ /_widget$/
6
-
6
+
7
7
  klass = begin
8
8
  @_action_widget_class_cache = {}
9
9
  @_action_widget_class_cache[name] = "#{name.to_s.camelcase}".constantize
@@ -12,9 +12,10 @@ module ActionWidget
12
12
  rescue LoadError => e
13
13
  super
14
14
  end
15
-
16
- klass.new(*args).render_in_context(self, &block)
15
+
16
+ klass.new(self, *args).render(&block)
17
17
  end
18
18
 
19
19
  end
20
- end
20
+ end
21
+
metadata CHANGED
@@ -1,32 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_widget
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
5
4
  prerelease:
5
+ version: 0.4.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Konstantin Tennhard
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-10 00:00:00.000000000 Z
12
+ date: 2012-12-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: smart_properties
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
15
+ version_requirements: !ruby/object:Gem::Requirement
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
21
19
  version: '1.1'
20
+ none: false
21
+ name: smart_properties
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
24
+ requirement: !ruby/object:Gem::Requirement
26
25
  requirements:
27
26
  - - ~>
28
27
  - !ruby/object:Gem::Version
29
28
  version: '1.1'
29
+ none: false
30
30
  description:
31
31
  email:
32
32
  - me@t6d.de
@@ -57,17 +57,17 @@ rdoc_options: []
57
57
  require_paths:
58
58
  - lib
59
59
  required_ruby_version: !ruby/object:Gem::Requirement
60
- none: false
61
60
  requirements:
62
61
  - - ! '>='
63
62
  - !ruby/object:Gem::Version
64
63
  version: '0'
65
- required_rubygems_version: !ruby/object:Gem::Requirement
66
64
  none: false
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
66
  requirements:
68
67
  - - ! '>='
69
68
  - !ruby/object:Gem::Version
70
69
  version: '0'
70
+ none: false
71
71
  requirements: []
72
72
  rubyforge_project:
73
73
  rubygems_version: 1.8.24
@@ -75,3 +75,4 @@ signing_key:
75
75
  specification_version: 3
76
76
  summary: Reusable view components for your Ruby web application
77
77
  test_files: []
78
+ has_rdoc: