Inheritance: LanguageOptions
Exemplo n.º 1
0
        private RubyArray /*!*/ MakeLoadPaths(RubyOptions /*!*/ options)
        {
            var loadPaths = new RubyArray();

            if (options.HasSearchPaths)
            {
                foreach (string path in options.SearchPaths)
                {
                    loadPaths.Add(_context.EncodePath(path));
                }
            }

#if !SILVERLIGHT // no library paths on Silverlight
            string applicationBaseDir;
            try {
                applicationBaseDir = AppDomain.CurrentDomain.BaseDirectory;
            } catch (SecurityException) {
                applicationBaseDir = null;
            }

            AddAbsoluteLibraryPaths(loadPaths, applicationBaseDir, options.LibraryPaths);
#endif
            loadPaths.Add(MutableString.CreateAscii("."));
            return(loadPaths);
        }
Exemplo n.º 2
0
        private RubyArray /*!*/ MakeLoadPaths(RubyOptions /*!*/ options)
        {
            var loadPaths = new RubyArray();

            if (options.HasSearchPaths)
            {
                foreach (string path in options.SearchPaths)
                {
                    loadPaths.Add(_context.EncodePath(path));
                }
            }

            AddStandardLibraryPath(loadPaths, options.StandardLibraryPath, options.ApplicationBase);
            // TODO: remove?
            loadPaths.Add(MutableString.CreateAscii("."));
            return(loadPaths);
        }
Exemplo n.º 3
0
        private RubyArray/*!*/ MakeLoadPaths(RubyOptions/*!*/ options) {
            var loadPaths = new RubyArray();
            
            if (options.HasSearchPaths) {
                foreach (string path in options.SearchPaths) {
                    loadPaths.Add(MutableString.Create(path.Replace('\\', '/')));
                }
            }
            
#if !SILVERLIGHT // no library paths on Silverlight
            string applicationBaseDir;
            try {
                applicationBaseDir = AppDomain.CurrentDomain.BaseDirectory;
            } catch (SecurityException) {
                applicationBaseDir = null;
            }
            
            AddAbsoluteLibraryPaths(loadPaths, applicationBaseDir, options.LibraryPaths);
#endif
            loadPaths.Add(MutableString.Create("."));
            return loadPaths;
        }
Exemplo n.º 4
0
 // copies relevant options from runtime options:
 public RubyCompilerOptions(RubyOptions/*!*/ runtimeOptions) {
     Compatibility = runtimeOptions.Compatibility;
 }
Exemplo n.º 5
0
        private RubyArray/*!*/ MakeLoadPaths(RubyOptions/*!*/ options) {
            var loadPaths = new RubyArray();
            
            if (options.HasSearchPaths) {
                foreach (string path in options.SearchPaths) {
                    loadPaths.Add(_context.EncodePath(path));
                }
            }

            AddStandardLibraryPath(loadPaths, options.StandardLibraryPath, options.ApplicationBase);
            // TODO: remove?
            loadPaths.Add(MutableString.CreateAscii("."));
            return loadPaths;
        }
Exemplo n.º 6
0
        private RubyArray/*!*/ MakeLoadPaths(RubyOptions/*!*/ options) {
            var loadPaths = new RubyArray();
            
            if (options.HasSearchPaths) {
                foreach (string path in options.SearchPaths) {
                    loadPaths.Add(_context.EncodePath(path));
                }
            }
            
#if !SILVERLIGHT // no library paths on Silverlight
            string applicationBaseDir;
            try {
                applicationBaseDir = AppDomain.CurrentDomain.BaseDirectory;
            } catch (SecurityException) {
                applicationBaseDir = null;
            }

            AddAbsoluteLibraryPaths(loadPaths, applicationBaseDir, (ICollection<string>)options.LibraryPaths ?? new[] { 
                @"..\Lib\ironruby",
                @"..\Lib\ruby\site_ruby\" + _context.StandardLibraryVersion,
                @"..\Lib\ruby\" + _context.StandardLibraryVersion,
            });
#endif
            // TODO: remove?
            loadPaths.Add(MutableString.CreateAscii("."));
            return loadPaths;
        }