clowne 0.1.0.pre1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +7 -0
- data/.gitattributes +1 -0
- data/.gitignore +1 -0
- data/.rubocop.yml +17 -0
- data/.travis.yml +15 -2
- data/CHANGELOG.md +9 -2
- data/Gemfile +1 -0
- data/README.md +25 -381
- data/clowne.gemspec +1 -0
- data/docs/.rubocop.yml +12 -0
- data/docs/active_record.md +36 -0
- data/docs/alternatives.md +26 -0
- data/docs/architecture.md +141 -0
- data/docs/basic_example.md +66 -0
- data/docs/configuration.md +29 -0
- data/docs/customization.md +64 -0
- data/docs/exclude_association.md +63 -0
- data/docs/execution_order.md +14 -0
- data/docs/finalize.md +35 -0
- data/docs/implicit_cloner.md +36 -0
- data/docs/include_association.md +119 -0
- data/docs/init_as.md +36 -0
- data/docs/inline_configuration.md +38 -0
- data/docs/installation.md +16 -0
- data/docs/nullify.md +37 -0
- data/docs/sequel.md +56 -0
- data/docs/supported_adapters.md +13 -0
- data/docs/traits.md +28 -0
- data/docs/web/.gitignore +11 -0
- data/docs/web/core/Footer.js +92 -0
- data/docs/web/i18n/en.json +134 -0
- data/docs/web/package.json +14 -0
- data/docs/web/pages/en/help.js +50 -0
- data/docs/web/pages/en/index.js +231 -0
- data/docs/web/pages/en/users.js +47 -0
- data/docs/web/sidebars.json +30 -0
- data/docs/web/siteConfig.js +44 -0
- data/docs/web/static/css/custom.css +229 -0
- data/docs/web/static/fonts/FiraCode-Medium.woff +0 -0
- data/docs/web/static/fonts/FiraCode-Regular.woff +0 -0
- data/docs/web/static/fonts/StemText.woff +0 -0
- data/docs/web/static/fonts/StemTextBold.woff +0 -0
- data/docs/web/static/img/favicon/favicon.ico +0 -0
- data/docs/web/yarn.lock +1741 -0
- data/gemfiles/activerecord42.gemfile +1 -0
- data/gemfiles/jruby.gemfile +2 -0
- data/gemfiles/railsmaster.gemfile +1 -0
- data/lib/clowne.rb +3 -1
- data/lib/clowne/adapters/active_record.rb +3 -12
- data/lib/clowne/adapters/active_record/association.rb +1 -1
- data/lib/clowne/adapters/active_record/associations/base.rb +8 -48
- data/lib/clowne/adapters/active_record/associations/has_one.rb +8 -1
- data/lib/clowne/adapters/active_record/associations/noop.rb +4 -1
- data/lib/clowne/adapters/active_record/dsl.rb +33 -0
- data/lib/clowne/adapters/base.rb +13 -6
- data/lib/clowne/adapters/base/association.rb +69 -0
- data/lib/clowne/adapters/base/finalize.rb +1 -1
- data/lib/clowne/adapters/base/init_as.rb +21 -0
- data/lib/clowne/adapters/registry.rb +5 -11
- data/lib/clowne/adapters/sequel.rb +25 -0
- data/lib/clowne/adapters/sequel/association.rb +47 -0
- data/lib/clowne/adapters/sequel/associations.rb +26 -0
- data/lib/clowne/adapters/sequel/associations/base.rb +23 -0
- data/lib/clowne/adapters/sequel/associations/many_to_many.rb +19 -0
- data/lib/clowne/adapters/sequel/associations/noop.rb +16 -0
- data/lib/clowne/adapters/sequel/associations/one_to_many.rb +23 -0
- data/lib/clowne/adapters/sequel/associations/one_to_one.rb +23 -0
- data/lib/clowne/adapters/sequel/copier.rb +23 -0
- data/lib/clowne/adapters/sequel/record_wrapper.rb +59 -0
- data/lib/clowne/cloner.rb +6 -4
- data/lib/clowne/declarations.rb +1 -0
- data/lib/clowne/declarations/exclude_association.rb +0 -5
- data/lib/clowne/declarations/include_association.rb +0 -2
- data/lib/clowne/declarations/init_as.rb +20 -0
- data/lib/clowne/declarations/trait.rb +2 -0
- data/lib/clowne/ext/orm_ext.rb +21 -0
- data/lib/clowne/ext/string_constantize.rb +2 -2
- data/lib/clowne/planner.rb +11 -4
- data/lib/clowne/version.rb +1 -1
- metadata +70 -4
@@ -0,0 +1,92 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2017-present, Facebook, Inc.
|
3
|
+
*
|
4
|
+
* This source code is licensed under the MIT license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
const React = require('react');
|
9
|
+
|
10
|
+
class Footer extends React.Component {
|
11
|
+
docUrl(doc, language) {
|
12
|
+
const baseUrl = this.props.config.baseUrl;
|
13
|
+
return baseUrl + 'docs/' + (language ? language + '/' : '') + doc;
|
14
|
+
}
|
15
|
+
|
16
|
+
pageUrl(doc, language) {
|
17
|
+
const baseUrl = this.props.config.baseUrl;
|
18
|
+
return baseUrl + (language ? language + '/' : '') + doc;
|
19
|
+
}
|
20
|
+
|
21
|
+
render() {
|
22
|
+
const currentYear = new Date().getFullYear();
|
23
|
+
|
24
|
+
const yearLabel = currentYear > 2018 ? `2018–${currentYear}` : currentYear;
|
25
|
+
|
26
|
+
return (
|
27
|
+
<footer className="nav-footer" id="footer">
|
28
|
+
<section className="sitemap">
|
29
|
+
<div className="footer--block">
|
30
|
+
<h5>Project</h5>
|
31
|
+
<div className="footer--list--item">
|
32
|
+
<a href={this.props.config.repoUrl} target="_blank">
|
33
|
+
GitHub
|
34
|
+
</a>
|
35
|
+
</div>
|
36
|
+
<div className="footer--list--item">
|
37
|
+
<a href={this.props.config.gemUrl} target="_blank">
|
38
|
+
RubyGems
|
39
|
+
</a>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
{/* <div className="footer--block">
|
43
|
+
<h5>Community</h5>
|
44
|
+
<div className="footer--list--item">
|
45
|
+
<a href="https://discordapp.com/" target="_blank">Project Chat</a>
|
46
|
+
</div>
|
47
|
+
<div className="footer--list--item">
|
48
|
+
<a href="https://twitter.com/" target="_blank">
|
49
|
+
Twitter
|
50
|
+
</a>
|
51
|
+
</div>
|
52
|
+
</div>
|
53
|
+
<div className="footer--block">
|
54
|
+
<h5>Resources</h5>
|
55
|
+
<div className="footer--list--item">
|
56
|
+
<a href="#" target="_blank">Super puper chronicles post</a>
|
57
|
+
</div>
|
58
|
+
<div className="footer--list--item">
|
59
|
+
<a href="#" target="_blank">
|
60
|
+
Talk Slides
|
61
|
+
</a>
|
62
|
+
</div>
|
63
|
+
</div> */}
|
64
|
+
<div className="footer--block legals">
|
65
|
+
<p className="footer--copy">
|
66
|
+
<span className="copy">{yearLabel}</span>
|
67
|
+
<a href="https://evilmartians.com" target="_blank">Evil Martians</a>
|
68
|
+
</p>
|
69
|
+
<div className="footer--list--item">
|
70
|
+
<p>Released under the <a href="https://github.com/palkan/clowne/blob/master/LICENSE.txt" target="_blank">MIT license</a></p>
|
71
|
+
</div>
|
72
|
+
<div className="footer--list--item">
|
73
|
+
<p>Built with <a href="https://docusaurus.io" target="_blank">Docusaurus</a></p>
|
74
|
+
</div>
|
75
|
+
</div>
|
76
|
+
</section>
|
77
|
+
<div className="footer--humanoids">
|
78
|
+
<div className="humanoids">
|
79
|
+
<div className="humanoids__martian">
|
80
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 108 92"><path fill="#111" d="M26 88L8 78l18-10"/><path fill="#111" d="M94 92v-6H44c-5.5 0-10-4.5-10-10s4.5-10 10-10h50V32c0-14-7.9-22-22-22H48c-14.1 0-22 8-22 22v60h68z"/><circle fill="#FFF" cx="48" cy="50" r="8"/><circle fill="#FFF" cx="72" cy="50" r="8"/><circle fill="#363636" cx="48" cy="50" r="4"/><circle fill="#363636" cx="72" cy="50" r="4"/><g fill="#fff"><path d="M48 60c-5.5 0-10-4.5-10-10s4.5-10 10-10 10 4.5 10 10-4.5 10-10 10zm0-16c-3.3 0-6 2.7-6 6s2.7 6 6 6 6-2.7 6-6-2.7-6-6-6zM82 50c0 5.5-4.5 10-10 10s-10-4.5-10-10 4.5-10 10-10 10 4.5 10 10zm-16 0c0 3.3 2.7 6 6 6s6-2.7 6-6-2.7-6-6-6-6 2.7-6 6z"/><path d="M102 8c-3.8 0-6-2.2-6-6 0-1.1-.9-2-2-2s-2 .9-2 2c0 2.2.5 4.1 1.5 5.7L88.2 13c-4-3.3-9.5-5-16.2-5H48c-6.7 0-12.2 1.7-16.2 4.9l-5.3-5.3C27.5 6.1 28 4.2 28 2c0-1.1-.9-2-2-2s-2 .9-2 2c0 3.8-2.2 6-6 6-1.1 0-2 .9-2 2s.9 2 2 2c2.2 0 4.1-.5 5.7-1.5l5.3 5.3c-3.2 4-4.9 9.5-4.9 16.2v34.8L3.9 78 24 89v3h4V32c0-12.9 7.1-20 20-20h24c12.9 0 20 7.1 20 20v32H44c-6.6 0-12 5.4-12 12s5.4 12 12 12h48v4h4v-8h-2l-4-8-4 8h-4l-4-8-4 8h-4l-4-8-4 8h-4l-4-8-4 8h-4l-4-8-3.1 6.2C37.1 80.7 36 78.5 36 76c0-4.4 3.6-8 8-8l4 8 4-8h4l4 8 4-8h4l4 8 4-8h4l4 8 4-8h8V32c0-6.7-1.7-12.2-4.9-16.2l5.3-5.3c1.6 1 3.5 1.5 5.7 1.5 1.1 0 2-.9 2-2s-1-2-2.1-2zM24 84.4L12.1 78 24 71.4v13z"/></g></svg>
|
81
|
+
</div>
|
82
|
+
<div className="humanoids__human">
|
83
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 108 92"><path fill="#FFF" d="M14 62v30h68v-6H32c-5.5 0-10-4.5-10-10s4.5-10 10-10h50v-4c4 0 8-3.6 8-8s-4-8-8-8V32c0-14-7.9-22-22-22H36c-14.1 0-22 8-22 22v14c-4 0-8 3.6-8 8s4 8 8 8z"/><circle fill="#FFF" cx="36" cy="50" r="8"/><circle fill="#FFF" cx="60" cy="50" r="8"/><circle fill="#363636" cx="36" cy="50" r="4"/><circle fill="#363636" cx="60" cy="50" r="4"/><path fill="#363636" d="M60 10H36c-14.1 0-22 8-22 22v2l4-4 6 6 6-6 6 6 6-6 6 6 6-6 6 6 6-6 6 6 6-6 4 4v-2c0-14-7.9-22-22-22z"/><g fill="#111"><path d="M36 60c-5.5 0-10-4.5-10-10s4.5-10 10-10 10 4.5 10 10-4.5 10-10 10zm0-16c-3.3 0-6 2.7-6 6s2.7 6 6 6 6-2.7 6-6-2.7-6-6-6zM60 60c-5.5 0-10-4.5-10-10s4.5-10 10-10 10 4.5 10 10-4.5 10-10 10zm0-16c-3.3 0-6 2.7-6 6s2.7 6 6 6 6-2.7 6-6-2.7-6-6-6z"/><path d="M12 63.8V92h4V32c0-12.9 7.1-20 20-20h24c12.9 0 20 7.1 20 20v32H32c-6.6 0-12 5.4-12 12s5.4 12 12 12h48v4h4v-8H74v-1c0-1.7-1.3-3-3-3s-3 1.3-3 3v1h-6v-1c0-1.7-1.3-3-3-3s-3 1.3-3 3v1h-6v-1c0-1.7-1.3-3-3-3s-3 1.3-3 3v1h-6v-1c0-1.7-1.3-3-3-3s-3 1.3-3 3v1c-4 0-8-3.6-8-8s3.6-8 8-8h6v1c0 1.7 1.3 3 3 3s3-1.3 3-3v-1h6v1c0 1.7 1.3 3 3 3s3-1.3 3-3v-1h6v1c0 1.7 1.3 3 3 3s3-1.3 3-3v-1h6v1c0 1.7 1.3 3 3 3s3-1.3 3-3v-1h4v-4.2c5-.9 8-5 8-9.8s-3-8.9-8-9.8V32c0-15.3-8.7-24-24-24H36c-15.3 0-24 8.7-24 24v12.2c-5 .9-8 5-8 9.8s3 8.9 8 9.8zm72-15.5c2 .8 4 3 4 5.7s-2 4.8-4 5.7V48.3zm-72 0v11.3c-2-.8-4-3-4-5.7s2-4.7 4-5.6z"/></g></svg>
|
84
|
+
</div>
|
85
|
+
</div>
|
86
|
+
</div>
|
87
|
+
</footer>
|
88
|
+
);
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
module.exports = Footer;
|
@@ -0,0 +1,134 @@
|
|
1
|
+
{
|
2
|
+
"_comment": "This file is auto-generated by write-translations.js",
|
3
|
+
"localized-strings": {
|
4
|
+
"next": "Next",
|
5
|
+
"previous": "Previous",
|
6
|
+
"tagline": "A flexible gem for cloning your models",
|
7
|
+
"active_record": "Active Record",
|
8
|
+
"alternatives": "Motivation & Alternatives",
|
9
|
+
"architecture": "Architecture",
|
10
|
+
"basic_example": "Basic Example",
|
11
|
+
"configuration": "Configuration",
|
12
|
+
"customization": "Customization",
|
13
|
+
"exclude_association": "Exclude Association",
|
14
|
+
"execution_order": "Execution Order",
|
15
|
+
"finalize": "Finalization",
|
16
|
+
"Finalize": "Finalize",
|
17
|
+
"implicit_cloner": "Implicit Cloner",
|
18
|
+
"include_association": "Include Association",
|
19
|
+
"init_as": "Initialize Cloning Target",
|
20
|
+
"Init As": "Init As",
|
21
|
+
"inline_configuration": "Inline Configuration",
|
22
|
+
"installation": "Installation",
|
23
|
+
"nullify": "Nullify Attributes",
|
24
|
+
"Nullify": "Nullify",
|
25
|
+
"sequel": "Sequel",
|
26
|
+
"supported_adapters": "Supported Adapters",
|
27
|
+
"traits": "Traits",
|
28
|
+
"HISTORY": "HISTORY",
|
29
|
+
"README": "README",
|
30
|
+
"readme": "readme",
|
31
|
+
"CHANGES": "CHANGES",
|
32
|
+
"LICENSE": "LICENSE",
|
33
|
+
"CHANGELOG": "CHANGELOG",
|
34
|
+
"CONTRIBUTING": "CONTRIBUTING",
|
35
|
+
"History": "History",
|
36
|
+
"Readme": "Readme",
|
37
|
+
"extending-remarkable": "extending-remarkable",
|
38
|
+
"local-third-party-project-testing": "local-third-party-project-testing",
|
39
|
+
"publish": "publish",
|
40
|
+
"testing-changes-on-Docusaurus-itself": "testing-changes-on-Docusaurus-itself",
|
41
|
+
"CODE_OF_CONDUCT": "CODE_OF_CONDUCT",
|
42
|
+
"2016-03-11-blog-post": "Blog Title",
|
43
|
+
"2017-04-10-blog-post-two": "New Blog Post",
|
44
|
+
"2017-09-25-testing-rss": "Adding RSS Support - RSS Truncation Test",
|
45
|
+
"2017-09-26-adding-rss": "Adding RSS Support",
|
46
|
+
"2017-10-24-new-version-1.0.0": "New Version 1.0.0",
|
47
|
+
"doc1": "Latin-ish",
|
48
|
+
"Example Page": "Example Page",
|
49
|
+
"doc2": "document number 2",
|
50
|
+
"doc3": "This is document number 3",
|
51
|
+
"doc4": "Other Document",
|
52
|
+
"doc5": "Fifth Document",
|
53
|
+
"copy-sync": "copy-sync",
|
54
|
+
"copy": "copy",
|
55
|
+
"emptyDir-sync": "emptyDir-sync",
|
56
|
+
"emptyDir": "emptyDir",
|
57
|
+
"ensureDir-sync": "ensureDir-sync",
|
58
|
+
"ensureDir": "ensureDir",
|
59
|
+
"ensureFile-sync": "ensureFile-sync",
|
60
|
+
"ensureFile": "ensureFile",
|
61
|
+
"ensureLink-sync": "ensureLink-sync",
|
62
|
+
"ensureLink": "ensureLink",
|
63
|
+
"ensureSymlink-sync": "ensureSymlink-sync",
|
64
|
+
"ensureSymlink": "ensureSymlink",
|
65
|
+
"fs-read-write": "fs-read-write",
|
66
|
+
"move-sync": "move-sync",
|
67
|
+
"move": "move",
|
68
|
+
"outputFile-sync": "outputFile-sync",
|
69
|
+
"outputFile": "outputFile",
|
70
|
+
"outputJson-sync": "outputJson-sync",
|
71
|
+
"outputJson": "outputJson",
|
72
|
+
"pathExists-sync": "pathExists-sync",
|
73
|
+
"pathExists": "pathExists",
|
74
|
+
"readJson-sync": "readJson-sync",
|
75
|
+
"readJson": "readJson",
|
76
|
+
"remove-sync": "remove-sync",
|
77
|
+
"remove": "remove",
|
78
|
+
"writeJson-sync": "writeJson-sync",
|
79
|
+
"writeJson": "writeJson",
|
80
|
+
"changelog": "changelog",
|
81
|
+
"http_signing": "http_signing",
|
82
|
+
"Changelog": "Changelog",
|
83
|
+
"license": "license",
|
84
|
+
"ERROR-HANDLING": "ERROR-HANDLING",
|
85
|
+
"LIMITS": "LIMITS",
|
86
|
+
"block-bq-flat": "block-bq-flat",
|
87
|
+
"block-bq-nested": "block-bq-nested",
|
88
|
+
"block-code": "block-code",
|
89
|
+
"block-fences": "block-fences",
|
90
|
+
"block-heading": "block-heading",
|
91
|
+
"block-hr": "block-hr",
|
92
|
+
"block-html": "block-html",
|
93
|
+
"block-lheading": "block-lheading",
|
94
|
+
"block-list-flat": "block-list-flat",
|
95
|
+
"block-list-nested": "block-list-nested",
|
96
|
+
"block-ref-flat": "block-ref-flat",
|
97
|
+
"block-ref-nested": "block-ref-nested",
|
98
|
+
"block-tables-large": "block-tables-large",
|
99
|
+
"block-tables": "block-tables",
|
100
|
+
"inline-autolink": "inline-autolink",
|
101
|
+
"inline-backticks": "inline-backticks",
|
102
|
+
"inline-em-flat": "inline-em-flat",
|
103
|
+
"inline-em-nested": "inline-em-nested",
|
104
|
+
"inline-em-worst": "inline-em-worst",
|
105
|
+
"inline-entity": "inline-entity",
|
106
|
+
"inline-escape": "inline-escape",
|
107
|
+
"inline-html": "inline-html",
|
108
|
+
"inline-links-flat": "inline-links-flat",
|
109
|
+
"inline-links-nested": "inline-links-nested",
|
110
|
+
"inline-newlines-large": "inline-newlines-large",
|
111
|
+
"inline-newlines": "inline-newlines",
|
112
|
+
"rawtabs": "rawtabs",
|
113
|
+
"example": "example",
|
114
|
+
"parser": "parser",
|
115
|
+
"parsing_block": "parsing_block",
|
116
|
+
"parsing_core": "parsing_core",
|
117
|
+
"parsing_inline": "parsing_inline",
|
118
|
+
"plugins": "plugins",
|
119
|
+
"renderer": "renderer",
|
120
|
+
"AUTHORS": "AUTHORS",
|
121
|
+
"PULL_REQUEST_TEMPLATE": "PULL_REQUEST_TEMPLATE",
|
122
|
+
"Docs": "Docs",
|
123
|
+
"GitHub": "GitHub",
|
124
|
+
"Getting Started": "Getting Started",
|
125
|
+
"API": "API",
|
126
|
+
"Adapters": "Adapters",
|
127
|
+
"Features": "Features"
|
128
|
+
},
|
129
|
+
"pages-strings": {
|
130
|
+
"Help Translate|recruit community translators for your project": "Help Translate",
|
131
|
+
"Edit this Doc|recruitment message asking to edit the doc source": "Edit",
|
132
|
+
"Translate this Doc|recruitment message asking to translate the docs": "Translate"
|
133
|
+
}
|
134
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
{
|
2
|
+
"scripts": {
|
3
|
+
"examples": "docusaurus-examples",
|
4
|
+
"start": "docusaurus-start",
|
5
|
+
"build": "docusaurus-build",
|
6
|
+
"publish-gh-pages": "docusaurus-publish",
|
7
|
+
"write-translations": "docusaurus-write-translations",
|
8
|
+
"version": "docusaurus-version",
|
9
|
+
"rename-version": "docusaurus-rename-version"
|
10
|
+
},
|
11
|
+
"devDependencies": {
|
12
|
+
"docusaurus": "^1.0.5"
|
13
|
+
}
|
14
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2017-present, Facebook, Inc.
|
3
|
+
*
|
4
|
+
* This source code is licensed under the MIT license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
const React = require('react');
|
9
|
+
|
10
|
+
const CompLibrary = require('../../core/CompLibrary.js');
|
11
|
+
const Container = CompLibrary.Container;
|
12
|
+
const GridBlock = CompLibrary.GridBlock;
|
13
|
+
|
14
|
+
const siteConfig = require(process.cwd() + '/siteConfig.js');
|
15
|
+
|
16
|
+
class Help extends React.Component {
|
17
|
+
render() {
|
18
|
+
const supportLinks = [
|
19
|
+
{
|
20
|
+
content:
|
21
|
+
'Learn more using the [documentation on this site.](/test-site/docs/en/doc1.html)',
|
22
|
+
title: 'Browse Docs',
|
23
|
+
},
|
24
|
+
{
|
25
|
+
content: 'Ask questions about the documentation and project',
|
26
|
+
title: 'Join the community',
|
27
|
+
},
|
28
|
+
{
|
29
|
+
content: "Find out what's new with this project",
|
30
|
+
title: 'Stay up to date',
|
31
|
+
},
|
32
|
+
];
|
33
|
+
|
34
|
+
return (
|
35
|
+
<div className="docMainWrapper wrapper">
|
36
|
+
<Container className="mainContainer documentContainer postContainer">
|
37
|
+
<div className="post">
|
38
|
+
<header className="postHeader">
|
39
|
+
<h2>Need help?</h2>
|
40
|
+
</header>
|
41
|
+
<p>This project is maintained by a dedicated group of people.</p>
|
42
|
+
<GridBlock contents={supportLinks} layout="threeColumn" />
|
43
|
+
</div>
|
44
|
+
</Container>
|
45
|
+
</div>
|
46
|
+
);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
|
50
|
+
module.exports = Help;
|
@@ -0,0 +1,231 @@
|
|
1
|
+
/**
|
2
|
+
* Copyright (c) 2017-present, Facebook, Inc.
|
3
|
+
*
|
4
|
+
* This source code is licensed under the MIT license found in the
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
6
|
+
*/
|
7
|
+
|
8
|
+
const React = require('react');
|
9
|
+
|
10
|
+
const CompLibrary = require('../../core/CompLibrary.js');
|
11
|
+
const MarkdownBlock = CompLibrary.MarkdownBlock; /* Used to read markdown */
|
12
|
+
const Container = CompLibrary.Container;
|
13
|
+
const GridBlock = CompLibrary.GridBlock;
|
14
|
+
|
15
|
+
const siteConfig = require(process.cwd() + '/siteConfig.js');
|
16
|
+
|
17
|
+
function imgUrl(img) {
|
18
|
+
return siteConfig.baseUrl + 'img/' + img;
|
19
|
+
}
|
20
|
+
|
21
|
+
function docUrl(doc, language) {
|
22
|
+
return siteConfig.baseUrl + 'docs/' + (language ? language + '/' : '') + doc;
|
23
|
+
}
|
24
|
+
|
25
|
+
function pageUrl(page, language) {
|
26
|
+
return siteConfig.baseUrl + (language ? language + '/' : '') + page;
|
27
|
+
}
|
28
|
+
|
29
|
+
class Button extends React.Component {
|
30
|
+
render() {
|
31
|
+
return (
|
32
|
+
<div className="pluginWrapper buttonWrapper">
|
33
|
+
<a className={`button ${this.props.className}`} href={this.props.href} target={this.props.target}>
|
34
|
+
{this.props.children}
|
35
|
+
</a>
|
36
|
+
</div>
|
37
|
+
);
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
Button.defaultProps = {
|
42
|
+
target: '_self',
|
43
|
+
className: '',
|
44
|
+
};
|
45
|
+
|
46
|
+
const SplashContainer = props => (
|
47
|
+
<div className="homeContainer">
|
48
|
+
<div className="homeSplashFade">
|
49
|
+
<div className="wrapper homeWrapper">{props.children}</div>
|
50
|
+
</div>
|
51
|
+
</div>
|
52
|
+
);
|
53
|
+
|
54
|
+
const Logo = props => (
|
55
|
+
<div className="projectLogo">
|
56
|
+
</div>
|
57
|
+
);
|
58
|
+
|
59
|
+
const ProjectTitle = props => (
|
60
|
+
<h2 className="projectTitle">
|
61
|
+
<span className="projectTitleName">{siteConfig.title}</span>
|
62
|
+
<small>{siteConfig.tagline}</small>
|
63
|
+
<p>
|
64
|
+
<a href="https://badge.fury.io/rb/clowne"><image title="Gem Version" src="https://badge.fury.io/rb/clowne.svg" /></a>
|
65
|
+
</p>
|
66
|
+
</h2>
|
67
|
+
);
|
68
|
+
|
69
|
+
const PromoSection = props => (
|
70
|
+
<div className="section promoSection">
|
71
|
+
<div className="promoRow">
|
72
|
+
<div className="pluginRowBlock">{props.children}</div>
|
73
|
+
</div>
|
74
|
+
</div>
|
75
|
+
);
|
76
|
+
|
77
|
+
class HomeSplash extends React.Component {
|
78
|
+
render() {
|
79
|
+
let language = this.props.language || '';
|
80
|
+
return (
|
81
|
+
<SplashContainer>
|
82
|
+
<div className="inner">
|
83
|
+
<ProjectTitle />
|
84
|
+
<PromoSection>
|
85
|
+
<Button href="/clowne/docs/installation.html">Getting Started</Button>
|
86
|
+
</PromoSection>
|
87
|
+
</div>
|
88
|
+
</SplashContainer>
|
89
|
+
);
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
const Block = props => (
|
94
|
+
<Container
|
95
|
+
padding={props.padding}
|
96
|
+
id={props.id}
|
97
|
+
background={props.background}>
|
98
|
+
<GridBlock align="center" contents={props.children} layout={props.layout} />
|
99
|
+
</Container>
|
100
|
+
);
|
101
|
+
|
102
|
+
Block.defaultProps = {
|
103
|
+
padding: ['bottom', 'top'],
|
104
|
+
};
|
105
|
+
|
106
|
+
const Features = props => (
|
107
|
+
<Block layout="twoColumn" padding={['bottom']}>
|
108
|
+
{[
|
109
|
+
{
|
110
|
+
content: 'Rich DSL out-of-the-box',
|
111
|
+
imageAlign: 'top',
|
112
|
+
title: 'Powerful',
|
113
|
+
},
|
114
|
+
{
|
115
|
+
content: 'Supports ActiveRecord and Sequel<br/><small><em>ROM is coming soon!</em></small>',
|
116
|
+
imageAlign: 'top',
|
117
|
+
title: 'ORM adapters',
|
118
|
+
},
|
119
|
+
{
|
120
|
+
content: 'Easy to extend for your needs',
|
121
|
+
imageAlign: 'top',
|
122
|
+
title: 'Customizable',
|
123
|
+
},
|
124
|
+
{
|
125
|
+
content: "It's just Ruby without any dependency",
|
126
|
+
imageAlign: 'top',
|
127
|
+
title: 'Rails-free',
|
128
|
+
},
|
129
|
+
]}
|
130
|
+
</Block>
|
131
|
+
);
|
132
|
+
|
133
|
+
const FeatureCallout = props => (
|
134
|
+
<div
|
135
|
+
className="productShowcaseSection paddingBottom"
|
136
|
+
style={{textAlign: 'center'}}>
|
137
|
+
<h2>Feature Callout</h2>
|
138
|
+
<MarkdownBlock>These are features of this project</MarkdownBlock>
|
139
|
+
</div>
|
140
|
+
);
|
141
|
+
|
142
|
+
const LearnHow = props => (
|
143
|
+
<Block background="light">
|
144
|
+
{[
|
145
|
+
{
|
146
|
+
content: 'Talk about learning how to use this',
|
147
|
+
image: imgUrl('docusaurus.svg'),
|
148
|
+
imageAlign: 'right',
|
149
|
+
title: 'Learn How',
|
150
|
+
},
|
151
|
+
]}
|
152
|
+
</Block>
|
153
|
+
);
|
154
|
+
|
155
|
+
const TryOut = props => (
|
156
|
+
<Block id="try">
|
157
|
+
{[
|
158
|
+
{
|
159
|
+
content: 'Talk about trying this out',
|
160
|
+
image: imgUrl('docusaurus.svg'),
|
161
|
+
imageAlign: 'left',
|
162
|
+
title: 'Try it Out',
|
163
|
+
},
|
164
|
+
]}
|
165
|
+
</Block>
|
166
|
+
);
|
167
|
+
|
168
|
+
const Description = props => (
|
169
|
+
<Block background="dark">
|
170
|
+
{[
|
171
|
+
{
|
172
|
+
content: 'This is another description of how this project is useful',
|
173
|
+
image: imgUrl('docusaurus.svg'),
|
174
|
+
imageAlign: 'right',
|
175
|
+
title: 'Description',
|
176
|
+
},
|
177
|
+
]}
|
178
|
+
</Block>
|
179
|
+
);
|
180
|
+
|
181
|
+
const Showcase = props => {
|
182
|
+
if ((siteConfig.users || []).length === 0) {
|
183
|
+
return null;
|
184
|
+
}
|
185
|
+
const showcase = siteConfig.users
|
186
|
+
.filter(user => {
|
187
|
+
return user.pinned;
|
188
|
+
})
|
189
|
+
.map((user, i) => {
|
190
|
+
return (
|
191
|
+
<a href={user.infoLink} key={i}>
|
192
|
+
<img src={user.image} title={user.caption} />
|
193
|
+
</a>
|
194
|
+
);
|
195
|
+
});
|
196
|
+
|
197
|
+
return (
|
198
|
+
<div className="productShowcaseSection paddingBottom">
|
199
|
+
<h2>{"Who's Using This?"}</h2>
|
200
|
+
<p>This project is used by all these people</p>
|
201
|
+
<div className="logos">{showcase}</div>
|
202
|
+
<div className="more-users">
|
203
|
+
<a className="button" href={pageUrl('users.html', props.language)}>
|
204
|
+
More {siteConfig.title} Users
|
205
|
+
</a>
|
206
|
+
</div>
|
207
|
+
</div>
|
208
|
+
);
|
209
|
+
};
|
210
|
+
|
211
|
+
class Index extends React.Component {
|
212
|
+
render() {
|
213
|
+
let language = this.props.language || '';
|
214
|
+
|
215
|
+
return (
|
216
|
+
<div>
|
217
|
+
<HomeSplash language={language} />
|
218
|
+
<div className="mainContainer">
|
219
|
+
<Features />
|
220
|
+
{/* <FeatureCallout /> */}
|
221
|
+
{/* <LearnHow /> */}
|
222
|
+
{/* <TryOut /> */}
|
223
|
+
{/* <Description /> */}
|
224
|
+
{/* <Showcase language={language} /> */}
|
225
|
+
</div>
|
226
|
+
</div>
|
227
|
+
);
|
228
|
+
}
|
229
|
+
}
|
230
|
+
|
231
|
+
module.exports = Index;
|