README.md in mangadex-5.5.8 vs README.md in mangadex-5.7.5
- old
+ new
@@ -1,14 +1,15 @@
-[![Ruby](https://github.com/thedrummeraki/mangadex/actions/workflows/ruby.yml/badge.svg)](https://github.com/thedrummeraki/mangadex/actions/workflows/ruby.yml)<a href="https://rubygems.org/gems/mangadex"><img src="https://badgen.net/rubygems/v/mangadex" /></a>
+[![Docker Image CI](https://github.com/thedrummeraki/mangadex/actions/workflows/docker-image.yml/badge.svg)](https://github.com/thedrummeraki/mangadex/actions/workflows/docker-image.yml)<a href="https://rubygems.org/gems/mangadex"><img src="https://badgen.net/rubygems/v/mangadex" /></a>
# Mangadex
Welcome to `mangadex`, your next favourite Ruby gem for interacting with [Mangadex](https://mangadex.org).
## Important information
**By using this gem you accept**:
+
- To **credit [Mangadex](https://mangadex.org)**. This gem is your friendly neighbourhood wrapper on _their_ API.
- To **credit scanlation groups**, especially if you offer the ability to read chapters.
- **Not to run any ads** on the service that will use this gem. Please do not make money off of Mangadex's services.
These are Mangadex's [rules](https://api.mangadex.org/docs.html#section/Acceptable-use-policy), please follow them.
@@ -194,10 +195,11 @@
end
```
Already created your `User` class? Make sure it has all of the following:
+
- `mangade_user_id`: ID used to identify your user on Mangadex
- `username`: Your username
- `session`: The session token (valid for 15 minutes)
- `refresh`: The refresh token, used to refresh the session (valid for 1 month)
- `session_valid_until`: The time `session` session expires at
@@ -280,11 +282,11 @@
log_in(user)
redirect_to(root_path)
rescue Mangadex::Errors::AuthenticationError => error
# See https://api.mangadex.org/docs.html to learn more about errors
Rails.logger.error(error.response.errors)
-
+
# Handle authentication errors here
end
# DELETE /logout
def destroy
@@ -323,11 +325,11 @@
redirect_to(login_path) # go to /login
end
end
```
-We're going with managing (list, create, show, edit, delete) MDLists (ie: custom lists). __We're not using strong params below to keep things simple, but you should, especially when mutating data (ie: creating and editing)__.
+We're going with managing (list, create, show, edit, delete) MDLists (ie: custom lists). **We're not using strong params below to keep things simple, but you should, especially when mutating data (ie: creating and editing)**.
```ruby
class CustomListsController < ProtectedController
# GET /custom_list
def index
@@ -382,12 +384,36 @@
end
```
## Development
+### Docker
+
+You can use Docker to get started with dev work on the repo. After installing Dcoker, you can build the image:
+
+```
+docker build -t mangadex .
+```
+
+Then run the ruby console with the gem loaded
+
+```
+docker run --rm -it mangadex:latest
+```
+
+You can also log in directly when setting the `MD_USERNAME` and `MD_PASSWORD` (or `MD_EMAIL`) environment variables:
+
+```
+docker run --rm -e MD_USERNAME=username -e MD_PASSWORD=password -it mangadex:latest
+```
+
+### Locally
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
+
+You can also
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/thedrummeraki/mangadex. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.