|
| 1 | +# monofile - read in / parse monorepo / mono source tree definitions - a list of git (and github) projects, and more |
| 2 | + |
| 3 | +* home :: [github.com/rubycocos/git](https://github.com/rubycocos/git) |
| 4 | +* bugs :: [github.com/rubycocos/git/issues](https://github.com/rubycocos/git/issues) |
| 5 | +* gem :: [rubygems.org/gems/monofile](https://rubygems.org/gems/monofile) |
| 6 | +* rdoc :: [rubydoc.info/gems/monofile](http://rubydoc.info/gems/monofile) |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | +## Usage |
| 11 | + |
| 12 | + |
| 13 | +Use `Monofile.read` to read in / parse monorepo / mono source tree definitions - supporting a ruby or a yaml format. |
| 14 | + |
| 15 | + |
| 16 | +Example - `Monofile`: |
| 17 | +``` ruby |
| 18 | +project "@openfootball/england" |
| 19 | +project "@openfootball/world-cup" |
| 20 | +project "@geraldb/austria" |
| 21 | +project "@geraldb/geraldb.github.io" |
| 22 | + |
| 23 | +project "geraldb", "catalog" |
| 24 | +project "openfootball", "europe" |
| 25 | +project "openfootball", "south-america" |
| 26 | +``` |
| 27 | + |
| 28 | +or |
| 29 | + |
| 30 | +Example - `monofile.yml`: |
| 31 | + |
| 32 | +``` yaml |
| 33 | +geraldb: |
| 34 | +- austria |
| 35 | +- catalog |
| 36 | +- geraldb.github.io |
| 37 | + |
| 38 | +openfootball: |
| 39 | +- england |
| 40 | +- europe |
| 41 | +- south-america |
| 42 | +- world-cup |
| 43 | +``` |
| 44 | +
|
| 45 | +
|
| 46 | +To read use. |
| 47 | +
|
| 48 | +``` ruby |
| 49 | +monofile = Monofile.read( "./Monofile" ) |
| 50 | +# -or- |
| 51 | +monofile = Monofile.read( "./monofile.yml" ) |
| 52 | +pp monofile.to_a |
| 53 | +#=> ["@openfootball/england", |
| 54 | +# "@openfootball/world-cup", |
| 55 | +# "@geraldb/austria", |
| 56 | +# "@geraldb/geraldb.github.io", |
| 57 | +# "@geraldb/catalog", |
| 58 | +# "@openfootball/europe"] |
| 59 | +# "@openfootball/south-america"] |
| 60 | + |
| 61 | +pp monofile.to_h |
| 62 | +#=> {"openfootball"=>["england", "world-cup", "europe", "south-america"], |
| 63 | +# "geraldb" =>["austria", "geraldb.github.io", "catalog"]} |
| 64 | + |
| 65 | +monofile.each do |proj| |
| 66 | + puts " #{proj}" |
| 67 | +end |
| 68 | +#=> @openfootball/england |
| 69 | +# @openfootball/world-cup |
| 70 | +# @geraldb/austria |
| 71 | +# @geraldb/geraldb.github.io |
| 72 | +# @geraldb/catalog |
| 73 | +# @openfootball/europe |
| 74 | +# @openfootball/south-america |
| 75 | + |
| 76 | +monofile.size |
| 77 | +#=> 7 |
| 78 | +``` |
| 79 | + |
| 80 | +and so on. That's it for now. |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | +### Troubleshooting / Debugging |
| 85 | + |
| 86 | +Use the `monofile` command line tool to test reading in of |
| 87 | +monorepo / mono source tree definitions. |
| 88 | +Example: |
| 89 | + |
| 90 | +``` shell |
| 91 | +# option 1) try to find default name (e.g. Monofile, Monofile.rb, etc.) |
| 92 | +$ monofile |
| 93 | + |
| 94 | +# option 2) pass in monofiles |
| 95 | +$ monofile ./Monofile |
| 96 | +$ monofile ./monfile.yml |
| 97 | +# ... |
| 98 | +``` |
| 99 | + |
| 100 | +Printing the normalized / canonical names of the repo sources. Example. |
| 101 | + |
| 102 | +``` |
| 103 | +@openfootball/england |
| 104 | +@openfootball/world-cup |
| 105 | +@geraldb/austria |
| 106 | +@geraldb/geraldb.github.io |
| 107 | +@geraldb/catalog |
| 108 | +@openfootball/europe |
| 109 | +@openfootball/south-america |
| 110 | +``` |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | +## Real-World Usage |
| 116 | + |
| 117 | +See the [`monos`](https://github.com/rubycocos/git/tree/master/monos) package that incl. the `mono` (or short `mo`) |
| 118 | +command line tool lets you run |
| 119 | +git commands on multiple repo(sitories) with a single command. |
| 120 | + |
| 121 | + |
| 122 | +## Installation |
| 123 | + |
| 124 | +Use |
| 125 | + |
| 126 | + gem install monofile |
| 127 | + |
| 128 | +or add to your Gemfile |
| 129 | + |
| 130 | + gem 'monofile' |
| 131 | + |
| 132 | + |
| 133 | + |
| 134 | +## License |
| 135 | + |
| 136 | +The `monofile` scripts are dedicated to the public domain. |
| 137 | +Use it as you please with no restrictions whatsoever. |
| 138 | + |
0 commit comments