Giter Site home page Giter Site logo

uni_rails's Introduction

UniRails

UniRails makes it easy to build Ruby on Rails apps all within one Ruby file. It's perfect for small personal projects or teaching, as everything is one scroll away.

We aim to help educators and writers create clear examples for articles or books. Rails requires a full folder structure to show the basics, which can be a hassle. UniRails cuts through that by letting you spin up a complete Rails app from just one Ruby file โ€” everything you need in one place.

Check out our examples to understand how the library creates Rails apps from a single file.

Installation & Usage

See some examples of how the UniRails library can be used. Running an example is a easy as ruby filename.rb

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To 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 the created tag, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/uni_rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

Roadmap

We would like to support all railties and engines. Please help us support more of them

  • action_controller
  • active_record
  • active_model/railtie
  • active_job/railtie
  • active_storage/engine
  • action_mailer/railtie
  • action_mailbox/engine
  • action_text/engine
  • action_view/railtie
  • action_cable/engine

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the UniRails project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

uni_rails's People

Contributors

alexb52 avatar

Stargazers

Ed Tee avatar Samnang Chhun avatar Nick van der Wildt avatar  avatar David Angulo avatar

Watchers

 avatar

uni_rails's Issues

Support CDN libraries for CSS

Add a way to support adding stylesheet scripts in the ruby file.

The current workaround if to provide your own application layout with the stylesheet in the head.

Fix partial rendering

Registering a partial view raises as partial variables are undefined.

undefined local variable or method `todo' for main:Object
<%= form_with(model: todo, id: "#{dom_id(todo)}_form") do |form| %

Support sqlite3 :memory: database

The connections between the DB schema and the main app are different.
While the :memory: database gets loaded correctly the first time, the app uses another :memory: database that doesn't have the schema loaded.

We should have a way to either allow the use of the same :memory: database or change when the DB gets loaded during the app initialization when SQLite :memory: is used

Support live reload

We need to kill the server and rerun it after every change; this isn't developer-friendly.

Question: Is there a way to apply changes to the ruby file without a kill/restart workflow?

Support turbo-rails

We need to register the turbo-rails engine to use the helper methods and turbo stream Mime types.

Question: Is there a way to register this engine in order to use Hotwire within a single file?

Add support for different Rakup/Handler

We currently hardcode the Rack handler to be Puma, but webrick and falcon also provides rack handlers that work with uni rails applications. It's about formalising the configuration with webrick or puma as the default server.

Support friendly database migrations

Currently, a UniRails app requires a fully migrated database. It would be nice to have a way to allow DB migrations as part of the development. Whether it's in the main ruby file or not is up to debate.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.