active_component 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +4 -0
- data/.rspec +1 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +30 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +65 -0
- data/Rakefile +52 -0
- data/VERSION +1 -0
- data/active_component.gemspec +104 -0
- data/init.rb +1 -0
- data/lib/active_component.rb +196 -0
- data/lib/active_component/base.rb +930 -0
- data/lib/active_component/components/block.rb +20 -0
- data/lib/active_component/components/empty_tag.rb +26 -0
- data/lib/active_component/components/heading.rb +60 -0
- data/lib/active_component/components/inline_tag.rb +24 -0
- data/lib/active_component/components/section.rb +39 -0
- data/lib/active_component/components/table.rb +61 -0
- data/lib/active_component/config.rb +33 -0
- data/lib/active_component/core_extensions.rb +99 -0
- data/lib/active_component/template_handler.rb +20 -0
- data/pkg/active_component-0.1.2.gem +0 -0
- data/spec/active_component_spec.rb +156 -0
- data/spec/active_component_spec_helper.rb +10 -0
- data/spec/base_spec.rb +154 -0
- data/spec/components/block_spec.rb +51 -0
- data/spec/components/heading_spec.rb +95 -0
- data/spec/components/section_spec.rb +35 -0
- data/spec/components/table_spec.rb +88 -0
- data/spec/core_extensions_spec.rb +62 -0
- data/spec/factories.rb +23 -0
- data/spec/rcov.opts +2 -0
- data/spec/spec.opts +4 -0
- data/spec/spec_helper.rb +15 -0
- metadata +166 -0
data/spec/factories.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
class Thing
|
4
|
+
attr_accessor :name, :color
|
5
|
+
|
6
|
+
def attributes
|
7
|
+
attr = ActiveSupport::OrderedHash.new
|
8
|
+
attr[:name] = name
|
9
|
+
attr[:color] = color
|
10
|
+
attr
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
Factory.define :thing do |t|
|
15
|
+
t.name "Thingamabob"
|
16
|
+
t.color :yellow
|
17
|
+
end
|
18
|
+
|
19
|
+
Factory.define :component_base, :class => ActiveComponent::Base do; end
|
20
|
+
|
21
|
+
class GreetingBox < ActiveComponent::Base
|
22
|
+
attr_accessor :content, :title, :attributes
|
23
|
+
end
|
data/spec/rcov.opts
ADDED
data/spec/spec.opts
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
4
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
5
|
+
require 'rspec'
|
6
|
+
require 'active_component_spec_helper'
|
7
|
+
|
8
|
+
# Requires supporting files with custom matchers and macros, etc,
|
9
|
+
# in ./support/ and its subdirectories.
|
10
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
11
|
+
|
12
|
+
RSpec.configure do |c|
|
13
|
+
c.filter_run :focus => true
|
14
|
+
c.run_all_when_everything_filtered = true
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,166 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: active_component
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.1.2
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Christian Peters
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-01-03 00:00:00 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: activesupport
|
17
|
+
prerelease: false
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
type: :runtime
|
25
|
+
version_requirements: *id001
|
26
|
+
- !ruby/object:Gem::Dependency
|
27
|
+
name: haml
|
28
|
+
prerelease: false
|
29
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
|
+
none: false
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: "0"
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id002
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: rspec
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 2.3.0
|
46
|
+
type: :development
|
47
|
+
version_requirements: *id003
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: bundler
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ~>
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 1.0.0
|
57
|
+
type: :development
|
58
|
+
version_requirements: *id004
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: jeweler
|
61
|
+
prerelease: false
|
62
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ~>
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: 1.5.2
|
68
|
+
type: :development
|
69
|
+
version_requirements: *id005
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: haml
|
72
|
+
prerelease: false
|
73
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: "0"
|
79
|
+
type: :runtime
|
80
|
+
version_requirements: *id006
|
81
|
+
description: |-
|
82
|
+
Active Component introduces components into your Rails presentation layer.
|
83
|
+
The use of components improves consistency and development speed through reuse and a new way of view code organization.
|
84
|
+
Components are plain Ruby classes that are able to render themselves using a to_html method.
|
85
|
+
Active Component provides several means that make it easy to write and use components.
|
86
|
+
email: christian.peters@zweitag.de
|
87
|
+
executables: []
|
88
|
+
|
89
|
+
extensions: []
|
90
|
+
|
91
|
+
extra_rdoc_files:
|
92
|
+
- LICENSE.txt
|
93
|
+
- README.rdoc
|
94
|
+
files:
|
95
|
+
- .document
|
96
|
+
- .rspec
|
97
|
+
- Gemfile
|
98
|
+
- Gemfile.lock
|
99
|
+
- LICENSE.txt
|
100
|
+
- README.rdoc
|
101
|
+
- Rakefile
|
102
|
+
- VERSION
|
103
|
+
- active_component.gemspec
|
104
|
+
- init.rb
|
105
|
+
- lib/active_component.rb
|
106
|
+
- lib/active_component/base.rb
|
107
|
+
- lib/active_component/components/block.rb
|
108
|
+
- lib/active_component/components/empty_tag.rb
|
109
|
+
- lib/active_component/components/heading.rb
|
110
|
+
- lib/active_component/components/inline_tag.rb
|
111
|
+
- lib/active_component/components/section.rb
|
112
|
+
- lib/active_component/components/table.rb
|
113
|
+
- lib/active_component/config.rb
|
114
|
+
- lib/active_component/core_extensions.rb
|
115
|
+
- lib/active_component/template_handler.rb
|
116
|
+
- pkg/active_component-0.1.2.gem
|
117
|
+
- spec/active_component_spec.rb
|
118
|
+
- spec/active_component_spec_helper.rb
|
119
|
+
- spec/base_spec.rb
|
120
|
+
- spec/components/block_spec.rb
|
121
|
+
- spec/components/heading_spec.rb
|
122
|
+
- spec/components/section_spec.rb
|
123
|
+
- spec/components/table_spec.rb
|
124
|
+
- spec/core_extensions_spec.rb
|
125
|
+
- spec/factories.rb
|
126
|
+
- spec/rcov.opts
|
127
|
+
- spec/spec.opts
|
128
|
+
- spec/spec_helper.rb
|
129
|
+
homepage: http://github.com/ChristianPeters/activecomponent
|
130
|
+
licenses:
|
131
|
+
- MIT
|
132
|
+
post_install_message:
|
133
|
+
rdoc_options: []
|
134
|
+
|
135
|
+
require_paths:
|
136
|
+
- lib
|
137
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
138
|
+
none: false
|
139
|
+
requirements:
|
140
|
+
- - ">="
|
141
|
+
- !ruby/object:Gem::Version
|
142
|
+
version: "0"
|
143
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
144
|
+
none: false
|
145
|
+
requirements:
|
146
|
+
- - ">="
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: "0"
|
149
|
+
requirements: []
|
150
|
+
|
151
|
+
rubyforge_project:
|
152
|
+
rubygems_version: 1.8.7
|
153
|
+
signing_key:
|
154
|
+
specification_version: 3
|
155
|
+
summary: Build your views by assembling self-rendering components
|
156
|
+
test_files:
|
157
|
+
- spec/active_component_spec.rb
|
158
|
+
- spec/active_component_spec_helper.rb
|
159
|
+
- spec/base_spec.rb
|
160
|
+
- spec/components/block_spec.rb
|
161
|
+
- spec/components/heading_spec.rb
|
162
|
+
- spec/components/section_spec.rb
|
163
|
+
- spec/components/table_spec.rb
|
164
|
+
- spec/core_extensions_spec.rb
|
165
|
+
- spec/factories.rb
|
166
|
+
- spec/spec_helper.rb
|