Skip to content

Commit 57b4068

Browse files
committed
Merge pull request #11 from econchick/master
RC 0.1.3 - Update docs
2 parents 268e85d + aa7efec commit 57b4068

21 files changed

+367
-111
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ after_success:
1717
- coveralls
1818
notifications:
1919
email: false
20+
irc: "chat.freenode.net#ramlfications"
2021
slack:
2122
secure: RGdJmcQiapxCZWALwbogYykeuqUWhKgFtMR7JgRqPg/swcqbvD2rWYkT7eqUBrUldU7dTFhXt0RRqBf6J5vm4WcvkY5heQ4OpTi7R4itIiMLPndN24eG//PaOMhqrUyjkCsrWb0B7nuGRXmnH0C5xkPS/Dz1acugPG7zzXBKbKk=
2223
deploy:

README.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ or::
107107
Then within ``ramlfications/docs/_build`` you can open the index.html page in your browser.
108108

109109

110+
Still have issues?
111+
^^^^^^^^^^^^^^^^^^
112+
113+
Feel free to drop by ``#ramlfications`` on Freenode (`webchat`_) or ping via `Twitter`_.
114+
"roguelynn" is the maintainer, a.k.a `econchick`_ on GitHub, and based in San Fran.
115+
110116

111117
.. _pip: https://pip.pypa.io/en/latest/installing.html#install-pip
112118
.. _PyPI: https://pypi.python.org/project/ramlfications/
@@ -117,3 +123,6 @@ Then within ``ramlfications/docs/_build`` you can open the index.html page in yo
117123
.. _`Read the Docs site`: https://ramlfications.readthedocs.org
118124
.. _`usage`: http://ramlfications.readthedocs.org/en/latest/usage.html
119125
.. _`How to Contribute`: http://ramlfications.readthedocs.org/en/latest/contributing.html
126+
.. _`webchat`: http://webchat.freenode.net?channels=%23ramlfications&uio=ND10cnVlJjk9dHJ1ZQb4
127+
.. _`econchick`: https://github.com/econchick
128+
.. _`Twitter`: https://twitter.com/roguelynn
119 KB
Binary file not shown.
69.8 KB
Binary file not shown.
55.4 KB
Binary file not shown.

docs/changelog.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
Changelog
22
=========
33

4+
5+
0.1.3 (2015-05-14)
6+
------------------
7+
8+
Added:
9+
10+
- New ``#ramlfications`` channel on `freenode`_ (web chat link)! Come chat, I'm lonely.
11+
- Documentation for configuration and the ``update`` command.
12+
13+
Fixed:
14+
15+
- Handle recursive/cyclical ``!includes`` in RAML files for now (`PR`_)
16+
- Encoding issues from upgrading to tox 2.0
17+
- ``tests/test_utils.py`` would create ``ramlfications/data/supported_mime_types.json``; now mocked out.
18+
419
0.1.2 (2015-04-21)
520
------------------
621

@@ -19,3 +34,7 @@ New:
1934
0.1.0a1 (2015-04-18)
2035
--------------------
2136
Initial alpha release of ``ramlfications``\!
37+
38+
39+
.. _`PR`: https://github.com/spotify/ramlfications/pull/8
40+
.. _`freenode`: http://webchat.freenode.net?channels=%23ramlfications&uio=ND10cnVlJjk9dHJ1ZQb4

docs/conf.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,22 @@ def find_version(*file_paths):
4646
return version_match.group(1)
4747
raise RuntimeError("Unable to find version string.")
4848

49+
50+
def find_latest_release_date():
51+
"""
52+
Build a date string from the latest release logged in ``changelog.rst``
53+
"""
54+
changelog = read("changelog.rst")
55+
# format of either YYYY-MM-DD or YYYY/MM/DD
56+
date_regex = re.compile("(\d{4}[-/]\d{2}[-/]\d{2})")
57+
date_match = date_regex.findall(changelog)[0]
58+
if date_match:
59+
release_date = datetime.datetime.strptime(date_match, "%Y-%m-%d")
60+
fmt_release_date = release_date.strftime("%b %-d, %Y")
61+
return fmt_release_date
62+
raise RuntimeError("Unable to find latest release date in changelog.rst")
63+
64+
4965
# If extensions (or modules to document with autodoc) are in another directory,
5066
# add these directories to sys.path here. If the directory is relative to the
5167
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -103,7 +119,7 @@ def find_version(*file_paths):
103119

104120
# There are two options for replacing |today|: either, you set today to some
105121
# non-false value, then it is used:
106-
#today = ''
122+
today = find_latest_release_date()
107123
# Else, today_fmt is used as the format for a strftime call.
108124
#today_fmt = '%B %d, %Y'
109125

docs/config.rst

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
Configuration
2+
=============
3+
4+
.. _supported:
5+
6+
Supported
7+
---------
8+
9+
In support of the `RAML spec`_, ``ramlfications`` will automatically support
10+
the following:
11+
12+
RAML Versions
13+
^^^^^^^^^^^^^
14+
15+
| **Config variable**: ``raml_versions``
16+
| **Config type**: list of strings
17+
| **Supported**: ``0.8``
18+
|
19+
20+
21+
HTTP Methods
22+
^^^^^^^^^^^^
23+
| **Config variable**: ``http_methods``
24+
| **Config type**: list of strings
25+
| **Supported**: ``GET``, ``POST``, ``PUT``, ``DELETE``, ``PATCH``, ``HEAD``, ``OPTIONS``, ``TRACE``, ``CONNECT``
26+
|
27+
28+
Authentication Schemes
29+
^^^^^^^^^^^^^^^^^^^^^^
30+
31+
| **Config variable**: ``auth_schemes``
32+
| **Config type**: list of strings
33+
| **Supported**: OAuth 1.0, OAuth 2.0, Basic Authentication, Digest Authentication
34+
|
35+
36+
HTTP Response Codes
37+
^^^^^^^^^^^^^^^^^^^
38+
39+
| **Config variable**: ``resp_codes``
40+
| **Config type**: list of integers
41+
| **Supported**: From Python stdlib ``BaseHTTPServer``
42+
| ``100``, ``101``,
43+
| ``200``, ``201``, ``202``, ``203``, ``204``, ``205``, ``206``,
44+
| ``300``, ``301``, ``302``, ``303``, ``304``, ``305``, ``307``,
45+
| ``400``, ``401``, ``402``, ``403``, ``404``, ``405``, ``406``, ``407``, ``408``, ``409``, ``410``, ``411``, ``412``, ``413``, ``414``, ``415``, ``416``, ``417``,
46+
| ``500``, ``501``, ``502``, ``503``, ``504``, ``505``
47+
|
48+
49+
Protocols
50+
^^^^^^^^^
51+
52+
| **Config variable**: ``protocols``
53+
| **Config type**: list of strings
54+
| **Supported**: ``HTTP``, ``HTTPS``
55+
|
56+
57+
MIME Media Types
58+
^^^^^^^^^^^^^^^^
59+
60+
| **Config variable**: ``media_types``
61+
| **Config type**: list of strings that fit the regex defined under `default media type`_: ``application\/[A-Za-z.-0-1]*+?(json|xml)``
62+
| **Supported**: MIME media types that the package supports can be found on `GitHub`_ and is up to date as of the time of this release (|today|).
63+
|
64+
65+
.. note::
66+
If you would like to update your own setup with the latest `IANA`_ supported MIME media types, refer to :doc:`usage`.
67+
68+
69+
User-specified
70+
--------------
71+
72+
You may define additional values beyond what ``ramlfications`` already supports above.
73+
74+
To do so, create your own ``ini`` file with a ``[custom]`` section.
75+
76+
Then add the attributes defined :ref:`above <supported>` that you want to support.
77+
You can **only** add support to the configuration values explained above.
78+
79+
.. warning::
80+
81+
Additionally supported values defined in your configuration will only **add** to the values
82+
that ``ramlfications`` will validate against; it will **not** overwrite values that the
83+
``ramlfications`` supports as defined in the `RAML spec`_.
84+
85+
An example ``config.ini`` file::
86+
87+
[custom]
88+
raml_versions = 0.9, 1.0
89+
http_methods = foo, bar
90+
auth_schemes = oauth_3_0, my_auth
91+
media_types = application/vnd.foobar.v2
92+
protocols = FTP
93+
resp_codes = 429, 440
94+
95+
96+
Usage
97+
^^^^^
98+
99+
To use your configuration from within Python:
100+
101+
.. code-block:: python
102+
103+
>>> from ramlfications import parse, validate
104+
>>> RAML_FILE = "path/to/api.raml"
105+
>>> CONFIG_FILE = "path/to/api.ini"
106+
>>> api = parse(RAML_FILE, CONFIG_FILE)
107+
>>> validate(RAML_FILE, CONFIG_FILE)
108+
>>>
109+
110+
To use via the command line:
111+
112+
.. code-block:: bash
113+
114+
$ ramlfications validate --config path/to/api.ini path/to/api.raml
115+
$ ramlfications tree --config path/to/api.ini path/to/api.raml
116+
117+
118+
.. _`RAML spec`: http://raml.org/spec.html
119+
.. _`default media type`: http://raml.org/spec.html#default-media-type
120+
.. _IANA: https://www.iana.org/assignments/media-types/media-types.xml
121+
.. _GitHub: https://github.com/spotify/ramlfications/blob/master/ramlfications/data/supported_mime_types.json

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ User's Guide
1616
installation
1717
usage
1818
extendedusage
19+
config
1920
api
2021

2122

0 commit comments

Comments
 (0)