Examples of OSEnvironment


Examples of net.sourceforge.cruisecontrol.util.OSEnvironment

        return properties;
    }
   
    /** for mocking **/
    protected OSEnvironment getOSEnvironment() {
        return new OSEnvironment();
    }
View Full Code Here

Examples of net.sourceforge.cruisecontrol.util.OSEnvironment

                        "Could not load properties from file \"" + fileName
                                + "\".", e);
            }
        } else if (environment != null) {
            // Load the environment into the project's properties
            Iterator variables = new OSEnvironment().getEnvironment().iterator();
            while (variables.hasNext()) {
                String line = (String) variables.next();
                int index = line.indexOf('=');
                if (index < 0) {
                    continue;
View Full Code Here

Examples of org.jruby.environment.OSEnvironment

    }

    private static void defineGlobalEnvConstants(Ruby runtime) {

      Map environmentVariableMap = null;
      OSEnvironment environment = new OSEnvironment();
      try {
        environmentVariableMap = environment.getEnvironmentVariableMap(runtime);
      } catch (OSEnvironmentReaderExcepton e) {
        // If the environment variables are not accessible shouldn't terminate
        runtime.getWarnings().warn(ID.MISCELLANEOUS, e.getMessage());
      }
   
      if (environmentVariableMap == null) {
            // if the environment variables can't be obtained, define an empty ENV
        environmentVariableMap = new HashMap();
      }

        StringOnlyRubyHash h1 = new StringOnlyRubyHash(runtime,
                                                       environmentVariableMap, runtime.getNil());
        h1.getSingletonClass().defineAnnotatedMethods(StringOnlyRubyHash.class);
        runtime.defineGlobalConstant("ENV", h1);

        // Define System.getProperties() in ENV_JAVA
        Map systemProps = environment.getSystemPropertiesMap(runtime);
        runtime.defineGlobalConstant("ENV_JAVA", new StringOnlyRubyHash(
                runtime, systemProps, runtime.getNil()));
       
    }
View Full Code Here

Examples of org.jruby.util.OSEnvironment

        RubyArgsFile.initArgsFile(runtime);
    }

    private static void defineGlobalEnvConstants(Ruby runtime) {
      Map environmentVariableMap = null;
      OSEnvironment environment = new OSEnvironment();
        environmentVariableMap = environment.getEnvironmentVariableMap(runtime);
   
      if (environmentVariableMap == null) {
            // if the environment variables can't be obtained, define an empty ENV
        environmentVariableMap = new HashMap();
      }

        CaseInsensitiveStringOnlyRubyHash h1 = new CaseInsensitiveStringOnlyRubyHash(runtime,
                                                       environmentVariableMap, runtime.getNil());
        h1.getSingletonClass().defineAnnotatedMethods(CaseInsensitiveStringOnlyRubyHash.class);
        runtime.defineGlobalConstant("ENV", h1);
        runtime.setENV(h1);

        // Define System.getProperties() in ENV_JAVA
        Map systemProps = environment.getSystemPropertiesMap(runtime);
        runtime.defineGlobalConstant("ENV_JAVA", new StringOnlyRubyHash(
                runtime, systemProps, runtime.getNil()));
    }
View Full Code Here

Examples of org.jruby.util.OSEnvironment

        globals.alias("$LAST_PAREN_MATCH", "$+");
    }

    private static void defineGlobalEnvConstants(Ruby runtime) {
      Map environmentVariableMap = null;
      OSEnvironment environment = new OSEnvironment();
        environmentVariableMap = environment.getEnvironmentVariableMap(runtime);
   
      if (environmentVariableMap == null) {
            // if the environment variables can't be obtained, define an empty ENV
        environmentVariableMap = new HashMap();
      }

      CaseInsensitiveStringOnlyRubyHash env = new CaseInsensitiveStringOnlyRubyHash(runtime,
                                                       environmentVariableMap,
                                                       runtime.getNil(),
                                                       runtime.getInstanceConfig().isNativeEnabled() &&
                                                           runtime.getInstanceConfig().isUpdateNativeENVEnabled() );
        env.getSingletonClass().defineAnnotatedMethods(CaseInsensitiveStringOnlyRubyHash.class);
        runtime.defineGlobalConstant("ENV", env);
        runtime.setENV(env);

        // Define System.getProperties() in ENV_JAVA
        Map systemProps = environment.getSystemPropertiesMap(runtime);
        RubyHash systemPropsHash = new ReadOnlySystemPropertiesHash(
                runtime, systemProps, runtime.getNil());
        systemPropsHash.setFrozen(true);
        runtime.defineGlobalConstant("ENV_JAVA", systemPropsHash);
    }
View Full Code Here

Examples of org.jruby.util.OSEnvironment

        }
    }

    private static void defineGlobalEnvConstants(Ruby runtime) {
      Map environmentVariableMap = null;
      OSEnvironment environment = new OSEnvironment();
        environmentVariableMap = environment.getEnvironmentVariableMap(runtime);
   
      if (environmentVariableMap == null) {
            // if the environment variables can't be obtained, define an empty ENV
        environmentVariableMap = new HashMap();
      }

      CaseInsensitiveStringOnlyRubyHash env = new CaseInsensitiveStringOnlyRubyHash(runtime,
                                                       environmentVariableMap,
                                                       runtime.getNil(),
                                                       runtime.getInstanceConfig().isNativeEnabled() &&
                                                           runtime.getInstanceConfig().isUpdateNativeENVEnabled() );
        env.getSingletonClass().defineAnnotatedMethods(CaseInsensitiveStringOnlyRubyHash.class);
        runtime.defineGlobalConstant("ENV", env);
        runtime.setENV(env);

        // Define System.getProperties() in ENV_JAVA
        Map systemProps = environment.getSystemPropertiesMap(runtime);
        RubyHash systemPropsHash = new ReadOnlySystemPropertiesHash(
                runtime, systemProps, runtime.getNil());
        systemPropsHash.setFrozen(true);
        runtime.defineGlobalConstant("ENV_JAVA", systemPropsHash);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.