{"id":17003836,"url":"https://github.com/cldwalker/rubydoc","last_synced_at":"2025-04-12T06:31:55.865Z","repository":{"id":4016952,"uuid":"5116231","full_name":"cldwalker/rubydoc","owner":"cldwalker","description":"A repl tool to help rubyists find clojure equivalents","archived":false,"fork":false,"pushed_at":"2014-04-04T19:33:05.000Z","size":234,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-06T18:53:03.273Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cldwalker.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-19T22:05:58.000Z","updated_at":"2020-10-16T01:24:28.000Z","dependencies_parsed_at":"2022-09-07T18:10:28.498Z","dependency_job_id":null,"html_url":"https://github.com/cldwalker/rubydoc","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldwalker%2Frubydoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldwalker%2Frubydoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldwalker%2Frubydoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cldwalker%2Frubydoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cldwalker","download_url":"https://codeload.github.com/cldwalker/rubydoc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248529759,"owners_count":21119576,"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-14T04:32:50.406Z","updated_at":"2025-04-12T06:31:55.527Z","avatar_url":"https://github.com/cldwalker.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Description\n\nA repl tool to help rubyists find clojure equivalents. This project\nprovides a rubydoc command to search the included db of ruby/clojure\ncomparisons. Compares versions \u003e= ruby 1.9.3 and clojure 1.4.0.\n\n[![Build Status](https://travis-ci.org/cldwalker/rubydoc.png?branch=master)](https://travis-ci.org/cldwalker/rubydoc)\n\n## Install\n\nTo have it on an individual project, add to your project.clj:\n\n    [rubydoc \"0.4.0\"]\n\nTo have it available on all projects, add to your leiningen2's ~/lein/profiles.clj:\n\n    {:user {:dependencies [[rubydoc \"0.4.0\"]]}}\n\n## Usage\n\nTo use in a library:\n\n    (use 'rubydoc.core)\n\nLet's search for ruby equivalents in clojure:\n\n    $ lein repl\n    user=\u003e (use 'rubydoc.core)\n    nil\n\n    ; Pull up clojure equivalents to Kernel methods\n    user=\u003e (rubydoc \"Kernel\")\n    +-----+--------------------------------+--------------------------------+---------+--------------------------------------------------------+\n    | id  | ruby                           | clj                            | similar | desc                                                   |\n    +-----+--------------------------------+--------------------------------+---------+--------------------------------------------------------+\n    | 1   | Kernel#system                  | clojure.java.shell/sh          | true    | sh executes commands but unlike system, stdout is c... |\n    | 2   | Kernel#exit                    | System/exit                    |         |                                                        |\n    | 3   | Kernel#require                 | clojure.core/require           |         | They are mostly the same though the clojure version... |\n    | 4   | Kernel#load                    | clojure.core/load-file         |         |                                                        |\n    | 6   | Kernel#puts                    | clojure.core/println           |         |                                                        |\n    | 7   | Kernel#print                   | clojure.core/print             |         |                                                        |\n    | 8   | Kernel#pp                      | clojure.pprint/pprint          |         | The ruby meth comes from requiring 'pp', a file in ... |\n    | 9   | Kernel#sleep                   | Thread/sleep                   |         |                                                        |\n    | 10  | Kernel#at_exit                 | (.addShutdownHook (Runtime/... | true    | Whereas at_exits are run in the reverse order defin... |\n    | 15  | Kernel#raise                   | throw                          |         |                                                        |\n    | 23  | IO.read and Kernel#open fro... | clojure.core/slurp             |         | slurp is a generalize read, reading anything java.i... |\n    | 64  | String#% or Kernel#sprintf     | clojure.core/format            |         |                                                        |\n    | 106 | Kernel#warn                    | (binding [*out* *err*] (pri... |         |                                                        |\n    +-----+--------------------------------+--------------------------------+---------+--------------------------------------------------------+\n    nil\n\n    ; To expand a record's information, pass it's id\n    user=\u003e (rubydoc 3)\n    +-------+----------------------------------------------------------------------------------------------------------------------------------+\n    | field | value                                                                                                                            |\n    +-------+----------------------------------------------------------------------------------------------------------------------------------+\n    | :id   | 3                                                                                                                                |\n    | :ruby | Kernel#require                                                                                                                   |\n    | :clj  | clojure.core/require                                                                                                             |\n    | :desc | They are mostly the same though the clojure version has useful :reload and :reload-all flags. Also the require file format is di |\n    |       | fferent. For example, a ruby version of \"reply/eval_state\", has the clojure equivalent of \"reply.eval-state\".                    |\n    +-------+----------------------------------------------------------------------------------------------------------------------------------+\n\n    ; Pull up a ruby method by it's name\n    user=\u003e (rubydoc \"system\")\n    +----------+-------------------------------------------------------------------------+\n    | field    | value                                                                   |\n    +----------+-------------------------------------------------------------------------+\n    | :id      | 1                                                                       |\n    | :ruby    | Kernel#system                                                           |\n    | :clj     | clojure.java.shell/sh                                                   |\n    | :similar | true                                                                    |\n    | :desc    | sh executes commands but unlike system, stdout is captured as a string. |\n    +----------+-------------------------------------------------------------------------+\n    nil\n\n    ; Pull up ruby methods by their library/gem\n    user=\u003e (rubydoc \"activesupport\")\n    +-----+----------------------------------+--------------------------+---------------+----------------------------------------------------------------+\n    | id  | ruby                             | clj                      | ruby-lib      | desc                                                           |\n    +-----+----------------------------------+--------------------------+---------------+----------------------------------------------------------------+\n    | 49  | ActiveSupport::Memoizable#mem... | clojure.core/memoize     | activesupport | Memoizes a function based on arguments.                        |\n    | 93  | Object#blank?                    | clojure.string/blank?    | activesupport |                                                                |\n    | 186 | Hash#slice                       | clojure.core/select-keys | activesupport |                                                                |\n    | 187 | Hash#except                      | clojure.core/dissoc      | activesupport |                                                                |\n    | 195 | Object#present?                  | clojure.core/seq         | activesupport | seq is meant for more than just checking presence and retur... |\n    +-----+----------------------------------+--------------------------+---------------+----------------------------------------------------------------+\n\n    ; What clojure functions have 'con' in them\n    (rubydoc \"con\" :clj)\n    +-----+---------------+------------------------+-----------------------------------------------------------------------------------+\n    | id  | ruby          | clj                    | desc                                                                              |\n    +-----+---------------+------------------------+-----------------------------------------------------------------------------------+\n    | 54  | Hash#key?     | clojure.core/contains? |                                                                                   |\n    | 87  | Array#unshift | clojure.core/cons      | See also clojure.core/conj which does this for lists but with arguments reversed. |\n    | 98  | Array#concat  | clojure.core/concat    | Clojure version can take multiple collections.                                    |\n    | 101 | Array#\u003c\u003c      | clojure.core/conj      |                                                                                   |\n    +-----+---------------+------------------------+-----------------------------------------------------------------------------------+\n\n    ; Do any records have 'private' anywhere in them?\n    user=\u003e (rubydoc \"private\" :all)\n    +----------+------------------------------------------------------------------------+\n    | field    | value                                                                  |\n    +----------+------------------------------------------------------------------------+\n    | :id      | 11                                                                     |\n    | :ruby    | Object#send                                                            |\n    | :clj     | @#'namespace/meth                                                      |\n    | :similar | true                                                                   |\n    | :type    | code                                                                   |\n    | :desc    | To call private methods as send can, place the deref-ed Var in the ... |\n    +----------+------------------------------------------------------------------------+\n\n    ; What records are of type \"variable\"?\n    user=\u003e (rubydoc \"variable\" :type)\n    +----+------------+-------------------------------+----------+-------------------------------------------+---------+\n    | id | ruby       | clj                           | type     | desc                                      | similar |\n    +----+------------+-------------------------------+----------+-------------------------------------------+---------+\n    | 33 | $:         | (seq (.getURLs (ClassLoade... | variable | These are the loaded loadpaths/classpa... |         |\n    | 34 | $LOAD_PATH | (seq (.getURLs (ClassLoade... | variable | These are the loaded loadpaths/classpa... |         |\n    | 35 | $RUBYLIB   | $CLASSPATH                    | variable | These environment variables can be man... |         |\n    | 42 | _          | *1                            | variable | These give back the returned value fro... |         |\n    | 43 | $!         | *e                            | variable | While ruby's is available to any progr... | true    |\n    +----+------------+-------------------------------+----------+-------------------------------------------+---------+\n\n## Record Fields\n\nA record can have the following fields:\n\n* :id (required) - A unique integer identifying the record. Automatically generated.\n* :ruby (required) - Main field for ruby. Contains full method name when fn type. Can also contain\n  code, be a gem name, etc. depending on the type.\n* :clj (required) - Main field for clojure.\n* :ruby-lib - When fn type, an optional field for stdlib or gem name that a method belongs to.\n* :type: Has one of the following values: fn, constant, variable, lib, code and keyword. When\n  not specified defaults to fn. More about each type:\n  * fn - compares a ruby method to clojure fn\n  * constant - compares a ruby and/or clojure constant\n  * variable - compares a ruby and/or clojure variable\n  * code - compares ruby and/or clojure code\n  * keyword - compares a language level feature, keyword in ruby and special form in clojure\n  * lib - compares ruby gem to clojar\n* :desc - A description of the record\n\n## Contributing\n\nIf you have some ruby/clojure comparisons, please add them to [rubydoc's\ndatabase](https://github.com/cldwalker/rubydoc/blob/master/src/rubydoc/db.clj)! Please add them to\nthe end of file (to keep record ids consistent). I would definitely love to see this become a\ncommunity resource. While this project is primarily focused on method/functions, you can also add\nconstants, variables, libraries (gems/jars), general code and keywords (special forms).  When\nadding these records be sure to use an allowed type. See the Record Fields section for more info.\n\n[Some additional general guidelines](http://tagaholic.me/contributing.html). New tests aren't needed\nfor db contributions.\n\n## Contributors\n\nThanks to:\n* edtsech\n\n## Credits\nThanks to @relevance fridays for time to start this!\n\n## Additional links\n* https://gist.github.com/17283 - A nice list of Array and Enumerable ruby/clojure comparisons\n* http://langref.org/clojure+ruby/files - Comparison by tackling specific problems. Clojure could be\n  more idiomatic.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcldwalker%2Frubydoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcldwalker%2Frubydoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcldwalker%2Frubydoc/lists"}