The minimalistic framework for developing Rails component based applications.
Add this line to your application's Gemfile:
gem 'component-framework'And then execute:
$ bundle
Or install it yourself as:
$ gem install component-framework
Add the following lines to application.rb after your application class declaration.
application.rb
module My
class Application < Rails::Application
...
end
Component::Framework.initialize(My::Application)
endto get the components initialization output specify verbose: true parameter in framework initialization call
in case you don't use Sprockets assets pipeline, you can explicitly disable it's configuration by specifying
assets_pipeline: false in framework initialization call
e.g.
Component::Framework.initialize(My::Application, assets_pipeline: false, verbose: true)
app_root
/components
/<name>
/assets
/images
/javascripts
myDialog.js
/stylesheets
my-dialog.scss
/templates
my-dialog.html
/migrations
20180102001234_create_task.rb
/test
# custom folders
/rest_api
/helpers
/views
/v1
my_controller.rb
routes.rb
/mailers
/services
initializer.rb
settings.rb
It's recommended to use group :default, :component_name for gems required by particular component.
settings = Component::Settings.load_settings(:settings)
config.settings = settingsAfter checking out the repo, run bin/setup to install dependencies. 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 tags, and push the .gem file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/brokermint/component-framework. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
The gem is available as open source under the terms of the MIT License.