Closed richtera closed 10 years ago
Seems to be something with the new way config is implemented. It's not actually reading my config.yml and therefore config is an empty object.
config = Ruhoh::Parse.data_file(@base, "config") || {}
Is not being called anywhere and I don't think
@config.touch
causes it to be called anywhere either. Also the code is assuming touch actually returns the config but I guess that could be done easily once the touch method actually loads the config. Unfortunately I didn't really search for when this broke. It's also very curious why the test scripts wouldn't pick this up. Maybe it's only during compile and not during watch.
The config is managed in its own class now since it merges itself down the cascade. There's some hacky logic needed since we don't know which folder is the "theme" before config is built, so to build the config we have to scan all directories to see if any define config.yml|config.json
.
Anyway, here is the new library: https://github.com/ruhoh/ruhoh.rb/blob/master/lib/ruhoh/config.rb#L26
You can see that config.touch
does indeed return itself which is essentially a hash.
I can't reproduce this error. If you can point me to your failing blog I can clone it and try to reproduce it. Lastly, all the tests are testing against the actual compiled result, so the tests would catch it if config.yml were not parsing correctly for any reason.
The directory scanning might be tye problem. I have to construct the config from a template. So I have a _private folder which contains a file called config.yml which is an incomplete file I append runtime values to. I'll rename it to see whether that's causing the weirdness Andy
Sent from my iPhone
On Dec 13, 2013, at 2:27 AM, Jade Dominguez notifications@github.com wrote:
The config is managed in its own class now since it merges itself down the cascade. There's some hacky logic needed since we don't know which folder is the "theme" before config is built, so to build the config we have to scan all directories to see if any define config.yml|config.json.
Anyway, here is the new library: https://github.com/ruhoh/ruhoh.rb/blob/master/lib/ruhoh/config.rb#L26 You can see that config.touch does indeed return itself which is essentially a hash.
I can't reproduce this error. If you can point me to your failing blog I can clone it and try to reproduce it. Lastly, all the tests are testing against the actual compiled result, so the tests would catch it if config.yml were not parsing correctly for any reason.
— Reply to this email directly or view it on GitHubhttps://github.com/ruhoh/ruhoh.rb/issues/251#issuecomment-30491345 .
There is a config.ru file in my root folder which seems to be causing the problem. Removing that file allows compilation to work. The file contains this ruby code:
require 'rack'
require 'ruhoh'
run Ruhoh::Program.preview
# To preview your blog in "production" mode:
# run Ruhoh::Program.preview(:env => 'production')
Somehow the config loader is picking up that file. So it should be a fairly simple fix. Since I am not deploying to a rack I will just remove the file for now. Thanks Andy
Right, that file was from an older version. If you're in 2.5+ it's no longer needed. You'd just do
bundle exec ruhoh s On Dec 13, 2013 6:48 AM, "Andreas Richter" notifications@github.com wrote:
There is a config.ru file in my root folder which seems to be causing the problem. Removing that file allows compilation to work. The file contains this ruby code:
require 'rack'require 'ruhoh'run Ruhoh::Program.preview
To preview your blog in "production" mode:# run Ruhoh::Program.preview(:env => 'production')
Somehow the config loader is picking up that file. So it should be a fairly simple fix. Since I am not deploying to a rack I will just remove the file for now. Thanks Andy
— Reply to this email directly or view it on GitHubhttps://github.com/ruhoh/ruhoh.rb/issues/251#issuecomment-30514141 .
Ok, thanks. So this is not an issue unless you want to add code to warn the user of the file since it will mess up the config file loader. This is because "ru" sorts before "yml" so it will attempt to read the "ru" file as a yaml file.
Here is the stacktrace I am getting:
Checking into it...