Skip to content
This repository has been archived by the owner on Dec 7, 2018. It is now read-only.

Server configuration by block, versus by initialization options. #209

Open
digitalextremist opened this issue Sep 11, 2015 · 2 comments
Open
Assignees
Milestone

Comments

@digitalextremist
Copy link
Member

Implement this style of configuration, which sets the defaults used by the actual Reel::Server constructor... meaning they can be overridden directly at instantiation, if desired:

#de Can be either `Reel.configure` or `Ree::Server.configure`
Reel.configure { |config|
  config.host = '0.0.0.0'
  config.port = 8888
}

Reel.configure(host: '0.0.0.0', port: 8888)
@digitalextremist digitalextremist self-assigned this Sep 11, 2015
@digitalextremist digitalextremist added this to the 0.6.0 milestone Sep 11, 2015
@dilumn
Copy link
Member

dilumn commented Sep 17, 2015

So is it going to be something like this in Reel?

class << self
    def configure

    end
end

But Reel::Server constructor require server for initialisation. Did you mean Reel::Server::HTTP & Reel::Server::HTTPS for this feature??

@digitalextremist
Copy link
Member Author

The implementation you posted is more of a shortcut for Server.new which hard-codes HTTP

We need to be able to select which server type, so server: or config.server with either a class passed in or a symbol ( :HTTP, :HTTPS, or :UNIX for example )

If the block approach is used, class variables need to be set, and those values need to be used for the default initialization of the server.

@digitalextremist digitalextremist modified the milestones: 1.0, 0.6.0 Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants