active-component 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_component.rb +1 -1
- data/lib/active_component/base.rb +2 -2
- data/lib/active_component/renderable.rb +1 -3
- data/lib/active_component/version.rb +1 -1
- data/test/sinatra_test.rb +17 -0
- data/test/support/foo_sinatra.rb +7 -0
- data/test/test_helper.rb +1 -0
- metadata +30 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba4d45308921a66f144f54aeceb3cda1a874d72e
|
4
|
+
data.tar.gz: b3eec18c5050fc9ed0eb4fec26f3b9d2420c6ced
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30a90132c878f34a78536f9181fdfcd3b5302ce416bedc454a1a0b91750fcb3e1bcbe0579cf5fb2fcdb2d9fecd13aabd76f409cf1f59a72a5913a4f8290ad484
|
7
|
+
data.tar.gz: 8e75888dc8938f024e956703c33e6ee79a36c9cb8837283dc0e0d385d9296be89e45ca4a8be916ed7c38638081ad11d9079b5ed9fe67f7cd2996b5d06a6a059c
|
data/lib/active_component.rb
CHANGED
@@ -12,7 +12,7 @@ module ActiveComponent
|
|
12
12
|
# the application in order to allow this class to interact with
|
13
13
|
# the rails conventions, especially with the asset pipeline.
|
14
14
|
#
|
15
|
-
include ActionView::Helpers::DateHelper
|
15
|
+
include ActionView::Helpers::DateHelper if defined?(ActionView)
|
16
16
|
include ActiveComponent::Renderable
|
17
17
|
#
|
18
18
|
# Whenever the user creates a new object from a class inherited
|
@@ -36,7 +36,7 @@ module ActiveComponent
|
|
36
36
|
#
|
37
37
|
def initialize(args = {})
|
38
38
|
assign_variables args
|
39
|
-
@controller = ActiveComponent.get_controller
|
39
|
+
@controller = ActiveComponent.get_controller if defined?(Rails)
|
40
40
|
end
|
41
41
|
|
42
42
|
def assign_variables(args)
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'active_support/concern'
|
2
|
-
|
3
1
|
#
|
4
2
|
# This provides a clean implementation for rendering your template
|
5
3
|
# inside your view.
|
@@ -64,4 +62,4 @@ module ActiveComponent
|
|
64
62
|
end
|
65
63
|
end
|
66
64
|
|
67
|
-
ActionView::Base.send(:include, ActiveComponent::Renderable)
|
65
|
+
ActionView::Base.send(:include, ActiveComponent::Renderable) if defined?(ActionView)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'rack/test'
|
3
|
+
|
4
|
+
class SinatraTest < Test::Unit::TestCase
|
5
|
+
include Rack::Test::Methods
|
6
|
+
|
7
|
+
def app
|
8
|
+
FooSinatra
|
9
|
+
end
|
10
|
+
|
11
|
+
def test_includes_render_component
|
12
|
+
get '/'
|
13
|
+
assert last_response.ok?
|
14
|
+
assert_equal '<div>Hello</div>world!', last_response.body
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active-component
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antonio Chavez
|
@@ -9,30 +9,30 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-10-
|
12
|
+
date: 2013-10-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
15
|
+
name: mustache
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
18
|
- - '>='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: '0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '>='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: '0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
|
-
name:
|
29
|
+
name: sqlite3
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
32
|
- - '>='
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '0'
|
35
|
-
type: :
|
35
|
+
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
|
-
name:
|
43
|
+
name: faker
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - '>='
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
|
-
name:
|
57
|
+
name: pry
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - '>='
|
@@ -68,7 +68,7 @@ dependencies:
|
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
|
-
name:
|
71
|
+
name: mocha
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
74
|
- - '>='
|
@@ -82,7 +82,7 @@ dependencies:
|
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
|
-
name:
|
85
|
+
name: coveralls
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
88
|
- - '>='
|
@@ -96,7 +96,21 @@ dependencies:
|
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
|
-
name:
|
99
|
+
name: sinatra
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - '>='
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - '>='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: rails
|
100
114
|
requirement: !ruby/object:Gem::Requirement
|
101
115
|
requirements:
|
102
116
|
- - '>='
|
@@ -136,8 +150,10 @@ files:
|
|
136
150
|
- test/active_component_test.rb
|
137
151
|
- test/dummy/application.rb
|
138
152
|
- test/generators/component_generator_test.rb
|
153
|
+
- test/sinatra_test.rb
|
139
154
|
- test/support/foo_component.rb
|
140
155
|
- test/support/foo_controller.rb
|
156
|
+
- test/support/foo_sinatra.rb
|
141
157
|
- test/test_helper.rb
|
142
158
|
homepage: https://github.com/TheNaoX/active_component
|
143
159
|
licenses:
|
@@ -171,7 +187,9 @@ test_files:
|
|
171
187
|
- test/active_component_test.rb
|
172
188
|
- test/dummy/application.rb
|
173
189
|
- test/generators/component_generator_test.rb
|
190
|
+
- test/sinatra_test.rb
|
174
191
|
- test/support/foo_component.rb
|
175
192
|
- test/support/foo_controller.rb
|
193
|
+
- test/support/foo_sinatra.rb
|
176
194
|
- test/test_helper.rb
|
177
195
|
has_rdoc:
|