{"id":13503683,"url":"https://github.com/opal/opal-sprockets","last_synced_at":"2025-10-25T02:40:33.193Z","repository":{"id":8974734,"uuid":"10718355","full_name":"opal/opal-sprockets","owner":"opal","description":"Sprockets support for Opal (used to be embedded into Opal from v0.6 up to v0.10)","archived":false,"fork":false,"pushed_at":"2024-08-08T04:09:05.000Z","size":156,"stargazers_count":29,"open_issues_count":5,"forks_count":17,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-30T06:44:31.501Z","etag":null,"topics":["opal","opal-sprockets","ruby","sprockets","sprockets-support"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opal.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2013-06-16T10:02:08.000Z","updated_at":"2024-09-11T08:18:33.000Z","dependencies_parsed_at":"2024-11-01T00:31:12.486Z","dependency_job_id":"7d0c25da-3874-47bd-8df2-f9653a9baa90","html_url":"https://github.com/opal/opal-sprockets","commit_stats":{"total_commits":121,"total_committers":9,"mean_commits":"13.444444444444445","dds":0.2892561983471075,"last_synced_commit":"ad505ec2948561a23606a8d2d25cc296fedab922"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opal%2Fopal-sprockets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opal%2Fopal-sprockets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opal%2Fopal-sprockets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opal%2Fopal-sprockets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opal","download_url":"https://codeload.github.com/opal/opal-sprockets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251658196,"owners_count":21622819,"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":["opal","opal-sprockets","ruby","sprockets","sprockets-support"],"created_at":"2024-07-31T23:00:43.288Z","updated_at":"2025-10-25T02:40:33.119Z","avatar_url":"https://github.com/opal.png","language":"Ruby","readme":"# Opal Sprockets\n\n_Adds sprockets support for [Opal](http://opalrb.com)._\n\n## Installation\n\nAdd to your `Gemfile`:\n\n```ruby\ngem \"opal-sprockets\"\n```\n\n### A note on the version number\n\nThe version number is an attempt to keep track and support different combinations of both opal and sprockets without cluttering the code with giant `if`s and conditional requires. The structure is roughly as follows:\n\n`\u003cbasic version number\u003e.\u003copal version number\u003e.\u003csprockets version numbers\u003e`\n\nFor example version `0.4.1.0.11.0.rc1.3.1` is build taking into account the following components:\n\n    BASE_VERSION = '0.4.1'\n    OPAL_VERSION = '0.11.0.rc1'\n    SPROCKETS_VERSION = '3.1'\n\n\n## Usage\n\nSprockets uses a set of load paths to resolve dependencies. This gem extends\nsprockets to provide opal load paths to sprockets. `opal-sprockets` provides\na template processor for all files with `.rb` or `.opal` extensions.\n\n```ruby\n#= require opal\n\nputs \"opal running in sprockets!\"\n```\n\n### Improved require support\n\nBy default, sprockets will examine your code for processor directive comments\nto handle requires, e.g. `#= require opal`. Opal takes this one step futher\nby extending the opal processor to automatically detect and register any\n`require` call made inside your ruby code:\n\n```ruby\nrequire \"opal\"\nrequire \"opal-jquery\"\n\nputs \"opal-jquery is now available!\"\n```\n\nOpal cannot require files at runtime, so this trick allows ruby code to use\nthe nicer ruby syntax for requiring dependencies.\n\n## Example\n\nSprockets uses a load path for code files, so make a simple `app/` directory\nwith some code inside `app/application.rb`:\n\n```ruby\n# app/application.rb\n\nrequire \"opal\"\n\nputs \"hello, world\"\n```\n\nThe opal corelib and runtime can be included in your app simply by adding\n`require \"opal\"`. We also need an html file to test the application with,\nso add `index.html`:\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"utf-8\"\u003e\n  \u003cscript src=\"/assets/application.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n### Running Application\n\n`opal-sprockets` comes with a simple `Server` class that can be used to easily\nconfigure applications inside `config.ru`:\n\n```ruby\n# config.ru\n\nrequire 'bundler'\nBundler.require\n\nrun Opal::Sprockets::Server.new { |s|\n  s.append_path 'app'\n  s.main = 'application'\n\n  # This can be used to provide a custom index file.\n  # s.index_path = 'my_index.erb'\n}\n```\n\nThis just adds the `app/` directory to the load path, and tells sprockets that\n`application.rb` will be the main file to load.\n\nNow just run the rack app:\n\n```\n$ bundle exec rackup\n```\n\nAnd then visit `http://127.0.0.1:9292` in any browser.\n\n### Source Maps\n\n`opal-sprockets` will create source maps for all assets by default. You can disable this with:\n\n```ruby\nOpal::Config.source_map_enabled = false\n```\n\n## License\n\n(The MIT License)\n\nCopyright (C) 2013 by Adam Beynon\nCopyright (C) 2013 by Elia Schito\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopal%2Fopal-sprockets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopal%2Fopal-sprockets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopal%2Fopal-sprockets/lists"}