reality-generators 1.14.0 → 1.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitattributes +12 -5
- data/.github/ISSUE_TEMPLATE.md +47 -0
- data/.ruby-version +1 -1
- data/.travis.yml +6 -3
- data/CODE_OF_CONDUCT.md +73 -0
- data/CONTRIBUTING.md +27 -10
- data/README.md +4 -4
- data/lib/reality/generators/generator.rb +7 -3
- data/lib/reality/generators/template_set.rb +1 -1
- data/lib/reality/generators/template_set_container.rb +1 -1
- data/lib/reality/generators.rb +0 -1
- data/reality-generators.gemspec +1 -4
- metadata +5 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: acd8a4936db77dd749853e4acafb77c085a1dcc850fc2f05765f81a3b5062c47
|
4
|
+
data.tar.gz: 0c4eec47b3067dfc911819a8f0d73b883ea6dfa28882c3abecdba01f577bb095
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd269c773287b32e7420552b595134d5405c0d7954377fc23e76bada75b61308de2f801369f12a70197add6a40346c41ec0f50ce5fcc37a4336d4334028423a5
|
7
|
+
data.tar.gz: 77e1e1c98b11647d59647369576b9c72713bf39ce03cbb21c28bccb1cf3e62217f3af7722e79c75c1c0431ee80a011461b2b67504c46ff829a33b7953d5bf342
|
data/.gitattributes
CHANGED
@@ -1,6 +1,13 @@
|
|
1
|
+
# DO NOT EDIT: File is auto-generated
|
1
2
|
* -text
|
2
|
-
*.
|
3
|
-
*.
|
4
|
-
*.
|
5
|
-
*.
|
6
|
-
*.
|
3
|
+
*.erb text
|
4
|
+
*.gemspec text
|
5
|
+
*.md text
|
6
|
+
*.rb text
|
7
|
+
*.yml text
|
8
|
+
.gitattributes text
|
9
|
+
.gitignore text
|
10
|
+
.ruby-version text
|
11
|
+
Gemfile text
|
12
|
+
LICENSE text
|
13
|
+
Rakefile text
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<!--
|
2
|
+
Thanks for your interest in the project. I appreciate bugs filed and PRs submitted!
|
3
|
+
Please make sure that you are familiar with and follow the Code of Conduct for
|
4
|
+
this project (found in the CODE_OF_CONDUCT.md file).
|
5
|
+
|
6
|
+
Please fill out this template with all the relevant information so we can
|
7
|
+
understand what's going on and fix the issue.
|
8
|
+
|
9
|
+
I may ask you to submit the fix (after giving some direction).
|
10
|
+
-->
|
11
|
+
|
12
|
+
Environment:
|
13
|
+
|
14
|
+
<!--
|
15
|
+
Please provide the version of this project where the issue occurred as well as the
|
16
|
+
versions of other environmental factors. This could be virtual machine version, os
|
17
|
+
version, browser version etc.
|
18
|
+
-->
|
19
|
+
|
20
|
+
Relevant code or config:
|
21
|
+
|
22
|
+
```
|
23
|
+
|
24
|
+
```
|
25
|
+
|
26
|
+
What you did:
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
What happened:
|
31
|
+
|
32
|
+
<!-- Please provide the full error message/screenshots/anything -->
|
33
|
+
|
34
|
+
Reproduction repository:
|
35
|
+
|
36
|
+
<!--
|
37
|
+
If possible, please create a repository that reproduces the issue with the
|
38
|
+
minimal amount of code possible. It is highly recommended you take the time
|
39
|
+
to read "How to create a Minimal, Complete, and Verifiable example" at
|
40
|
+
https://stackoverflow.com/help/mcve
|
41
|
+
-->
|
42
|
+
|
43
|
+
Problem description:
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
Suggested solution:
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7.2
|
data/.travis.yml
CHANGED
@@ -1,11 +1,14 @@
|
|
1
|
+
# Lock down dist to ensure that builds run on a distribution that supports oraclejdk8
|
2
|
+
dist: trusty
|
1
3
|
language: ruby
|
2
|
-
sudo: false
|
3
4
|
rvm:
|
4
|
-
- 2.
|
5
|
+
- 2.7.2
|
5
6
|
- jruby-19mode
|
6
7
|
jdk:
|
7
|
-
-
|
8
|
+
- oraclejdk8
|
8
9
|
git:
|
9
10
|
depth: 10
|
10
11
|
before_install:
|
12
|
+
- rvm install ruby-2.7.2
|
13
|
+
- rvm use 2.7.2
|
11
14
|
- gem update bundler
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
education, socio-economic status, nationality, personal appearance, race,
|
10
|
+
religion, or sexual identity and orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at peter@realityforge.org. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
72
|
+
|
73
|
+
[homepage]: https://www.contributor-covenant.org
|
data/CONTRIBUTING.md
CHANGED
@@ -1,19 +1,34 @@
|
|
1
1
|
# How to Contribute
|
2
2
|
|
3
|
-
|
3
|
+
We'd love to accept your patches and contributions to this project. Pull requests are part of
|
4
|
+
what makes open source great. There are just a few small guidelines you need to follow.
|
4
5
|
|
5
|
-
|
6
|
-
* Create your feature branch (`git checkout -b my-new-feature`)
|
7
|
-
* Commit your changes (`git commit -am 'Add some feature'`)
|
8
|
-
* Push to the branch (`git push origin my-new-feature`)
|
9
|
-
* Create new Pull Request
|
6
|
+
## Code of Conduct
|
10
7
|
|
11
|
-
|
8
|
+
Participation in this project comes under the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md)
|
9
|
+
|
10
|
+
## Submitting code via Pull Requests
|
11
|
+
|
12
|
+
- We follow the [Github Pull Request Model](https://help.github.com/articles/about-pull-requests/) for
|
13
|
+
all contributions.
|
14
|
+
- For large bodies of work, we recommend creating an issue outlining the feature that you wish to build,
|
15
|
+
and describing how it will be implemented. This gives a chance for review to happen early, and ensures
|
16
|
+
no wasted effort occurs.
|
17
|
+
- All submissions, will require review before being merged.
|
18
|
+
- Finally - *Thanks* for considering submitting code to the project!
|
19
|
+
|
20
|
+
## Formatting
|
21
|
+
|
22
|
+
When submitting pull requests, make sure to do the following:
|
23
|
+
|
24
|
+
- Maintain the same code style as the rest of the project.
|
25
|
+
- Remove trailing whitespace. Many editors will do this automatically.
|
26
|
+
- Ensure any new files have [a trailing newline](https://stackoverflow.com/questions/5813311/no-newline-at-end-of-file)
|
12
27
|
|
13
28
|
## How to speed the merging of pull requests
|
14
29
|
|
15
|
-
* Describe your changes in the CHANGELOG.
|
16
|
-
* Give yourself some credit in the appropriate place (usually the CHANGELOG).
|
30
|
+
* Describe your changes in the CHANGELOG.md (if present).
|
31
|
+
* Give yourself some credit in the appropriate place (usually the CHANGELOG.md).
|
17
32
|
* Make commits of logical units.
|
18
33
|
* Ensure your commit messages help others understand what you are doing and why.
|
19
34
|
* Check for unnecessary whitespace with `git diff --check` before committing.
|
@@ -23,4 +38,6 @@ Pester us if we don't get your Pull Requests merged in a timely fashion. :)
|
|
23
38
|
## Additional Resources
|
24
39
|
|
25
40
|
* [General GitHub documentation](http://help.github.com/)
|
26
|
-
* [
|
41
|
+
* [How to write a good Git Commit message](https://chris.beams.io/posts/git-commit/) -
|
42
|
+
Great way to make sure your Pull Requests get accepted.
|
43
|
+
* [An Open Source Etiquette Guidebook](https://css-tricks.com/open-source-etiquette-guidebook/#article-header-id-1)
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# reality-generators
|
2
2
|
|
3
|
-
[![Build Status](https://
|
3
|
+
[![Build Status](https://api.travis-ci.com/realityforge/reality-generators.svg?branch=master)](http://travis-ci.com/realityforge/reality-generators)
|
4
4
|
|
5
5
|
A basic toolkit for abstracting the generation of files from model objects. These classes
|
6
6
|
were extracted from several existing toolkits, primarily [Domgen](https://github.com/realityforge/domgen).
|
@@ -22,7 +22,7 @@ the generation. These templates types included in the base framework include;
|
|
22
22
|
|
23
23
|
* `ErbTemplate` - Output is generated using an `ERB` template. The model object is supplied as an instance
|
24
24
|
method in the templates context.
|
25
|
-
* `RubyTemplate` - Output is generated by loading a ruby file to define a module and calling a method
|
25
|
+
* `RubyTemplate` - Output is generated by loading a ruby file to define a module and calling a method
|
26
26
|
supplying the model object as a parameter. The method returns the file contents as a string.
|
27
27
|
|
28
28
|
Templates are typically defined as rules such as; all models of a particular type, matching a particular
|
@@ -35,13 +35,13 @@ but these vary based on the particular template type but commonly include:
|
|
35
35
|
on a particular model object instance.
|
36
36
|
* `facets` - A list of `facets` that must be enabled on the model object instance for the template
|
37
37
|
to be applied. This is in effect a standardized `guard`. Almost all templates will define a list
|
38
|
-
of required `facets` but very few will supply a custom `guard` so that the `facets` attribute
|
38
|
+
of required `facets` but very few will supply a custom `guard` so that the `facets` attribute
|
39
39
|
is just shorthand for a common pattern.
|
40
40
|
* `output_filename_pattern` - A ruby string that is evaluated to determine the output filename for
|
41
41
|
a particular model object instance. This is only applicable for templates that generate a single file.
|
42
42
|
* `target` - A short name that selects the type of model objects against which template should
|
43
43
|
run. See below for more details.
|
44
|
-
* `template_filename` - The filename of the file that template loads if it loads one.
|
44
|
+
* `template_filename` - The filename of the file that template loads if it loads one.
|
45
45
|
|
46
46
|
## Targets
|
47
47
|
|
@@ -36,7 +36,7 @@ module Reality #nodoc
|
|
36
36
|
# The traversal starts from a root element of specified element_type and
|
37
37
|
# traverses all elements that are contained transitively by the root element.
|
38
38
|
# The templates then generate files from traversed elements.
|
39
|
-
def generate(element_type, element, directory, templates, filter)
|
39
|
+
def generate(element_type, element, directory, templates, filter, keep_filter = nil)
|
40
40
|
templates = load_templates_from_template_sets(templates) if templates.any? {|t| t.is_a?(Symbol) || t.is_a?(String)}
|
41
41
|
unprocessed_files = (Dir["#{directory}/**/*.*"] + Dir["#{directory}/**/*"]).uniq
|
42
42
|
|
@@ -66,8 +66,12 @@ module Reality #nodoc
|
|
66
66
|
FileUtils.rmdir file
|
67
67
|
end
|
68
68
|
else
|
69
|
-
|
70
|
-
|
69
|
+
if keep_filter && keep_filter.call(file)
|
70
|
+
Generators.debug "Keeping #{file} that is not generated as it matches the keep filter"
|
71
|
+
else
|
72
|
+
Generators.debug "Removing #{file} as no longer generated"
|
73
|
+
FileUtils.rm_f file
|
74
|
+
end
|
71
75
|
end
|
72
76
|
end
|
73
77
|
|
data/lib/reality/generators.rb
CHANGED
data/reality-generators.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{reality-generators}
|
5
|
-
s.version = '1.
|
5
|
+
s.version = '1.16.0'
|
6
6
|
s.platform = Gem::Platform::RUBY
|
7
7
|
|
8
8
|
s.authors = ['Peter Donald']
|
@@ -15,15 +15,12 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.files = `git ls-files`.split("\n")
|
16
16
|
s.test_files = `git ls-files -- {spec}/*`.split("\n")
|
17
17
|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
18
|
-
s.default_executable = []
|
19
18
|
s.require_paths = %w(lib)
|
20
19
|
|
21
|
-
s.has_rdoc = false
|
22
20
|
s.rdoc_options = %w(--line-numbers --inline-source --title reality-generators)
|
23
21
|
|
24
22
|
s.add_dependency 'reality-core', '>= 1.7.0'
|
25
23
|
s.add_dependency 'reality-naming', '>= 1.9.0'
|
26
|
-
s.add_dependency 'reality-orderedhash', '>= 1.0.0'
|
27
24
|
|
28
25
|
s.add_development_dependency(%q<minitest>, ['= 5.9.1'])
|
29
26
|
s.add_development_dependency(%q<test-unit>, ['= 3.1.5'])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reality-generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Donald
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: reality-core
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 1.9.0
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: reality-orderedhash
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 1.0.0
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 1.0.0
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: minitest
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,9 +73,11 @@ extensions: []
|
|
87
73
|
extra_rdoc_files: []
|
88
74
|
files:
|
89
75
|
- ".gitattributes"
|
76
|
+
- ".github/ISSUE_TEMPLATE.md"
|
90
77
|
- ".gitignore"
|
91
78
|
- ".ruby-version"
|
92
79
|
- ".travis.yml"
|
80
|
+
- CODE_OF_CONDUCT.md
|
93
81
|
- CONTRIBUTING.md
|
94
82
|
- Gemfile
|
95
83
|
- LICENSE
|
@@ -149,8 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
137
|
- !ruby/object:Gem::Version
|
150
138
|
version: '0'
|
151
139
|
requirements: []
|
152
|
-
|
153
|
-
rubygems_version: 2.5.1
|
140
|
+
rubygems_version: 3.1.4
|
154
141
|
signing_key:
|
155
142
|
specification_version: 4
|
156
143
|
summary: A basic toolkit for abstracting the generation of files from model objects.
|