compony 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/Gemfile.lock +3 -3
- data/README.md +1397 -33
- data/Rakefile +6 -2
- data/TODO.md +1 -0
- data/VERSION +1 -0
- data/app/controllers/compony_controller.rb +3 -1
- data/compony.gemspec +7 -7
- data/config/locales/fr.yml +33 -0
- data/doc/ComponentGenerator.html +231 -0
- data/doc/Components.html +105 -0
- data/doc/ComponentsGenerator.html +203 -0
- data/doc/Compony/Component.html +2098 -0
- data/doc/Compony/ComponentMixins/Default/Labelling.html +406 -0
- data/doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html +539 -0
- data/doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html +588 -0
- data/doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html +577 -0
- data/doc/Compony/ComponentMixins/Default/Standalone.html +692 -0
- data/doc/Compony/ComponentMixins/Default.html +126 -0
- data/doc/Compony/ComponentMixins/Resourceful.html +1193 -0
- data/doc/Compony/ComponentMixins.html +126 -0
- data/doc/Compony/Components/Button.html +293 -0
- data/doc/Compony/Components/Destroy.html +384 -0
- data/doc/Compony/Components/Edit.html +462 -0
- data/doc/Compony/Components/Form.html +1112 -0
- data/doc/Compony/Components/New.html +462 -0
- data/doc/Compony/Components/WithForm.html +528 -0
- data/doc/Compony/Components.html +126 -0
- data/doc/Compony/ControllerMixin.html +136 -0
- data/doc/Compony/Engine.html +133 -0
- data/doc/Compony/MethodAccessibleHash.html +453 -0
- data/doc/Compony/ModelFields/Anchormodel.html +383 -0
- data/doc/Compony/ModelFields/Association.html +613 -0
- data/doc/Compony/ModelFields/Attachment.html +305 -0
- data/doc/Compony/ModelFields/Base.html +1066 -0
- data/doc/Compony/ModelFields/Boolean.html +232 -0
- data/doc/Compony/ModelFields/Color.html +299 -0
- data/doc/Compony/ModelFields/Currency.html +232 -0
- data/doc/Compony/ModelFields/Date.html +232 -0
- data/doc/Compony/ModelFields/Datetime.html +232 -0
- data/doc/Compony/ModelFields/Decimal.html +154 -0
- data/doc/Compony/ModelFields/Email.html +240 -0
- data/doc/Compony/ModelFields/Float.html +154 -0
- data/doc/Compony/ModelFields/Integer.html +154 -0
- data/doc/Compony/ModelFields/Percentage.html +232 -0
- data/doc/Compony/ModelFields/Phone.html +301 -0
- data/doc/Compony/ModelFields/RichText.html +232 -0
- data/doc/Compony/ModelFields/String.html +154 -0
- data/doc/Compony/ModelFields/Text.html +154 -0
- data/doc/Compony/ModelFields/Time.html +154 -0
- data/doc/Compony/ModelFields/Url.html +240 -0
- data/doc/Compony/ModelFields.html +126 -0
- data/doc/Compony/ModelMixin.html +524 -0
- data/doc/Compony/RequestContext.html +791 -0
- data/doc/Compony/Version.html +139 -0
- data/doc/Compony/ViewHelpers.html +443 -0
- data/doc/Compony.html +2156 -0
- data/doc/ComponyController.html +124 -0
- data/doc/_index.html +569 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +497 -0
- data/doc/file.README.html +1565 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/imgs/intro-example-destroy.png +0 -0
- data/doc/imgs/intro-example-edit.png +0 -0
- data/doc/imgs/intro-example-index.png +0 -0
- data/doc/imgs/intro-example-new.png +0 -0
- data/doc/imgs/intro-example-show.png +0 -0
- data/doc/index.html +1565 -0
- data/doc/js/app.js +314 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +1435 -0
- data/doc/resourceful_lifecycle.png +0 -0
- data/doc/top-level-namespace.html +112 -0
- data/lib/compony/component.rb +2 -1
- data/lib/compony/component_mixins/default/standalone/resourceful_verb_dsl.rb +1 -1
- data/lib/compony/component_mixins/default/standalone/standalone_dsl.rb +14 -3
- data/lib/compony/component_mixins/default/standalone/verb_dsl.rb +14 -5
- data/lib/compony/component_mixins/default/standalone.rb +10 -3
- data/lib/compony/components/form.rb +6 -1
- data/lib/compony/components/with_form.rb +14 -1
- data/lib/compony/model_fields/anchormodel.rb +0 -22
- data/lib/compony/model_mixin.rb +12 -2
- data/lib/compony/version.rb +1 -7
- data/logo.svg +133 -0
- metadata +83 -6
data/Rakefile
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
2
|
require_relative 'lib/compony/version'
|
3
3
|
|
4
|
+
File.open('VERSION', 'w') { |f| f.puts(Compony::Version::LABEL) }
|
5
|
+
|
4
6
|
task :gemspec do
|
5
7
|
specification = Gem::Specification.new do |s|
|
6
8
|
s.name = 'compony'
|
7
9
|
s.version = Compony::Version::LABEL
|
8
10
|
s.author = ['Sandro Kalbermatter', 'contributors']
|
9
|
-
s.summary = '
|
11
|
+
s.summary = 'Compony is a Gem that allows you to write your Rails application in component-style fashion. It combines a controller action and route along \
|
12
|
+
with its view into a single Ruby class. This allows writing much DRYer code, using inheritance even in views and much easier refactoring for your Rails \
|
13
|
+
applications, helping you to keep the code clean as the application evolves.'
|
10
14
|
s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
11
15
|
s.executables = []
|
12
16
|
s.require_paths = ['lib']
|
@@ -23,7 +27,7 @@ task :gemspec do
|
|
23
27
|
s.add_runtime_dependency 'schemacop', '>= 3.0.17'
|
24
28
|
s.add_runtime_dependency 'simple_form', '>= 5.1.0'
|
25
29
|
s.add_runtime_dependency 'dslblend', '>= 0.0.3'
|
26
|
-
s.add_runtime_dependency 'anchormodel', '~> 0.1.
|
30
|
+
s.add_runtime_dependency 'anchormodel', '~> 0.1.5'
|
27
31
|
s.add_runtime_dependency 'cancancan', '~> 3.4.0'
|
28
32
|
end
|
29
33
|
|
data/TODO.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
- When cancelling in an owned form, prefer Show instead of owner.Index
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.2.2
|
@@ -15,7 +15,9 @@ class ComponyController < ApplicationController
|
|
15
15
|
|
16
16
|
# Define controller action for each standalone config
|
17
17
|
define_method(standalone_config.rails_action_name) do
|
18
|
-
|
18
|
+
translated_verb = request.raw_request_method.downcase.to_sym
|
19
|
+
translated_verb = :get if translated_verb == :head # Rails transparently converts HEAD to GET, so we must do the same for fetching the config.
|
20
|
+
verb_config = standalone_config.verbs[translated_verb]
|
19
21
|
Compony.comp_class_for!(comp_cst, family_cst).new.on_standalone_access(verb_config, self)
|
20
22
|
end
|
21
23
|
|
data/compony.gemspec
CHANGED
@@ -2,20 +2,20 @@
|
|
2
2
|
# This file is auto-generated via: 'rake gemspec'.
|
3
3
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: compony 0.2.
|
5
|
+
# stub: compony 0.2.2 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "compony".freeze
|
9
|
-
s.version = "0.2.
|
9
|
+
s.version = "0.2.2".freeze
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Sandro Kalbermatter".freeze, "contributors".freeze]
|
14
|
-
s.date = "
|
15
|
-
s.files = [".gitignore".freeze, ".ruby-version".freeze, ".yardopts".freeze, "CHANGELOG.md".freeze, "Gemfile".freeze, "Gemfile.lock".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "app/controllers/compony_controller.rb".freeze, "compony.gemspec".freeze, "config/locales/de.yml".freeze, "config/locales/en.yml".freeze, "config/routes.rb".freeze, "doc/resourceful_lifecycle.graphml".freeze, "doc/resourceful_lifecycle.pdf".freeze, "lib/compony.rb".freeze, "lib/compony/component.rb".freeze, "lib/compony/component_mixins/default/labelling.rb".freeze, "lib/compony/component_mixins/default/standalone.rb".freeze, "lib/compony/component_mixins/default/standalone/resourceful_verb_dsl.rb".freeze, "lib/compony/component_mixins/default/standalone/standalone_dsl.rb".freeze, "lib/compony/component_mixins/default/standalone/verb_dsl.rb".freeze, "lib/compony/component_mixins/resourceful.rb".freeze, "lib/compony/components/button.rb".freeze, "lib/compony/components/destroy.rb".freeze, "lib/compony/components/edit.rb".freeze, "lib/compony/components/form.rb".freeze, "lib/compony/components/new.rb".freeze, "lib/compony/components/with_form.rb".freeze, "lib/compony/controller_mixin.rb".freeze, "lib/compony/engine.rb".freeze, "lib/compony/method_accessible_hash.rb".freeze, "lib/compony/model_fields/anchormodel.rb".freeze, "lib/compony/model_fields/association.rb".freeze, "lib/compony/model_fields/attachment.rb".freeze, "lib/compony/model_fields/base.rb".freeze, "lib/compony/model_fields/boolean.rb".freeze, "lib/compony/model_fields/color.rb".freeze, "lib/compony/model_fields/currency.rb".freeze, "lib/compony/model_fields/date.rb".freeze, "lib/compony/model_fields/datetime.rb".freeze, "lib/compony/model_fields/decimal.rb".freeze, "lib/compony/model_fields/email.rb".freeze, "lib/compony/model_fields/float.rb".freeze, "lib/compony/model_fields/integer.rb".freeze, "lib/compony/model_fields/percentage.rb".freeze, "lib/compony/model_fields/phone.rb".freeze, "lib/compony/model_fields/rich_text.rb".freeze, "lib/compony/model_fields/string.rb".freeze, "lib/compony/model_fields/text.rb".freeze, "lib/compony/model_fields/time.rb".freeze, "lib/compony/model_fields/url.rb".freeze, "lib/compony/model_mixin.rb".freeze, "lib/compony/request_context.rb".freeze, "lib/compony/version.rb".freeze, "lib/compony/view_helpers.rb".freeze, "lib/generators/component/USAGE".freeze, "lib/generators/component/component_generator.rb".freeze, "lib/generators/component/templates/component.rb.erb".freeze, "lib/generators/component/templates/destroy.rb.erb".freeze, "lib/generators/component/templates/edit.rb.erb".freeze, "lib/generators/component/templates/form.rb.erb".freeze, "lib/generators/component/templates/new.rb.erb".freeze, "lib/generators/components/USAGE".freeze, "lib/generators/components/components_generator.rb".freeze]
|
14
|
+
s.date = "2024-04-24"
|
15
|
+
s.files = [".gitignore".freeze, ".ruby-version".freeze, ".yardopts".freeze, "CHANGELOG.md".freeze, "Gemfile".freeze, "Gemfile.lock".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "TODO.md".freeze, "VERSION".freeze, "app/controllers/compony_controller.rb".freeze, "compony.gemspec".freeze, "config/locales/de.yml".freeze, "config/locales/en.yml".freeze, "config/locales/fr.yml".freeze, "config/routes.rb".freeze, "doc/ComponentGenerator.html".freeze, "doc/Components.html".freeze, "doc/ComponentsGenerator.html".freeze, "doc/Compony.html".freeze, "doc/Compony/Component.html".freeze, "doc/Compony/ComponentMixins.html".freeze, "doc/Compony/ComponentMixins/Default.html".freeze, "doc/Compony/ComponentMixins/Default/Labelling.html".freeze, "doc/Compony/ComponentMixins/Default/Standalone.html".freeze, "doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html".freeze, "doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html".freeze, "doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html".freeze, "doc/Compony/ComponentMixins/Resourceful.html".freeze, "doc/Compony/Components.html".freeze, "doc/Compony/Components/Button.html".freeze, "doc/Compony/Components/Destroy.html".freeze, "doc/Compony/Components/Edit.html".freeze, "doc/Compony/Components/Form.html".freeze, "doc/Compony/Components/New.html".freeze, "doc/Compony/Components/WithForm.html".freeze, "doc/Compony/ControllerMixin.html".freeze, "doc/Compony/Engine.html".freeze, "doc/Compony/MethodAccessibleHash.html".freeze, "doc/Compony/ModelFields.html".freeze, "doc/Compony/ModelFields/Anchormodel.html".freeze, "doc/Compony/ModelFields/Association.html".freeze, "doc/Compony/ModelFields/Attachment.html".freeze, "doc/Compony/ModelFields/Base.html".freeze, "doc/Compony/ModelFields/Boolean.html".freeze, "doc/Compony/ModelFields/Color.html".freeze, "doc/Compony/ModelFields/Currency.html".freeze, "doc/Compony/ModelFields/Date.html".freeze, "doc/Compony/ModelFields/Datetime.html".freeze, "doc/Compony/ModelFields/Decimal.html".freeze, "doc/Compony/ModelFields/Email.html".freeze, "doc/Compony/ModelFields/Float.html".freeze, "doc/Compony/ModelFields/Integer.html".freeze, "doc/Compony/ModelFields/Percentage.html".freeze, "doc/Compony/ModelFields/Phone.html".freeze, "doc/Compony/ModelFields/RichText.html".freeze, "doc/Compony/ModelFields/String.html".freeze, "doc/Compony/ModelFields/Text.html".freeze, "doc/Compony/ModelFields/Time.html".freeze, "doc/Compony/ModelFields/Url.html".freeze, "doc/Compony/ModelMixin.html".freeze, "doc/Compony/RequestContext.html".freeze, "doc/Compony/Version.html".freeze, "doc/Compony/ViewHelpers.html".freeze, "doc/ComponyController.html".freeze, "doc/_index.html".freeze, "doc/class_list.html".freeze, "doc/css/common.css".freeze, "doc/css/full_list.css".freeze, "doc/css/style.css".freeze, "doc/file.README.html".freeze, "doc/file_list.html".freeze, "doc/frames.html".freeze, "doc/imgs/intro-example-destroy.png".freeze, "doc/imgs/intro-example-edit.png".freeze, "doc/imgs/intro-example-index.png".freeze, "doc/imgs/intro-example-new.png".freeze, "doc/imgs/intro-example-show.png".freeze, "doc/index.html".freeze, "doc/js/app.js".freeze, "doc/js/full_list.js".freeze, "doc/js/jquery.js".freeze, "doc/method_list.html".freeze, "doc/resourceful_lifecycle.graphml".freeze, "doc/resourceful_lifecycle.pdf".freeze, "doc/resourceful_lifecycle.png".freeze, "doc/top-level-namespace.html".freeze, "lib/compony.rb".freeze, "lib/compony/component.rb".freeze, "lib/compony/component_mixins/default/labelling.rb".freeze, "lib/compony/component_mixins/default/standalone.rb".freeze, "lib/compony/component_mixins/default/standalone/resourceful_verb_dsl.rb".freeze, "lib/compony/component_mixins/default/standalone/standalone_dsl.rb".freeze, "lib/compony/component_mixins/default/standalone/verb_dsl.rb".freeze, "lib/compony/component_mixins/resourceful.rb".freeze, "lib/compony/components/button.rb".freeze, "lib/compony/components/destroy.rb".freeze, "lib/compony/components/edit.rb".freeze, "lib/compony/components/form.rb".freeze, "lib/compony/components/new.rb".freeze, "lib/compony/components/with_form.rb".freeze, "lib/compony/controller_mixin.rb".freeze, "lib/compony/engine.rb".freeze, "lib/compony/method_accessible_hash.rb".freeze, "lib/compony/model_fields/anchormodel.rb".freeze, "lib/compony/model_fields/association.rb".freeze, "lib/compony/model_fields/attachment.rb".freeze, "lib/compony/model_fields/base.rb".freeze, "lib/compony/model_fields/boolean.rb".freeze, "lib/compony/model_fields/color.rb".freeze, "lib/compony/model_fields/currency.rb".freeze, "lib/compony/model_fields/date.rb".freeze, "lib/compony/model_fields/datetime.rb".freeze, "lib/compony/model_fields/decimal.rb".freeze, "lib/compony/model_fields/email.rb".freeze, "lib/compony/model_fields/float.rb".freeze, "lib/compony/model_fields/integer.rb".freeze, "lib/compony/model_fields/percentage.rb".freeze, "lib/compony/model_fields/phone.rb".freeze, "lib/compony/model_fields/rich_text.rb".freeze, "lib/compony/model_fields/string.rb".freeze, "lib/compony/model_fields/text.rb".freeze, "lib/compony/model_fields/time.rb".freeze, "lib/compony/model_fields/url.rb".freeze, "lib/compony/model_mixin.rb".freeze, "lib/compony/request_context.rb".freeze, "lib/compony/version.rb".freeze, "lib/compony/view_helpers.rb".freeze, "lib/generators/component/USAGE".freeze, "lib/generators/component/component_generator.rb".freeze, "lib/generators/component/templates/component.rb.erb".freeze, "lib/generators/component/templates/destroy.rb.erb".freeze, "lib/generators/component/templates/edit.rb.erb".freeze, "lib/generators/component/templates/form.rb.erb".freeze, "lib/generators/component/templates/new.rb.erb".freeze, "lib/generators/components/USAGE".freeze, "lib/generators/components/components_generator.rb".freeze, "logo.svg".freeze]
|
16
16
|
s.required_ruby_version = Gem::Requirement.new(">= 3.0.0".freeze)
|
17
|
-
s.rubygems_version = "3.
|
18
|
-
s.summary = "
|
17
|
+
s.rubygems_version = "3.5.9".freeze
|
18
|
+
s.summary = "Compony is a Gem that allows you to write your Rails application in component-style fashion. It combines a controller action and route along \\ with its view into a single Ruby class. This allows writing much DRYer code, using inheritance even in views and much easier refactoring for your Rails \\ applications, helping you to keep the code clean as the application evolves.".freeze
|
19
19
|
|
20
20
|
s.specification_version = 4
|
21
21
|
|
@@ -28,6 +28,6 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.add_runtime_dependency(%q<schemacop>.freeze, [">= 3.0.17".freeze])
|
29
29
|
s.add_runtime_dependency(%q<simple_form>.freeze, [">= 5.1.0".freeze])
|
30
30
|
s.add_runtime_dependency(%q<dslblend>.freeze, [">= 0.0.3".freeze])
|
31
|
-
s.add_runtime_dependency(%q<anchormodel>.freeze, ["~> 0.1.
|
31
|
+
s.add_runtime_dependency(%q<anchormodel>.freeze, ["~> 0.1.5".freeze])
|
32
32
|
s.add_runtime_dependency(%q<cancancan>.freeze, ["~> 3.4.0".freeze])
|
33
33
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
fr:
|
2
|
+
compony:
|
3
|
+
cancel: 'Annuler'
|
4
|
+
filtered: '[Filtré]' # Not translated as this appears in log
|
5
|
+
boolean:
|
6
|
+
true: 'Oui'
|
7
|
+
false: 'Non'
|
8
|
+
feasibility:
|
9
|
+
has_dependent_models: 'il existe des %{dependent_class} dépendants'
|
10
|
+
model_fields:
|
11
|
+
attachment:
|
12
|
+
download: 'Télécharger'
|
13
|
+
components:
|
14
|
+
form:
|
15
|
+
submit: 'Envoyer'
|
16
|
+
cancel: 'Annuler'
|
17
|
+
edit:
|
18
|
+
label:
|
19
|
+
long: 'Modifier %{data_label}'
|
20
|
+
short: 'Modifier'
|
21
|
+
data_was_updated: '%{data_label} a été enregistré.'
|
22
|
+
new:
|
23
|
+
label:
|
24
|
+
long: 'Créer %{data_class}'
|
25
|
+
short: 'Nouveau'
|
26
|
+
data_was_created: '%{data_label} a été créé.'
|
27
|
+
destroy:
|
28
|
+
label:
|
29
|
+
long: 'Supprimer %{data_label}'
|
30
|
+
short: 'Supprimer'
|
31
|
+
confirm_question: 'Voulez-vous vraiment supprimer %{data_label} ?'
|
32
|
+
confirm_button: 'Oui, supprimer'
|
33
|
+
data_was_destroyed: '%{data_label} a été supprimé.'
|
@@ -0,0 +1,231 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: ComponentGenerator
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.34
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "ComponentGenerator";
|
19
|
+
relpath = '';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="_index.html">Index (C)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">ComponentGenerator</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: ComponentGenerator
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Rails::Generators::NamedBase</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">Rails::Generators::NamedBase</li>
|
78
|
+
|
79
|
+
<li class="next">ComponentGenerator</li>
|
80
|
+
|
81
|
+
</ul>
|
82
|
+
<a href="#" class="inheritanceTree">show all</a>
|
83
|
+
|
84
|
+
</dd>
|
85
|
+
</dl>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
<dl>
|
98
|
+
<dt>Defined in:</dt>
|
99
|
+
<dd>lib/generators/component/component_generator.rb</dd>
|
100
|
+
</dl>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
<h2>
|
113
|
+
Instance Method Summary
|
114
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
115
|
+
</h2>
|
116
|
+
|
117
|
+
<ul class="summary">
|
118
|
+
|
119
|
+
<li class="public ">
|
120
|
+
<span class="summary_signature">
|
121
|
+
|
122
|
+
<a href="#add_component-instance_method" title="#add_component (instance method)">#<strong>add_component</strong> ⇒ Object </a>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
</span>
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
137
|
+
|
138
|
+
</li>
|
139
|
+
|
140
|
+
|
141
|
+
</ul>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
<div id="instance_method_details" class="method_details_list">
|
148
|
+
<h2>Instance Method Details</h2>
|
149
|
+
|
150
|
+
|
151
|
+
<div class="method_details first">
|
152
|
+
<h3 class="signature first" id="add_component-instance_method">
|
153
|
+
|
154
|
+
#<strong>add_component</strong> ⇒ <tt>Object</tt>
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
</h3><table class="source_code">
|
161
|
+
<tr>
|
162
|
+
<td>
|
163
|
+
<pre class="lines">
|
164
|
+
|
165
|
+
|
166
|
+
4
|
167
|
+
5
|
168
|
+
6
|
169
|
+
7
|
170
|
+
8
|
171
|
+
9
|
172
|
+
10
|
173
|
+
11
|
174
|
+
12
|
175
|
+
13
|
176
|
+
14
|
177
|
+
15
|
178
|
+
16
|
179
|
+
17
|
180
|
+
18
|
181
|
+
19
|
182
|
+
20
|
183
|
+
21
|
184
|
+
22
|
185
|
+
23
|
186
|
+
24
|
187
|
+
25</pre>
|
188
|
+
</td>
|
189
|
+
<td>
|
190
|
+
<pre class="code"><span class="info file"># File 'lib/generators/component/component_generator.rb', line 4</span>
|
191
|
+
|
192
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_add_component'>add_component</span>
|
193
|
+
<span class='id identifier rubyid_segments'>segments</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_underscore'>underscore</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>/</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
194
|
+
<span class='id identifier rubyid_fail'>fail</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>NAME must be of the form Family::ComponentName or family/component_name but got </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='id identifier rubyid_segments'>segments</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='op'>!=</span> <span class='int'>2</span>
|
195
|
+
<span class='ivar'>@family</span><span class='comma'>,</span> <span class='ivar'>@comp</span> <span class='op'>=</span> <span class='id identifier rubyid_segments'>segments</span>
|
196
|
+
<span class='ivar'>@family</span> <span class='op'>=</span> <span class='ivar'>@family</span><span class='period'>.</span><span class='id identifier rubyid_pluralize'>pluralize</span> <span class='comment'># Force plural
|
197
|
+
</span> <span class='ivar'>@family_cst</span> <span class='op'>=</span> <span class='ivar'>@family</span><span class='period'>.</span><span class='id identifier rubyid_camelize'>camelize</span><span class='period'>.</span><span class='id identifier rubyid_pluralize'>pluralize</span> <span class='comment'># Force plural
|
198
|
+
</span> <span class='ivar'>@comp_cst</span> <span class='op'>=</span> <span class='ivar'>@comp</span><span class='period'>.</span><span class='id identifier rubyid_camelize'>camelize</span> <span class='comment'># Tolerate singular and plural
|
199
|
+
</span> <span class='ivar'>@args</span> <span class='op'>=</span> <span class='id identifier rubyid_args'>args</span>
|
200
|
+
|
201
|
+
<span class='kw'>case</span> <span class='ivar'>@comp_cst</span>
|
202
|
+
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Destroy</span><span class='tstring_end'>'</span></span>
|
203
|
+
<span class='id identifier rubyid_template'>template</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>destroy.rb.erb</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>app/components/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@family</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@comp</span><span class='embexpr_end'>}</span><span class='tstring_content'>.rb</span><span class='tstring_end'>"</span></span>
|
204
|
+
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Edit</span><span class='tstring_end'>'</span></span>
|
205
|
+
<span class='id identifier rubyid_template'>template</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>edit.rb.erb</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>app/components/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@family</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@comp</span><span class='embexpr_end'>}</span><span class='tstring_content'>.rb</span><span class='tstring_end'>"</span></span>
|
206
|
+
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Form</span><span class='tstring_end'>'</span></span>
|
207
|
+
<span class='id identifier rubyid_template'>template</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>form.rb.erb</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>app/components/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@family</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@comp</span><span class='embexpr_end'>}</span><span class='tstring_content'>.rb</span><span class='tstring_end'>"</span></span>
|
208
|
+
<span class='kw'>when</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>New</span><span class='tstring_end'>'</span></span>
|
209
|
+
<span class='id identifier rubyid_template'>template</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>new.rb.erb</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>app/components/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@family</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@comp</span><span class='embexpr_end'>}</span><span class='tstring_content'>.rb</span><span class='tstring_end'>"</span></span>
|
210
|
+
<span class='kw'>else</span>
|
211
|
+
<span class='id identifier rubyid_template'>template</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>component.rb.erb</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>app/components/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@family</span><span class='embexpr_end'>}</span><span class='tstring_content'>/</span><span class='embexpr_beg'>#{</span><span class='ivar'>@comp</span><span class='embexpr_end'>}</span><span class='tstring_content'>.rb</span><span class='tstring_end'>"</span></span>
|
212
|
+
<span class='kw'>end</span>
|
213
|
+
<span class='kw'>end</span></pre>
|
214
|
+
</td>
|
215
|
+
</tr>
|
216
|
+
</table>
|
217
|
+
</div>
|
218
|
+
|
219
|
+
</div>
|
220
|
+
|
221
|
+
</div>
|
222
|
+
|
223
|
+
<div id="footer">
|
224
|
+
Generated on Wed Apr 24 17:14:06 2024 by
|
225
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
226
|
+
0.9.34 (ruby-3.2.2).
|
227
|
+
</div>
|
228
|
+
|
229
|
+
</div>
|
230
|
+
</body>
|
231
|
+
</html>
|
data/doc/Components.html
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Module: Components
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.34
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "Components";
|
19
|
+
relpath = '';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="_index.html">Index (C)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">Components</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Module: Components
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<dl>
|
80
|
+
<dt>Defined in:</dt>
|
81
|
+
<dd>lib/compony/engine.rb</dd>
|
82
|
+
</dl>
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
</div>
|
96
|
+
|
97
|
+
<div id="footer">
|
98
|
+
Generated on Wed Apr 24 17:14:05 2024 by
|
99
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
100
|
+
0.9.34 (ruby-3.2.2).
|
101
|
+
</div>
|
102
|
+
|
103
|
+
</div>
|
104
|
+
</body>
|
105
|
+
</html>
|