Closed dottedmag closed 14 years ago
Or maybe you should consider using XRefresh config file?
I think I favour the config file approach. Not sure I want to use the XRefresh one, though — configs clearly need to be per-project.
Would be nice to have both global config and configs per project.
what about a .livereload yml file in the project dir?
My current plan is to have a Ruby DSL-based config. It's just as clean as YAML, but allows you to throw in a line of code or two for really complex setups.
I'm also considering to name that config “Rakefile” :-) — i.e. just have you include the config into Rakefile, like:
require 'livereload'
LiveReload do |config|
config.include '*.haml'
config.exclude 'bar*'
config.exclude /some.*reg.*exp/
config.exclude { |path| really_complex_test(path) }
end
livereload
would then simply launch rake livereload
. Seems simple and consistent that way, although may be confusing to non-rubists.
Any objections / thoughts?
Sounds good for me.
Not sure about Rake, but API looks sexy.
Here is a simple solution to this problem:
http://github.com/jeroenvandijk/livereload/commit/f10be2dd371b09b51dacfbccd8238f67c4952fda
Not sure if it is the best but it works for me
Eval? No, I don't think that's a good solution. YML or a Rakefile would be far better.
YAML would be my favorite as well, but this was the smallest change in the code to achieve the same and I thought would be nice to share. Is anyone already working on this?
If it's a consensus here that everyone prefers YAML, I'm ready to add it today or tomorrow unless someone else wants to take on the task.
Okay, I'm starting work on configuration. Feel free to drop by on livereload@jaconda.im (just add it to your Jabber / Google Talk) if you want to participate in defining the config format.
Done and released in 1.3. See README for config file details (in short: .livereload
, Ruby, autocreated).
@jeroenvandijk Big thanks, you have truly inspired the syntax. I would never go for such simple syntax without your sample. I didn't use eval, however — applied a trick with method_missing
to provide a top-level config
object to the config file. I believe error reporting will be a lot more friendly this way.
(Forgot to close.)
@andreyvit Thanks for your work. I think you went for right approach, mine was just quick and dirty. I tested this new feature and it works great! Keep up the good work!
Use command-line arguments instead.