Search engine for Magic: The Gathering cards.
Ruby on Rails frontend
To run frontend like http://mtg.wtf/
$ cd frontend
$ bundle
$ bundle exec rails s
Command line
To search card names from command line:
$ ./bin/find_cards "query"
To search card names and content from command line:
$ ./bin/find_cards -v "query"
To explore card database from Ruby console:
$ ./bin/pry_cards
Testing
Tests for library and for Rails frontend are separate:
$ bundle install
$ bundle exec rake test
$ (cd frontend; bundle install)
$ (cd frontend; bundle exec rake test)
How to update database
Whenever new set is released:
- Add new set code to legalities in Vintage
- Add new set code and date to legalities in Standard and Modern if applicable
- Add new set code to appropriate block in indexer
- Create new block format if applicable and add it to indexer and Format class
- Update format tests
Then import cards:
- Run
rake mtgjson:updateto fetch mtgjson data and index it - Run
rake testand fix any tests failing due to data changes
Whenever banned and restricted list is announced:
- Update
BanlistTestand/orBanlistCommanderTest - Update
Banlistdata
If Comprehensive rules changed:
- Update
data/MagicCompRules.txtwith TXT format Comprehensive Rule - Run
./bin/format_comp_rules
On this page
Languages
HTML76.2%Ruby23.3%CSS0.5%JavaScript0.1%CoffeeScript0.1%
Contributors
Created August 14, 2016
Updated August 14, 2016