onsi 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +27 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +18 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +13 -0
- data/CHANGELOG.md +8 -0
- data/CODE_OF_CONDUCT.md +76 -0
- data/CONTRIBUTING.md +25 -0
- data/LICENSE.txt +1 -1
- data/README.md +4 -2
- data/lib/onsi/params.rb +3 -1
- data/lib/onsi/version.rb +1 -1
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad9ea7a61b943a647485d219e1d254c994627321
|
4
|
+
data.tar.gz: 24638143f81a54ef013f86878c74dfd065912799
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6bf0db1aaaeccf10e1ebd7c3c0d5255cb9906bbfaede640c7b348f2cf315bf69b29d4218a2d9b7b16ebdb333cb37b49023156b64eaf128164e0b03ab5c80e54
|
7
|
+
data.tar.gz: 17663d785bae35d73a0f460939f36be95c030c7934fe386ce79701f66efd231779b0718d404b8772f4507af550dd415c85ec818d36923fe9dd3b36c7add19cfd
|
@@ -0,0 +1,27 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Create a report to help us improve
|
4
|
+
labels:
|
5
|
+
- Bugs
|
6
|
+
---
|
7
|
+
|
8
|
+
**Summary:**
|
9
|
+
|
10
|
+
|
11
|
+
**Steps to Reproduce:**
|
12
|
+
|
13
|
+
|
14
|
+
**Expected Results:**
|
15
|
+
|
16
|
+
|
17
|
+
**Actual Results:**
|
18
|
+
|
19
|
+
|
20
|
+
**Screenshots:**
|
21
|
+
|
22
|
+
|
23
|
+
**Version Info:**
|
24
|
+
|
25
|
+
|
26
|
+
**Notes:**
|
27
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
name: Feature request
|
3
|
+
about: Suggest an idea for Onsi
|
4
|
+
labels:
|
5
|
+
- Features
|
6
|
+
---
|
7
|
+
|
8
|
+
**Is your feature request related to a problem? Please describe.**
|
9
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
10
|
+
|
11
|
+
**Describe the solution you'd like**
|
12
|
+
A clear and concise description of what you want to happen.
|
13
|
+
|
14
|
+
**Describe alternatives you've considered**
|
15
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
16
|
+
|
17
|
+
**Additional context**
|
18
|
+
Add any other context or screenshots about the feature request here.
|
@@ -0,0 +1,13 @@
|
|
1
|
+
Thanks for opening a pull request!
|
2
|
+
|
3
|
+
Before you get started there are a few things to do.
|
4
|
+
|
5
|
+
1. Make sure the specs pass.
|
6
|
+
|
7
|
+
`$ bundle exec rspec`
|
8
|
+
|
9
|
+
2. Make sure rubocop is happy(ish).
|
10
|
+
|
11
|
+
`$ rubocop . --auto-correct`
|
12
|
+
|
13
|
+
3. Write a descriptive PR details :D
|
data/CHANGELOG.md
CHANGED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,76 @@
|
|
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, sex characteristics, gender identity and expression,
|
9
|
+
level of experience, education, socio-economic status, nationality, personal
|
10
|
+
appearance, race, 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 me@maddiesch.com. 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
|
74
|
+
|
75
|
+
For answers to common questions about this code of conduct, see
|
76
|
+
https://www.contributor-covenant.org/faq
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
Write code. Open a Pull Request ;)
|
2
|
+
|
3
|
+
Okay. So there's a bit more to it than that.
|
4
|
+
|
5
|
+
The best way to get started is checking out any good ['Starter Issues'](https://github.com/maddiesch/onsi/issues?q=is%3Aopen+is%3Aissue+label%3AStarter)
|
6
|
+
|
7
|
+
## Testing
|
8
|
+
|
9
|
+
Onsi uses [RSpec](http://rspec.info) for unit tests. Please make sure any code you add is properly tested.
|
10
|
+
|
11
|
+
## Documentation
|
12
|
+
|
13
|
+
Onsi uses [yard](https://yardoc.org) for documentation generation. Please make sure any code you add is properly documented.
|
14
|
+
|
15
|
+
#### Before opening a PR
|
16
|
+
|
17
|
+
1. Make sure the specs pass.
|
18
|
+
|
19
|
+
`$ bundle exec rspec`
|
20
|
+
|
21
|
+
2. Make sure rubocop is happy(ish).
|
22
|
+
|
23
|
+
`$ rubocop . --auto-correct`
|
24
|
+
|
25
|
+
3. Write a descriptive PR details :D
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
Used to generate API responses from a Rails App.
|
4
4
|
|
5
|
+
[Documentation](https://www.rubydoc.info/gems/onsi)
|
6
|
+
|
5
7
|
***
|
6
8
|
|
7
9
|
[![CircleCI](https://circleci.com/gh/maddiesch/onsi.svg?style=svg)](https://circleci.com/gh/maddiesch/onsi)
|
@@ -87,7 +89,7 @@ Calling `#flatten` will merge the attributes & relationships.
|
|
87
89
|
"data": {
|
88
90
|
"type": "person",
|
89
91
|
"attributes": {
|
90
|
-
"first_name": "
|
92
|
+
"first_name": "Maddie",
|
91
93
|
"last_name": "Schipper",
|
92
94
|
"bad_value": "'); DROP TABLE `people`; --"
|
93
95
|
},
|
@@ -111,7 +113,7 @@ Calling `#flatten` will merge the attributes & relationships.
|
|
111
113
|
Flattened gives you:
|
112
114
|
|
113
115
|
```ruby
|
114
|
-
{ "first_name" => "
|
116
|
+
{ "first_name" => "Maddie", "last_name" => "Schipper", "team_id" => "1" }
|
115
117
|
```
|
116
118
|
|
117
119
|
```ruby
|
data/lib/onsi/params.rb
CHANGED
@@ -101,7 +101,9 @@ module Onsi
|
|
101
101
|
def permit_attributes(data, attributes)
|
102
102
|
return {} if Array(attributes).empty?
|
103
103
|
|
104
|
-
|
104
|
+
normalized_attributes = attributes.map(&:to_sym)
|
105
|
+
|
106
|
+
data.require(:attributes).permit!.to_h.select { |k, _| normalized_attributes.include?(k.to_sym) }
|
105
107
|
end
|
106
108
|
|
107
109
|
def permit_relationships(data, relationships)
|
data/lib/onsi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onsi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maddie Schipper
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -165,11 +165,16 @@ extra_rdoc_files: []
|
|
165
165
|
files:
|
166
166
|
- ".circleci/config.yml"
|
167
167
|
- ".codeclimate.yml"
|
168
|
+
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
169
|
+
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
170
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
168
171
|
- ".gitignore"
|
169
172
|
- ".rspec"
|
170
173
|
- ".rubocop.yml"
|
171
174
|
- ".yardopts"
|
172
175
|
- CHANGELOG.md
|
176
|
+
- CODE_OF_CONDUCT.md
|
177
|
+
- CONTRIBUTING.md
|
173
178
|
- Gemfile
|
174
179
|
- LICENSE.txt
|
175
180
|
- README.md
|