|
1 | | -[](http://badge.fury.io/rb/morph-cli) |
| 1 | +[](https://rubygems.org/gems/morph-cli) |
2 | 2 | [](https://github.com/openaustralia/morph-cli/actions/workflows/ci.yml) |
3 | 3 |
|
4 | | -# Morph Commandline |
| 4 | +# Morph CLI |
5 | 5 |
|
6 | | -Runs Morph scrapers from the commandline. |
| 6 | +Runs [morph.io](https://morph.io) scrapers from the command line. |
7 | 7 |
|
8 | | -Actually it will run them on the Morph server identically to the real thing. That means not installing a bucket load of libraries |
9 | | -and bits and bobs that are already installed with the Morph scraper environments. |
| 8 | +Actually it will run them on the morph.io server identically to the real thing. |
| 9 | +That means not installing a bucket load of libraries and bits and bobs that are |
| 10 | +already installed with the morph.io scraper environments. |
10 | 11 |
|
11 | | -To run a scraper in your local directory |
| 12 | +## Installation |
| 13 | + |
| 14 | +You'll need Ruby 3.2 or later. Then |
| 15 | + |
| 16 | + gem install morph-cli |
| 17 | + |
| 18 | +## Usage |
| 19 | + |
| 20 | +To run the scraper in your current directory |
12 | 21 |
|
13 | 22 | morph |
14 | 23 |
|
15 | 24 | Yup, that's it. |
16 | 25 |
|
17 | | -It runs the code that's there right now. It doesn't need to be checked into git or anything. |
| 26 | +It runs the code that's there right now. It doesn't need to be checked into git |
| 27 | +or anything. |
| 28 | + |
| 29 | +The first time you run it, it will ask for your morph.io API key, which it |
| 30 | +saves in `~/.morph`. |
18 | 31 |
|
19 | 32 | For help |
20 | 33 |
|
21 | 34 | morph help |
22 | 35 |
|
23 | | -## Installation |
| 36 | +## Limitations |
24 | 37 |
|
25 | | -You'll need Ruby >= 1.9 and then |
| 38 | +It uploads your code every time. So if it's big it might take a little while. |
| 39 | +Scrapers are not usually so I'm hoping this won't really be an issue. |
26 | 40 |
|
27 | | - gem install morph-cli |
| 41 | +It doesn't yet return you the resulting sqlite database (or use the one you |
| 42 | +might have locally). |
28 | 43 |
|
29 | | -## Limitations |
| 44 | +## Development |
30 | 45 |
|
31 | | -It uploads your code everytime. So if it's big it might take a little while. Scrapers are not usually so I'm hoping this won't really be an issue |
| 46 | +After checking out the repo, run `bundle install` to install dependencies. |
| 47 | +Then run the tests with |
32 | 48 |
|
33 | | -It doesn't yet return you the resulting sqlite database (or use the one you might have locally) |
| 49 | + bundle exec rspec |
34 | 50 |
|
35 | 51 | ## Contributing |
36 | 52 |
|
| 53 | +Contributions are welcome! Please see the |
| 54 | +[OpenAustralia Foundation contributing guide](https://github.com/openaustralia/.github/blob/main/.github/CONTRIBUTING.md) |
| 55 | +for how we work: GitHub Flow, draft pull requests, signed-off commits (DCO) |
| 56 | +and our contributor licence agreement. |
| 57 | + |
37 | 58 | 1. Fork it |
38 | | -2. Create your feature branch (`git checkout -b my-new-feature`) |
39 | | -3. Commit your changes (`git commit -am 'Add some feature'`) |
40 | | -4. Push to the branch (`git push origin my-new-feature`) |
41 | | -5. Create new Pull Request |
| 59 | +2. Create your feature branch (`git checkout -b feature/my-new-feature`) |
| 60 | +3. Commit your changes (`git commit -s -am 'Add some feature'`) |
| 61 | +4. Push to the branch (`git push origin feature/my-new-feature`) |
| 62 | +5. Create a new pull request |
| 63 | + |
| 64 | +## License |
| 65 | + |
| 66 | +The gem is available as open source under the terms of the |
| 67 | +[MIT License](LICENSE.txt). |
0 commit comments