{"id":17041897,"url":"https://github.com/cloudhead/mutter","last_synced_at":"2025-07-14T01:11:13.630Z","repository":{"id":624164,"uuid":"264147","full_name":"cloudhead/mutter","owner":"cloudhead","description":"the tiny command-line interface library with lots of style~","archived":false,"fork":false,"pushed_at":"2010-01-11T18:36:58.000Z","size":123,"stargazers_count":80,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-09T18:13:16.032Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://gemcutter.org/gems/mutter","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"tsuru/tsuru","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudhead.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-07-30T00:02:21.000Z","updated_at":"2024-10-15T09:38:28.000Z","dependencies_parsed_at":"2022-07-05T04:01:34.346Z","dependency_job_id":null,"html_url":"https://github.com/cloudhead/mutter","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudhead%2Fmutter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudhead%2Fmutter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudhead%2Fmutter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudhead%2Fmutter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudhead","download_url":"https://codeload.github.com/cloudhead/mutter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230445927,"owners_count":18227060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T09:14:04.562Z","updated_at":"2024-12-19T14:08:05.482Z","avatar_url":"https://github.com/cloudhead.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"mutter\n======\n\n    $ my words come out, \n        in color and\n            style\n\n\u003e mutter takes the concepts of **separation of style \u0026 content** to the command-line!\n\nsetup\n-----\n\n    $ sudo gem install mutter -s http://gemcutter.org\n\nsynopsis\n--------\n\n    require 'mutter'\n\n    mut = Mutter.new                # creates a new 'Mutterer', who talks in command-line language\n    mut.say \"hello _world_\"         # underlines 'world'\n    mut.say \"hello world\",   :bold  # bolds the whole string\n    mut.say \"hello [world]\", :cyan  # inverts 'world', and colors the string cyan\n    mut.print \"bonjour!\"            # alias of `say`\n    mut[\"_hola_\"]                   # return the stylized string without printing, alias of #process\n\n### Tables\n\nDefine your table structure, arguments are optional.\n\n    table = Mutter::Table.new(:delimiter =\u003e '|') do    # Strings which don't fit the column width will be truncated\n      column :width =\u003e 15, :style =\u003e :green            # with '..' by default, you can change that with the :truncater\n      column :style =\u003e :yellow                         # option.\n      column :width =\u003e 15, :align =\u003e :right\n    end\n\nAdd some rows\n\n    table \u003c\u003c [\"gaspar\", \"morello\", 1976]\n    table \u003c\u003c [\"eddie\", \"vedder\", 1964]\n    table \u003c\u003c [\"david\", \"bowie\", 1947]\n    \nPrint.\n\n    print table.to_s\n\nIf you want something barebones, you can also do\n\n    t = Mutter::Table.new\n    t.rows = (1..10).map {|n| [n, n **2, n **3] }\n    t.print\n\nAnd it'll make sure everything is aligned nicely\n\nstyles\n------\nmutter supports these styles:\n\n    :bold, :underline, :inverse, :blink\n\nand these colors:\n\n    :red, :green, :blue, :yellow, :cyan, :purple, :white, :black\n\ncustomization\n-------------\n\n    styles = {\n      :warning =\u003e {                     # an alias you can use anywhere in mutter\n        :match =\u003e ['*!', '!*'],         # will match *!mutter!*\n        :style =\u003e ['yellow', 'bold']    # these styles will be applied to the match\n      },\n      :error =\u003e {\n        :match =\u003e '!!',                 # will match !!mutter!!\n        :style =\u003e ['red', 'underline']\n      }\n    }\n    \n    mut = Mutter.new(styles)\n    mut.say     \"warning, the dogs have escaped!\", :warning  # These two are\n    mut.warning \"warning, the dogs have escaped!\"            # equivalent\n    mut.say     \"gosh, we have an !!error!!\"\n\n### YAML\n    \nThe previous example could have (and should really have) been written in a separate .yml file, like so:\n    \n    warning:\n      match: \n        - '*!'\n        - '!*\n      style:\n        - yellow\n        - bold\n\n    error:\n      match: '!!'\n      style:\n        - red\n        - underline\n\nand then loaded like this:\n\n    Mutter.new(\"styles.yml\")\n    \n### quick styles\n\n    mut = Mutter.new :yellow =\u003e '~'\n    mut.say \"~[black on yellow!]~\"\n    \n### add/remove styles from an instance\n\n    mut = Mutter.new(:blink)\n    mut \u003e\u003e :blink               # remove :blink\n    mut \u003c\u003c :bold \u003c\u003c :underline  # add :bold and :underline\n    mut.say \"hello mutter.\"     # bold and underlined\n    \nThat's it!\n----------\n\n_have fun_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudhead%2Fmutter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudhead%2Fmutter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudhead%2Fmutter/lists"}