Commit Graph

312 Commits

Author SHA1 Message Date
Sebastian Thiel
bf37e515d2 fix(docs): corrected cursor handling in mkdocs
The trick was to use an actual list of cursor tokens that is consumed
on use. That way, we don't loose track of were we are in the
structure.

Related to #64
2015-04-16 12:16:40 +02:00
Sebastian Thiel
4b87d909f2 fix(CLI): NULL default values instead of randoms
Instead of generating nonesense random values, we just map defaults
that represent the respective NULL value of a given type.
2015-04-15 18:29:21 +02:00
Sebastian Thiel
6119bfb762 feat(CLI): make respective uppload_call
Now we actually provide the information required to upload data in a
simple or resumable fashion.

Fixes #62
2015-04-15 18:16:56 +02:00
Sebastian Thiel
9eed4056e5 feat(CLI): upload flag parsing
We handle errors gracefully with costum types and minimal amount of
code. Unfortunately, Mime type parsing is very 'flexible', allowing
nonesense types to be passed easily.

Related to #62
2015-04-15 17:23:01 +02:00
Sebastian Thiel
306852d514 fix(CLI): alt-media handling in CLI+API-docs
* API-docs now adjust depending on where 'alt' is set (either as global
  parameter, or as method-parameter)
* CLI: download tracking now works for 'alt' as method-parameter
* CLI: global parameter remapping allows them to be named consistently,
  but map to the name required by the google API.

Fixes #61
2015-04-15 14:41:46 +02:00
Sebastian Thiel
36a7cb239a feat(CLI): global optional parameters+DL tracking
* set globally shared parameters (which includes 'alt')
* track if 'alt' is set to 'media' at runtime to do the right thing when
  outputting the result. There is still an issue to be fixed though

Related to #61
2015-04-15 12:12:39 +02:00
Sebastian Thiel
830529c40b fix(CLI): optional parameter default handling
Now we provide a matching default for each paramter, thus alleviating
the previous issue of unncecessary follow-up errors.
2015-04-15 11:27:48 +02:00
Sebastian Thiel
6ae6ee88a0 feat(CLI): parse method parameters and set them
It's implemented in a working fashion, except that the default value
is not currently set to something sensible, causing duplicate errors in
case the key-value syntax is wrong.

Related to #61
2015-04-15 11:02:23 +02:00
Sebastian Thiel
fa011315c3 fix(test): add rustc_serialize to test-crate
A top-level `cargo test` didn't work anymore thanks to a missing
mention of rustc_serialize.

[skip ci]
2015-04-15 09:04:16 +02:00
Sebastian Thiel
3f49f50ac2 feat(CLI):handle output json encoding and ostreams
* support for encoding response schemas to json
* support for simple downloads (without alt=media)

Fixes #63
2015-04-14 21:57:58 +02:00
Sebastian Thiel
c3a9f1e8e5 feat(CLI): interpret output arguments
For now we don't properly handle errors when opening files, but the
code is there.
Will panic in next commit.

Related to #63
2015-04-14 21:18:57 +02:00
Sebastian Thiel
76841da098 fix(CLI): optimze argument handling and conversion
* Thanks to a generic function, we save a lot of code within main.rs
* more effcient signature for ParseError

Fixes #65
2015-04-14 20:17:30 +02:00
Sebastian Thiel
e34e24e049 feat(CLI):required arg parsing + first doit() call
We are parsing required scalar values and handle parse-errors correctly,
to the point were we make a simple, non-upload doit() call.

It shows that we seem to build invalid calls, for now,but that's nothing
we can't fix once the time is ripe.

Next goals will be related to finalizing the argument parsing code.

Fixes #60
2015-04-14 17:17:21 +02:00
Sebastian Thiel
d6919f1eb6 feat(CLI): infrastructure for call and dry-run
Now we are able to cleanly handle our arguments on a per-method basis.
The generated code won't clutter our design as we put the details into
their own methods.

Fixes #59
2015-04-14 15:42:12 +02:00
Sebastian Thiel
8afc76a7fe feat(CLI): Implementation of JsonTokenStorage
It's also used by the code, replacing the previous standing,
MemoryStorage.

Fixes #58
2015-04-14 15:13:37 +02:00
Sebastian Thiel
f71c286285 feat(CLI): init hub + refactor for dry-run mode
The hub is just using preset types - we will have to implement our own
storage and auth-delegate, as well as a Hub delegate at some point.

Dry run mode allows us to check for errors and use a call builder
using the very same code.

Fixes #57
2015-04-14 11:54:46 +02:00
Sebastian Thiel
7dc9972445 feat(API): Display + Error traits for Error struct
* improved documentation about error handling, it's less verbose yet
  explains what you can do.

Fixes #56
2015-04-14 10:28:59 +02:00
Sebastian Thiel
be228f1994 feat(CLI): engine checks resource and method args
We are now at a spot where we can actually start parsing arguments.

* ArgumentError -> ClIError - seems more fitting

Fixes #55
2015-04-14 09:41:55 +02:00
Sebastian Thiel
e45eb053d5 fix(CLI): Display for Errors + refactor
* refactored errors into a hierarchy
* implemented `Display` trait for all error types, including some
  'hierarchy-aware' printing.

Fixes #54
2015-04-14 08:34:53 +02:00
Sebastian Thiel
4548644cb1 feat(CLI):write default and read app-secret
* if there is no secret file in json format, we write a default one
  that we will then read in a second iteration of the loop.
  That way, the user has an example of how such a file must look like.

Next step is to cleanup the error type and implement the Error trait.

Fixes #53
2015-04-13 21:21:05 +02:00
Sebastian Thiel
5799d44fce feat(config): create config directory, if possible
* Only supports one level of directory
* full error handling, and uses memory efficiently
2015-04-13 18:45:29 +02:00
Sebastian Thiel
ca8e8c0622 feat(engine): infrastructure
* allow usage of cmn.rs for common types (like Error types)
* instantiate an engine and handle errors, in an initial quick and dirty
  way.

 Fixes #52
2015-04-13 17:08:50 +02:00
Sebastian Thiel
b64722cca8 docs(CLI): random values + cursor information
* Instead of writing pod-types, we generate a random value of the
  required type.
* Fully document how cursors can be set, which is all that's usually
  demonstrated in more complex dynamic structure documentation

Fixes #49
2015-04-13 14:18:32 +02:00
Sebastian Thiel
47f9ca8b20 docs(CLI): absolute top-level cursor + details
* just for show, use absolute cursors in the top-level structure
* indicate you are setting an array or hashmap in the details
2015-04-13 13:50:58 +02:00
Sebastian Thiel
683cbbdd75 docs(CLI): relative cursor positioning
It would still be nice though to show absolute positioning as well.
2015-04-13 13:19:23 +02:00
Sebastian Thiel
92b1ef7476 docs(CLI):dynamic absolute cursor position example
We build all required -r flags using absolute cursor positions only.
The next step should be to use relative ones, and of course be more
verbose about how this should be interpreted (sequential).
2015-04-13 12:06:52 +02:00
Sebastian Thiel
5b4f18d341 fix(api+cli): improved scope handling; fix CLI
* in APIs, scopes will now be per-method, and if no scope is given,
  we will assume only the API key has to be set. Previously there was
  a wild mix between globally mentioned scopes and method scopes.
* assure CLI generation works so far, for all avaialable APIs

Related to #48
2015-04-13 10:50:19 +02:00
Sebastian Thiel
6d3bbcea57 docs(CLI): upload and output flag
We are already there, except for documenting the request value type,
which definitely deserves a separate issue.

Fixes #45
2015-04-12 20:24:12 +02:00
Sebastian Thiel
24e053718a docs(CLI): optional paramters
Added documentation for flags setting all kinds of optional parameters.
2015-04-12 19:33:11 +02:00
Sebastian Thiel
c004840d5b docs(CLI): inforamtion about setting structs
For now we just have a 'dum' example, but once we are there, we shall
make the example and documentation based on the actual request value.

This requires some additional work, which fortunately has to be done
in python only.
2015-04-12 18:46:04 +02:00
Sebastian Thiel
c65a8a6bdf docs(CLI): add required scalar arguments 2015-04-12 18:16:53 +02:00
Sebastian Thiel
334061a5e2 docs(mbuild): name default scope in API docs 2015-04-12 17:28:20 +02:00
Sebastian Thiel
49c4a4101e docs(scopes): added CLI scope documentation
In addition to that, they can now be set as well.
Unified generation of the 'default' scope.
2015-04-12 17:15:55 +02:00
Sebastian Thiel
310c81f19c feat(cli): generate complete docopts grammar
Grammar is laid out per method, providing general purpose arguments
only as needed/supported.

All details will be contained in the markdown documentation.

Related to #45
2015-04-12 12:23:00 +02:00
Sebastian Thiel
51ddcf74a6 fix(cli): add commands.yml.mako
It was previously hidden thanks to .gitignore.

Good I made a fresh clone to see if make really really works.
2015-04-12 10:03:54 +02:00
Sebastian Thiel
acd42dfccc fix(make): dependencies are now per-program-type
Previously we put cli.py into the common lib folder, which caused the
API to be regenerated and rebuilt whenever we changed code that will
only affect the CLI, causing terrible turnaround times.

Now the dependency is fixed.
2015-04-12 09:55:17 +02:00
Sebastian Thiel
3e0a24db0d fix(api-update): 'bytes ...' -> 'bytes=...'
* update all APIs to contain said change. It's not worth a republish
  though.
2015-04-12 08:56:48 +02:00
Sebastian Thiel
75e73d56d9 fix(README+deps): better subtext + rename target
* catchier title for dev diary episode 1
* fixed target name for clean, which was 'clean-api', but should have
  been 'clean-all-api'
2015-04-12 08:55:00 +02:00
Sebastian Thiel
6d3dc77635 fix(docs): one folder per API docs
Otherwise, it would overwrite its search index, effectively breaking
the search field.

We might run into space issues on github, as the generated docs are
duplicating each other and use a lot of disk-space.

Fixes #48
2015-04-11 18:24:32 +02:00
Sebastian Thiel
b9a469c0a4 fix(cmn): use bytes=... when sending as well
Previously, `bytes=` was just parsed, but not sent to the server.
This change is motivated by a similar change in this commit:
http://goo.gl/AvyvLb
2015-04-11 09:31:23 +02:00
Sebastian Thiel
3cef120c58 feat(mkdocs): per-method-markdown-files
That way, all information can be placed within a single markdown file
per method call. This will keep loading times low while maximizing
usability.

That way, it's comparable to the API documentation, which is most
detailed on a per-method basis as well.
2015-04-10 16:52:42 +02:00
Sebastian Thiel
c78ea5381a feat(mkdocs): cli postprocessing support
That way, a single huge markdown file containing documentation for
commands and methods can be split up into multiple files for
individual inclusion in mkdocs.

It's done by a post-processor which is loaded by mako-render, providing
access to the entire context. Said processor may also drop results
altogether and thus prevent files to be written that have been split up
by it.
2015-04-10 13:02:36 +02:00
Sebastian Thiel
2e74d91413 fix(make-deps): fix dependencies
That way, we don't build documentation unless this is truly necessary
2015-04-10 11:22:49 +02:00
Sebastian Thiel
39253d988a feat(cli): docopt subcommands
Setup command/subcommand pattern.
Next will be the infrastucture for documenting these, using mkdocs
and markdown.
2015-04-09 18:01:58 +02:00
Sebastian Thiel
f527c8202b feat(cli): bin renaming + docopt infrastructure
* allow to rename executables, for now just brute-force using a boolean
  flag. If we have more binaries at some point, we might want to be more
  elaborate.
* everything related to docopts functionality is now in the docopts
  module.

  Related to #45
2015-04-09 17:05:55 +02:00
Sebastian Thiel
390354bd08 feat(cli): basic usage of docopts
For now we just show it works within our generator.
Next step is to actually generate docopts grammar.
2015-04-09 16:28:08 +02:00
Sebastian Thiel
6db733274d fix(version-up): add publish state v0.1.5 2015-04-09 13:00:31 +02:00
Sebastian Thiel
34d0a7aad3 fix(README): corrected absolute links
This only affected links in readme files, not the relative ones
in the actual documentation
2015-04-08 17:19:04 +02:00
Sebastian Thiel
a399488c27 fix(version-up): v0.1.5
* fix documentation link in Cargo.toml
* adjust to latest hyper. It's not even out yet, but people
  can't build the APIs anyway.
2015-04-08 16:54:50 +02:00
Sebastian Thiel
191e822c5a fix(hyper-client): adjust to hyper client
* deal with hyper client not using a type-parameter anymore
* fix incorrect documentation link (use '_' instead of '-')

Fixes #47
2015-04-08 16:51:46 +02:00