Closed rye closed 9 years ago
We could also create a separate Version
class to handle the version.
@Sammidysam and I talked about this yesterday, and he agrees that having two separate things is fairly redundant.
I would argue that Configuration
is included with Environment
; a system's environment should incorporate the configurations. So, my recommendation is that we introduce my new Environment
class and replace the existing Configuration
class with that.
This new Environment
class would incorporate not only the business logic for reading and manipulating Configuration
s, but also switching between "execution environments" (e.g. :development
, :production
, :test
).
We should probably rework the Configuration
structure to make it a bit smarter and less redundant. Database
s should probably just use the current "execution environment" as their session name. (This Session Name is currently one of the keys under the frecon.database.mongoid
thing) Thus, we can reduce the database configuration down to the database' name
and hosts
values.
Probably, the best way about this will be to remove all of the existing stuff and just patch stuff in, since the spec is still lagging behind.
We should also work hard on ensuring that the XDG Base Directory specification is heavily followed. Windows compatibility should probably be thought-about as well.
How it is now
We have a raw
Symbol
being stored inlib/frecon/base/variables.rb
that is used as our environment configuration. There are corresponding getter/setter methods, but nothing overly special. Furthermore, a completely separate configuration system is used for retrieving and comprehending configurations.How It Should Be™
We should really have a single system,
lib/frecon/environment.rb
that is used to go out and do the hunting for configuration. A newEnvironment
class will be created, and it will handle the business logic. It'll beHash
-like, but pre-filled and basically static. ThisEnvironment
class will be used to (i) parse the various configurations around the place; (ii) handle any changes that are made by CLI arguments; and (iii) spit out stuff intelligently.