Initializes the generator.

 @param options [Hash]
 Generates the given slip.

 @param slip [Bollettino::Slip]
 @param path [String]
351241
def generate!(slip, path)
      image = MiniMagick::Image.open(File.expand_path('../../../assets/slip.png', __FILE__))
      Bollettino::Renderer::Slip.render(image, slip)
      image.write path
    end
1167192
protected function init(array $options = [])
    {
        if (array_key_exists(static::PERSISTENCE, $options)) {
            $this->persistence = $options[static::PERSISTENCE];
        }
        if (array_key_exists(static::PERSISTENCE_ARGS, $options)) {
            $this->persistenceArgs = $options[static::PERSISTENCE_ARGS];
        }

        if (array_key_exists(static::VARIABLE_RESOLVER, $options)) {
            $variableResolver = $options[static::VARIABLE_RESOLVER];
            if (null === $variableResolver) {
                $variableResolver = new DefaultVariableResolver();
            }
        } else {
            $variableResolver = new DefaultVariableResolver();
        }
        if (!$variableResolver instanceof VariableResolverInterface) {
            $errMsg = sprintf('Variable resolver not implements %s', VariableResolverInterface::class);
            throw new Exception\InvalidVariableResolverException($errMsg);
        }
        $this->variableResolver = $variableResolver;


        if (array_key_exists(static::WORKFLOW_FACTORY, $options)) {
            $workflowFactory = $options[static::WORKFLOW_FACTORY];
            if (null === $workflowFactory) {
                $workflowFactory = new UrlWorkflowFactory();
            }

            if (!$workflowFactory instanceof WorkflowFactoryInterface) {
                $errMsg = sprintf('Workflow factory not implements %s', WorkflowFactoryInterface::class);
                throw new Exception\InvalidWorkflowFactoryException($errMsg);
            }
            $workflowFactory->initDone();
            $this->factory = $workflowFactory;
        }
    }
346644
private void initialize(String scheme, String authority, String path) {
		try {
			this.uri = new URI(scheme, authority, normalizePath(path), null, null).normalize();
		} catch (URISyntaxException e) {
			throw new IllegalArgumentException(e);
		}
	}
1081890
function initialize(app, options) {
  var log = logger.get(options);
  app._mukoan = app._mukoan || {};
  if (!app._mukoan.initialized) {
    var config = defaults({}, options, DEFAULT_CONFIGURATION);
    log.info('Starting and configuring Koa server');

    // Setup global error handler and logger
    app.use(middlewares.error(config.error));
    app.on('error', (error) => log.error('Unexpected exception ', error));
    app._mukoan.initialized = true;
  } else {
    log.warn('Trying to initialize the same Koa instance twice (ignoring action)');
  }
}
790967
@Override
  public void initialize(URI path, Configuration config) throws IOException {
    initialize(path, config, /* initSuperclass= */ true);
  }
455890
public void init(String path, String charset) throws IOException {
		BufferedReader reader = FileUtil.getReader(path, charset);
		try {
			String line;
			while(true) {
				line = reader.readLine();
				if(line == null) {
					break;
				}
				this.add(line);
			}
		}finally {
			IoUtil.close(reader);
		}
	}
491888
def init(self, rules):
        """"""
        # Initialize the option parser
        for dest in rules.keys():
            rule = rules[dest]

            # Assign defaults ourselves here, instead of in the option parser
            # itself in order to allow for multiple calls to parse (dont want
            # subsequent calls to override previous values with default vals).
            if 'default' in rule:
                self.result['kwargs'][dest] = rule['default']

            flags = rule['flags']
            kwargs = { 'action': rule.get('action', "store") }
            # NOTE: Don't provision the parser with defaults here, per above.
            for key in ['callback', 'help', 'metavar', 'type']:
                if key in rule: kwargs[key] = rule[key]
            self.add_option(*flags, dest=dest, **kwargs)

            # Remember the dest vars that we see, so that we can merge results
            self.dests.add(dest)
724555
private void init(PathImpl path)
  {
    _contentLength = -1;
    _isChunked = false;
    _isRequestDone = false;
    _didGet = false;
    _isPost = false;
    _isHead = false;
    _method = null;
    _attributes.clear();
    
    //setPath(path);

    if (path instanceof HttpPath)
      _virtualHost = ((HttpPath) path).getVirtualHost();
  }
636035
public function initialize() {
        $this->handler = curl_init();

        $this->setOption(CURLOPT_URL, $this->requestUrl)
             ->setOption(CURLOPT_VERBOSE, 0)
             ->setOption(CURLOPT_HEADER, 0);
    }
1034375
def options(path, options = {}, &block)
      perform_request Net::HTTP::Options, path, options, &block
    end
446930
def init_options(args = nil)
      @args = case args
              when nil    then []
              when String then args.split
              else             args
              end

      @options = load_config || {}

      Kat.options(@args).tap do |o|
        @options.merge!(o) { |k, ov, nv| o["#{ k }_given".intern] ? nv : ov }
      end

      Kat::Colour.colour = @options[:colour]
    rescue NoMethodError => e
      @options = {}
      warn "Wrong config file format: #{ e }"
    end
726323
def initialize_autoloaded_paths(mods = ObjectSpace.each_object(Module)) # &do_autoload_block
      mods.each do |mod|
        # Module's constants are shared with Object. But if you set autoloads directly on Module, they
        # appear on multiple classes. So just skip, Object will take care of those.
        next if mod == Module
        # This happens with JRuby
        next unless mod.respond_to?(:constants)

        if mod.frozen?
          if mod.constants.any? { |name| mod.autoload?(name) }
            self.class.warn_frozen_module(mod)
          end
          next
        end

        mod.constants.each do |name|
          # JRuby can talk about deprecated constants here
          path = Tools.silence_warnings do
            mod.autoload?(name)
          end
          next unless path
          interceptor_path = setup_interceptor_for(mod, name, path)
          yield mod, name, interceptor_path
        end
      end
    end
789047
@PostConstruct
  public void init()
    throws ConfigException, IOException
  {
    if (_path != null) {
      _rotateStream = RotateStream.create(_path);
    }
    else if (_pathFormat != null) {
      _rotateStream = RotateStream.create(_pathFormat);
    }
    else {
      throw new ConfigException(L.l("'path' is a required attribute of <{0}>.  Each <{0}> must configure the destination stream.", getTagName()));
    }

    if (_path != null
        && Files.exists(_path)
        && ! Files.isReadable(_path)
        && (_rolloverPeriod != null
           || _rolloverSize != null
           || _archiveFormat != null)) {
      throw new ConfigException(L.l("log path '{0}' is not readable and therefore cannot be rotated.", _path.toUri()));
    }

    RolloverLogBase rolloverLog = _rotateStream.getRolloverLog();

    if (_rolloverPeriod != null) {
      rolloverLog.setRolloverPeriod(_rolloverPeriod);
    }

    if (_rolloverSize != null) {
      rolloverLog.setRolloverSize(_rolloverSize);
    }
    
    _rotateStream.setMaxRolloverCount(_rolloverCount);
    
    if (_archiveFormat != null) {
      rolloverLog.setArchiveFormat(_archiveFormat);
    }

    _rotateStream.init();
  }
1140403
function(path, handler) {
    var node = trie.define(path)[0];

    if (typeof handler !== 'function') {
      throw new Error('invalid handler');
    }

    node.handler = handler;
  }
31311
def initialize_project
      if((Pathname.new(options[:path]) + "../partials").exist?)
        puts "[ERROR]: Don't use the \"html\" path, use the project base path instead"
        exit(1)
      end
      
      Project.new(options[:path], {:shell => self.shell}.update(options))
    end
627153
def add_options(self, path: str, handler: _WebHandler,
                    **kwargs: Any) -> AbstractRoute:
        
        return self.add_route(hdrs.METH_OPTIONS, path, handler, **kwargs)
502580
protected void initNextPath (long initStamp, long tickStamp)
    {
        if (_paths.size() == 0) {
            _pable.pathCompleted(tickStamp);

        } else {
            _curPath = _paths.remove(0);
            _lastInit = initStamp;

            _curPath.init(_pableRep, initStamp);
            _curPath.tick(_pableRep, tickStamp);
        }
    }