<commit_before>#!/usr/bin/ruby
# 
# This file contains the MUES::NullEnvironment class, a <strong>VERY</strong> simple
# testing MUES::Environment class.
# 
# This is a barebones environment used in testing. It doesn^t really contain any
# interesting functionality other than the ability to return roles and allow
# connections.
# 
# Well, maybe there^s a few other things you can do...
# 
# == Synopsis
# 
#   mues> /loadenv NullEnvironment nullWorld
#   Attempting to load the 'NullEnvironment' environment as 'nullWorld'
#   Successfully loaded 'nullWorld'
# 
#   mues> /roles
#   nullWorld (NullEnvironment):
#        muggle   A boring role for testing
#        admin    A barely less-boring role for testing
# 
#   (2) roles available to you.
# 
#   mues> /connect nullWorld superuser
#   Connecting...
#   Connected to NullEnvironment as 'superuser'
# 
#   nullWorld: superuser>> ...
# 
# == Rcsid
# 
# $Id: null.rb,v 1.8 2002/10/12 17:48:12 stillflame Exp $
# 
# == Authors
# 
# * <NAME> <<EMAIL>>
# * <NAME> <<EMAIL>>
# 
#:include: COPYRIGHT
#
#---
#
# Please see the file COPYRIGHT for licensing details.
#


require "sync"

require "mues"
require "mues/Mixins"
require "mues/Exceptions"
require "mues/Events"
require "mues/Environment"
require "mues/Role"
require "mues/ObjectStore"
require "mues/IOEventFilters"
require "mues/ObjectSpaceVisitor"

module MUES

	### A simple testing MUES::Environment class.
	class NullEnvironment < MUES::Environment

		include MUES::TypeCheckFunctions

		### Class constants
		Version = /([\d\.]+)/.match( %q$Revision: 1.8 $ )[1]
		Rcsid = %q$Id: null.rb,v 1.8 2002/10/12 17:48:12 stillflame Exp $

		DefaultDescription = %Q{
		This is a barebones environment used in testing. It doesn't really contain any
		interesting functionality other than the ability to return roles and allow
		connections.
			
		Well, maybe there's a few other things you can do...
		}.gsub( /^[ \t]*/, '' )

		ObjectStoreParams = {
			:backend	=> 'Flatfile',
			:memmgr		=> 'Null',
			:indexes	=> [:class],
			:visitor	=> MUES::ObjectSpaceVisitor,
		}

		### Instantiate and return a new MUES::NullEnvironment object.
		def initialize( instanceName, description=DefaultDescription, params={} )
			super( instanceName, description, params )

			@participants		= []
			@participantsMutex	= Sync.new

			ostoreParams = ObjectStoreParams.dup
			ostoreParams['name'] = instanceName
			@ostore = MUES::ObjectStore::create( ostoreParams )
		end


		######
		public
		######
<commit_msg>- Fixed a bug in the handling of the :name constructor parameter.<commit_after>#!/usr/bin/ruby
# 
# This file contains the MUES::NullEnvironment class, a <strong>VERY</strong> simple
# testing MUES::Environment class.
# 
# This is a barebones environment used in testing. It doesn^t really contain any
# interesting functionality other than the ability to return roles and allow
# connections.
# 
# Well, maybe there^s a few other things you can do...
# 
# == Synopsis
# 
#   mues> /loadenv NullEnvironment nullWorld
#   Attempting to load the 'NullEnvironment' environment as 'nullWorld'
#   Successfully loaded 'nullWorld'
# 
#   mues> /roles
#   nullWorld (NullEnvironment):
#        muggle   A boring role for testing
#        admin    A barely less-boring role for testing
# 
#   (2) roles available to you.
# 
#   mues> /connect nullWorld superuser
#   Connecting...
#   Connected to NullEnvironment as 'superuser'
# 
#   nullWorld: superuser>> ...
# 
# == Rcsid
# 
# $Id: null.rb,v 1.9 2002/10/28 00:11:54 deveiant Exp $
# 
# == Authors
# 
# * <NAME> <<EMAIL>>
# * <NAME> <<EMAIL>>
# 
#:include: COPYRIGHT
#
#---
#
# Please see the file COPYRIGHT for licensing details.
#


require "sync"

require "mues"
require "mues/Mixins"
require "mues/Exceptions"
require "mues/Events"
require "mues/Environment"
require "mues/Role"
require "mues/ObjectStore"
require "mues/IOEventFilters"
require "mues/ObjectSpaceVisitor"

module MUES

	### A simple testing MUES::Environment class.
	class NullEnvironment < MUES::Environment

		include MUES::TypeCheckFunctions

		### Class constants
		Version = /([\d\.]+)/.match( %q$Revision: 1.9 $ )[1]
		Rcsid = %q$Id: null.rb,v 1.9 2002/10/28 00:11:54 deveiant Exp $

		DefaultDescription = %Q{
		This is a barebones environment used in testing. It doesn't really contain any
		interesting functionality other than the ability to return roles and allow
		connections.
			
		Well, maybe there's a few other things you can do...
		}.gsub( /^[ \t]*/, '' )

		ObjectStoreParams = {
			:backend	=> 'Flatfile',
			:memmgr		=> 'Null',
			:indexes	=> [:class],
			:visitor	=> MUES::ObjectSpaceVisitor,
		}

		### Instantiate and return a new MUES::NullEnvironment object.
		def initialize( instanceName, description=DefaultDescription, params={} )
			super( instanceName, description, params )

			@participants		= []
			@participantsMutex	= Sync.new

			ostoreParams = ObjectStoreParams.dup
			ostoreParams[:name] = instanceName
			@ostore = MUES::ObjectStore::create( ostoreParams )
		end


		######
		public
		######

{'fraction_non_alphanumeric': 0.125915660265294, 'fraction_numerical': 0.014254603048901207, 'mean_word_length': 3.7392120075046904, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6315670', 'n_tokens_mistral': 1802, 'n_tokens_neox': 1621, 'n_words': 499}