Author: Pedro Lucas Porcellis <firstname.lastname@example.org>
all: initial commit
.editorconfig | 11 +++++++++++ .gitignore | 1 + .ruby-version | 1 + COPYING | 15 +++++++++++++++ README.md | 40 ++++++++++++++++++++++++++++++++++++++++
diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..28add8e0d0ccfb341ab27821f5aaccce47d2e1fb --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 + +# Tab indentation +[Makefile] +indent_style = tab +indent_size = 4 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..75804c40072bfe55c46495a80a014fc9eeefc530 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +config/config.yml diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000000000000000000000000000000000000..fd2a01863fdd3035fac5918c59666363544bfe23 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.1.0 diff --git a/COPYING b/COPYING new file mode 100644 index 0000000000000000000000000000000000000000..2e38ea0f97123d5c330e8dc5cd01f789a9a95c7e --- /dev/null +++ b/COPYING @@ -0,0 +1,15 @@ +ISC-License + +Copyright 2022 Pedro Lucas Porcellis <email@example.com> + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..619d69845101d636fe0108c7fc2cc9e5f4859c83 --- /dev/null +++ b/README.md @@ -0,0 +1,40 @@ +# Marvel Comics Test + +This is a barebones Marvel's API demo. It'll fetch a given story (I've picked +some random Silk's story) and display its name and list characters that are on +that story with their photo. + +## Running + +It's a pretty barebones sinatra application. You'll just need Ruby 3.0 and +install sinatra itself. How to install the ruby version, depends on each +environment. Some folks use rvm, some others rbenv. I personally just install +via my system package manager (using apk), so that's an exercise for the reader. + +Lastly, you should be able to install sinatra's using rubygems: + +```sh +$ gem install sinatra +``` + +Then, to run the application, just run `rackup`. You have to set your personal +Marvel API Key pair on `config/config.yml` before you can start running the +application. Just copy the `.sample` file and you're good to go: + +```sh +$ cp config/config.yml.sample config/config.yml +$ rackup +``` + +At this point you'll have the webserver running at `:9292`. + +## TODO + +Or things I would do, if I had more time: + +- Caching API responses +- Mapping the response into some struct, so no more messing with hashes directly + +## License + +ISC License. Check COPYING for more detailed information.