{"id":15472962,"url":"https://github.com/martinnicolas/maritotito","last_synced_at":"2025-03-28T13:13:42.593Z","repository":{"id":71476136,"uuid":"304788037","full_name":"martinnicolas/maritotito","owner":"martinnicolas","description":"Client side validations gem for files size and extension.","archived":false,"fork":false,"pushed_at":"2022-01-12T01:44:33.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T13:28:36.506Z","etag":null,"topics":["extensions","file-upload","gem","ruby","size"],"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/martinnicolas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2020-10-17T03:21:11.000Z","updated_at":"2024-06-16T06:03:00.000Z","dependencies_parsed_at":"2023-02-22T21:00:41.798Z","dependency_job_id":null,"html_url":"https://github.com/martinnicolas/maritotito","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"64dd06d8fc72e06de3369d746c14e2e8573bf475"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinnicolas%2Fmaritotito","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinnicolas%2Fmaritotito/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinnicolas%2Fmaritotito/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinnicolas%2Fmaritotito/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martinnicolas","download_url":"https://codeload.github.com/martinnicolas/maritotito/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246034302,"owners_count":20712857,"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":["extensions","file-upload","gem","ruby","size"],"created_at":"2024-10-02T02:41:57.622Z","updated_at":"2025-03-28T13:13:42.568Z","avatar_url":"https://github.com/martinnicolas.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Maritotito\n\n[![Tests](https://github.com/martinnicolas/maritotito/actions/workflows/tests.yml/badge.svg)](https://github.com/martinnicolas/maritotito/actions/workflows/tests.yml) [![Wercker](https://img.shields.io/github/license/mashape/apistatus.svg)](https://opensource.org/licenses/MIT) [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md) \n\nThis gem allows you to run client side validations for files size and extension. This is an usefull aproachment for complement server side validations or prevent server configuration.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'maritotito', git: 'https://github.com/martinnicolas/maritotito'\n```\n\nAnd then execute:\n\n    $ bundle\n\n## Usage\n\nAdd this line to yout `application.js` file:\n\n\t//= require maritotito\n\nIn every file field on your form add the onchange attribute with the function `\"validateFiles(this);\"` and a data attribute with a Hash containing maximum file size and allowed extensions:\n\n```ruby\n\u003c%= f.file_field :some_field, onchange: \"validateFiles(this);\", data: { max_file_size: 2.megabytes, allowed_extensions: ['pdf'] } %\u003e\n```\n\nYou can add more allowed extensions on the allowed_extensions array:\n\n```ruby\n\u003c%= f.file_field :other_field, onchange: \"validateFiles(this);\", data: { max_file_size: 5.megabytes, allowed_extensions: ['jpg', 'jpeg', 'png'] } %\u003e\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/martinnicolas/maritotito. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Maritotito project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/maritotito/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinnicolas%2Fmaritotito","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartinnicolas%2Fmaritotito","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinnicolas%2Fmaritotito/lists"}