{"id":18026807,"url":"https://github.com/yegor256/total","last_synced_at":"2025-04-09T22:13:27.737Z","repository":{"id":59157835,"uuid":"163407764","full_name":"yegor256/total","owner":"yegor256","description":"Ruby Gem to get total memory size in the system","archived":false,"fork":false,"pushed_at":"2025-04-08T15:59:51.000Z","size":220,"stargazers_count":17,"open_issues_count":5,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T22:13:23.629Z","etag":null,"topics":["memory","memory-management","ruby","ruby-gem"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/total","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/yegor256.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-28T12:25:01.000Z","updated_at":"2025-04-07T22:01:31.000Z","dependencies_parsed_at":"2024-06-21T04:29:39.978Z","dependency_job_id":"96d3c3c1-dc36-4122-b51f-24203ae6e8f6","html_url":"https://github.com/yegor256/total","commit_stats":{"total_commits":28,"total_committers":1,"mean_commits":28.0,"dds":0.0,"last_synced_commit":"5b55c690e337e71df9071cbb883d274d8eec80e7"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Ftotal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Ftotal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Ftotal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Ftotal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yegor256","download_url":"https://codeload.github.com/yegor256/total/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119292,"owners_count":21050755,"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":["memory","memory-management","ruby","ruby-gem"],"created_at":"2024-10-30T08:08:07.330Z","updated_at":"2025-04-09T22:13:27.731Z","avatar_url":"https://github.com/yegor256.png","language":"Ruby","readme":"\u003cimg src=\"/logo.svg\" width=\"64px\"/\u003e\n\n[![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)\n[![DevOps By Rultor.com](https://www.rultor.com/b/yegor256/total)](https://www.rultor.com/p/yegor256/total)\n[![We recommend RubyMine](https://www.elegantobjects.org/rubymine.svg)](https://www.jetbrains.com/ruby/)\n\n[![rake](https://github.com/yegor256/total/actions/workflows/rake.yml/badge.svg)](https://github.com/yegor256/total/actions/workflows/rake.yml)\n[![Gem Version](https://badge.fury.io/rb/total.svg)](https://badge.fury.io/rb/total)\n[![Maintainability](https://api.codeclimate.com/v1/badges/6e08ce63e597f241ccc7/maintainability)](https://codeclimate.com/github/yegor256/total/maintainability)\n[![Yard Docs](https://img.shields.io/badge/yard-docs-blue.svg)](https://rubydoc.info/github/yegor256/total/master/frames)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/total/sibit/master/LICENSE.txt)\n[![Test Coverage](https://img.shields.io/codecov/c/github/yegor256/total.svg)](https://codecov.io/github/yegor256/total?branch=master)\n[![Hits-of-Code](https://hitsofcode.com/github/yegor256/total)](https://hitsofcode.com/view/github/yegor256/total)\n\nTotal is a Ruby gem to detect the total amount of memory in the system.\n\nFirst, install it:\n\n```bash\n$ gem install total\n```\n\nThen, use it like this:\n\n```ruby\nrequire 'total'\nputs Total::Mem.new.bytes\n```\n\nThe following platforms are supported:\n\n  * MacOSX\n  * Linux\n  * FreeBSD\n  * \u003cdel\u003eWindows\u003c/del\u003e ([help wanted](https://github.com/yegor256/total/issues/3))\n\nIf the platform is not recognized or is not supported, `Total::CantDetect` exception\nwill be raised. You should catch it and proceed accordingly, for example:\n\n```ruby\ndef total_mb\n  Total::Mem.new.bytes / (1024 * 1024)\nrescue Total::CantDetect\n  512\nend\n```\n\nThis code will return the actual memory size in Mb, if it can be detected,\nor 512 otherwise.\n\nThat's it.\n\n## How to contribute\n\nRead [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).\nMake sure your build is green before you contribute\nyour pull request. You will need to have [Ruby](https://www.ruby-lang.org/en/) 2.3+ and\n[Bundler](https://bundler.io/) installed. Then:\n\n```\n$ bundle update\n$ bundle exec rake\n```\n\nIf it's clean and you don't see any error messages, submit your pull request.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyegor256%2Ftotal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyegor256%2Ftotal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyegor256%2Ftotal/lists"}