Skip to content

Commit c833f41

Browse files
committed
Add a CONTRIBUTING.md and add a note to the README about which versions of Ruby are supported
1 parent e422598 commit c833f41

File tree

2 files changed

+68
-13
lines changed

2 files changed

+68
-13
lines changed

CONTRIBUTING.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Contributing to recursive-open-struct
2+
3+
Thanks for wanting to contribute a bug or code to recursive-open-struct!
4+
5+
To help you out with understanding the direction and philosophy of this project
6+
with regards to to new features/how it should behave (and whether to file a bug
7+
report), please review the following contribution guidelines.
8+
9+
## ROS Feature Philosophy
10+
11+
Recursive-open-struct tries to be a minimal extension to the Ruby stdlib's
12+
`ostruct`/OpenStruct that allows for a nested set of Hashes (and Arrays) to
13+
initialize similarly structured OpenStruct-like objects. This has the benefit
14+
of creating arbitrary objects whose values can be accessed with accessor
15+
methods, similar to JavaScript Objects' dot-notation.
16+
17+
To phrase it another way, RecursiveOpenStruct tries to behave as closely as
18+
possible to OpenStruct, except for the recursive functionality that it adds.
19+
20+
If Recursive-open-struct were to add additional features (particularly methods)
21+
that are not implemented by OpenStruct, then those method names would not be
22+
available for use for accessing fields with the dot-notation that OpenStruct
23+
and RecursiveOpenStruct provide.
24+
25+
For example, OpenStruct is not (at the time this is written) a
26+
subclass/specialization of Hash, so several methods implemented by Hash do not
27+
work with OpenStruct (and thus Recursive OpenStruct), such as `#fetch`.
28+
29+
If you want to add features into RecursiveOpenStruct that would "pollute" the
30+
method namespace more than OpenStruct already does, consider creating your own
31+
subclass instead of submitting a code change to RecursiveOpenStruct itself.
32+
33+
34+
## Filing/Fixing Bugs and Requesting/Proposing New Features
35+
36+
For simple bug fixes, feel free to provide a pull request. This includes bugs
37+
in stated features of RecursiveOpenStruct, as well as features added to
38+
OpenStruct in a newer version of Ruby that RecursiveOpenStruct needs custom
39+
support to handle.
40+
41+
For anything else (new features, bugs that you want to report, and bugs that
42+
are difficult to fix), I recommend opening an issue first to discuss the
43+
feature or bug. I am fairly cautious about adding new features that might cause
44+
RecursiveOpenStruct's API to deviate radically from OpenStruct's (since it
45+
might introduce new reserved method names), and it is useful to discuss the
46+
best way to solve a problem when there are tradeoffs or imperfect solutions.
47+
48+
When contributing code that changes behavior or fixes bugs, please include unit
49+
tests to cover the new behavior or to provide regression testing for bugs.
50+
Also, treat the unit tests as documentation --- make sure they are clean,
51+
clear, and concise, and well organized.

README.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,23 @@ You may also install the gem manually:
8080

8181
## Contributing
8282

83-
For simple bug fixes, feel free to provide a pull request.
84-
85-
For anything else (new features, bugs that you want to report, and bugs that
86-
are difficult to fix), I recommend opening an issue first to discuss the
87-
feature or bug. I am fairly cautious about adding new features that might cause
88-
RecursiveOpenStruct's API to deviate radically from OpenStruct's (since it
89-
might introduce new reserved method names), and it is useful to discuss the
90-
best way to solve a problem when there are tradeoffs or imperfect solutions.
91-
92-
When contributing code that changes behavior or fixes bugs, please include unit
93-
tests to cover the new behavior or to provide regression testing for bugs.
94-
Also, treat the unit tests as documentation --- make sure they are clean,
95-
clear, and concise, and well organized.
83+
If you would like to file or fix a bug, or propose a new feature, please review
84+
[CONTRIBUTING](CONTRIBUTING.md) first.
85+
86+
87+
## Supported Ruby Versions
88+
89+
Recursive-open-struct attempts to support just the versions of Ruby that are
90+
still actively maintained. Once a given major/minor version of Ruby no longer
91+
receives patches, they will no longer be supported (but recursive-open-struct
92+
may still work). I usually update the travis.yml file to reflect this when
93+
preparing for a new release or do some other work on recursive-open-struct.
94+
95+
I also try to update recursive-open-struct to support new features in
96+
OpenStruct itself as new versions of Ruby are released. However, I don't
97+
actively monitor the status of this, so a newer feature might not work. If you
98+
encounter such a feature, please file a bug or a PR to fix it, and I will try
99+
to cut a new release of recursive-open-struct quickly.
96100

97101

98102
## SemVer Compliance

0 commit comments

Comments
 (0)