apotomo 0.1.3 → 0.1.4

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/Gemfile CHANGED
@@ -3,7 +3,7 @@ source "http://rubygems.org"
3
3
  gem "rails", "~> 2.3.8"
4
4
  gem "cells", "3.3.4"
5
5
  gem "onfire"
6
- gem "hooks", "~> 0.1"
6
+ gem "hooks", "~> 0.1.2"
7
7
  gem "jeweler"
8
8
 
9
9
  # for test env:
data/Gemfile.lock CHANGED
@@ -14,8 +14,7 @@ GEM
14
14
  cells (3.3.4)
15
15
  gemcutter (0.6.1)
16
16
  git (1.2.5)
17
- hooks (0.1)
18
- activesupport (>= 2.3.0)
17
+ hooks (0.1.2)
19
18
  jeweler (1.4.0)
20
19
  gemcutter (>= 0.1.0)
21
20
  git (>= 1.2.5)
@@ -42,7 +41,7 @@ PLATFORMS
42
41
 
43
42
  DEPENDENCIES
44
43
  cells (= 3.3.4)
45
- hooks (~> 0.1)
44
+ hooks (~> 0.1.2)
46
45
  jeweler
47
46
  mocha
48
47
  onfire
data/Rakefile CHANGED
@@ -30,12 +30,12 @@ Jeweler::Tasks.new do |spec|
30
30
  spec.authors = ["Nick Sutterer"]
31
31
  spec.email = "apotonick@gmail.com"
32
32
 
33
- spec.files = FileList["[A-Z]*", File.join(*%w[{generators,lib,rails,app,config} ** *]).to_s]
33
+ spec.files = FileList["app/.jeweler_doesnt_like_empty_directories", "[A-Z]*", File.join(*%w[{generators,lib,rails,app,config} ** *]).to_s]
34
34
 
35
35
  spec.add_dependency 'cells', '~> 3.3'
36
36
  spec.add_dependency 'activesupport', '>= 2.3.0'
37
37
  spec.add_dependency 'onfire', '>= 0.1.0'
38
- spec.add_dependency 'hooks', '~> 0.1'
38
+ spec.add_dependency 'hooks', '~> 0.1.2'
39
39
  end
40
40
 
41
41
  Jeweler::GemcutterTasks.new
File without changes
@@ -46,7 +46,7 @@ module TreeNode
46
46
  @children << child
47
47
  child.parent = self
48
48
 
49
- child.run_hook :after_add, child, self
49
+ child.run_widget_hook(:after_add, child, self)
50
50
  child
51
51
  end
52
52
 
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Apotomo
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
5
5
  end
@@ -35,9 +35,9 @@ module Apotomo
35
35
  attr_writer :controller
36
36
  attr_accessor :version
37
37
 
38
- class << self
39
- include WidgetShortcuts
40
- end
38
+ #class << self
39
+ # include WidgetShortcuts
40
+ #end
41
41
 
42
42
  include TreeNode
43
43
 
@@ -51,10 +51,14 @@ module Apotomo
51
51
  helper Apotomo::Rails::ViewHelper
52
52
 
53
53
 
54
+ # Runs callbacks for +name+ hook in instance context.
55
+ def run_widget_hook(name, *args)
56
+ self.class.callbacks_for_hook(name).each { |blk| instance_exec(*args, &blk) }
57
+ end
54
58
 
55
59
 
56
60
  def add_has_widgets_blocks(*)
57
- run_hook :has_widgets, self
61
+ run_widget_hook(:has_widgets, self)
58
62
  end
59
63
  after_initialize :add_has_widgets_blocks
60
64
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apotomo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Nick Sutterer
@@ -73,11 +73,12 @@ dependencies:
73
73
  requirements:
74
74
  - - ~>
75
75
  - !ruby/object:Gem::Version
76
- hash: 9
76
+ hash: 31
77
77
  segments:
78
78
  - 0
79
79
  - 1
80
- version: "0.1"
80
+ - 2
81
+ version: 0.1.2
81
82
  type: :runtime
82
83
  version_requirements: *id004
83
84
  description: A generic widget framework for Rails. Event-driven. Clean. Fast. Free optional statefulness included.
@@ -97,6 +98,7 @@ files:
97
98
  - README.rdoc
98
99
  - Rakefile
99
100
  - TODO
101
+ - app/.jeweler_doesnt_like_empty_directories
100
102
  - config/routes.rb
101
103
  - generators/widget/USAGE
102
104
  - generators/widget/templates/functional_test.rb