monofile - read in / parse monorepo / mono source tree definitions - a list of git (and github) projects, and more
- home :: github.com/rubycocos/git
- bugs :: github.com/rubycocos/git/issues
- gem :: rubygems.org/gems/monofile
- rdoc :: rubydoc.info/gems/monofile
Use Monofile.read
to read in / parse monorepo / mono source tree definitions - supporting a ruby or a yaml format.
Example - Monofile
:
project "@openfootball/england"
project "@openfootball/world-cup"
project "@geraldb/austria"
project "@geraldb/geraldb.github.io"
project "geraldb", "catalog"
project "openfootball", "europe"
project "openfootball", "south-america"
or
Example - monofile.yml
:
geraldb:
- austria
- catalog
- geraldb.github.io
openfootball:
- england
- europe
- south-america
- world-cup
To read use.
monofile = Monofile.read( "./Monofile" )
# -or-
monofile = Monofile.read( "./monofile.yml" )
pp monofile.to_a
#=> ["@openfootball/england",
# "@openfootball/world-cup",
# "@geraldb/austria",
# "@geraldb/geraldb.github.io",
# "@geraldb/catalog",
# "@openfootball/europe"]
# "@openfootball/south-america"]
pp monofile.to_h
#=> {"openfootball"=>["england", "world-cup", "europe", "south-america"],
# "geraldb" =>["austria", "geraldb.github.io", "catalog"]}
monofile.each do |proj|
puts " #{proj}"
end
#=> @openfootball/england
# @openfootball/world-cup
# @geraldb/austria
# @geraldb/geraldb.github.io
# @geraldb/catalog
# @openfootball/europe
# @openfootball/south-america
monofile.size
#=> 7
and so on. That's it for now.
Use the monofile
command line tool to test reading in of
monorepo / mono source tree definitions.
Example:
# option 1) try to find default name (e.g. Monofile, Monofile.rb, etc.)
$ monofile
# option 2) pass in monofiles
$ monofile ./Monofile
$ monofile ./monfile.yml
# ...
Printing the normalized / canonical names of the repo sources. Example.
@openfootball/england
@openfootball/world-cup
@geraldb/austria
@geraldb/geraldb.github.io
@geraldb/catalog
@openfootball/europe
@openfootball/south-america
See the monos
package that incl. the mono
(or short mo
)
command line tool lets you run
git commands on multiple repo(sitories) with a single command.
Use
gem install monofile
or add to your Gemfile
gem 'monofile'
The monofile
scripts are dedicated to the public domain.
Use it as you please with no restrictions whatsoever.