r3_plugin_toolbox 0.3.13 → 0.3.14
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +4 -0
- data/Rakefile +2 -1
- data/VERSION +1 -1
- data/lib/r3_plugin_toolbox.rb +1 -0
- data/lib/r3_plugin_toolbox/extender.rb +6 -4
- data/lib/r3_plugin_toolbox/macro.rb +7 -1
- data/r3_plugin_toolbox.gemspec +5 -2
- data/spec/r3_plugin_toolbox/extender/extender_macro_view_spec.rb +5 -1
- metadata +18 -3
data/README.markdown
CHANGED
data/Rakefile
CHANGED
@@ -10,7 +10,8 @@ begin
|
|
10
10
|
|
11
11
|
gem.add_development_dependency "rspec", "~> 2.0.0.beta.22"
|
12
12
|
gem.add_dependency "rails", "~> 3.0.0"
|
13
|
-
gem.add_dependency "require_all", "~> 1.2.0"
|
13
|
+
gem.add_dependency "require_all", "~> 1.2.0"
|
14
|
+
gem.add_dependency "sugar-high", "~> 0.2.11"
|
14
15
|
|
15
16
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
16
17
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.14
|
data/lib/r3_plugin_toolbox.rb
CHANGED
@@ -25,15 +25,17 @@ module Rails3
|
|
25
25
|
end
|
26
26
|
|
27
27
|
# convenience method to extend with multiple modules all within the same base module
|
28
|
-
def extend_from_module base_name, *module_names
|
29
|
-
|
28
|
+
def extend_from_module base_name, *module_names
|
29
|
+
options = last_option(module_names)
|
30
|
+
raise ArgumentError, "You must specify an options Hash as the last argument for #extend_from_module" if !options || !options.kind_of?(Hash)
|
30
31
|
module_names.each do |name|
|
31
32
|
extend_with get_constant(base_name, name), options
|
32
33
|
end
|
33
34
|
end
|
34
35
|
|
35
|
-
def extend_with *module_names
|
36
|
-
|
36
|
+
def extend_with *module_names
|
37
|
+
options = last_option(module_names)
|
38
|
+
raise ArgumentError, "You must specify an options Hash as the last argument for #extend_with" if !options || !options.kind_of?(Hash)
|
37
39
|
type = options[:in]
|
38
40
|
raise ArgumentError, "You must specify an :in option to indicate which Rails 3 component base class to extend with #{module_names}" if !type
|
39
41
|
module_names.each do |name|
|
data/r3_plugin_toolbox.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{r3_plugin_toolbox}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.14"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Kristian Mandrup"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-10-03}
|
13
13
|
s.description = %q{Provides a more intuitive DSL for Rails 3 plugin configuration and a specialized RSpec 2 matcher. Makes it much easier to develop Rails 3 plugins!}
|
14
14
|
s.email = %q{kmandrup@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -80,15 +80,18 @@ Gem::Specification.new do |s|
|
|
80
80
|
s.add_development_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
|
81
81
|
s.add_runtime_dependency(%q<rails>, ["~> 3.0.0"])
|
82
82
|
s.add_runtime_dependency(%q<require_all>, ["~> 1.2.0"])
|
83
|
+
s.add_runtime_dependency(%q<sugar-high>, ["~> 0.2.11"])
|
83
84
|
else
|
84
85
|
s.add_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
|
85
86
|
s.add_dependency(%q<rails>, ["~> 3.0.0"])
|
86
87
|
s.add_dependency(%q<require_all>, ["~> 1.2.0"])
|
88
|
+
s.add_dependency(%q<sugar-high>, ["~> 0.2.11"])
|
87
89
|
end
|
88
90
|
else
|
89
91
|
s.add_dependency(%q<rspec>, ["~> 2.0.0.beta.22"])
|
90
92
|
s.add_dependency(%q<rails>, ["~> 3.0.0"])
|
91
93
|
s.add_dependency(%q<require_all>, ["~> 1.2.0"])
|
94
|
+
s.add_dependency(%q<sugar-high>, ["~> 0.2.11"])
|
92
95
|
end
|
93
96
|
end
|
94
97
|
|
@@ -64,7 +64,11 @@ describe Rails3::Plugin::Extender do
|
|
64
64
|
end
|
65
65
|
|
66
66
|
it "should extend Action View" do
|
67
|
-
after_init :view do
|
67
|
+
after_init :view do
|
68
|
+
Rails3.with_configuration do
|
69
|
+
greeting = 'hello'
|
70
|
+
end
|
71
|
+
|
68
72
|
puts "View initialized!"
|
69
73
|
|
70
74
|
:view.should be_extended_with Helper::View, :panel, :window, :button, :form
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 3
|
8
|
-
-
|
9
|
-
version: 0.3.
|
8
|
+
- 14
|
9
|
+
version: 0.3.14
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Kristian Mandrup
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-10-03 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -64,6 +64,21 @@ dependencies:
|
|
64
64
|
version: 1.2.0
|
65
65
|
type: :runtime
|
66
66
|
version_requirements: *id003
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: sugar-high
|
69
|
+
prerelease: false
|
70
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
segments:
|
76
|
+
- 0
|
77
|
+
- 2
|
78
|
+
- 11
|
79
|
+
version: 0.2.11
|
80
|
+
type: :runtime
|
81
|
+
version_requirements: *id004
|
67
82
|
description: Provides a more intuitive DSL for Rails 3 plugin configuration and a specialized RSpec 2 matcher. Makes it much easier to develop Rails 3 plugins!
|
68
83
|
email: kmandrup@gmail.com
|
69
84
|
executables: []
|