{"id":18035907,"url":"https://github.com/candlerb/couchdb_ruby_view","last_synced_at":"2025-03-27T08:30:36.154Z","repository":{"id":609256,"uuid":"246596","full_name":"candlerb/couchdb_ruby_view","owner":"candlerb","description":"View server for CouchDB which lets you write map and reduce functions in ruby","archived":false,"fork":false,"pushed_at":"2010-08-25T19:39:34.000Z","size":93,"stargazers_count":29,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-23T10:44:09.572Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/candlerb.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-07-08T21:48:52.000Z","updated_at":"2021-01-13T19:26:38.000Z","dependencies_parsed_at":"2022-07-16T15:17:26.045Z","dependency_job_id":null,"html_url":"https://github.com/candlerb/couchdb_ruby_view","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candlerb%2Fcouchdb_ruby_view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candlerb%2Fcouchdb_ruby_view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candlerb%2Fcouchdb_ruby_view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/candlerb%2Fcouchdb_ruby_view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/candlerb","download_url":"https://codeload.github.com/candlerb/couchdb_ruby_view/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245809568,"owners_count":20676010,"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-30T12:10:44.085Z","updated_at":"2025-03-27T08:30:35.798Z","avatar_url":"https://github.com/candlerb.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Installation\n------------\nCopy bin/couchdb_ruby_view to somewhere like /usr/local/bin, and make\nsure it is executable.\n\nEdit /usr/local/etc/couchdb/local.ini and set:\n\n[query_servers]\nruby = /usr/local/bin/couchdb_ruby_view\n\nor\n\nruby = /path/to/ruby /usr/local/bin/couchdb_ruby_view\n\nRestart couchdb.\n\nAPI\n---\nmap:\n\n  proc { |doc|\n    ...\n    emit(key,val)\n    ...\n  }\n\nreduce/rereduce:\n\n  proc { |ks,vs,rereduce|\n    vs.inject(0) { |a,b| a+b }\n  }\n\nNote that CouchDB actually passes objects which could be iterated directly\nusing { |(k,id),v| ... }. However I've split these into separate arrays of\n[k,id] and v for consistency with the Javascript view server, and because it\nsimplifies some reduce/rereduce functions (as in the example above, where\nboth reduce and rereduce are the same)\n\n*** IMPORTANT SECURITY WARNING ***\n----------------------------------\nDON'T USE THIS CODE IF UNTRUSTED USERS HAVE DIRECT ACCESS TO YOUR DATABASE!\nThey will be able to run *any* code or read/write *any* file as the couchdb\nuser if they can post to _temp_view or update design documents.\n\nTODO: improve this by compiling and running the functions in a separate\nthread with $SAFE=4.  There is also _why's ruby sandbox gem, although this\nrequires a small patch to the ruby interpreter itself.\n\nALSO TODO\n---------\nIf map/reduce functions define helper methods using 'def', they should do\nthis inside a singleton class rather than globally.\n\nAuthors\n-------\nJohan Sørensen \u003cjohan@johansorensen.com\u003e\nBrian Candler \u003cB.Candler@pobox.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcandlerb%2Fcouchdb_ruby_view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcandlerb%2Fcouchdb_ruby_view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcandlerb%2Fcouchdb_ruby_view/lists"}