Questions tagged [settingslogic]

settingslogic is a ruby gem to implement a simple and straightforward settings solution that uses an ERB enabled YAML file and a singleton design pattern.

settingslogic is a ruby gem to implement a simple and straightforward settings solution that uses an ERB enabled YAML file and a singleton design pattern.

Settingslogic works with Rails, Sinatra, or any Ruby project.

14 questions
3
votes
1 answer

How do I use the SettingsLogic gem in a ruby project?

According to the GitHub page it's possible to use SettingsLogic in a Ruby project (outside of Rails) but there's no documentation to show you how. Can anyone provide me with some sample code of how it might work with things like the Rails.env…
Simmo
  • 1,717
  • 19
  • 37
1
vote
1 answer

SettingsLogic not working when running unit tests in Rails 2.3

I am getting this error when running some unit tests (using the Test::Unit module included in Ruby/Rails) that call a method that uses some SettingsLogic feature: RuntimeError: Called id for nil, which would mistakenly be 4 -- if you really…
flyer88
  • 1,073
  • 3
  • 15
  • 33
1
vote
2 answers

Rails: Settingslogic accessible to users?

I have my app configured with Settingslogic, which I love. My question is how to I make a page on my Rails app where Administrators can make changes to the settings specified in config/settings.yml?? I assume said page would have to read and display…
neezer
  • 19,720
  • 33
  • 121
  • 220
1
vote
1 answer

Dynamic settingslogic settings

I'm using the settingslogic gem in my Rails app (Ruby 2.0.0p247 / Rails 3.2.13). I can dynamically change a setting when it is not nested e.g. #config/settings.yml defaults:&defaults mysetting: 1 nested: myothersetting:…
Joe Gatt
  • 2,197
  • 3
  • 15
  • 19
1
vote
2 answers

How to reset ruby class accessors between requests?

I'm working on ecommerce solution, which provides few different shops within a single rails application. There I have a class to hold shop-specific settings. # models/shop.rb class Shop < Settingslogic source "#{Rails.root}/config/shop.yml" …
Vladimir E
  • 47
  • 2
  • 6
0
votes
0 answers

Settingslogic missing settings error

I'm having a weird problem with Settingslogic in my Rails app. I have this in config/application.yml: defaults: &defaults redis: host: localhost port: 6379 development: <<: *defaults session_key: "_app_development" …
Seth Jackson
  • 539
  • 4
  • 16
0
votes
0 answers

How to deploy file with sensitive data to heroku? (Rails project with Settingslogic gem)

Im using Settingslogic gem as alternative to Environment Variables, and I found it more convenient. But, how to deploy the application to Heroku if my file with configs is out of the repo? I mean, all configs I save in application.yml, which is…
Ruslan Valeev
  • 1,529
  • 13
  • 24
0
votes
1 answer

Syntax Error in application.yml File

I am running the command rail s and it displays the following error: /home/user/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:189:in `missing_key': Missing setting 'mail_from' in…
Stefan Hansch
  • 1,550
  • 4
  • 22
  • 55
0
votes
1 answer

YAML anchors issue

Here is the tutorial I'm following: http://rhnh.net/2011/01/31/yaml-tutorial I'm using the SettingsLogic gem: https://github.com/binarylogic/settingslogic And every config file used by Settings logic works fine, but if I use the same tactics on…
Max Paprikas
  • 579
  • 6
  • 16
0
votes
1 answer

Rails: Making Settingslogic work with Cucumber

I can't seem to run Cucumber tests on views that include strings governed by Settingslogic. Scenario: Login as an existing user from homepage Given a user exists And I am on the home page can't convert nil into Hash…
neezer
  • 19,720
  • 33
  • 121
  • 220
0
votes
1 answer

Settingslogic automatic reload using guard

I want to guard to automatically reload my settingslogic settings when I change a settings file. I guessed putting this in the Guardfile would work, but it didn't. Any ideas? guard 'settings' do watch(%r{^config/.*settings\.yml$}) {…
Joe Gatt
  • 2,197
  • 3
  • 15
  • 19
0
votes
1 answer

Rails application settings and tests

In my app I've used SettingsLogic to handle the app's settings (such as facebook tokens etc.) which is a gem that basically parses the config/application.yml file and provides easy access to its content. I've also used this configuration file to…
Jeremy F.
  • 1,346
  • 12
  • 30
0
votes
1 answer

Ruby Configuration: replacing nested key value for dev environment doesn't work

Case: Development environment log level is DEBUG while Production is INFO. I want to use every default log configuration and overwrite only level if environment == develoment. Problem: first level configs can be over-written but not sub levels.…
dlite922
  • 1,924
  • 3
  • 24
  • 60
0
votes
0 answers

rails 3 settingslogic uninitialized constant Settingslogic error

I am trying to set up settings in my app: in app/models/_settings.rb class Settings < Settingslogic source "#{Rails.root}/config/app_config.yml" namespace Rails.env end in config/app_config: # config/app_config.yml defaults: &defaults …
devmonster
  • 323
  • 2
  • 12