clowne 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +11 -51
  3. data/.travis.yml +11 -23
  4. data/Gemfile +9 -9
  5. data/README.md +8 -7
  6. data/Rakefile +3 -3
  7. data/clowne.gemspec +14 -8
  8. data/docs/.nojekyll +0 -0
  9. data/docs/.rubocop.yml +8 -2
  10. data/docs/CNAME +1 -0
  11. data/docs/README.md +131 -0
  12. data/docs/_sidebar.md +25 -0
  13. data/docs/active_record.md +2 -5
  14. data/docs/after_clone.md +3 -6
  15. data/docs/after_persist.md +7 -10
  16. data/docs/architecture.md +2 -5
  17. data/docs/assets/docsify.min.js +1 -0
  18. data/docs/assets/prism-ruby.min.js +1 -0
  19. data/docs/assets/styles.css +348 -0
  20. data/docs/assets/vue.css +1 -0
  21. data/docs/clone_mapper.md +2 -5
  22. data/docs/customization.md +1 -4
  23. data/docs/exclude_association.md +1 -4
  24. data/docs/finalize.md +4 -8
  25. data/docs/from_v02_to_v1.md +2 -10
  26. data/docs/getting_started.md +171 -0
  27. data/docs/implicit_cloner.md +1 -4
  28. data/docs/include_association.md +3 -6
  29. data/docs/index.html +29 -0
  30. data/docs/init_as.md +4 -8
  31. data/docs/inline_configuration.md +1 -4
  32. data/docs/nullify.md +1 -5
  33. data/docs/operation.md +3 -6
  34. data/docs/parameters.md +5 -8
  35. data/docs/sequel.md +1 -4
  36. data/docs/supported_adapters.md +3 -6
  37. data/docs/testing.md +18 -21
  38. data/docs/traits.md +1 -4
  39. data/gemfiles/activerecord42.gemfile +5 -5
  40. data/gemfiles/jruby.gemfile +6 -6
  41. data/gemfiles/railsmaster.gemfile +6 -6
  42. data/lib/clowne.rb +11 -11
  43. data/lib/clowne/adapters/active_record.rb +3 -3
  44. data/lib/clowne/adapters/active_record/associations.rb +7 -7
  45. data/lib/clowne/adapters/active_record/associations/base.rb +1 -1
  46. data/lib/clowne/adapters/active_record/associations/belongs_to.rb +1 -1
  47. data/lib/clowne/adapters/active_record/associations/has_one.rb +1 -1
  48. data/lib/clowne/adapters/active_record/resolvers/association.rb +1 -1
  49. data/lib/clowne/adapters/base.rb +6 -6
  50. data/lib/clowne/adapters/sequel.rb +7 -7
  51. data/lib/clowne/adapters/sequel/associations.rb +6 -6
  52. data/lib/clowne/adapters/sequel/associations/base.rb +2 -2
  53. data/lib/clowne/adapters/sequel/associations/many_to_many.rb +4 -4
  54. data/lib/clowne/adapters/sequel/associations/one_to_many.rb +1 -1
  55. data/lib/clowne/adapters/sequel/associations/one_to_one.rb +1 -1
  56. data/lib/clowne/adapters/sequel/operation.rb +3 -2
  57. data/lib/clowne/adapters/sequel/resolvers/after_persist.rb +1 -1
  58. data/lib/clowne/adapters/sequel/resolvers/association.rb +1 -1
  59. data/lib/clowne/adapters/sequel/specifications/after_persist_does_not_support.rb +1 -1
  60. data/lib/clowne/cloner.rb +8 -8
  61. data/lib/clowne/declarations.rb +15 -15
  62. data/lib/clowne/declarations/after_clone.rb +1 -1
  63. data/lib/clowne/declarations/after_persist.rb +1 -1
  64. data/lib/clowne/declarations/finalize.rb +1 -1
  65. data/lib/clowne/declarations/include_association.rb +1 -1
  66. data/lib/clowne/declarations/init_as.rb +1 -1
  67. data/lib/clowne/declarations/nullify.rb +1 -1
  68. data/lib/clowne/ext/orm_ext.rb +1 -1
  69. data/lib/clowne/ext/record_key.rb +1 -1
  70. data/lib/clowne/ext/string_constantize.rb +1 -1
  71. data/lib/clowne/ext/yield_self_then.rb +1 -1
  72. data/lib/clowne/planner.rb +1 -1
  73. data/lib/clowne/rspec.rb +3 -3
  74. data/lib/clowne/rspec/clone_association.rb +3 -3
  75. data/lib/clowne/rspec/clone_associations.rb +2 -2
  76. data/lib/clowne/rspec/helpers.rb +1 -1
  77. data/lib/clowne/utils/clone_mapper.rb +1 -1
  78. data/lib/clowne/utils/operation.rb +3 -3
  79. data/lib/clowne/utils/params.rb +1 -1
  80. data/lib/clowne/version.rb +1 -1
  81. metadata +50 -35
  82. data/docs/alternatives.md +0 -26
  83. data/docs/basic_example.md +0 -83
  84. data/docs/installation.md +0 -46
  85. data/docs/overview.md +0 -25
  86. data/docs/web/.gitignore +0 -11
  87. data/docs/web/README.md +0 -6
  88. data/docs/web/core/Footer.js +0 -88
  89. data/docs/web/i18n/en.json +0 -141
  90. data/docs/web/package.json +0 -14
  91. data/docs/web/pages/en/help.js +0 -50
  92. data/docs/web/pages/en/index.js +0 -231
  93. data/docs/web/pages/en/users.js +0 -47
  94. data/docs/web/sidebars.json +0 -38
  95. data/docs/web/siteConfig.js +0 -46
  96. data/docs/web/static/css/custom.css +0 -235
  97. data/docs/web/static/fonts/FiraCode-Medium.woff +0 -0
  98. data/docs/web/static/fonts/FiraCode-Regular.woff +0 -0
  99. data/docs/web/static/img/favicon/favicon.ico +0 -0
  100. data/docs/web/yarn.lock +0 -1741
@@ -1,50 +0,0 @@
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;
@@ -1,231 +0,0 @@
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={docUrl("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;
@@ -1,47 +0,0 @@
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
-
13
- const siteConfig = require(process.cwd() + '/siteConfig.js');
14
-
15
- class Users extends React.Component {
16
- render() {
17
- const showcase = siteConfig.users.map((user, i) => {
18
- return (
19
- <a href={user.infoLink} key={i}>
20
- <img src={user.image} title={user.caption} />
21
- </a>
22
- );
23
- });
24
-
25
- return (
26
- <div className="mainContainer">
27
- <Container padding={['bottom', 'top']}>
28
- <div className="showcaseSection">
29
- <div className="prose">
30
- <h1>Who's Using This?</h1>
31
- <p>This project is used by many folks</p>
32
- </div>
33
- <div className="logos">{showcase}</div>
34
- <p>Are you using this project?</p>
35
- <a
36
- href="https://github.com/facebook/docusaurus/edit/master/website/siteConfig.js"
37
- className="button">
38
- Add your company
39
- </a>
40
- </div>
41
- </Container>
42
- </div>
43
- );
44
- }
45
- }
46
-
47
- module.exports = Users;
@@ -1,38 +0,0 @@
1
- {
2
- "docs": {
3
- "Getting Started": [
4
- "installation",
5
- "basic_example",
6
- "overview",
7
- "alternatives"
8
- ],
9
- "API": [
10
- "operation",
11
- "include_association",
12
- "exclude_association",
13
- "nullify",
14
- "finalize",
15
- "after_clone",
16
- "after_persist",
17
- "init_as",
18
- "traits",
19
- "parameters"
20
- ],
21
- "Adapters": [
22
- "supported_adapters",
23
- "active_record",
24
- "sequel"
25
- ],
26
- "Advanced Options": [
27
- "implicit_cloner",
28
- "inline_configuration",
29
- "clone_mapper",
30
- "architecture",
31
- "testing",
32
- "customization"
33
- ],
34
- "Upgrade Notes": [
35
- "from_v02_to_v10"
36
- ]
37
- }
38
- }
@@ -1,46 +0,0 @@
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 siteConfig = {
9
- title: 'Clowne' /* title for your website */,
10
- tagline: 'A flexible gem for cloning your models',
11
- url: 'http://clowne.evilmartians.io' /* your website url */,
12
- cname: 'clowne.evilmartians.io',
13
- baseUrl: '/' /* base url for your project */,
14
- customDocsPath: '../docs',
15
- projectName: 'clowne',
16
- headerLinks: [
17
- {doc: 'basic_example', label: 'Docs'},
18
- {href: 'https://github.com/palkan/clowne', label: 'GitHub'},
19
- ],
20
- users: [], /* users, */
21
- /* path to images for header/footer */
22
- // headerIcon: 'img/docusaurus.svg',
23
- favicon: 'img/favicon/favicon.ico',
24
- /* colors for website */
25
- colors: {
26
- primaryColor: '#9FA628', // '#ff5e5e'
27
- secondaryColor: '#e3e3e3',
28
- },
29
- // This copyright info is used in /core/Footer.js and blog rss/atom feeds.
30
- copyright:
31
- 'Copyright © ' +
32
- new Date().getFullYear() +
33
- ' Evil Martians',
34
- // organizationName: 'deltice', // or set an env variable ORGANIZATION_NAME
35
- highlight: {
36
- // Highlight.js theme to use for syntax highlighting in code blocks
37
- theme: 'atom-one-light',
38
- },
39
- scripts: ['https://buttons.github.io/buttons.js'],
40
- // You may provide arbitrary config keys to be used as needed by your template.
41
- repoUrl: 'https://github.com/palkan/clowne',
42
- gemUrl: 'https://rubygems.org/gems/clowne',
43
- gaTrackingId: 'UA-104346673-2',
44
- };
45
-
46
- module.exports = siteConfig;
@@ -1,235 +0,0 @@
1
- /* your custom css */
2
-
3
- @font-face {
4
- font-weight: 400;
5
- font-style: normal;
6
- font-family: "Stem Text";
7
- src: url("//cdn.evilmartians.com/front/fonts/subset-StemText-Regular.woff") format("woff");
8
- }
9
- @font-face {
10
- font-weight: 700;
11
- font-style: normal;
12
- font-family: "Stem Text";
13
- src: url("//cdn.evilmartians.com/front/fonts/subset-StemText-Bold.woff") format("woff");
14
- }
15
-
16
- @font-face {
17
- font-family: "Fira Code";
18
- src: url("../fonts/FiraCode-Regular.woff") format("woff");
19
- }
20
-
21
- body {
22
- font: 18px/30px "Stem Text", "Arial", sans-serif;
23
- color: #363636;
24
- background: #fff;
25
- }
26
-
27
- pre code {
28
- font-family: "Fira Code";
29
- font-size: 16px;
30
- }
31
-
32
- code {
33
- font-family: "Fira Code";
34
- font-size: 0.9em;
35
- }
36
-
37
- p {
38
- line-height: initial;
39
- }
40
-
41
- footer .sitemap div {
42
- flex: none;
43
- }
44
-
45
- .fixedHeaderContainer {
46
- box-sizing: border-box;
47
- background: #fff;
48
- border-bottom: solid 1px #e3e3e3;
49
- }
50
-
51
- .fixedHeaderContainer a {
52
- color: #9FA628;
53
- }
54
-
55
- header h2 {
56
- color: #9FA628;
57
- text-transform: uppercase;
58
- }
59
-
60
- .container .wrapper h2 {
61
- font-weight: bold;
62
- }
63
-
64
- .mainContainer .wrapper a {
65
- text-decoration: underline;
66
- }
67
-
68
- .projectTitle {
69
- color: #111;
70
- }
71
-
72
- .projectTitleName {
73
- color: #9FA628;
74
- }
75
-
76
- .mainContainer .wrapper a:hover {
77
- text-decoration: none;
78
- }
79
-
80
- .mainContainer .wrapper .post h3 {
81
- font-weight: bold;
82
- }
83
-
84
- small {
85
- font-size: 80%;
86
- }
87
-
88
- .navigationSlider .slidingNav ul li a {
89
- color: #9FA628;
90
- }
91
-
92
- nav.toc .toggleNav .navGroup.navGroupActive {
93
- background: #fafafa;
94
- color: #363636;
95
- }
96
-
97
- .mainContainer .wrapper .post .postHeader h1 {
98
- margin-bottom: 30px;
99
- }
100
-
101
- .hljs-doctag {
102
- color: #a0a1a7;
103
- }
104
-
105
- @keyframes humanoids-blink{
106
-
107
- 0%, 48%{
108
- transform: scaleY(1);
109
- }
110
-
111
- 50%{
112
- transform: scaleY(0);
113
- }
114
-
115
- 52%, 100%{
116
- transform: scaleY(1);
117
- }
118
- }
119
-
120
- .humanoids{
121
- position: absolute;
122
- bottom: -10px;
123
- width: 150px;
124
- height: 60px;
125
- margin: 0 auto 0 -10px;
126
- font-size: 0;
127
- }
128
- .humanoids circle{
129
- transform: scaleY(1);
130
- transform-origin: 50%;
131
- animation-duration: 8s;
132
- animation-name: humanoids-blink;
133
- animation-iteration-count: infinite;
134
- }
135
- .humanoids svg{
136
- height: 60px;
137
- }
138
- .humanoids__human, .humanoids__martian{
139
- position: absolute;
140
- width: 80px;
141
- height: 90px;
142
- transition: transform 300ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
143
- transform: translateY(0);
144
- }
145
- .humanoids__human:hover, .humanoids__martian:hover{
146
- transform: translateY(-12px);
147
- }
148
- .humanoids__martian{
149
- left: 0;
150
- }
151
- .humanoids__human{
152
- right: 0;
153
- }
154
- .humanoids__human circle{
155
- animation-delay: 0.5s;
156
- }
157
-
158
- footer{
159
- width: 100%;
160
- z-index: 20;
161
- padding: 60px;
162
- justify-content: flex-end;
163
- position: relative;
164
- overflow: hidden;
165
- }
166
-
167
- footer.nav-footer {
168
- box-shadow: none;
169
- background: #363636;
170
- }
171
-
172
- footer .sitemap a {
173
- display: inline;
174
- }
175
-
176
- footer h5{
177
- color: white;
178
- font-weight: normal;
179
- }
180
- .footer--block{
181
- color: white;
182
- font-size: 14px;
183
- position: relative;
184
- }
185
-
186
- .footer--copy {
187
- margin: 0 0 10px;
188
- }
189
-
190
- .footer--block.legals{
191
- color:rgba(255, 255, 255, 0.6);
192
- }
193
- .footer--humanoids{
194
- position: absolute;
195
- bottom: -10px;
196
- margin-left: 50%;
197
- left: -60px;
198
- }
199
- .copy{
200
- position: relative;
201
- }
202
- .copy:before{
203
- content: '©';
204
- position: absolute;
205
- left: -20px;
206
- top: 0;
207
- line-height: 10px;
208
- }
209
-
210
- @media only screen and (min-device-width: 360px) and (max-device-width: 736px) {
211
- .footer--block:not(:first-child) {
212
- margin-top: 2em;
213
- }
214
- }
215
-
216
- @media only screen and (min-width: 1024px) {
217
- }
218
-
219
- @media only screen and (max-width: 1023px) {
220
- }
221
-
222
- @media only screen and (min-width: 1400px) {
223
- }
224
-
225
- @media only screen and (min-width: 1500px) {
226
- }
227
-
228
- .projectTitleName{
229
- font-weight: bold;
230
- }
231
-
232
- .mainContainer {
233
- background: none;
234
- border-top: 1px solid #e3e3e3;
235
- }