Comments (10)
Maybe we should do it the "Rails" way. Rails does not use yaml files for configuration... Why yaml?
from kuhsaft.
Well. The database.yml
for instance is a well known example of yaml used for configuring rails apps.
Even external stuff like travis or rubocop use yaml for configuration.
I don't think that yaml is so bad at all. 😉
Initializers or something else which leads to 'normal' keys in the config also would be fine in my opinion.
But the also would result into large code-bases that contain configuration anyway.
from kuhsaft.
Yes, right. Rails uses YAML. But I meant the configuration for gems.
I don't know what you want to configure, I just want to prevent implementing the configuration mechanism twice - when we realize that YAML is not enough.
I mean, I don't know a gem that uses yaml files for configuration. Do you?
from kuhsaft.
kuhsaft is an engine which is basically a rails app anyway. 😉
But sure, as I already mentioned for example rubocop and travis.
I could image something like this which could be set in the rails instance to overwrite some kuhsaft defaults
asset_brick:
styles: 'pdf word excel button'
user_can_add_childs: false
renders_own_childs: true
allowed_brick_types: '$inherit'
allow_voda: true
As I've said already: that is really just my personal preference.
I have no problem to use something different if yaml files aren't an adequate solution.
I just find the current mix of business logic and configuration not optimal - that's all. 😉
from kuhsaft.
So
configuration_implementation:
yaml: +1
ruby: +1
Other votes? ;)
from kuhsaft.
@alexanderadam @fpellanda I generally am in favor of extracting configuration and separating it from business logic. Going all the way would mean yml files and I have no objection to that. So 👍 for a yml file!
from kuhsaft.
TLDR: keep it in ruby land :)
My 2 cents:
The underlying issue here is the de-separation of model and view-model which was - at the time we built this - simply a shortcut we took to make it useable. Imagine you'd build the inputs strictly client side, you'd essentially have a client model handling all of this.
Imho allowed_brick_types: '$inherit'
is a smell you're eventually going to invent a yml dsl here. Also I don't believe it's true the values are not going to change in the app lifecycle. The initial imagination was that certain options can be data/context sensitive, for example: don't let users add childs when there's already 5 childs attached. This is certainly easier to extend in ruby land than via yml configuration.
FYI these are use cases I'm evaluating for the current project I'm working on.
from kuhsaft.
@manufaktor good ponts, thanks a lot for your input! The context sensitive options are indeed a nice idea, though I don't think we used them a lot. Are you suggesting a split between brick models and brick view models?
from kuhsaft.
@effkay basically I'd just delegate the options in question to a config object with some sane defaults. You could also go the decorator route, all I'm saying I'd prefer not to have YML (You could always add that to back the config objects but I'm sharing @fpellanda 's concerns).
from kuhsaft.
Migrated / Added to qBrick roadmap: https://github.com/screenconcept/qbrick
from kuhsaft.
Related Issues (20)
- New Brick creation fails to display errors when uploading a picture on a brick with ckeditor fields
- Always downcase slug HOT 2
- Add method to check if we are on a kuhsaft page or not HOT 8
- Collapse all other bricks when user starts to drag a brick HOT 2
- Fix indention of generated translations HOT 1
- Clean up kuhsaft_en translations HOT 1
- Automatic Styleguide HOT 1
- Live edit HTML/CSS in backend HOT 1
- Configurable responsive images with picturefill HOT 1
- (re-)move ImageSizeDelegator from `engine.rb` HOT 1
- Enable profile management for admin users HOT 1
- view default backend login HOT 1
- its not possible to delete value in redirect_url HOT 1
- caching bricks HOT 7
- settings field for webmaster tools verification HOT 1
- Use ImageOptim for image uploads HOT 1
- ActionView::Template::Error (File name too long... HOT 2
- Brick without input fields does not have a save button HOT 1
- CKEDITOR hides editor content when brick is dragged HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kuhsaft.