diff --git a/jruby/pom.xml b/jruby/pom.xml
deleted file mode 100644
index fed3827e07..0000000000
--- a/jruby/pom.xml
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
- 4.0.0
-
- org.kohsuke.stapler
- stapler-parent
- ${changelist}
-
-
- stapler-jruby
- Stapler JRuby module
- JRuby binding for Stapler
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
- ${skip.jruby.tests}
-
-
-
-
-
-
- ${project.groupId}
- stapler-jelly
- ${project.version}
-
-
- org.jruby
- jruby-complete
- 1.7.17
-
-
- org.jruby.rack
- jruby-rack
- 1.1.21
-
-
- javax.servlet
- javax.servlet-api
- 3.1.0
- provided
-
-
- org.jvnet.hudson
- commons-jelly-tags-define
- test
-
-
- dom4j
- dom4j
-
-
- commons-cli
- commons-cli
-
-
- org.jvnet.hudson
- commons-jelly
-
-
-
-
- ${project.groupId}
- stapler
- ${project.version}
- tests
- test
-
-
- junit
- junit
- test
-
-
- org.kohsuke.metainf-services
- metainf-services
- true
-
-
- org.mockito
- mockito-core
- test
-
-
- org.jenkins-ci
- test-annotations
- test
-
-
- org.hamcrest
- hamcrest
- test
-
-
-
- true
- ${skipTests}
-
-
diff --git a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/AbstractRubyTearOff.java b/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/AbstractRubyTearOff.java
deleted file mode 100644
index 20ff2fe404..0000000000
--- a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/AbstractRubyTearOff.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.kohsuke.stapler.jelly.jruby;
-
-import org.apache.commons.jelly.Script;
-import org.kohsuke.stapler.AbstractTearOff;
-import org.kohsuke.stapler.MetaClass;
-import org.kohsuke.stapler.WebApp;
-import org.kohsuke.stapler.jelly.JellyRequestDispatcher;
-
-import javax.servlet.RequestDispatcher;
-import java.io.IOException;
-import java.net.URL;
-
-/**
- *
- *
- * @author Kohsuke Kawaguchi
- */
-public abstract class AbstractRubyTearOff extends AbstractTearOff {
- protected AbstractRubyTearOff(MetaClass owner) {
- super(owner, JRubyClassLoaderTearOff.class);
- }
-
- /**
- * Defines the file extension, like ".erb", that designates this kind of view type.
- */
- @Override
- protected abstract String getDefaultScriptExtension();
-
- @Override
- public Script parseScript(URL res) throws IOException {
- return WebApp.getCurrent().getFacet(JRubyFacet.class).parseScript(res);
- }
-
- /**
- * Creates a {@link RequestDispatcher} that forwards to the jelly view, if available.
- */
- public RequestDispatcher createDispatcher(Object it, String viewName) throws IOException {
- Script script = findScript(viewName+getDefaultScriptExtension());
- if(script!=null)
- return new JellyRequestDispatcher(it,script);
- return null;
- }
-}
diff --git a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/IJRubyContext.java b/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/IJRubyContext.java
deleted file mode 100644
index 192df67510..0000000000
--- a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/IJRubyContext.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.kohsuke.stapler.jelly.jruby;
-
-import org.apache.commons.jelly.JellyContext;
-import org.apache.commons.jelly.XMLOutput;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-public interface IJRubyContext {
- JellyContext getJellyContext();
- void setJellyContext(JellyContext context);
- XMLOutput getOutput();
- void setOutput(XMLOutput output);
-}
diff --git a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/JRubyClassLoaderTearOff.java b/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/JRubyClassLoaderTearOff.java
deleted file mode 100644
index e61ea23f79..0000000000
--- a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/JRubyClassLoaderTearOff.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.kohsuke.stapler.jelly.jruby;
-
-import org.kohsuke.stapler.MetaClassLoader;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-public class JRubyClassLoaderTearOff {
- private final MetaClassLoader owner;
-
- public JRubyClassLoaderTearOff(MetaClassLoader owner) {
- this.owner = owner;
- }
-}
diff --git a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/JRubyFacet.java b/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/JRubyFacet.java
deleted file mode 100644
index c6ba24fbd6..0000000000
--- a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/JRubyFacet.java
+++ /dev/null
@@ -1,228 +0,0 @@
-package org.kohsuke.stapler.jelly.jruby;
-
-import org.apache.commons.jelly.JellyTagException;
-import org.apache.commons.jelly.Script;
-import org.jruby.RubyClass;
-import org.jruby.RubyModule;
-import org.jruby.RubyObject;
-import org.jruby.embed.LocalContextScope;
-import org.jruby.embed.ScriptingContainer;
-import org.kohsuke.MetaInfServices;
-import org.kohsuke.stapler.Dispatcher;
-import org.kohsuke.stapler.Facet;
-import org.kohsuke.stapler.MetaClass;
-import org.kohsuke.stapler.RequestImpl;
-import org.kohsuke.stapler.ResponseImpl;
-import org.kohsuke.stapler.TearOffSupport;
-import org.kohsuke.stapler.WebApp;
-import org.kohsuke.stapler.jelly.JellyCompatibleFacet;
-import org.kohsuke.stapler.jelly.JellyFacet;
-import org.kohsuke.stapler.jelly.jruby.erb.ERbClassTearOff;
-import org.kohsuke.stapler.lang.Klass;
-
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletException;
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.logging.Level;
-
-import static java.util.logging.Level.FINE;
-
-/**
- * {@link Facet} that adds Ruby-based view technologies.
- *
- * @author Kohsuke Kawaguchi
- * @author Hiroshi Nakamura
- */
-@MetaInfServices(Facet.class)
-public class JRubyFacet extends Facet implements JellyCompatibleFacet {
- /*package*/ final List languages = new CopyOnWriteArrayList<>();
-
- /**
- * There are all kinds of downsides in doing this, but for the time being we just use one scripting container.
- */
- private final ScriptingContainer container;
-
- private final RubyKlassNavigator navigator;
-
- /**
- * {@link RubyTemplateContainer}s keyed by their {@linkplain RubyTemplateLanguage#getScriptExtension() extensions}.
- * (since {@link #container} is a singleton per {@link JRubyFacet}, this is also just one map.
- */
- private final Map templateContainers = new HashMap<>();
-
- private final Collection> tearOffTypes = new CopyOnWriteArrayList<>();
-
- public JRubyFacet() {
- // TODO: is this too early? Shall we allow registrations later?
- languages.addAll(Facet.discoverExtensions(RubyTemplateLanguage.class,
- Thread.currentThread().getContextClassLoader(), getClass().getClassLoader()));
-
- container = new ScriptingContainer(LocalContextScope.SINGLETHREAD); // we don't want any funny multiplexing from ScriptingContainer.
- container.runScriptlet("require 'org/kohsuke/stapler/jelly/jruby/JRubyJellyScriptImpl'");
-
- navigator = new RubyKlassNavigator(container.getProvider().getRuntime(), getClass().getClassLoader());
-
- for (RubyTemplateLanguage l : languages) {
- templateContainers.put(l.getScriptExtension(),l.createContainer(container));
- tearOffTypes.add(l.getTearOffClass());
- }
- }
-
- private RubyTemplateContainer selectTemplateContainer(String path) {
- int idx = path.lastIndexOf('.');
- if (idx >= 0) {
- RubyTemplateContainer t = templateContainers.get(path.substring(idx));
- if (t!=null) return t;
- }
- throw new IllegalArgumentException("Unrecognized file extension: "+path);
- }
-
- public Script parseScript(URL template) throws IOException {
- return selectTemplateContainer(template.getPath()).parseScript(template);
- }
-
- @Override
- public Klass getKlass(Object o) {
- if (o instanceof RubyObject)
- return makeKlass(((RubyObject) o).getMetaClass());
- return null;
- }
-
- private Klass makeKlass(RubyModule o) {
- return new Klass<>(o,navigator);
- }
-
- public synchronized MetaClass getClassInfo(RubyClass r) {
- return WebApp.getCurrent().getMetaClass(makeKlass(r));
- }
-
- private boolean isRuby(MetaClass mc) {
- return mc.klass.clazz instanceof RubyModule;
- }
-
- @Override
- public void buildViewDispatchers(final MetaClass owner, List dispatchers) {
- for (final Class extends AbstractRubyTearOff> t : getClassTearOffTypes()) {
- dispatchers.add(new ScriptInvokingDispatcher() {
- final AbstractRubyTearOff tearOff = owner.loadTearOff(t);
- @Override
- public boolean dispatch(RequestImpl req, ResponseImpl rsp, Object node) throws IOException, ServletException {
- String next = req.tokens.peek();
- if(next==null) return false;
-
- // only match the end of the URL
- if (req.tokens.countRemainingTokens()>1) return false;
- // and avoid serving both "foo" and "foo/" as relative URL semantics are drastically different
- if (req.getRequestURI().endsWith("/")) return false;
-
- if (!isBasename(next)) {
- // potentially an attempt to make a folder traversal
- return false;
- }
-
- Script script = tearOff.findScript(next);
-
- if (script == null) {
- // no script found
- return false;
- }
-
- return invokeScript(req, rsp, node, next, script);
- }
- });
- }
- }
-
- @Override
- public void buildFallbackDispatchers(MetaClass owner, List dispatchers) {
- if (isRuby(owner)) {
- dispatchers.add(new RackDispatcher());
- }
- }
-
- @Override
- public Collection> getClassTearOffTypes() {
- return tearOffTypes;
- }
-
- @Override
- public Collection getScriptExtensions() {
- List r = new ArrayList<>();
- for (RubyTemplateLanguage l : languages)
- r.add(l.getScriptExtension());
- return r;
- }
-
-
- @Override
- public RequestDispatcher createRequestDispatcher(RequestImpl request, Klass> type, Object it, String viewName) throws IOException {
- TearOffSupport mc = request.stapler.getWebApp().getMetaClass(type);
- return mc.loadTearOff(ERbClassTearOff.class).createDispatcher(it,viewName);
- }
-
- private ScriptDispatcher makeIndexDispatcher(MetaClass mc) throws IOException {
- for (Class extends AbstractRubyTearOff> t : getClassTearOffTypes()) {
- final AbstractRubyTearOff rt = mc.loadTearOff(t);
- final Script script = rt.findScript("index");
- if(script!=null)
- return new ScriptDispatcher(rt, script);
- }
- return null;
- }
-
- @Override
- public void buildIndexDispatchers(MetaClass mc, List dispatchers) {
- try {
- ScriptDispatcher d = makeIndexDispatcher(mc);
- if (d!=null)
- dispatchers.add(d);
- } catch (IOException e) {
- LOGGER.log(Level.WARNING, "Failed to parse Ruby index view for "+mc, e);
- }
- }
-
- @Override
- public boolean handleIndexRequest(RequestImpl req, ResponseImpl rsp, Object node, MetaClass mc) throws IOException, ServletException {
- ScriptDispatcher d = makeIndexDispatcher(mc);
- return d!=null && d.dispatch(req,rsp,node);
- }
-
- private static class ScriptDispatcher extends Dispatcher {
- private final AbstractRubyTearOff rt;
- private final Script script;
-
- public ScriptDispatcher(AbstractRubyTearOff rt, Script script) {
- this.rt = rt;
- this.script = script;
- }
-
- @Override
- public boolean dispatch(RequestImpl req, ResponseImpl rsp, Object node) throws IOException, ServletException {
- try {
- if (req.tokens.hasMore())
- return false;
-
- if(LOGGER.isLoggable(FINE))
- LOGGER.fine("Invoking index"+ rt.getDefaultScriptExtension()+" on " + node);
-
- WebApp.getCurrent().getFacet(JellyFacet.class).scriptInvoker.invokeScript(req, rsp, script, node);
- return true;
- } catch (JellyTagException e) {
- throw new ServletException(e);
- }
- }
-
- @Override
- public String toString() {
- return "index"+ rt.getDefaultScriptExtension()+" for url=/";
- }
- }
-}
-
diff --git a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/JRubyJellyScript.java b/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/JRubyJellyScript.java
deleted file mode 100644
index 7197e1d376..0000000000
--- a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/JRubyJellyScript.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package org.kohsuke.stapler.jelly.jruby;
-
-import org.apache.commons.jelly.JellyContext;
-import org.apache.commons.jelly.JellyException;
-import org.apache.commons.jelly.JellyTagException;
-import org.apache.commons.jelly.Script;
-import org.apache.commons.jelly.TagLibrary;
-import org.apache.commons.jelly.XMLOutput;
-import org.apache.commons.jelly.expression.ConstantExpression;
-import org.apache.commons.jelly.impl.TagScript;
-import org.jruby.Ruby;
-import org.jruby.RubyProc;
-import org.jruby.RubySymbol;
-import org.jruby.runtime.builtin.IRubyObject;
-
-import java.util.Map;
-import java.util.Map.Entry;
-
-/**
- * Exposes ERb/Haml scripts as {@link Script}.
- *
- *
- * This abstract class defines the Java half of it, and it is further subtyped in Ruby for different languages.
- *
- * @author Kohsuke Kawaguchi
- */
-public abstract class JRubyJellyScript implements Script {
-
- protected JRubyJellyScript() {
- }
-
- @Override
- public Script compile() throws JellyException {
- return this;
- }
-
- // this method is implemented in Ruby
- @Override
- public abstract void run(JellyContext context, XMLOutput output) throws JellyTagException;
-
- /**
- * Invokes other Jelly tag libraries.
- */
- public void invokeTaglib(final IJRubyContext rcon, JellyContext context, XMLOutput output, String uri, String localName, Map attributes, final RubyProc proc) throws JellyException {
- TagScript tagScript = createTagScript(context, uri, localName);
-
- if (attributes!=null) {
- for (Entry e : attributes.entrySet()) {
- tagScript.addAttribute(e.getKey().asJavaString(), new ConstantExpression(e.getValue()));
- }
- }
-
- if (proc!=null) {
- final Ruby runtime = ((IRubyObject)rcon).getRuntime();
-
- tagScript.setTagBody(new Script() {
- @Override
- public Script compile() throws JellyException {
- return this;
- }
-
- @Override
- public void run(JellyContext context, XMLOutput output) throws JellyTagException {
- JellyContext oc = rcon.getJellyContext();
- XMLOutput oo = rcon.getOutput();
- try {
- rcon.setJellyContext(context);
- rcon.setOutput(output);
- proc.getBlock().yield(runtime.getCurrentContext(),null);
- } finally {
- rcon.setJellyContext(oc);
- rcon.setOutput(oo);
- }
- }
- });
- }
- tagScript.run(context, output);
- }
-
- private TagScript createTagScript(JellyContext context, String uri, String name) throws JellyException {
- TagLibrary lib = context.getTagLibrary(uri);
- if (lib==null)
- throw new JellyException("Undefined tag library namespace URI: "+uri);
- TagScript tagScript = lib.createTagScript(name, null/*this parameter appears to be unused.*/);
- if (tagScript!=null) return tagScript;
- tagScript = lib.createTagScript(name.replace('_','-'), null);
- if (tagScript!=null) return tagScript;
- throw new JellyException(String.format("name '%s' not found for '%s'", name, uri));
- }
-}
diff --git a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/RackDispatcher.java b/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/RackDispatcher.java
deleted file mode 100644
index ee1189b0ac..0000000000
--- a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/RackDispatcher.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.kohsuke.stapler.jelly.jruby;
-
-import org.jruby.Ruby;
-import org.jruby.RubyModule;
-import org.jruby.RubyObject;
-import org.jruby.internal.runtime.methods.DynamicMethod;
-import org.jruby.rack.DefaultRackApplication;
-import org.jruby.rack.servlet.*;
-import org.jruby.runtime.builtin.IRubyObject;
-import org.kohsuke.stapler.Dispatcher;
-import org.kohsuke.stapler.RequestImpl;
-import org.kohsuke.stapler.ResponseImpl;
-import org.kohsuke.stapler.Stapler;
-
-import javax.servlet.ServletException;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-
-/**
- * {@link Dispatcher} that looks for the Rack-compliant call method.
- *
- * @author Kohsuke Kawaguchi
- */
-public class RackDispatcher extends Dispatcher {
- @Override
- public boolean dispatch(final RequestImpl req, ResponseImpl rsp, Object node) throws IOException, ServletException, IllegalAccessException, InvocationTargetException {
- RubyObject x = (RubyObject) node;
- Ruby runtime = x.getRuntime();
-
- DynamicMethod m = x.getMetaClass().searchMethod("call");
- if (m==null) // does this instance respond to the 'call' method?
- return false;
-
- // TODO: does the context need to live longer?
- ServletRackContext rackContext = new DefaultServletRackContext(new ServletRackConfig(req.getServletContext()));
-
- // we don't want the Rack app to consider the portion of the URL that was already consumed
- // to reach to the Rack app, so for PATH_INFO we use getRestOfPath(), not getPathInfo()
- ServletRackEnvironment env = new ServletRackEnvironment(req, rsp, rackContext) {
- @Override
- public String getPathInfo() {
- return req.getRestOfPath();
- }
- };
- // servletHandler = Rack::Handler::Servlet.new(node)
- runtime.getLoadService().require("rack/handler/servlet");
- IRubyObject servletHandler = ((RubyModule)runtime.getModule("Rack").getConstantAt("Handler")).getClass("Servlet").callMethod("new", x);
-
- DefaultRackApplication dra = new DefaultRackApplication();
- dra.setApplication(servletHandler);
- dra.call(env)
- .respond(new ServletRackResponseEnvironment(Stapler.getCurrentResponse()));
-
- return true;
- }
-
- @Override
- public String toString() {
- return "call(env) to delegate to Rack-compatible Ruby objects";
- }
-}
diff --git a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/RubyKlassNavigator.java b/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/RubyKlassNavigator.java
deleted file mode 100644
index 9f8a9d5a5c..0000000000
--- a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/RubyKlassNavigator.java
+++ /dev/null
@@ -1,115 +0,0 @@
-package org.kohsuke.stapler.jelly.jruby;
-
-import org.jruby.Ruby;
-import org.jruby.RubyClass;
-import org.jruby.RubyModule;
-import org.jruby.RubyObject;
-import org.jruby.internal.runtime.methods.DynamicMethod;
-import org.kohsuke.stapler.ClassDescriptor;
-import org.kohsuke.stapler.Function;
-import org.kohsuke.stapler.MetaClassLoader;
-import org.kohsuke.stapler.lang.FieldRef;
-import org.kohsuke.stapler.lang.Klass;
-import org.kohsuke.stapler.lang.KlassNavigator;
-import org.kohsuke.stapler.lang.MethodRef;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Locale;
-
-/**
- * {@link KlassNavigator} implementation for JRuby.
- *
- * @author Kohsuke Kawaguchi
- */
-public class RubyKlassNavigator extends KlassNavigator {
- private final Ruby ruby;
- /**
- * ClassLoader to load resources from.
- */
- private final ClassLoader classLoader;
-
- public RubyKlassNavigator(Ruby ruby, ClassLoader cl) {
- this.ruby = ruby;
- this.classLoader = cl;
- }
-
-
- @Override
- public URL getResource(RubyModule clazz, String resourceName) {
- String fullName;
- if (resourceName.startsWith("/"))
- fullName = resourceName.substring(1);
- else
- fullName = decamelize(clazz.getName().replace("::","/")+'/'+resourceName);
-
- if (MetaClassLoader.debugLoader!=null) {
- URL res = MetaClassLoader.debugLoader.loader.getResource(fullName);
- if (res!=null) return res;
- }
- return classLoader.getResource(fullName);
- }
-
- @Override
- public Iterable> getAncestors(RubyModule clazz) {
- List> r = new ArrayList<>();
- for (RubyModule anc : (List)(List)clazz.getAncestorList()) {
- r.add(wrap(anc));
- }
- return r;
- }
-
- @Override
- public Klass> getSuperClass(RubyModule clazz) {
- // TODO: what happens when a Ruby class extends from Java class?
- return wrap(clazz.getSuperClass());
- }
-
- @Override
- public List getDeclaredMethods(RubyModule clazz) {
- List r = new ArrayList<>();
- for (DynamicMethod m : clazz.getMethods().values()) {
- // TODO: not sure if this is entirely correct
- if (m.getImplementationClass()==clazz)
- r.add(new RubyMethodRef(clazz,m));
- }
- return r;
- }
-
- @Override
- public List getDeclaredFields(RubyModule clazz) {
- // IIUC, Ruby doesn't have statically defined instance fields
- return Collections.emptyList();
- }
-
- @Override
- public List getFunctions(RubyModule clazz) {
- // implemented as a fallback to Java through reified class, but maybe there's a better way to do this
- return new ClassDescriptor(toJavaClass(clazz)).methods;
- }
-
- @Override
- public Class toJavaClass(RubyModule clazz) {
- if (clazz instanceof RubyClass) {
- RubyClass rc = (RubyClass) clazz;
- Class c = rc.getReifiedClass();
- if (c!=null) return c; // is this right?
- }
- return RubyObject.class;
- }
-
- public Klass wrap(RubyModule m) {
- return m==null ? null : new Klass<>(m,this);
- }
-
- /**
- * Converts "FooBarZot" to "foo_bar_zot"
- */
- static String decamelize(String s) {
- return s.replaceAll("(\\p{javaLetterOrDigit})(\\p{javaUpperCase}\\p{javaLowerCase})","$1_$2")
- .replaceAll("(\\p{javaLowerCase})(\\p{javaUpperCase})","$1_$2")
- .toLowerCase(Locale.ENGLISH);
- }
-}
diff --git a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/RubyMethodRef.java b/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/RubyMethodRef.java
deleted file mode 100644
index 6a0b678802..0000000000
--- a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/RubyMethodRef.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.kohsuke.stapler.jelly.jruby;
-
-import org.jruby.RubyModule;
-import org.jruby.internal.runtime.methods.DynamicMethod;
-import org.jruby.javasupport.Java;
-import org.jruby.runtime.builtin.IRubyObject;
-import org.kohsuke.stapler.lang.MethodRef;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.InvocationTargetException;
-import edu.umd.cs.findbugs.annotations.NonNull;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-public class RubyMethodRef extends MethodRef {
- @NonNull
- private final RubyModule klass;
- @NonNull
- private final DynamicMethod method;
-
-
- public RubyMethodRef(@NonNull RubyModule klass, @NonNull DynamicMethod method) {
- this.klass = klass;
- this.method = method;
- }
-
- /**
- * Retrieves the Ruby module (aka class), for which the method is declared.
- * @return Ruby module, which stores the method reference
- * @since 1.248
- */
- @NonNull
- public RubyModule getKlass() {
- return klass;
- }
-
- /**
- * Retrieves the referenced method.
- * @return Referenced method
- * @since 1.248
- */
- @NonNull
- public DynamicMethod getMethod() {
- return method;
- }
-
- @Override
- public String getName() {
- return method.getName();
- }
-
- @Override
- public T getAnnotation(Class type) {
- // TODO: what's the equivalent in JRuby?
- return null;
- }
-
- @Override
- public Object invoke(Object _this, Object... args) throws InvocationTargetException, IllegalAccessException {
- IRubyObject[] argList = new IRubyObject[args.length];
- for (int i=0; i
- * One often needs to do some preparation work in every {@link ScriptingContainer} that it uses,
- * such as loading gem. Instance of this captures that context.
- *
- *
- * Right now, we only use one {@link ScriptingContainer}, so this isn't serving any useful purpose,
- * but this is in anticipation of the future expansion to handle multiple {@link ScriptingContainer}s.
- *
- * @author Kohsuke Kawaguchi
- */
-public class RubyTemplateContainer {
- /**
- * Subtype of {@link JRubyJellyScript} for this specific template language.
- */
- private final RubyClass scriptClass;
-
- /**
- * Where we came from.
- */
- public final RubyTemplateLanguage language;
-
- /**
- * This {@link RubyTemplateContainer} instance if scoped to this JRuby interpreter context.
- */
- public final ScriptingContainer container;
-
- public RubyTemplateContainer(RubyClass scriptClass, RubyTemplateLanguage language, ScriptingContainer container) {
- this.scriptClass = scriptClass;
- this.language = language;
- this.container = container;
- }
-
- @SuppressFBWarnings(value = "URLCONNECTION_SSRF_FD", justification = "Not relevant in this situation.")
- public Script parseScript(URL path) throws IOException {
- try {
- String template = IOUtils.toString(path.openStream(), StandardCharsets.UTF_8);
- return (Script) container.callMethod(scriptClass, "new", template);
- } catch (Exception e) {
- throw new IOException("Failed to parse " + path, e);
- }
- }
-}
diff --git a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/RubyTemplateLanguage.java b/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/RubyTemplateLanguage.java
deleted file mode 100644
index 3e49bbe752..0000000000
--- a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/RubyTemplateLanguage.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.kohsuke.stapler.jelly.jruby;
-
-import org.jruby.embed.ScriptingContainer;
-
-/**
- * Ruby template language binding.
- *
- *
- * Implementations of this is discovered via service-loader mechanism.
- *
- * @author Kohsuke Kawaguchi
- */
-public abstract class RubyTemplateLanguage {
- /**
- * Defines the file extension, like ".erb", that designates this kind of view type.
- */
- protected abstract String getScriptExtension();
-
- protected abstract Class extends AbstractRubyTearOff> getTearOffClass();
-
- /**
- * Called to set up this template language binding on the specified scripting container.
- */
- protected abstract RubyTemplateContainer createContainer(ScriptingContainer container);
-}
diff --git a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/ScriptInvokingDispatcher.java b/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/ScriptInvokingDispatcher.java
deleted file mode 100644
index b0f160da2c..0000000000
--- a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/ScriptInvokingDispatcher.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.kohsuke.stapler.jelly.jruby;
-
-import org.apache.commons.jelly.Script;
-import org.kohsuke.stapler.Dispatcher;
-import org.kohsuke.stapler.RequestImpl;
-import org.kohsuke.stapler.ResponseImpl;
-import org.kohsuke.stapler.WebApp;
-import org.kohsuke.stapler.jelly.JellyFacet;
-
-import javax.servlet.ServletException;
-import java.io.IOException;
-
-/**
- * {@link Dispatcher} that invokes view script.
- *
- * @author Kohsuke Kawaguchi
- */
-abstract class ScriptInvokingDispatcher extends Dispatcher {
- protected boolean invokeScript(RequestImpl req, ResponseImpl rsp, Object node, String next, Script script) throws IOException, ServletException {
- try {
- if(script==null) return false;
-
- req.tokens.next();
-
- if(traceable())
- trace(req,rsp,"Invoking "+next+" on "+node+" for "+req.tokens);
-
- WebApp.getCurrent().getFacet(JellyFacet.class).scriptInvoker.invokeScript(req, rsp, script, node);
-
- return true;
- } catch (RuntimeException | IOException e) {
- throw e;
- } catch (Exception e) {
- throw new ServletException(e);
- }
- }
-
- @Override
- public String toString() {
- return "TOKEN for url=/TOKEN/...";
- }
-}
diff --git a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/erb/ERbClassTearOff.java b/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/erb/ERbClassTearOff.java
deleted file mode 100644
index 3949d680e0..0000000000
--- a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/erb/ERbClassTearOff.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.kohsuke.stapler.jelly.jruby.erb;
-
-import org.kohsuke.stapler.MetaClass;
-import org.kohsuke.stapler.jelly.jruby.AbstractRubyTearOff;
-
-/**
- * Tear off that manages Ruby ERB views of Java objects (and not ruby objects.)
- *
- * @author Kohsuke Kawaguchi
- */
-public class ERbClassTearOff extends AbstractRubyTearOff {
- public ERbClassTearOff(MetaClass owner) {
- super(owner);
- }
-
- @Override
- protected String getDefaultScriptExtension() {
- return ".erb";
- }
-}
diff --git a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/erb/ERbLanguage.java b/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/erb/ERbLanguage.java
deleted file mode 100644
index e509380f2d..0000000000
--- a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/erb/ERbLanguage.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.kohsuke.stapler.jelly.jruby.erb;
-
-import org.jruby.RubyClass;
-import org.jruby.embed.ScriptingContainer;
-import org.kohsuke.MetaInfServices;
-import org.kohsuke.stapler.jelly.jruby.RubyTemplateContainer;
-import org.kohsuke.stapler.jelly.jruby.RubyTemplateLanguage;
-
-/**
- * @author Kohsuke Kawaguchi
- */
-@MetaInfServices
-public class ERbLanguage extends RubyTemplateLanguage {
- @Override
- protected String getScriptExtension() {
- return ".erb";
- }
-
- @Override
- protected Class getTearOffClass() {
- return ERbClassTearOff.class;
- }
-
- @Override
- protected RubyTemplateContainer createContainer(ScriptingContainer jruby) {
- return new RubyTemplateContainer(
- (RubyClass)jruby.runScriptlet(
- "require 'org/kohsuke/stapler/jelly/jruby/erb/JRubyJellyERbScript'\n"+
- "JRubyJellyScriptImpl::JRubyJellyERbScript"),
- this, jruby);
- }
-}
diff --git a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/haml/HamlClassTearOff.java b/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/haml/HamlClassTearOff.java
deleted file mode 100644
index b0f5fb2fd7..0000000000
--- a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/haml/HamlClassTearOff.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.kohsuke.stapler.jelly.jruby.haml;
-
-import org.kohsuke.stapler.MetaClass;
-import org.kohsuke.stapler.jelly.jruby.AbstractRubyTearOff;
-
-/**
- *
- * @author Kohsuke Kawaguchi
- */
-public class HamlClassTearOff extends AbstractRubyTearOff {
- public HamlClassTearOff(MetaClass owner) {
- super(owner);
- }
-
- @Override
- protected String getDefaultScriptExtension() {
- return ".haml";
- }
-}
diff --git a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/haml/HamlLanguage.java b/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/haml/HamlLanguage.java
deleted file mode 100644
index 867912bb18..0000000000
--- a/jruby/src/main/java/org/kohsuke/stapler/jelly/jruby/haml/HamlLanguage.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.kohsuke.stapler.jelly.jruby.haml;
-
-import org.jruby.RubyClass;
-import org.jruby.embed.ScriptingContainer;
-import org.kohsuke.MetaInfServices;
-import org.kohsuke.stapler.jelly.jruby.RubyTemplateContainer;
-import org.kohsuke.stapler.jelly.jruby.RubyTemplateLanguage;
-
-/**
- * @author Hiroshi Nakamura
- */
-@MetaInfServices
-public class HamlLanguage extends RubyTemplateLanguage {
- @Override
- protected String getScriptExtension() {
- return ".haml";
- }
-
- @Override
- protected Class getTearOffClass() {
- return HamlClassTearOff.class;
- }
-
- @Override
- protected RubyTemplateContainer createContainer(ScriptingContainer jruby) {
- jruby.put("gem_path", getClass().getResource("/gem").getPath());
-
- return new RubyTemplateContainer(
- (RubyClass)jruby.runScriptlet("ENV['GEM_PATH'] = gem_path\n" +
- "require 'rubygems'\n" +
- "require 'org/kohsuke/stapler/jelly/jruby/JRubyJellyScriptImpl'\n"+
- "require 'org/kohsuke/stapler/jelly/jruby/haml/JRubyJellyHamlScript'\n"+
- "JRubyJellyScriptImpl::JRubyJellyHamlScript"
- ),
- this, jruby);
- }
-}
diff --git a/jruby/src/main/resources/gem/bin/haml b/jruby/src/main/resources/gem/bin/haml
deleted file mode 100755
index 6b192fc768..0000000000
--- a/jruby/src/main/resources/gem/bin/haml
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/local/bin/ruby
-#
-# This file was generated by RubyGems.
-#
-# The application 'haml' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'rubygems'
-
-version = ">= 0"
-
-if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
- version = $1
- ARGV.shift
-end
-
-gem 'haml', version
-load Gem.bin_path('haml', 'haml', version)
diff --git a/jruby/src/main/resources/gem/bin/html2haml b/jruby/src/main/resources/gem/bin/html2haml
deleted file mode 100755
index d82349be9a..0000000000
--- a/jruby/src/main/resources/gem/bin/html2haml
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/local/bin/ruby
-#
-# This file was generated by RubyGems.
-#
-# The application 'haml' is installed as part of a gem, and
-# this file is here to facilitate running it.
-#
-
-require 'rubygems'
-
-version = ">= 0"
-
-if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
- version = $1
- ARGV.shift
-end
-
-gem 'haml', version
-load Gem.bin_path('haml', 'html2haml', version)
diff --git a/jruby/src/main/resources/gem/cache/haml-3.1.1.gem b/jruby/src/main/resources/gem/cache/haml-3.1.1.gem
deleted file mode 100644
index dae36b258d..0000000000
Binary files a/jruby/src/main/resources/gem/cache/haml-3.1.1.gem and /dev/null differ
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/.yardopts b/jruby/src/main/resources/gem/gems/haml-3.1.1/.yardopts
deleted file mode 100644
index c1c79a1991..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/.yardopts
+++ /dev/null
@@ -1,11 +0,0 @@
---readme README.md
---markup markdown
---markup-provider maruku
---default-return ""
---title "Haml Documentation"
---query 'object.type != :classvariable'
---query 'object.type != :constant || @api && @api.text == "public"'
---hide-void-return
---protected
---no-private
---no-highlight
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/CONTRIBUTING b/jruby/src/main/resources/gem/gems/haml-3.1.1/CONTRIBUTING
deleted file mode 100644
index f611387794..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/CONTRIBUTING
+++ /dev/null
@@ -1,3 +0,0 @@
-Contributions are welcomed. Please see the following sites for guidelines:
-
- http://haml-lang.com/development.html#contributing
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/MIT-LICENSE b/jruby/src/main/resources/gem/gems/haml-3.1.1/MIT-LICENSE
deleted file mode 100644
index 89c3814d26..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/MIT-LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-Copyright (c) 2006-2009 Hampton Catlin and Nathan Weizenbaum
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/README.md b/jruby/src/main/resources/gem/gems/haml-3.1.1/README.md
deleted file mode 100644
index df3d4d1f52..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/README.md
+++ /dev/null
@@ -1,133 +0,0 @@
-# Haml
-
-Haml is a templating engine for HTML.
-It's are designed to make it both easier and more pleasant
-to write HTML documents,
-by eliminating redundancy,
-reflecting the underlying structure that the document represents,
-and providing elegant, easily understandable, and powerful syntax.
-
-## Using
-
-Haml can be used from the command line
-or as part of a Ruby web framework.
-The first step is to install the gem:
-
- gem install haml
-
-After you convert some HTML to Haml, you can run
-
- haml document.haml
-
-to compile them.
-For more information on these commands, check out
-
- haml --help
-
-To install Haml in Rails 2,
-just add `config.gem "haml"` to `config/environment.rb`.
-In Rails 3, add `gem "haml"` to your Gemfile instead.
-and both Haml and Sass will be installed.
-Views with the `.html.haml` extension will automatically use Haml.
-
-To use Haml programatically,
-check out the [YARD documentation](http://haml-lang.com/docs/yardoc/).
-
-## Formatting
-
-The most basic element of Haml
-is a shorthand for creating HTML:
-
- %tagname{:attr1 => 'value1', :attr2 => 'value2'} Contents
-
-No end-tag is needed; Haml handles that automatically.
-If you prefer HTML-style attributes, you can also use:
-
- %tagname(attr1='value1' attr2='value2') Contents
-
-Adding `class` and `id` attributes is even easier.
-Haml uses the same syntax as the CSS that styles the document:
-
- %tagname#id.class
-
-In fact, when you're using the `
` tag,
-it becomes _even easier_.
-Because `
` is such a common element,
-a tag without a name defaults to a div. So
-
- #foo Hello!
-
-becomes
-
-
Hello!
-
-Haml uses indentation
-to bring the individual elements to represent the HTML structure.
-A tag's children are indented beneath than the parent tag.
-Again, a closing tag is automatically added.
-For example:
-
- %ul
- %li Salt
- %li Pepper
-
-becomes:
-
-
-
Salt
-
Pepper
-
-
-You can also put plain text as a child of an element:
-
- %p
- Hello,
- World!
-
-It's also possible to embed Ruby code into Haml documents.
-An equals sign, `=`, will output the result of the code.
-A hyphen, `-`, will run the code but not output the result.
-You can even use control statements
-like `if` and `while`:
-
- %p
- Date/Time:
- - now = DateTime.now
- %strong= now
- - if now > DateTime.parse("December 31, 2006")
- = "Happy new " + "year!"
-
-Haml provides far more tools than those presented here.
-Check out the [reference documentation](http://beta.haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html)
-for full details.
-
-### Indentation
-
-Haml's indentation can be made up of one or more tabs or spaces.
-However, indentation must be consistent within a given document.
-Hard tabs and spaces can't be mixed,
-and the same number of tabs or spaces must be used throughout.
-
-## Authors
-
-Haml was created by [Hampton Catlin](http://hamptoncatlin.com)
-(hcatlin) and he is the author of the original implementation. However, Hampton
-doesn't even know his way around the code anymore and now occasionally consults
-on the language issues. Hampton lives in Jacksonville, Florida and is the lead
-mobile developer for Wikimedia.
-
-[Nathan Weizenbaum](http://nex-3.com) is the primary developer and architect of
-the "modern" Ruby implementation of Haml. His hard work has kept the project
-alive by endlessly answering forum posts, fixing bugs, refactoring, finding
-speed improvements, writing documentation, implementing new features, and
-getting Hampton coffee (a fitting task for a boy-genius). Nathan lives in
-Seattle, Washington and while not being a student at the University of
-Washington or working at an internship, he consults for Unspace Interactive.
-
-If you use this software, you must pay Hampton a compliment. And
-buy Nathan some jelly beans. Maybe pet a kitten. Yeah. Pet that kitty.
-
-Some of the work on Haml was supported by Unspace Interactive.
-
-Beyond that, the implementation is licensed under the MIT License.
-Okay, fine, I guess that means compliments aren't __required__.
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/REVISION b/jruby/src/main/resources/gem/gems/haml-3.1.1/REVISION
deleted file mode 100644
index 54798d678b..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/REVISION
+++ /dev/null
@@ -1 +0,0 @@
-(release)
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/Rakefile b/jruby/src/main/resources/gem/gems/haml-3.1.1/Rakefile
deleted file mode 100644
index 889435d731..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/Rakefile
+++ /dev/null
@@ -1,394 +0,0 @@
-# ----- Utility Functions -----
-
-def scope(path)
- File.join(File.dirname(__FILE__), path)
-end
-
-# ----- Benchmarking -----
-
-desc < :"test:rails_compatibility"
-else
- task :default => :test
-end
-
-require 'rake/testtask'
-
-Rake::TestTask.new do |t|
- t.libs << 'lib'
- test_files = FileList[scope('test/**/*_test.rb')]
- test_files.exclude(scope('test/rails/*'))
- test_files.exclude(scope('test/plugins/*'))
- test_files.exclude(scope('test/haml/spec/*'))
- t.test_files = test_files
- t.verbose = true
-end
-Rake::Task[:test].send(:add_comment, < [:revision_file, :submodules, :permissions] do
- version = get_version
- File.open(scope('VERSION'), 'w') {|f| f.puts(version)}
- load scope('haml.gemspec')
- Gem::Builder.new(HAML_GEMSPEC).build
- sh %{git checkout VERSION}
-
- pkg = "#{HAML_GEMSPEC.name}-#{HAML_GEMSPEC.version}"
- mkdir_p "pkg"
- verbose(true) {mv "#{pkg}.gem", "pkg/#{pkg}.gem"}
-
- sh %{rm -f pkg/#{pkg}.tar.gz}
- verbose(false) {HAML_GEMSPEC.files.each {|f| sh %{tar rf pkg/#{pkg}.tar #{f}}}}
- sh %{gzip pkg/#{pkg}.tar}
-end
-
-task :permissions do
- sh %{chmod -R a+rx bin}
- sh %{chmod -R a+r .}
- require 'shellwords'
- Dir.glob('test/**/*_test.rb') do |file|
- next if file =~ %r{^test/haml/spec/}
- sh %{chmod a+rx #{file}}
- end
-end
-
-task :revision_file do
- require 'lib/haml'
-
- release = Rake.application.top_level_tasks.include?('release') || File.exist?(scope('EDGE_GEM_VERSION'))
- if Haml.version[:rev] && !release
- File.open(scope('REVISION'), 'w') { |f| f.puts Haml.version[:rev] }
- elsif release
- File.open(scope('REVISION'), 'w') { |f| f.puts "(release)" }
- else
- File.open(scope('REVISION'), 'w') { |f| f.puts "(unknown)" }
- end
-end
-
-# We also need to get rid of this file after packaging.
-at_exit { File.delete(scope('REVISION')) rescue nil }
-
-desc "Install Haml as a gem. Use SUDO=1 to install with sudo."
-task :install => [:package] do
- gem = RUBY_PLATFORM =~ /java/ ? 'jgem' : 'gem'
- sh %{#{'sudo ' if ENV["SUDO"]}#{gem} install --no-ri pkg/haml-#{get_version}}
-end
-
-desc "Release a new Haml package to Rubyforge."
-task :release => [:check_release, :package] do
- name = File.read(scope("VERSION_NAME")).strip
- version = File.read(scope("VERSION")).strip
- sh %{rubyforge add_release haml haml "#{name} (v#{version})" pkg/haml-#{version}.gem}
- sh %{rubyforge add_file haml haml "#{name} (v#{version})" pkg/haml-#{version}.tar.gz}
- sh %{gem push pkg/haml-#{version}.gem}
-end
-
-
-# Ensures that the VERSION file has been updated for a new release.
-task :check_release do
- version = File.read(scope("VERSION")).strip
- raise "There have been changes since current version (#{version})" if changed_since?(version)
- raise "VERSION_NAME must not be 'Bleeding Edge'" if File.read(scope("VERSION_NAME")) == "Bleeding Edge"
-end
-
-# Reads a password from the command line.
-#
-# @param name [String] The prompt to use to read the password
-def read_password(prompt)
- require 'readline'
- system "stty -echo"
- Readline.readline("#{prompt}: ").strip
-ensure
- system "stty echo"
- puts
-end
-
-# Returns whether or not the repository, or specific files,
-# has/have changed since a given revision.
-#
-# @param rev [String] The revision to check against
-# @param files [Array] The files to check.
-# If this is empty, checks the entire repository
-def changed_since?(rev, *files)
- IO.popen("git diff --exit-code #{rev} #{files.join(' ')}") {}
- return !$?.success?
-end
-
-task :submodules do
- if File.exist?(File.dirname(__FILE__) + "/.git")
- sh %{git submodule sync}
- sh %{git submodule update --init --recursive}
- end
-end
-
-task :release_edge do
- ensure_git_cleanup do
- puts "#{'=' * 50} Running rake release_edge"
-
- sh %{git checkout master}
- sh %{git reset --hard origin/master}
- sh %{rake package}
- version = get_version
- sh %{rubyforge add_release haml haml "Bleeding Edge (v#{version})" pkg/haml-#{version}.gem}
- sh %{gem push pkg/haml-#{version}.gem}
- end
-end
-
-# Get the version string. If this is being installed from Git,
-# this includes the proper prerelease version.
-def get_version
- written_version = File.read(scope('VERSION').strip)
- return written_version unless File.exist?(scope('.git'))
-
- # Get the current master branch version
- version = written_version.split('.')
- version.map! {|n| n =~ /^[0-9]+$/ ? n.to_i : n}
- return written_version unless version.size == 5 && version[3] == "alpha" # prerelease
-
- return written_version if (commit_count = `git log --pretty=oneline --first-parent stable.. | wc -l`).empty?
- version[4] = commit_count.strip
- version.join('.')
-end
-
-task :watch_for_update do
- sh %{ruby extra/update_watch.rb}
-end
-
-# ----- Documentation -----
-
-task :rdoc do
- puts '=' * 100, < :yard
- task :redoc => :yard
-rescue LoadError
- desc "Generate Documentation"
- task :doc => :rdoc
- task :yard => :rdoc
-end
-
-task :pages do
- puts "#{'=' * 50} Running rake pages"
- ensure_git_cleanup do
- sh %{git checkout haml-pages}
- sh %{git reset --hard origin/haml-pages}
-
- Dir.chdir("/var/www/haml-pages") do
- sh %{git fetch origin}
-
- sh %{git checkout stable}
- sh %{git reset --hard origin/stable}
-
- sh %{git checkout haml-pages}
- sh %{git reset --hard origin/haml-pages}
- sh %{rake build --trace}
- sh %{mkdir -p tmp}
- sh %{touch tmp/restart.txt}
- end
- end
-end
-
-# ----- Coverage -----
-
-begin
- require 'rcov/rcovtask'
-
- Rcov::RcovTask.new do |t|
- t.test_files = FileList[scope('test/**/*_test.rb')]
- t.rcov_opts << '-x' << '"^\/"'
- if ENV['NON_NATIVE']
- t.rcov_opts << "--no-rcovrt"
- end
- t.verbose = true
- end
-rescue LoadError; end
-
-# ----- Profiling -----
-
-begin
- require 'ruby-prof'
-
- desc < e
- IO.popen("sendmail nex342@gmail.com", "w") do |sm|
- sm << "From: nex3@nex-3.com\n" <<
- "To: nex342@gmail.com\n" <<
- "Subject: Exception when running rake #{Rake.application.top_level_tasks.join(', ')}\n" <<
- e.message << "\n\n" <<
- e.backtrace.join("\n")
- end
-ensure
- raise e if e
-end
-
-def ensure_git_cleanup
- email_on_error {yield}
-ensure
- sh %{git reset --hard HEAD}
- sh %{git clean -xdf}
- sh %{git checkout master}
-end
-
-task :handle_update do
- email_on_error do
- unless ENV["REF"] =~ %r{^refs/heads/(master|stable|haml-pages)$}
- puts "#{'=' * 20} Ignoring rake handle_update REF=#{ENV["REF"].inspect}"
- next
- end
- branch = $1
-
- puts
- puts
- puts '=' * 150
- puts "Running rake handle_update REF=#{ENV["REF"].inspect}"
-
- sh %{git fetch origin}
- sh %{git checkout stable}
- sh %{git reset --hard origin/stable}
- sh %{git checkout master}
- sh %{git reset --hard origin/master}
-
- case branch
- when "master"
- sh %{rake release_edge --trace}
- when "stable", "haml-pages"
- sh %{rake pages --trace}
- end
-
- puts 'Done running handle_update'
- puts '=' * 150
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/VERSION b/jruby/src/main/resources/gem/gems/haml-3.1.1/VERSION
deleted file mode 100644
index 94ff29cc4d..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-3.1.1
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/VERSION_NAME b/jruby/src/main/resources/gem/gems/haml-3.1.1/VERSION_NAME
deleted file mode 100644
index 8fe711e933..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/VERSION_NAME
+++ /dev/null
@@ -1 +0,0 @@
-Separated Sally
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/bin/haml b/jruby/src/main/resources/gem/gems/haml-3.1.1/bin/haml
deleted file mode 100755
index 1a24e4e42a..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/bin/haml
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env ruby
-# The command line Haml parser.
-
-$LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
-require 'haml'
-require 'haml/exec'
-
-opts = Haml::Exec::Haml.new(ARGV)
-opts.parse!
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/bin/html2haml b/jruby/src/main/resources/gem/gems/haml-3.1.1/bin/html2haml
deleted file mode 100755
index a85e95a3a7..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/bin/html2haml
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env ruby
-
-require File.dirname(__FILE__) + '/../lib/haml'
-require 'haml/exec'
-
-opts = Haml::Exec::HTML2Haml.new(ARGV)
-opts.parse!
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/extra/update_watch.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/extra/update_watch.rb
deleted file mode 100644
index 0d29c6081d..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/extra/update_watch.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require 'rubygems'
-require 'sinatra'
-require 'json'
-set :port, 3123
-set :environment, :production
-enable :lock
-Dir.chdir(File.dirname(__FILE__) + "/..")
-
-post "/" do
- puts "Recieved payload!"
- puts "Rev: #{`git name-rev HEAD`.strip}"
- system %{rake handle_update --trace REF=#{JSON.parse(params["payload"])["ref"].inspect}}
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/init.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/init.rb
deleted file mode 100644
index f8b3dab1a8..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/init.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-begin
- require File.join(File.dirname(__FILE__), 'lib', 'haml') # From here
-rescue LoadError
- begin
- require 'haml' # From gem
- rescue LoadError => e
- # gems:install may be run to install Haml with the skeleton plugin
- # but not the gem itself installed.
- # Don't die if this is the case.
- raise e unless defined?(Rake) &&
- (Rake.application.top_level_tasks.include?('gems') ||
- Rake.application.top_level_tasks.include?('gems:install'))
- end
-end
-
-# Load Haml.
-# Haml may be undefined if we're running gems:install.
-Haml.init_rails(binding) if defined?(Haml)
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml.rb
deleted file mode 100644
index 562443073d..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-dir = File.dirname(__FILE__)
-$LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
-
-require 'haml/version'
-
-# The module that contains everything Haml-related:
-#
-# * {Haml::Engine} is the class used to render Haml within Ruby code.
-# * {Haml::Helpers} contains Ruby helpers available within Haml templates.
-# * {Haml::Template} interfaces with web frameworks (Rails in particular).
-# * {Haml::Error} is raised when Haml encounters an error.
-# * {Haml::HTML} handles conversion of HTML to Haml.
-#
-# Also see the {file:HAML_REFERENCE.md full Haml reference}.
-module Haml
- # Initializes Haml for Rails.
- #
- # This method is called by `init.rb`,
- # which is run by Rails on startup.
- # We use it rather than putting stuff straight into `init.rb`
- # so we can change the initialization behavior
- # without modifying the file itself.
- #
- # @param binding [Binding] The context of the `init.rb` file.
- # This isn't actually used;
- # it's just passed in in case it needs to be used in the future
- def self.init_rails(binding)
- # 2.2 <= Rails < 3
- if defined?(Rails) && Rails.respond_to?(:configuration) &&
- Rails.configuration.respond_to?(:after_initialize) &&
- !Haml::Util.ap_geq_3?
- Rails.configuration.after_initialize do
- next if defined?(Sass)
- autoload(:Sass, 'sass/rails2_shim')
- # resolve autoload if it looks like they're using Sass without options
- Sass if File.exist?(File.join(RAILS_ROOT, 'public/stylesheets/sass'))
- end
- end
-
- # No &method here for Rails 2.1 compatibility
- %w[haml/template].each {|f| require f}
- end
-end
-
-require 'haml/util'
-require 'haml/engine'
-require 'haml/railtie'
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/buffer.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/buffer.rb
deleted file mode 100644
index 67d189e750..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/buffer.rb
+++ /dev/null
@@ -1,297 +0,0 @@
-module Haml
- # This class is used only internally. It holds the buffer of HTML that
- # is eventually output as the resulting document.
- # It's called from within the precompiled code,
- # and helps reduce the amount of processing done within `instance_eval`ed code.
- class Buffer
- include Haml::Helpers
- include Haml::Util
-
- # The string that holds the compiled HTML. This is aliased as
- # `_erbout` for compatibility with ERB-specific code.
- #
- # @return [String]
- attr_accessor :buffer
-
- # The options hash passed in from {Haml::Engine}.
- #
- # @return [{String => Object}]
- # @see Haml::Engine#options_for_buffer
- attr_accessor :options
-
- # The {Buffer} for the enclosing Haml document.
- # This is set for partials and similar sorts of nested templates.
- # It's `nil` at the top level (see \{#toplevel?}).
- #
- # @return [Buffer]
- attr_accessor :upper
-
- # nil if there's no capture_haml block running,
- # and the position at which it's beginning the capture if there is one.
- #
- # @return [Fixnum, nil]
- attr_accessor :capture_position
-
- # @return [Boolean]
- # @see #active?
- attr_writer :active
-
- # @return [Boolean] Whether or not the format is XHTML
- def xhtml?
- not html?
- end
-
- # @return [Boolean] Whether or not the format is any flavor of HTML
- def html?
- html4? or html5?
- end
-
- # @return [Boolean] Whether or not the format is HTML4
- def html4?
- @options[:format] == :html4
- end
-
- # @return [Boolean] Whether or not the format is HTML5.
- def html5?
- @options[:format] == :html5
- end
-
- # @return [Boolean] Whether or not this buffer is a top-level template,
- # as opposed to a nested partial
- def toplevel?
- upper.nil?
- end
-
- # Whether or not this buffer is currently being used to render a Haml template.
- # Returns `false` if a subtemplate is being rendered,
- # even if it's a subtemplate of this buffer's template.
- #
- # @return [Boolean]
- def active?
- @active
- end
-
- # @return [Fixnum] The current indentation level of the document
- def tabulation
- @real_tabs + @tabulation
- end
-
- # Sets the current tabulation of the document.
- #
- # @param val [Fixnum] The new tabulation
- def tabulation=(val)
- val = val - @real_tabs
- @tabulation = val > -1 ? val : 0
- end
-
- # @param upper [Buffer] The parent buffer
- # @param options [{Symbol => Object}] An options hash.
- # See {Haml::Engine#options\_for\_buffer}
- def initialize(upper = nil, options = {})
- @active = true
- @upper = upper
- @options = options
- @buffer = ruby1_8? ? "" : "".encode(Encoding.find(options[:encoding]))
- @tabulation = 0
-
- # The number of tabs that Engine thinks we should have
- # @real_tabs + @tabulation is the number of tabs actually output
- @real_tabs = 0
- end
-
- # Appends text to the buffer, properly tabulated.
- # Also modifies the document's indentation.
- #
- # @param text [String] The text to append
- # @param tab_change [Fixnum] The number of tabs by which to increase
- # or decrease the document's indentation
- # @param dont_tab_up [Boolean] If true, don't indent the first line of `text`
- def push_text(text, tab_change, dont_tab_up)
- if @tabulation > 0
- # Have to push every line in by the extra user set tabulation.
- # Don't push lines with just whitespace, though,
- # because that screws up precompiled indentation.
- text.gsub!(/^(?!\s+$)/m, tabs)
- text.sub!(tabs, '') if dont_tab_up
- end
-
- @buffer << text
- @real_tabs += tab_change
- end
-
- # Modifies the indentation of the document.
- #
- # @param tab_change [Fixnum] The number of tabs by which to increase
- # or decrease the document's indentation
- def adjust_tabs(tab_change)
- @real_tabs += tab_change
- end
-
- Haml::Util.def_static_method(self, :format_script, [:result],
- :preserve_script, :in_tag, :preserve_tag, :escape_html,
- :nuke_inner_whitespace, :interpolated, :ugly, <
- <% unless ugly %>
- # If we're interpolated,
- # then the custom tabulation is handled in #push_text.
- # The easiest way to avoid it here is to reset @tabulation.
- <% if interpolated %>
- old_tabulation = @tabulation
- @tabulation = 0
- <% end %>
-
- tabulation = @real_tabs
- result = <%= result_name %>.<% if nuke_inner_whitespace %>strip<% else %>rstrip<% end %>
- <% else %>
- result = <%= result_name %><% if nuke_inner_whitespace %>.strip<% end %>
- <% end %>
-
- <% if preserve_tag %>
- result = Haml::Helpers.preserve(result)
- <% elsif preserve_script %>
- result = Haml::Helpers.find_and_preserve(result, options[:preserve])
- <% end %>
-
- <% if ugly %>
- return result
- <% else %>
-
- has_newline = result.include?("\\n")
- <% if in_tag && !nuke_inner_whitespace %>
- <% unless preserve_tag %> if !has_newline <% end %>
- @real_tabs -= 1
- <% if interpolated %> @tabulation = old_tabulation <% end %>
- return result
- <% unless preserve_tag %> end <% end %>
- <% end %>
-
- # Precompiled tabulation may be wrong
- <% if !interpolated && !in_tag %>
- result = tabs + result if @tabulation > 0
- <% end %>
-
- if has_newline
- result = result.gsub "\\n", "\\n" + tabs(tabulation)
-
- # Add tabulation if it wasn't precompiled
- <% if in_tag && !nuke_inner_whitespace %> result = tabs(tabulation) + result <% end %>
- end
-
- <% if in_tag && !nuke_inner_whitespace %>
- result = "\\n\#{result}\\n\#{tabs(tabulation-1)}"
- @real_tabs -= 1
- <% end %>
- <% if interpolated %> @tabulation = old_tabulation <% end %>
- result
- <% end %>
-RUBY
-
- def attributes(class_id, obj_ref, *attributes_hashes)
- attributes = class_id
- attributes_hashes.each do |old|
- self.class.merge_attrs(attributes, to_hash(old.map {|k, v| [k.to_s, v]}))
- end
- self.class.merge_attrs(attributes, parse_object_ref(obj_ref)) if obj_ref
- Compiler.build_attributes(
- html?, @options[:attr_wrapper], @options[:escape_attrs], attributes)
- end
-
- # Remove the whitespace from the right side of the buffer string.
- # Doesn't do anything if we're at the beginning of a capture_haml block.
- def rstrip!
- if capture_position.nil?
- buffer.rstrip!
- return
- end
-
- buffer << buffer.slice!(capture_position..-1).rstrip
- end
-
- # Merges two attribute hashes.
- # This is the same as `to.merge!(from)`,
- # except that it merges id, class, and data attributes.
- #
- # ids are concatenated with `"_"`,
- # and classes are concatenated with `" "`.
- # data hashes are simply merged.
- #
- # Destructively modifies both `to` and `from`.
- #
- # @param to [{String => String}] The attribute hash to merge into
- # @param from [{String => #to_s}] The attribute hash to merge from
- # @return [{String => String}] `to`, after being merged
- def self.merge_attrs(to, from)
- from['id'] = Compiler.filter_and_join(from['id'], '_') if from['id']
- if to['id'] && from['id']
- to['id'] << '_' << from.delete('id').to_s
- elsif to['id'] || from['id']
- from['id'] ||= to['id']
- end
-
- from['class'] = Compiler.filter_and_join(from['class'], ' ') if from['class']
- if to['class'] && from['class']
- # Make sure we don't duplicate class names
- from['class'] = (from['class'].to_s.split(' ') | to['class'].split(' ')).sort.join(' ')
- elsif to['class'] || from['class']
- from['class'] ||= to['class']
- end
-
- from_data = from['data'].is_a?(Hash)
- to_data = to['data'].is_a?(Hash)
- if from_data && to_data
- to['data'] = to['data'].merge(from['data'])
- elsif to_data
- to = Haml::Util.map_keys(to.delete('data')) {|name| "data-#{name}"}.merge(to)
- elsif from_data
- from = Haml::Util.map_keys(from.delete('data')) {|name| "data-#{name}"}.merge(from)
- end
-
- to.merge!(from)
- end
-
- private
-
- @@tab_cache = {}
- # Gets `count` tabs. Mostly for internal use.
- def tabs(count = 0)
- tabs = [count + @tabulation, 0].max
- @@tab_cache[tabs] ||= ' ' * tabs
- end
-
- # Takes an array of objects and uses the class and id of the first
- # one to create an attributes hash.
- # The second object, if present, is used as a prefix,
- # just like you can do with `dom_id()` and `dom_class()` in Rails
- def parse_object_ref(ref)
- prefix = ref[1]
- ref = ref[0]
- # Let's make sure the value isn't nil. If it is, return the default Hash.
- return {} if ref.nil?
- class_name =
- if ref.respond_to?(:haml_object_ref)
- ref.haml_object_ref
- else
- underscore(ref.class)
- end
- id = "#{class_name}_#{ref.id || 'new'}"
- if prefix
- class_name = "#{ prefix }_#{ class_name}"
- id = "#{ prefix }_#{ id }"
- end
-
- {'id' => id, 'class' => class_name}
- end
-
- # Changes a word from camel case to underscores.
- # Based on the method of the same name in Rails' Inflector,
- # but copied here so it'll run properly without Rails.
- def underscore(camel_cased_word)
- camel_cased_word.to_s.gsub(/::/, '_').
- gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
- gsub(/([a-z\d])([A-Z])/,'\1_\2').
- tr("-", "_").
- downcase
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/compiler.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/compiler.rb
deleted file mode 100644
index c742a40bfc..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/compiler.rb
+++ /dev/null
@@ -1,452 +0,0 @@
-require 'cgi'
-
-module Haml
- module Compiler
- include Haml::Util
-
- private
-
- # Returns the precompiled string with the preamble and postamble
- def precompiled_with_ambles(local_names)
- preamble = < @node.value[:preserve],
- :escape_html => @node.value[:escape_html], &block)
- end
-
- def compile_silent_script
- return if @options[:suppress_eval]
- push_silent(@node.value[:text])
- keyword = @node.value[:keyword]
- ruby_block = block_given? && !keyword
-
- if block_given?
- # Store these values because for conditional statements,
- # we want to restore them for each branch
- @node.value[:dont_indent_next_line] = @dont_indent_next_line
- @node.value[:dont_tab_up_next_text] = @dont_tab_up_next_text
- yield
- push_silent("end", :can_suppress) unless @node.value[:dont_push_end]
- elsif keyword == "end"
- if @node.parent.children.last.equal?(@node)
- # Since this "end" is ending the block,
- # we don't need to generate an additional one
- @node.parent.value[:dont_push_end] = true
- end
- # Don't restore dont_* for end because it isn't a conditional branch.
- elsif Parser::MID_BLOCK_KEYWORDS.include?(keyword)
- # Restore dont_* for this conditional branch
- @dont_indent_next_line = @node.parent.value[:dont_indent_next_line]
- @dont_tab_up_next_text = @node.parent.value[:dont_tab_up_next_text]
- end
- end
-
- def compile_haml_comment; end
-
- def compile_tag
- t = @node.value
-
- # Get rid of whitespace outside of the tag if we need to
- rstrip_buffer! if t[:nuke_outer_whitespace]
-
- dont_indent_next_line =
- (t[:nuke_outer_whitespace] && !block_given?) ||
- (t[:nuke_inner_whitespace] && block_given?)
-
- if @options[:suppress_eval]
- object_ref = "nil"
- parse = false
- value = t[:parse] ? nil : t[:value]
- attributes_hashes = {}
- preserve_script = false
- else
- object_ref = t[:object_ref]
- parse = t[:parse]
- value = t[:value]
- attributes_hashes = t[:attributes_hashes]
- preserve_script = t[:preserve_script]
- end
-
- # Check if we can render the tag directly to text and not process it in the buffer
- if object_ref == "nil" && attributes_hashes.empty? && !preserve_script
- tag_closed = !block_given? && !t[:self_closing] && !parse
-
- open_tag = prerender_tag(t[:name], t[:self_closing], t[:attributes])
- if tag_closed
- open_tag << "#{value}#{t[:name]}>"
- open_tag << "\n" unless t[:nuke_outer_whitespace]
- elsif !(parse || t[:nuke_inner_whitespace] ||
- (t[:self_closing] && t[:nuke_outer_whitespace]))
- open_tag << "\n"
- end
-
- push_merged_text(open_tag,
- tag_closed || t[:self_closing] || t[:nuke_inner_whitespace] ? 0 : 1,
- !t[:nuke_outer_whitespace])
-
- @dont_indent_next_line = dont_indent_next_line
- return if tag_closed
- else
- if attributes_hashes.empty?
- attributes_hashes = ''
- elsif attributes_hashes.size == 1
- attributes_hashes = ", #{attributes_hashes.first}"
- else
- attributes_hashes = ", (#{attributes_hashes.join(").merge(")})"
- end
-
- push_merged_text "<#{t[:name]}", 0, !t[:nuke_outer_whitespace]
- push_generated_script(
- "_hamlout.attributes(#{inspect_obj(t[:attributes])}, #{object_ref}#{attributes_hashes})")
- concat_merged_text(
- if t[:self_closing] && xhtml?
- " />" + (t[:nuke_outer_whitespace] ? "" : "\n")
- else
- ">" + ((if t[:self_closing] && html?
- t[:nuke_outer_whitespace]
- else
- !block_given? || t[:preserve_tag] || t[:nuke_inner_whitespace]
- end) ? "" : "\n")
- end)
-
- if value && !parse
- concat_merged_text("#{value}#{t[:name]}>#{t[:nuke_outer_whitespace] ? "" : "\n"}")
- else
- @to_merge << [:text, '', 1] unless t[:nuke_inner_whitespace]
- end
-
- @dont_indent_next_line = dont_indent_next_line
- end
-
- return if t[:self_closing]
-
- if value.nil?
- @output_tabs += 1 unless t[:nuke_inner_whitespace]
- yield if block_given?
- @output_tabs -= 1 unless t[:nuke_inner_whitespace]
- rstrip_buffer! if t[:nuke_inner_whitespace]
- push_merged_text("#{t[:name]}>" + (t[:nuke_outer_whitespace] ? "" : "\n"),
- t[:nuke_inner_whitespace] ? 0 : -1, !t[:nuke_inner_whitespace])
- @dont_indent_next_line = t[:nuke_outer_whitespace]
- return
- end
-
- if parse
- push_script(value, t.merge(:in_tag => true))
- concat_merged_text("#{t[:name]}>" + (t[:nuke_outer_whitespace] ? "" : "\n"))
- end
- end
-
- def compile_comment
- open = "" : "-->"}")
- return
- end
-
- push_text(open, 1)
- @output_tabs += 1
- yield if block_given?
- @output_tabs -= 1
- push_text(@node.value[:conditional] ? "" : "-->", -1)
- end
-
- def compile_doctype
- doctype = text_for_doctype
- push_text doctype if doctype
- end
-
- def compile_filter
- unless filter = Filters.defined[@node.value[:name]]
- raise Error.new("Filter \"#{@node.value[:name]}\" is not defined.", @node.line - 1)
- end
- filter.internal_compile(self, @node.value[:text])
- end
-
- def text_for_doctype
- if @node.value[:type] == "xml"
- return nil if html?
- wrapper = @options[:attr_wrapper]
- return ""
- end
-
- if html5?
- ''
- else
- if xhtml?
- if @node.value[:version] == "1.1"
- ''
- elsif @node.value[:version] == "5"
- ''
- else
- case @node.value[:type]
- when "strict"; ''
- when "frameset"; ''
- when "mobile"; ''
- when "rdfa"; ''
- when "basic"; ''
- else ''
- end
- end
-
- elsif html4?
- case @node.value[:type]
- when "strict"; ''
- when "frameset"; ''
- else ''
- end
- end
- end
- end
-
- # Evaluates `text` in the context of the scope object, but
- # does not output the result.
- def push_silent(text, can_suppress = false)
- flush_merged_text
- return if can_suppress && options[:suppress_eval]
- @precompiled << "#{resolve_newlines}#{text}\n"
- @output_line += text.count("\n") + 1
- end
-
- # Adds `text` to `@buffer` with appropriate tabulation
- # without parsing it.
- def push_merged_text(text, tab_change = 0, indent = true)
- text = !indent || @dont_indent_next_line || @options[:ugly] ? text : "#{' ' * @output_tabs}#{text}"
- @to_merge << [:text, text, tab_change]
- @dont_indent_next_line = false
- end
-
- # Concatenate `text` to `@buffer` without tabulation.
- def concat_merged_text(text)
- @to_merge << [:text, text, 0]
- end
-
- def push_text(text, tab_change = 0)
- push_merged_text("#{text}\n", tab_change)
- end
-
- def flush_merged_text
- return if @to_merge.empty?
-
- str = ""
- mtabs = 0
- @to_merge.each do |type, val, tabs|
- case type
- when :text
- str << inspect_obj(val)[1...-1]
- mtabs += tabs
- when :script
- if mtabs != 0 && !@options[:ugly]
- val = "_hamlout.adjust_tabs(#{mtabs}); " + val
- end
- str << "\#{#{val}}"
- mtabs = 0
- else
- raise SyntaxError.new("[HAML BUG] Undefined entry in Haml::Compiler@to_merge.")
- end
- end
-
- unless str.empty?
- @precompiled <<
- if @options[:ugly]
- "_hamlout.buffer << \"#{str}\";"
- else
- "_hamlout.push_text(\"#{str}\", #{mtabs}, #{@dont_tab_up_next_text.inspect});"
- end
- end
- @to_merge = []
- @dont_tab_up_next_text = false
- end
-
- # Causes `text` to be evaluated in the context of
- # the scope object and the result to be added to `@buffer`.
- #
- # If `opts[:preserve_script]` is true, Haml::Helpers#find_and_flatten is run on
- # the result before it is added to `@buffer`
- def push_script(text, opts = {})
- return if options[:suppress_eval]
-
- args = %w[preserve_script in_tag preserve_tag escape_html nuke_inner_whitespace]
- args.map! {|name| opts[name.to_sym]}
- args << !block_given? << @options[:ugly]
-
- no_format = @options[:ugly] &&
- !(opts[:preserve_script] || opts[:preserve_tag] || opts[:escape_html])
- output_expr = "(#{text}\n)"
- static_method = "_hamlout.#{static_method_name(:format_script, *args)}"
-
- # Prerender tabulation unless we're in a tag
- push_merged_text '' unless opts[:in_tag]
-
- unless block_given?
- push_generated_script(no_format ? "#{text}\n" : "#{static_method}(#{output_expr});")
- concat_merged_text("\n") unless opts[:in_tag] || opts[:nuke_inner_whitespace]
- return
- end
-
- flush_merged_text
- push_silent "haml_temp = #{text}"
- yield
- push_silent('end', :can_suppress) unless @node.value[:dont_push_end]
- @precompiled << "_hamlout.buffer << #{no_format ? "haml_temp.to_s;" : "#{static_method}(haml_temp);"}"
- concat_merged_text("\n") unless opts[:in_tag] || opts[:nuke_inner_whitespace] || @options[:ugly]
- end
-
- def push_generated_script(text)
- @to_merge << [:script, resolve_newlines + text]
- @output_line += text.count("\n")
- end
-
- # This is a class method so it can be accessed from Buffer.
- def self.build_attributes(is_html, attr_wrapper, escape_attrs, attributes = {})
- quote_escape = attr_wrapper == '"' ? """ : "'"
- other_quote_char = attr_wrapper == '"' ? "'" : '"'
-
- if attributes['data'].is_a?(Hash)
- attributes = attributes.dup
- attributes =
- Haml::Util.map_keys(attributes.delete('data')) {|name| "data-#{name}"}.merge(attributes)
- end
-
- result = attributes.collect do |attr, value|
- next if value.nil?
-
- value = filter_and_join(value, ' ') if attr == 'class'
- value = filter_and_join(value, '_') if attr == 'id'
-
- if value == true
- next " #{attr}" if is_html
- next " #{attr}=#{attr_wrapper}#{attr}#{attr_wrapper}"
- elsif value == false
- next
- end
-
- escaped =
- if escape_attrs == :once
- Haml::Helpers.escape_once(value.to_s)
- elsif escape_attrs
- CGI.escapeHTML(value.to_s)
- else
- value.to_s
- end
- value = Haml::Helpers.preserve(escaped)
- if escape_attrs
- # We want to decide whether or not to escape quotes
- value.gsub!('"', '"')
- this_attr_wrapper = attr_wrapper
- if value.include? attr_wrapper
- if value.include? other_quote_char
- value = value.gsub(attr_wrapper, quote_escape)
- else
- this_attr_wrapper = other_quote_char
- end
- end
- else
- this_attr_wrapper = attr_wrapper
- end
- " #{attr}=#{this_attr_wrapper}#{value}#{this_attr_wrapper}"
- end
- result.compact.sort.join
- end
-
- def self.filter_and_join(value, separator)
- return "" if value == ""
- value = [value] unless value.is_a?(Array)
- value = value.flatten.collect {|item| item ? item.to_s : nil}.compact.join(separator)
- return !value.empty? && value
- end
-
- def prerender_tag(name, self_close, attributes)
- attributes_string = Compiler.build_attributes(
- html?, @options[:attr_wrapper], @options[:escape_attrs], attributes)
- "<#{name}#{attributes_string}#{self_close && xhtml? ? ' /' : ''}>"
- end
-
- def resolve_newlines
- diff = @node.line - @output_line
- return "" if diff <= 0
- @output_line = @node.line
- "\n" * [diff, 0].max
- end
-
- # Get rid of and whitespace at the end of the buffer
- # or the merged text
- def rstrip_buffer!(index = -1)
- last = @to_merge[index]
- if last.nil?
- push_silent("_hamlout.rstrip!", false)
- @dont_tab_up_next_text = true
- return
- end
-
- case last.first
- when :text
- last[1].rstrip!
- if last[1].empty?
- @to_merge.slice! index
- rstrip_buffer! index
- end
- when :script
- last[1].gsub!(/\(haml_temp, (.*?)\);$/, '(haml_temp.rstrip, \1);')
- rstrip_buffer! index - 1
- else
- raise SyntaxError.new("[HAML BUG] Undefined entry in Haml::Compiler@to_merge.")
- end
- end
-
- def compile(node)
- parent, @node = @node, node
- block = proc {node.children.each {|c| compile c}}
- send("compile_#{node.type}", &(block unless node.children.empty?))
- ensure
- @node = parent
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/engine.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/engine.rb
deleted file mode 100644
index 512c7b10ca..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/engine.rb
+++ /dev/null
@@ -1,312 +0,0 @@
-require 'haml/helpers'
-require 'haml/buffer'
-require 'haml/parser'
-require 'haml/compiler'
-require 'haml/filters'
-require 'haml/error'
-
-module Haml
- # This is the frontend for using Haml programmatically.
- # It can be directly used by the user by creating a
- # new instance and calling \{#render} to render the template.
- # For example:
- #
- # template = File.read('templates/really_cool_template.haml')
- # haml_engine = Haml::Engine.new(template)
- # output = haml_engine.render
- # puts output
- class Engine
- include Parser
- include Compiler
-
- # The options hash.
- # See {file:HAML_REFERENCE.md#haml_options the Haml options documentation}.
- #
- # @return [{Symbol => Object}]
- attr_accessor :options
-
- # The indentation used in the Haml document,
- # or `nil` if the indentation is ambiguous
- # (for example, for a single-level document).
- #
- # @return [String]
- attr_accessor :indentation
-
- # @return [Boolean] Whether or not the format is XHTML.
- def xhtml?
- not html?
- end
-
- # @return [Boolean] Whether or not the format is any flavor of HTML.
- def html?
- html4? or html5?
- end
-
- # @return [Boolean] Whether or not the format is HTML4.
- def html4?
- @options[:format] == :html4
- end
-
- # @return [Boolean] Whether or not the format is HTML5.
- def html5?
- @options[:format] == :html5
- end
-
- # The source code that is evaluated to produce the Haml document.
- #
- # In Ruby 1.9, this is automatically converted to the correct encoding
- # (see {file:HAML_REFERENCE.md#encoding-option the `:encoding` option}).
- #
- # @return [String]
- def precompiled
- return @precompiled if ruby1_8?
- encoding = Encoding.find(@options[:encoding])
- return @precompiled.force_encoding(encoding) if encoding == Encoding::BINARY
- return @precompiled.encode(encoding)
- end
-
- # Precompiles the Haml template.
- #
- # @param template [String] The Haml template
- # @param options [{Symbol => Object}] An options hash;
- # see {file:HAML_REFERENCE.md#haml_options the Haml options documentation}
- # @raise [Haml::Error] if there's a Haml syntax error in the template
- def initialize(template, options = {})
- @options = {
- :suppress_eval => false,
- :attr_wrapper => "'",
-
- # Don't forget to update the docs in doc-src/HAML_REFERENCE.md
- # if you update these
- :autoclose => %w[meta img link br hr input area param col base],
- :preserve => %w[textarea pre code],
-
- :filename => '(haml)',
- :line => 1,
- :ugly => false,
- :format => :xhtml,
- :escape_html => false,
- :escape_attrs => true,
- }
-
-
- template = check_haml_encoding(template) do |msg, line|
- raise Haml::Error.new(msg, line)
- end
-
- unless ruby1_8?
- @options[:encoding] = Encoding.default_internal || template.encoding
- @options[:encoding] = "utf-8" if @options[:encoding].name == "US-ASCII"
- end
- @options.merge! options.reject {|k, v| v.nil?}
- @index = 0
-
- unless [:xhtml, :html4, :html5].include?(@options[:format])
- raise Haml::Error, "Invalid output format #{@options[:format].inspect}"
- end
-
- if @options[:encoding] && @options[:encoding].is_a?(Encoding)
- @options[:encoding] = @options[:encoding].name
- end
-
- # :eod is a special end-of-document marker
- @template = (template.rstrip).split(/\r\n|\r|\n/) + [:eod, :eod]
- @template_index = 0
- @to_close_stack = []
- @output_tabs = 0
- @template_tabs = 0
- @flat = false
- @newlines = 0
- @precompiled = ''
- @to_merge = []
- @tab_change = 0
-
- compile(parse)
- rescue Haml::Error => e
- if @index || e.line
- e.backtrace.unshift "#{@options[:filename]}:#{(e.line ? e.line + 1 : @index) + @options[:line] - 1}"
- end
- raise
- end
-
- # Processes the template and returns the result as a string.
- #
- # `scope` is the context in which the template is evaluated.
- # If it's a `Binding` or `Proc` object,
- # Haml uses it as the second argument to `Kernel#eval`;
- # otherwise, Haml just uses its `#instance_eval` context.
- #
- # Note that Haml modifies the evaluation context
- # (either the scope object or the `self` object of the scope binding).
- # It extends {Haml::Helpers}, and various instance variables are set
- # (all prefixed with `haml_`).
- # For example:
- #
- # s = "foobar"
- # Haml::Engine.new("%p= upcase").render(s) #=> "
FOOBAR
"
- #
- # # s now extends Haml::Helpers
- # s.respond_to?(:html_attrs) #=> true
- #
- # `locals` is a hash of local variables to make available to the template.
- # For example:
- #
- # Haml::Engine.new("%p= foo").render(Object.new, :foo => "Hello, world!") #=> "
Hello, world!
"
- #
- # If a block is passed to render,
- # that block is run when `yield` is called
- # within the template.
- #
- # Due to some Ruby quirks,
- # if `scope` is a `Binding` or `Proc` object and a block is given,
- # the evaluation context may not be quite what the user expects.
- # In particular, it's equivalent to passing `eval("self", scope)` as `scope`.
- # This won't have an effect in most cases,
- # but if you're relying on local variables defined in the context of `scope`,
- # they won't work.
- #
- # @param scope [Binding, Proc, Object] The context in which the template is evaluated
- # @param locals [{Symbol => Object}] Local variables that will be made available
- # to the template
- # @param block [#to_proc] A block that can be yielded to within the template
- # @return [String] The rendered template
- def render(scope = Object.new, locals = {}, &block)
- buffer = Haml::Buffer.new(scope.instance_variable_get('@haml_buffer'), options_for_buffer)
-
- if scope.is_a?(Binding) || scope.is_a?(Proc)
- scope_object = eval("self", scope)
- scope = scope_object.instance_eval{binding} if block_given?
- else
- scope_object = scope
- scope = scope_object.instance_eval{binding}
- end
-
- set_locals(locals.merge(:_hamlout => buffer, :_erbout => buffer.buffer), scope, scope_object)
-
- scope_object.instance_eval do
- extend Haml::Helpers
- @haml_buffer = buffer
- end
-
- eval(precompiled + ";" + precompiled_method_return_value,
- scope, @options[:filename], @options[:line])
- ensure
- # Get rid of the current buffer
- scope_object.instance_eval do
- @haml_buffer = buffer.upper if buffer
- end
- end
- alias_method :to_html, :render
-
- # Returns a proc that, when called,
- # renders the template and returns the result as a string.
- #
- # `scope` works the same as it does for render.
- #
- # The first argument of the returned proc is a hash of local variable names to values.
- # However, due to an unfortunate Ruby quirk,
- # the local variables which can be assigned must be pre-declared.
- # This is done with the `local_names` argument.
- # For example:
- #
- # # This works
- # Haml::Engine.new("%p= foo").render_proc(Object.new, :foo).call :foo => "Hello!"
- # #=> "
Hello!
"
- #
- # # This doesn't
- # Haml::Engine.new("%p= foo").render_proc.call :foo => "Hello!"
- # #=> NameError: undefined local variable or method `foo'
- #
- # The proc doesn't take a block; any yields in the template will fail.
- #
- # @param scope [Binding, Proc, Object] The context in which the template is evaluated
- # @param local_names [Array] The names of the locals that can be passed to the proc
- # @return [Proc] The proc that will run the template
- def render_proc(scope = Object.new, *local_names)
- if scope.is_a?(Binding) || scope.is_a?(Proc)
- scope_object = eval("self", scope)
- else
- scope_object = scope
- scope = scope_object.instance_eval{binding}
- end
-
- eval("Proc.new { |*_haml_locals| _haml_locals = _haml_locals[0] || {};" +
- precompiled_with_ambles(local_names) + "}\n", scope, @options[:filename], @options[:line])
- end
-
- # Defines a method on `object` with the given name
- # that renders the template and returns the result as a string.
- #
- # If `object` is a class or module,
- # the method will instead by defined as an instance method.
- # For example:
- #
- # t = Time.now
- # Haml::Engine.new("%p\n Today's date is\n .date= self.to_s").def_method(t, :render)
- # t.render #=> "
\n"
- #
- # The first argument of the defined method is a hash of local variable names to values.
- # However, due to an unfortunate Ruby quirk,
- # the local variables which can be assigned must be pre-declared.
- # This is done with the `local_names` argument.
- # For example:
- #
- # # This works
- # obj = Object.new
- # Haml::Engine.new("%p= foo").def_method(obj, :render, :foo)
- # obj.render(:foo => "Hello!") #=> "
Hello!
"
- #
- # # This doesn't
- # obj = Object.new
- # Haml::Engine.new("%p= foo").def_method(obj, :render)
- # obj.render(:foo => "Hello!") #=> NameError: undefined local variable or method `foo'
- #
- # Note that Haml modifies the evaluation context
- # (either the scope object or the `self` object of the scope binding).
- # It extends {Haml::Helpers}, and various instance variables are set
- # (all prefixed with `haml_`).
- #
- # @param object [Object, Module] The object on which to define the method
- # @param name [String, Symbol] The name of the method to define
- # @param local_names [Array] The names of the locals that can be passed to the proc
- def def_method(object, name, *local_names)
- method = object.is_a?(Module) ? :module_eval : :instance_eval
-
- object.send(method, "def #{name}(_haml_locals = {}); #{precompiled_with_ambles(local_names)}; end",
- @options[:filename], @options[:line])
- end
-
- protected
-
- # Returns a subset of \{#options}: those that {Haml::Buffer} cares about.
- # All of the values here are such that when `#inspect` is called on the hash,
- # it can be `Kernel#eval`ed to get the same result back.
- #
- # See {file:HAML_REFERENCE.md#haml_options the Haml options documentation}.
- #
- # @return [{Symbol => Object}] The options hash
- def options_for_buffer
- {
- :autoclose => @options[:autoclose],
- :preserve => @options[:preserve],
- :attr_wrapper => @options[:attr_wrapper],
- :ugly => @options[:ugly],
- :format => @options[:format],
- :encoding => @options[:encoding],
- :escape_html => @options[:escape_html],
- :escape_attrs => @options[:escape_attrs],
- }
- end
-
- private
-
- def set_locals(locals, scope, scope_object)
- scope_object.send(:instance_variable_set, '@_haml_locals', locals)
- set_locals = locals.keys.map { |k| "#{k} = @_haml_locals[#{k.inspect}]" }.join("\n")
- eval(set_locals, scope)
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/error.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/error.rb
deleted file mode 100644
index b1865eaefa..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/error.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-module Haml
- # An exception raised by Haml code.
- class Error < StandardError
- # The line of the template on which the error occurred.
- #
- # @return [Fixnum]
- attr_reader :line
-
- # @param message [String] The error message
- # @param line [Fixnum] See \{#line}
- def initialize(message = nil, line = nil)
- super(message)
- @line = line
- end
- end
-
- # SyntaxError is the type of exception raised when Haml encounters an
- # ill-formatted document.
- # It's not particularly interesting,
- # except in that it's a subclass of {Haml::Error}.
- class SyntaxError < Haml::Error; end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/exec.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/exec.rb
deleted file mode 100644
index 81eea0194f..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/exec.rb
+++ /dev/null
@@ -1,362 +0,0 @@
-require 'optparse'
-require 'fileutils'
-
-module Haml
- # This module handles the various Haml executables (`haml` and `haml-convert`).
- module Exec
- # An abstract class that encapsulates the executable code for all three executables.
- class Generic
- # @param args [Array] The command-line arguments
- def initialize(args)
- @args = args
- @options = {}
- end
-
- # Parses the command-line arguments and runs the executable.
- # Calls `Kernel#exit` at the end, so it never returns.
- #
- # @see #parse
- def parse!
- begin
- parse
- rescue Exception => e
- raise e if @options[:trace] || e.is_a?(SystemExit)
-
- $stderr.print "#{e.class}: " unless e.class == RuntimeError
- $stderr.puts "#{e.message}"
- $stderr.puts " Use --trace for backtrace."
- exit 1
- end
- exit 0
- end
-
- # Parses the command-line arguments and runs the executable.
- # This does not handle exceptions or exit the program.
- #
- # @see #parse!
- def parse
- @opts = OptionParser.new(&method(:set_opts))
- @opts.parse!(@args)
-
- process_result
-
- @options
- end
-
- # @return [String] A description of the executable
- def to_s
- @opts.to_s
- end
-
- protected
-
- # Finds the line of the source template
- # on which an exception was raised.
- #
- # @param exception [Exception] The exception
- # @return [String] The line number
- def get_line(exception)
- # SyntaxErrors have weird line reporting
- # when there's trailing whitespace,
- # which there is for Haml documents.
- return (exception.message.scan(/:(\d+)/).first || ["??"]).first if exception.is_a?(::SyntaxError)
- (exception.backtrace[0].scan(/:(\d+)/).first || ["??"]).first
- end
-
- # Tells optparse how to parse the arguments
- # available for all executables.
- #
- # This is meant to be overridden by subclasses
- # so they can add their own options.
- #
- # @param opts [OptionParser]
- def set_opts(opts)
- opts.on('-s', '--stdin', :NONE, 'Read input from standard input instead of an input file') do
- @options[:input] = $stdin
- end
-
- opts.on('--trace', :NONE, 'Show a full traceback on error') do
- @options[:trace] = true
- end
-
- opts.on('--unix-newlines', 'Use Unix-style newlines in written files.') do
- @options[:unix_newlines] = true if ::Haml::Util.windows?
- end
-
- opts.on_tail("-?", "-h", "--help", "Show this message") do
- puts opts
- exit
- end
-
- opts.on_tail("-v", "--version", "Print version") do
- puts("Haml #{::Haml.version[:string]}")
- exit
- end
- end
-
- # Processes the options set by the command-line arguments.
- # In particular, sets `@options[:input]` and `@options[:output]`
- # to appropriate IO streams.
- #
- # This is meant to be overridden by subclasses
- # so they can run their respective programs.
- def process_result
- input, output = @options[:input], @options[:output]
- args = @args.dup
- input ||=
- begin
- filename = args.shift
- @options[:filename] = filename
- open_file(filename) || $stdin
- end
- output ||= open_file(args.shift, 'w') || $stdout
-
- @options[:input], @options[:output] = input, output
- end
-
- COLORS = { :red => 31, :green => 32, :yellow => 33 }
-
- # Prints a status message about performing the given action,
- # colored using the given color (via terminal escapes) if possible.
- #
- # @param name [#to_s] A short name for the action being performed.
- # Shouldn't be longer than 11 characters.
- # @param color [Symbol] The name of the color to use for this action.
- # Can be `:red`, `:green`, or `:yellow`.
- def puts_action(name, color, arg)
- return if @options[:for_engine][:quiet]
- printf color(color, "%11s %s\n"), name, arg
- end
-
- # Same as \{Kernel.puts}, but doesn't print anything if the `--quiet` option is set.
- #
- # @param args [Array] Passed on to \{Kernel.puts}
- def puts(*args)
- return if @options[:for_engine][:quiet]
- Kernel.puts(*args)
- end
-
- # Wraps the given string in terminal escapes
- # causing it to have the given color.
- # If terminal esapes aren't supported on this platform,
- # just returns the string instead.
- #
- # @param color [Symbol] The name of the color to use.
- # Can be `:red`, `:green`, or `:yellow`.
- # @param str [String] The string to wrap in the given color.
- # @return [String] The wrapped string.
- def color(color, str)
- raise "[BUG] Unrecognized color #{color}" unless COLORS[color]
-
- # Almost any real Unix terminal will support color,
- # so we just filter for Windows terms (which don't set TERM)
- # and not-real terminals, which aren't ttys.
- return str if ENV["TERM"].nil? || ENV["TERM"].empty? || !STDOUT.tty?
- return "\e[#{COLORS[color]}m#{str}\e[0m"
- end
-
- private
-
- def open_file(filename, flag = 'r')
- return if filename.nil?
- flag = 'wb' if @options[:unix_newlines] && flag == 'w'
- File.open(filename, flag)
- end
-
- def handle_load_error(err)
- dep = err.message[/^no such file to load -- (.*)/, 1]
- raise err if @options[:trace] || dep.nil? || dep.empty?
- $stderr.puts <] The command-line arguments
- def initialize(args)
- super
- @options[:for_engine] = {}
- @options[:requires] = []
- @options[:load_paths] = []
- end
-
- # Tells optparse how to parse the arguments.
- #
- # @param opts [OptionParser]
- def set_opts(opts)
- super
-
- opts.banner = < e
- raise e if @options[:trace]
-
- case e
- when ::Haml::SyntaxError; raise "Syntax error on line #{get_line e}: #{e.message}"
- when ::Haml::Error; raise "Haml error on line #{get_line e}: #{e.message}"
- else raise "Exception on line #{get_line e}: #{e.message}\n Use --trace for backtrace."
- end
- end
-
- output.write(result)
- output.close() if output.is_a? File
- end
- end
-
- # The `html2haml` executable.
- class HTML2Haml < Generic
- # @param args [Array] The command-line arguments
- def initialize(args)
- super
- @module_opts = {}
- end
-
- # Tells optparse how to parse the arguments.
- #
- # @param opts [OptionParser]
- def set_opts(opts)
- opts.banner = < e
- raise "#{e.is_a?(::Haml::SyntaxError) ? "Syntax error" : "Error"} on line " +
- "#{get_line e}: #{e.message}"
- rescue LoadError => err
- handle_load_error(err)
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/filters.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/filters.rb
deleted file mode 100644
index 9a3e6883ef..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/filters.rb
+++ /dev/null
@@ -1,385 +0,0 @@
-module Haml
- # The module containing the default Haml filters,
- # as well as the base module, {Haml::Filters::Base}.
- #
- # @see Haml::Filters::Base
- module Filters
- # @return [{String => Haml::Filters::Base}] a hash of filter names to classes
- def self.defined
- @defined ||= {}
- end
-
- # The base module for Haml filters.
- # User-defined filters should be modules including this module.
- # The name of the filter is taken by downcasing the module name.
- # For instance, if the module is named `FooBar`, the filter will be `:foobar`.
- #
- # A user-defined filter should override either \{#render} or {\#compile}.
- # \{#render} is the most common.
- # It takes a string, the filter source,
- # and returns another string, the result of the filter.
- # For example, the following will define a filter named `:sass`:
- #
- # module Haml::Filters::Sass
- # include Haml::Filters::Base
- #
- # def render(text)
- # ::Sass::Engine.new(text).render
- # end
- # end
- #
- # For details on overriding \{#compile}, see its documentation.
- #
- # Note that filters overriding \{#render} automatically support `#{}`
- # for interpolating Ruby code.
- # Those overriding \{#compile} will need to add such support manually
- # if it's desired.
- module Base
- # This method is automatically called when {Base} is included in a module.
- # It automatically defines a filter
- # with the downcased name of that module.
- # For example, if the module is named `FooBar`, the filter will be `:foobar`.
- #
- # @param base [Module, Class] The module that this is included in
- def self.included(base)
- Filters.defined[base.name.split("::").last.downcase] = base
- base.extend(base)
- end
-
- # Takes the source text that should be passed to the filter
- # and returns the result of running the filter on that string.
- #
- # This should be overridden in most individual filter modules
- # to render text with the given filter.
- # If \{#compile} is overridden, however, \{#render} doesn't need to be.
- #
- # @param text [String] The source text for the filter to process
- # @return [String] The filtered result
- # @raise [Haml::Error] if it's not overridden
- def render(text)
- raise Error.new("#{self.inspect}#render not defined!")
- end
-
- # Same as \{#render}, but takes a {Haml::Engine} options hash as well.
- # It's only safe to rely on options made available in {Haml::Engine#options\_for\_buffer}.
- #
- # @see #render
- # @param text [String] The source text for the filter to process
- # @return [String] The filtered result
- # @raise [Haml::Error] if it or \{#render} isn't overridden
- def render_with_options(text, options)
- render(text)
- end
-
- # Same as \{#compile}, but requires the necessary files first.
- # *This is used by {Haml::Engine} and is not intended to be overridden or used elsewhere.*
- #
- # @see #compile
- def internal_compile(*args)
- resolve_lazy_requires
- compile(*args)
- end
-
- # This should be overridden when a filter needs to have access to the Haml evaluation context.
- # Rather than applying a filter to a string at compile-time,
- # \{#compile} uses the {Haml::Compiler} instance to compile the string to Ruby code
- # that will be executed in the context of the active Haml template.
- #
- # Warning: the {Haml::Compiler} interface is neither well-documented
- # nor guaranteed to be stable.
- # If you want to make use of it, you'll probably need to look at the source code
- # and should test your filter when upgrading to new Haml versions.
- #
- # @param compiler [Haml::Compiler] The compiler instance
- # @param text [String] The text of the filter
- # @raise [Haml::Error] if none of \{#compile}, \{#render}, and \{#render_with_options} are overridden
- def compile(compiler, text)
- resolve_lazy_requires
- filter = self
- compiler.instance_eval do
- if contains_interpolation?(text)
- return if options[:suppress_eval]
-
- text = unescape_interpolation(text).gsub(/(\\+)n/) do |s|
- escapes = $1.size
- next s if escapes % 2 == 0
- ("\\" * (escapes - 1)) + "\n"
- end
- # We need to add a newline at the beginning to get the
- # filter lines to line up (since the Haml filter contains
- # a line that doesn't show up in the source, namely the
- # filter name). Then we need to escape the trailing
- # newline so that the whole filter block doesn't take up
- # too many.
- text = "\n" + text.sub(/\n"\Z/, "\\n\"")
- push_script < false
-find_and_preserve(#{filter.inspect}.render_with_options(#{text}, _hamlout.options))
-RUBY
- return
- end
-
- rendered = Haml::Helpers::find_and_preserve(filter.render_with_options(text, compiler.options), compiler.options[:preserve])
-
- if !options[:ugly]
- push_text(rendered.rstrip.gsub("\n", "\n#{' ' * @output_tabs}"))
- else
- push_text(rendered.rstrip)
- end
- end
- end
-
- # This becomes a class method of modules that include {Base}.
- # It allows the module to specify one or more Ruby files
- # that Haml should try to require when compiling the filter.
- #
- # The first file specified is tried first, then the second, etc.
- # If none are found, the compilation throws an exception.
- #
- # For example:
- #
- # module Haml::Filters::Markdown
- # lazy_require 'rdiscount', 'peg_markdown', 'maruku', 'bluecloth'
- #
- # ...
- # end
- #
- # @param reqs [Array] The requires to run
- def lazy_require(*reqs)
- @lazy_requires = reqs
- end
-
- private
-
- def resolve_lazy_requires
- return unless @lazy_requires
-
- @lazy_requires[0...-1].each do |req|
- begin
- @required = req
- require @required
- return
- rescue LoadError; end # RCov doesn't see this, but it is run
- end
-
- begin
- @required = @lazy_requires[-1]
- require @required
- rescue LoadError => e
- classname = self.name.match(/\w+$/)[0]
-
- if @lazy_requires.size == 1
- raise Error.new("Can't run #{classname} filter; required file '#{@lazy_requires.first}' not found")
- else
- raise Error.new("Can't run #{classname} filter; required #{@lazy_requires.map { |r| "'#{r}'" }.join(' or ')}, but none were found")
- end
- end
- end
- end
- end
-end
-
-begin
- require 'rubygems'
-rescue LoadError; end
-
-module Haml
- module Filters
- # Does not parse the filtered text.
- # This is useful for large blocks of text without HTML tags,
- # when you don't want lines starting with `.` or `-`
- # to be parsed.
- module Plain
- include Base
-
- # @see Base#render
- def render(text); text; end
- end
-
- # Surrounds the filtered text with `
-END
- end
- end
-
- # Surrounds the filtered text with `
-END
- end
- end
-
- # Surrounds the filtered text with CDATA tags.
- module Cdata
- include Base
-
- # @see Base#render
- def render(text)
- ""
- end
- end
-
- # Works the same as {Plain}, but HTML-escapes the text
- # before placing it in the document.
- module Escaped
- include Base
-
- # @see Base#render
- def render(text)
- Haml::Helpers.html_escape text
- end
- end
-
- # Parses the filtered text with the normal Ruby interpreter.
- # All output sent to `$stdout`, such as with `puts`,
- # is output into the Haml document.
- # Not available if the {file:HAML_REFERENCE.md#suppress_eval-option `:suppress_eval`} option is set to true.
- # The Ruby code is evaluated in the same context as the Haml template.
- module Ruby
- include Base
- lazy_require 'stringio'
-
- # @see Base#compile
- def compile(compiler, text)
- return if compiler.options[:suppress_eval]
- compiler.instance_eval do
- push_silent <<-FIRST.gsub("\n", ';') + text + <<-LAST.gsub("\n", ';')
- _haml_old_stdout = $stdout
- $stdout = StringIO.new(_hamlout.buffer, 'a')
- FIRST
- _haml_old_stdout, $stdout = $stdout, _haml_old_stdout
- _haml_old_stdout.close
- LAST
- end
- end
- end
-
- # Inserts the filtered text into the template with whitespace preserved.
- # `preserve`d blocks of text aren't indented,
- # and newlines are replaced with the HTML escape code for newlines,
- # to preserve nice-looking output.
- #
- # @see Haml::Helpers#preserve
- module Preserve
- include Base
-
- # @see Base#render
- def render(text)
- Haml::Helpers.preserve text
- end
- end
-
- # Parses the filtered text with {Sass} to produce CSS output.
- module Sass
- include Base
- lazy_require 'sass/plugin'
-
- # @see Base#render
- def render(text)
- ::Sass::Engine.new(text, ::Sass::Plugin.engine_options).render
- end
- end
-
- # Parses the filtered text with ERB.
- # Not available if the {file:HAML_REFERENCE.md#suppress_eval-option `:suppress_eval`} option is set to true.
- # Embedded Ruby code is evaluated in the same context as the Haml template.
- module ERB
- include Base
- lazy_require 'erb'
-
- # @see Base#compile
- def compile(compiler, text)
- return if compiler.options[:suppress_eval]
- src = ::ERB.new(text).src.sub(/^#coding:.*?\n/, '').
- sub(/^_erbout = '';/, "")
- compiler.send(:push_silent, src)
- end
- end
-
- # Parses the filtered text with [Textile](http://www.textism.com/tools/textile).
- # Only works if [RedCloth](http://redcloth.org) is installed.
- module Textile
- include Base
- lazy_require 'redcloth'
-
- # @see Base#render
- def render(text)
- ::RedCloth.new(text).to_html(:textile)
- end
- end
- # An alias for the Textile filter,
- # since the only available Textile parser is RedCloth.
- # @api public
- RedCloth = Textile
- Filters.defined['redcloth'] = RedCloth
-
- # Parses the filtered text with [Markdown](http://daringfireball.net/projects/markdown).
- # Only works if [RDiscount](http://github.com/rtomayko/rdiscount),
- # [RPeg-Markdown](http://github.com/rtomayko/rpeg-markdown),
- # [Maruku](http://maruku.rubyforge.org),
- # or [BlueCloth](www.deveiate.org/projects/BlueCloth) are installed.
- module Markdown
- include Base
- lazy_require 'rdiscount', 'peg_markdown', 'maruku', 'bluecloth'
-
- # @see Base#render
- def render(text)
- engine = case @required
- when 'rdiscount'
- ::RDiscount
- when 'peg_markdown'
- ::PEGMarkdown
- when 'maruku'
- ::Maruku
- when 'bluecloth'
- ::BlueCloth
- end
- engine.new(text).to_html
- end
- end
-
- # Parses the filtered text with [Maruku](http://maruku.rubyforge.org),
- # which has some non-standard extensions to Markdown.
- module Maruku
- include Base
- lazy_require 'maruku'
-
- # @see Base#render
- def render(text)
- ::Maruku.new(text).to_html
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/helpers.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/helpers.rb
deleted file mode 100644
index ec527cdef7..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/helpers.rb
+++ /dev/null
@@ -1,606 +0,0 @@
-module Haml
- # This module contains various helpful methods to make it easier to do various tasks.
- # {Haml::Helpers} is automatically included in the context
- # that a Haml template is parsed in, so all these methods are at your
- # disposal from within the template.
- module Helpers
- # An object that raises an error when \{#to\_s} is called.
- # It's used to raise an error when the return value of a helper is used
- # when it shouldn't be.
- class ErrorReturn
- # @param message [String] The error message to raise when \{#to\_s} is called
- def initialize(method)
- @message = < e
- e.backtrace.shift
-
- # If the ErrorReturn is used directly in the template,
- # we don't want Haml's stuff to get into the backtrace,
- # so we get rid of the format_script line.
- #
- # We also have to subtract one from the Haml line number
- # since the value is passed to format_script the line after
- # it's actually used.
- if e.backtrace.first =~ /^\(eval\):\d+:in `format_script/
- e.backtrace.shift
- e.backtrace.first.gsub!(/^\(haml\):(\d+)/) {|s| "(haml):#{$1.to_i - 1}"}
- end
- raise e
- end
-
- # @return [String] A human-readable string representation
- def inspect
- "Haml::Helpers::ErrorReturn(#{@message.inspect})"
- end
- end
-
- self.extend self
-
- @@action_view_defined = false
-
- # @return [Boolean] Whether or not ActionView is loaded
- def self.action_view?
- @@action_view_defined
- end
-
- # Note: this does **not** need to be called when using Haml helpers
- # normally in Rails.
- #
- # Initializes the current object as though it were in the same context
- # as a normal ActionView instance using Haml.
- # This is useful if you want to use the helpers in a context
- # other than the normal setup with ActionView.
- # For example:
- #
- # context = Object.new
- # class << context
- # include Haml::Helpers
- # end
- # context.init_haml_helpers
- # context.haml_tag :p, "Stuff"
- #
- def init_haml_helpers
- @haml_buffer = Haml::Buffer.new(@haml_buffer, Haml::Engine.new('').send(:options_for_buffer))
- nil
- end
-
- # Runs a block of code in a non-Haml context
- # (i.e. \{#is\_haml?} will return false).
- #
- # This is mainly useful for rendering sub-templates such as partials in a non-Haml language,
- # particularly where helpers may behave differently when run from Haml.
- #
- # Note that this is automatically applied to Rails partials.
- #
- # @yield A block which won't register as Haml
- def non_haml
- was_active = @haml_buffer.active?
- @haml_buffer.active = false
- yield
- ensure
- @haml_buffer.active = was_active
- end
-
- # Uses \{#preserve} to convert any newlines inside whitespace-sensitive tags
- # into the HTML entities for endlines.
- #
- # @param tags [Array] Tags that should have newlines escaped
- #
- # @overload find_and_preserve(input, tags = haml_buffer.options[:preserve])
- # Escapes newlines within a string.
- #
- # @param input [String] The string within which to escape newlines
- # @overload find_and_preserve(tags = haml_buffer.options[:preserve])
- # Escapes newlines within a block of Haml code.
- #
- # @yield The block within which to escape newlines
- def find_and_preserve(input = nil, tags = haml_buffer.options[:preserve], &block)
- return find_and_preserve(capture_haml(&block), input || tags) if block
- input.to_s.gsub(/<(#{tags.map(&Regexp.method(:escape)).join('|')})([^>]*)>(.*?)(<\/\1>)/im) do
- "<#{$1}#{$2}>#{preserve($3)}#{$1}>"
- end
- end
-
- # Takes any string, finds all the newlines, and converts them to
- # HTML entities so they'll render correctly in
- # whitespace-sensitive tags without screwing up the indentation.
- #
- # @overload perserve(input)
- # Escapes newlines within a string.
- #
- # @param input [String] The string within which to escape all newlines
- # @overload perserve
- # Escapes newlines within a block of Haml code.
- #
- # @yield The block within which to escape newlines
- def preserve(input = nil, &block)
- return preserve(capture_haml(&block)) if block
- input.to_s.chomp("\n").gsub(/\n/, '
').gsub(/\r/, '')
- end
- alias_method :flatten, :preserve
-
- # Takes an `Enumerable` object and a block
- # and iterates over the enum,
- # yielding each element to a Haml block
- # and putting the result into `
` elements.
- # This creates a list of the results of the block.
- # For example:
- #
- # = list_of([['hello'], ['yall']]) do |i|
- # = i[0]
- #
- # Produces:
- #
- #
hello
- #
yall
- #
- # And
- #
- # = list_of({:title => 'All the stuff', :description => 'A book about all the stuff.'}) do |key, val|
- # %h3= key.humanize
- # %p= val
- #
- # Produces:
- #
- #
- #
Title
- #
All the stuff
- #
- #
- #
Description
- #
A book about all the stuff.
- #
- #
- # @param enum [Enumerable] The list of objects to iterate over
- # @yield [item] A block which contains Haml code that goes within list items
- # @yieldparam item An element of `enum`
- def list_of(enum, &block)
- to_return = enum.collect do |i|
- result = capture_haml(i, &block)
-
- if result.count("\n") > 1
- result.gsub!("\n", "\n ")
- result = "\n #{result.strip}\n"
- else
- result.strip!
- end
-
- "
#{result}
"
- end
- to_return.join("\n")
- end
-
- # Returns a hash containing default assignments for the `xmlns`, `lang`, and `xml:lang`
- # attributes of the `html` HTML element.
- # For example,
- #
- # %html{html_attrs}
- #
- # becomes
- #
- #
- #
- # @param lang [String] The value of `xml:lang` and `lang`
- # @return [{#to_s => String}] The attribute hash
- def html_attrs(lang = 'en-US')
- {:xmlns => "http://www.w3.org/1999/xhtml", 'xml:lang' => lang, :lang => lang}
- end
-
- # Increments the number of tabs the buffer automatically adds
- # to the lines of the template.
- # For example:
- #
- # %h1 foo
- # - tab_up
- # %p bar
- # - tab_down
- # %strong baz
- #
- # Produces:
- #
- #
foo
- #
bar
- # baz
- #
- # @param i [Fixnum] The number of tabs by which to increase the indentation
- # @see #tab_down
- def tab_up(i = 1)
- haml_buffer.tabulation += i
- end
-
- # Decrements the number of tabs the buffer automatically adds
- # to the lines of the template.
- #
- # @param i [Fixnum] The number of tabs by which to decrease the indentation
- # @see #tab_up
- def tab_down(i = 1)
- haml_buffer.tabulation -= i
- end
-
- # Sets the number of tabs the buffer automatically adds
- # to the lines of the template,
- # but only for the duration of the block.
- # For example:
- #
- # %h1 foo
- # - with_tabs(2) do
- # %p bar
- # %strong baz
- #
- # Produces:
- #
- #
foo
- #
bar
- # baz
- #
- #
- # @param i [Fixnum] The number of tabs to use
- # @yield A block in which the indentation will be `i` spaces
- def with_tabs(i)
- old_tabs = haml_buffer.tabulation
- haml_buffer.tabulation = i
- yield
- ensure
- haml_buffer.tabulation = old_tabs
- end
-
- # Surrounds a block of Haml code with strings,
- # with no whitespace in between.
- # For example:
- #
- # = surround '(', ')' do
- # %a{:href => "food"} chicken
- #
- # Produces:
- #
- # (chicken)
- #
- # and
- #
- # = surround '*' do
- # %strong angry
- #
- # Produces:
- #
- # *angry*
- #
- # @param front [String] The string to add before the Haml
- # @param back [String] The string to add after the Haml
- # @yield A block of Haml to surround
- def surround(front, back = front, &block)
- output = capture_haml(&block)
-
- "#{front}#{output.chomp}#{back}\n"
- end
-
- # Prepends a string to the beginning of a Haml block,
- # with no whitespace between.
- # For example:
- #
- # = precede '*' do
- # %span.small Not really
- #
- # Produces:
- #
- # *Not really
- #
- # @param str [String] The string to add before the Haml
- # @yield A block of Haml to prepend to
- def precede(str, &block)
- "#{str}#{capture_haml(&block).chomp}\n"
- end
-
- # Appends a string to the end of a Haml block,
- # with no whitespace between.
- # For example:
- #
- # click
- # = succeed '.' do
- # %a{:href=>"thing"} here
- #
- # Produces:
- #
- # click
- # here.
- #
- # @param str [String] The string to add after the Haml
- # @yield A block of Haml to append to
- def succeed(str, &block)
- "#{capture_haml(&block).chomp}#{str}\n"
- end
-
- # Captures the result of a block of Haml code,
- # gets rid of the excess indentation,
- # and returns it as a string.
- # For example, after the following,
- #
- # .foo
- # - foo = capture_haml(13) do |a|
- # %p= a
- #
- # the local variable `foo` would be assigned to `"
13
\n"`.
- #
- # @param args [Array] Arguments to pass into the block
- # @yield [args] A block of Haml code that will be converted to a string
- # @yieldparam args [Array] `args`
- def capture_haml(*args, &block)
- buffer = eval('_hamlout', block.binding) rescue haml_buffer
- with_haml_buffer(buffer) do
- position = haml_buffer.buffer.length
-
- haml_buffer.capture_position = position
- block.call(*args)
-
- captured = haml_buffer.buffer.slice!(position..-1)
- return captured if haml_buffer.options[:ugly]
- captured = captured.split(/^/)
-
- min_tabs = nil
- captured.each do |line|
- tabs = line.index(/[^ ]/) || line.length
- min_tabs ||= tabs
- min_tabs = min_tabs > tabs ? tabs : min_tabs
- end
-
- captured.map do |line|
- line[min_tabs..-1]
- end.join
- end
- ensure
- haml_buffer.capture_position = nil
- end
-
- # Outputs text directly to the Haml buffer, with the proper indentation.
- #
- # @param text [#to_s] The text to output
- def haml_concat(text = "")
- unless haml_buffer.options[:ugly] || haml_indent == 0
- haml_buffer.buffer << haml_indent <<
- text.to_s.gsub("\n", "\n" + haml_indent) << "\n"
- else
- haml_buffer.buffer << text.to_s << "\n"
- end
- ErrorReturn.new("haml_concat")
- end
-
- # @return [String] The indentation string for the current line
- def haml_indent
- ' ' * haml_buffer.tabulation
- end
-
- # Creates an HTML tag with the given name and optionally text and attributes.
- # Can take a block that will run between the opening and closing tags.
- # If the block is a Haml block or outputs text using \{#haml\_concat},
- # the text will be properly indented.
- #
- # `name` can be a string using the standard Haml class/id shorthand
- # (e.g. "span#foo.bar", "#foo").
- # Just like standard Haml tags, these class and id values
- # will be merged with manually-specified attributes.
- #
- # `flags` is a list of symbol flags
- # like those that can be put at the end of a Haml tag
- # (`:/`, `:<`, and `:>`).
- # Currently, only `:/` and `:<` are supported.
- #
- # `haml_tag` outputs directly to the buffer;
- # its return value should not be used.
- # If you need to get the results as a string,
- # use \{#capture\_haml\}.
- #
- # For example,
- #
- # haml_tag :table do
- # haml_tag :tr do
- # haml_tag 'td.cell' do
- # haml_tag :strong, "strong!"
- # haml_concat "data"
- # end
- # haml_tag :td do
- # haml_concat "more_data"
- # end
- # end
- # end
- #
- # outputs
- #
- #
- #
- #
- #
- # strong!
- #
- # data
- #
- #
- # more_data
- #
- #
- #
- #
- # @param name [#to_s] The name of the tag
- # @param flags [Array] Haml end-of-tag flags
- #
- # @overload haml_tag(name, *flags, attributes = {})
- # @yield The block of Haml code within the tag
- # @overload haml_tag(name, text, *flags, attributes = {})
- # @param text [#to_s] The text within the tag
- def haml_tag(name, *rest, &block)
- ret = ErrorReturn.new("haml_tag")
-
- text = rest.shift.to_s unless [Symbol, Hash, NilClass].any? {|t| rest.first.is_a? t}
- flags = []
- flags << rest.shift while rest.first.is_a? Symbol
- attrs = Haml::Util.map_keys(rest.shift || {}) {|key| key.to_s}
- name, attrs = merge_name_and_attributes(name.to_s, attrs)
-
- attributes = Haml::Compiler.build_attributes(haml_buffer.html?,
- haml_buffer.options[:attr_wrapper],
- haml_buffer.options[:escape_attrs],
- attrs)
-
- if text.nil? && block.nil? && (haml_buffer.options[:autoclose].include?(name) || flags.include?(:/))
- haml_concat "<#{name}#{attributes} />"
- return ret
- end
-
- if flags.include?(:/)
- raise Error.new("Self-closing tags can't have content.") if text
- raise Error.new("Illegal nesting: nesting within a self-closing tag is illegal.") if block
- end
-
- tag = "<#{name}#{attributes}>"
- if block.nil?
- text = text.to_s
- if text.include?("\n")
- haml_concat tag
- tab_up
- haml_concat text
- tab_down
- haml_concat "#{name}>"
- else
- tag << text << "#{name}>"
- haml_concat tag
- end
- return ret
- end
-
- if text
- raise Error.new("Illegal nesting: content can't be both given to haml_tag :#{name} and nested within it.")
- end
-
- if flags.include?(:<)
- tag << capture_haml(&block).strip << "#{name}>"
- haml_concat tag
- return ret
- end
-
- haml_concat tag
- tab_up
- block.call
- tab_down
- haml_concat "#{name}>"
-
- ret
- end
-
- # Characters that need to be escaped to HTML entities from user input
- HTML_ESCAPE = { '&'=>'&', '<'=>'<', '>'=>'>', '"'=>'"', "'"=>''', }
-
- # Returns a copy of `text` with ampersands, angle brackets and quotes
- # escaped into HTML entities.
- #
- # Note that if ActionView is loaded and XSS protection is enabled
- # (as is the default for Rails 3.0+, and optional for version 2.3.5+),
- # this won't escape text declared as "safe".
- #
- # @param text [String] The string to sanitize
- # @return [String] The sanitized string
- def html_escape(text)
- Haml::Util.silence_warnings {text.to_s.gsub(/[\"><&]/n) {|s| HTML_ESCAPE[s]}}
- end
-
- # Escapes HTML entities in `text`, but without escaping an ampersand
- # that is already part of an escaped entity.
- #
- # @param text [String] The string to sanitize
- # @return [String] The sanitized string
- def escape_once(text)
- Haml::Util.silence_warnings do
- text.to_s.gsub(/[\"><]|&(?!(?:[a-zA-Z]+|(#\d+));)/n) {|s| HTML_ESCAPE[s]}
- end
- end
-
- # Returns whether or not the current template is a Haml template.
- #
- # This function, unlike other {Haml::Helpers} functions,
- # also works in other `ActionView` templates,
- # where it will always return false.
- #
- # @return [Boolean] Whether or not the current template is a Haml template
- def is_haml?
- !@haml_buffer.nil? && @haml_buffer.active?
- end
-
- # Returns whether or not `block` is defined directly in a Haml template.
- #
- # @param block [Proc] A Ruby block
- # @return [Boolean] Whether or not `block` is defined directly in a Haml template
- def block_is_haml?(block)
- eval('_hamlout', block.binding)
- true
- rescue
- false
- end
-
- private
-
- # Parses the tag name used for \{#haml\_tag}
- # and merges it with the Ruby attributes hash.
- def merge_name_and_attributes(name, attributes_hash = {})
- # skip merging if no ids or classes found in name
- return name, attributes_hash unless name =~ /^(.+?)?([\.#].*)$/
-
- return $1 || "div", Buffer.merge_attrs(
- Haml::Parser.parse_class_and_id($2), attributes_hash)
- end
-
- # Runs a block of code with the given buffer as the currently active buffer.
- #
- # @param buffer [Haml::Buffer] The Haml buffer to use temporarily
- # @yield A block in which the given buffer should be used
- def with_haml_buffer(buffer)
- @haml_buffer, old_buffer = buffer, @haml_buffer
- old_buffer.active, old_was_active = false, old_buffer.active? if old_buffer
- @haml_buffer.active, was_active = true, @haml_buffer.active?
- yield
- ensure
- @haml_buffer.active = was_active
- old_buffer.active = old_was_active if old_buffer
- @haml_buffer = old_buffer
- end
-
- # The current {Haml::Buffer} object.
- #
- # @return [Haml::Buffer]
- def haml_buffer
- @haml_buffer
- end
-
- # Gives a proc the same local `_hamlout` and `_erbout` variables
- # that the current template has.
- #
- # @param proc [#call] The proc to bind
- # @return [Proc] A new proc with the new variables bound
- def haml_bind_proc(&proc)
- _hamlout = haml_buffer
- _erbout = _hamlout.buffer
- proc { |*args| proc.call(*args) }
- end
- end
-end
-
-# @private
-class Object
- # Haml overrides various `ActionView` helpers,
- # which call an \{#is\_haml?} method
- # to determine whether or not the current context object
- # is a proper Haml context.
- # Because `ActionView` helpers may be included in non-`ActionView::Base` classes,
- # it's a good idea to define \{#is\_haml?} for all objects.
- def is_haml?
- false
- end
-end
-
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/helpers/action_view_extensions.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/helpers/action_view_extensions.rb
deleted file mode 100644
index afd0786da3..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/helpers/action_view_extensions.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-module Haml
- module Helpers
- @@action_view_defined = true
-
- # This module contains various useful helper methods
- # that either tie into ActionView or the rest of the ActionPack stack,
- # or are only useful in that context.
- # Thus, the methods defined here are only available
- # if ActionView is installed.
- module ActionViewExtensions
- # Returns a value for the "class" attribute
- # unique to this controller/action pair.
- # This can be used to target styles specifically at this action or controller.
- # For example, if the current action were `EntryController#show`,
- #
- # %div{:class => page_class} My Div
- #
- # would become
- #
- #
My Div
- #
- # Then, in a stylesheet (shown here as [Sass](http://sass-lang.com)),
- # you could refer to this specific action:
- #
- # .entry.show
- # font-weight: bold
- #
- # or to all actions in the entry controller:
- #
- # .entry
- # color: #00f
- #
- # @return [String] The class name for the current page
- def page_class
- controller.controller_name + " " + controller.action_name
- end
- alias_method :generate_content_class_names, :page_class
-
- # Treats all input to \{Haml::Helpers#haml\_concat} within the block
- # as being HTML safe for Rails' XSS protection.
- # This is useful for wrapping blocks of code that concatenate HTML en masse.
- #
- # This has no effect if Rails' XSS protection isn't enabled.
- #
- # @yield A block in which all input to `#haml_concat` is treated as raw.
- # @see Haml::Util#rails_xss_safe?
- def with_raw_haml_concat
- @_haml_concat_raw, old = true, @_haml_concat_raw
- yield
- ensure
- @_haml_concat_raw = old
- end
- end
-
- include ActionViewExtensions
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/helpers/action_view_mods.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/helpers/action_view_mods.rb
deleted file mode 100644
index 6d33d454e1..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/helpers/action_view_mods.rb
+++ /dev/null
@@ -1,244 +0,0 @@
-module ActionView
- class Base
- def render_with_haml(*args, &block)
- options = args.first
-
- # If render :layout is used with a block,
- # it concats rather than returning a string
- # so we need it to keep thinking it's Haml
- # until it hits the sub-render
- if is_haml? && !(options.is_a?(Hash) && options[:layout] && block_given?)
- return non_haml { render_without_haml(*args, &block) }
- end
- render_without_haml(*args, &block)
- end
- alias_method :render_without_haml, :render
- alias_method :render, :render_with_haml
-
- # Rails >2.1
- if Haml::Util.has?(:instance_method, self, :output_buffer)
- def output_buffer_with_haml
- return haml_buffer.buffer if is_haml?
- output_buffer_without_haml
- end
- alias_method :output_buffer_without_haml, :output_buffer
- alias_method :output_buffer, :output_buffer_with_haml
-
- def set_output_buffer_with_haml(new)
- if is_haml?
- new = String.new(new) if Haml::Util.rails_xss_safe? &&
- new.is_a?(Haml::Util.rails_safe_buffer_class)
- haml_buffer.buffer = new
- else
- set_output_buffer_without_haml new
- end
- end
- alias_method :set_output_buffer_without_haml, :output_buffer=
- alias_method :output_buffer=, :set_output_buffer_with_haml
- end
- end
-
- module Helpers
- # In Rails <=2.1, we've got to override considerable capturing infrastructure.
- # In Rails >2.1, we can make do with only overriding #capture
- # (which no longer behaves differently in helper contexts).
- unless Haml::Util.has?(:instance_method, ActionView::Base, :output_buffer)
- module CaptureHelper
- def capture_with_haml(*args, &block)
- # Rails' #capture helper will just return the value of the block
- # if it's not actually in the template context,
- # as detected by the existance of an _erbout variable.
- # We've got to do the same thing for compatibility.
-
- if is_haml? && block_is_haml?(block)
- capture_haml(*args, &block)
- else
- capture_without_haml(*args, &block)
- end
- end
- alias_method :capture_without_haml, :capture
- alias_method :capture, :capture_with_haml
-
- def capture_erb_with_buffer_with_haml(buffer, *args, &block)
- if is_haml?
- capture_haml(*args, &block)
- else
- capture_erb_with_buffer_without_haml(buffer, *args, &block)
- end
- end
- alias_method :capture_erb_with_buffer_without_haml, :capture_erb_with_buffer
- alias_method :capture_erb_with_buffer, :capture_erb_with_buffer_with_haml
- end
-
- module TextHelper
- def concat_with_haml(string, binding = nil)
- if is_haml?
- haml_buffer.buffer.concat(string)
- else
- concat_without_haml(string, binding)
- end
- end
- alias_method :concat_without_haml, :concat
- alias_method :concat, :concat_with_haml
- end
- else
- module CaptureHelper
- def capture_with_haml(*args, &block)
- if Haml::Helpers.block_is_haml?(block)
- str = capture_haml(*args, &block)
- return ActionView::NonConcattingString.new(str) if defined?(ActionView::NonConcattingString)
- return str
- else
- capture_without_haml(*args, &block)
- end
- end
- alias_method :capture_without_haml, :capture
- alias_method :capture, :capture_with_haml
- end
- end
-
- module TagHelper
- def content_tag_with_haml(name, *args, &block)
- return content_tag_without_haml(name, *args, &block) unless is_haml?
-
- preserve = haml_buffer.options[:preserve].include?(name.to_s)
-
- if block_given? && block_is_haml?(block) && preserve
- return content_tag_without_haml(name, *args) {preserve(&block)}
- end
-
- content = content_tag_without_haml(name, *args, &block)
- content = Haml::Helpers.preserve(content) if preserve && content
- content
- end
-
- alias_method :content_tag_without_haml, :content_tag
- alias_method :content_tag, :content_tag_with_haml
- end
-
- class InstanceTag
- # Includes TagHelper
-
- def haml_buffer
- @template_object.send :haml_buffer
- end
-
- def is_haml?
- @template_object.send :is_haml?
- end
-
- def content_tag(*args)
- html_tag = content_tag_with_haml(*args)
- return html_tag unless respond_to?(:error_wrapping)
- return error_wrapping(html_tag) if method(:error_wrapping).arity == 1
- return html_tag unless object.respond_to?(:errors) && object.errors.respond_to?(:on)
- return error_wrapping(html_tag, object.errors.on(@method_name))
- end
- end
-
- if Haml::Util.ap_geq_3?
- module FormTagHelper
- def form_tag_with_haml(url_for_options = {}, options = {}, *parameters_for_url, &proc)
- if is_haml?
- wrap_block = block_given? && block_is_haml?(proc)
- if wrap_block
- oldproc = proc
- proc = haml_bind_proc do |*args|
- concat "\n"
- with_tabs(1) {oldproc.call(*args)}
- end
- end
- res = form_tag_without_haml(url_for_options, options, *parameters_for_url, &proc) + "\n"
- res << "\n" if wrap_block
- res
- else
- form_tag_without_haml(url_for_options, options, *parameters_for_url, &proc)
- end
- end
- alias_method :form_tag_without_haml, :form_tag
- alias_method :form_tag, :form_tag_with_haml
- end
-
- module FormHelper
- def form_for_with_haml(object_name, *args, &proc)
- wrap_block = block_given? && is_haml? && block_is_haml?(proc)
- if wrap_block
- oldproc = proc
- proc = proc {|*args| with_tabs(1) {oldproc.call(*args)}}
- end
- res = form_for_without_haml(object_name, *args, &proc)
- res << "\n" if wrap_block
- res
- end
- alias_method :form_for_without_haml, :form_for
- alias_method :form_for, :form_for_with_haml
- end
-
- module CacheHelper
- # This is a workaround for a Rails 3 bug
- # that's present at least through beta 3.
- # Their fragment_for assumes that the block
- # will return its contents as a string,
- # which is not always the case.
- # Luckily, it only makes this assumption if caching is disabled,
- # so we only override that case.
- def fragment_for_with_haml(*args, &block)
- return fragment_for_without_haml(*args, &block) if controller.perform_caching
- capture(&block)
- end
- alias_method :fragment_for_without_haml, :fragment_for
- alias_method :fragment_for, :fragment_for_with_haml
- end
- else
- module FormTagHelper
- def form_tag_with_haml(url_for_options = {}, options = {}, *parameters_for_url, &proc)
- if is_haml?
- wrap_block = block_given? && block_is_haml?(proc)
- if wrap_block
- oldproc = proc
- proc = haml_bind_proc do |*args|
- concat "\n"
- tab_up
- oldproc.call(*args)
- tab_down
- concat haml_indent
- end
- concat haml_indent
- end
- res = form_tag_without_haml(url_for_options, options, *parameters_for_url, &proc) + "\n"
- if block_given?
- concat "\n"
- return Haml::Helpers::ErrorReturn.new("form_tag")
- end
- res
- else
- form_tag_without_haml(url_for_options, options, *parameters_for_url, &proc)
- end
- end
- alias_method :form_tag_without_haml, :form_tag
- alias_method :form_tag, :form_tag_with_haml
- end
-
- module FormHelper
- def form_for_with_haml(object_name, *args, &proc)
- wrap_block = block_given? && is_haml? && block_is_haml?(proc)
- if wrap_block
- oldproc = proc
- proc = haml_bind_proc do |*args|
- tab_up
- oldproc.call(*args)
- tab_down
- concat haml_indent
- end
- concat haml_indent
- end
- form_for_without_haml(object_name, *args, &proc)
- concat "\n" if wrap_block
- Haml::Helpers::ErrorReturn.new("form_for") if is_haml?
- end
- alias_method :form_for_without_haml, :form_for
- alias_method :form_for, :form_for_with_haml
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/helpers/xss_mods.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/helpers/xss_mods.rb
deleted file mode 100644
index f57ac2b93d..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/helpers/xss_mods.rb
+++ /dev/null
@@ -1,165 +0,0 @@
-module Haml
- module Helpers
- # This module overrides Haml helpers to work properly
- # in the context of ActionView.
- # Currently it's only used for modifying the helpers
- # to work with Rails' XSS protection methods.
- module XssMods
- def self.included(base)
- %w[html_escape find_and_preserve preserve list_of surround
- precede succeed capture_haml haml_concat haml_indent
- haml_tag escape_once].each do |name|
- base.send(:alias_method, "#{name}_without_haml_xss", name)
- base.send(:alias_method, name, "#{name}_with_haml_xss")
- end
- end
-
- # Don't escape text that's already safe,
- # output is always HTML safe
- def html_escape_with_haml_xss(text)
- str = text.to_s
- return text if str.html_safe?
- Haml::Util.html_safe(html_escape_without_haml_xss(str))
- end
-
- # Output is always HTML safe
- def find_and_preserve_with_haml_xss(*args, &block)
- Haml::Util.html_safe(find_and_preserve_without_haml_xss(*args, &block))
- end
-
- # Output is always HTML safe
- def preserve_with_haml_xss(*args, &block)
- Haml::Util.html_safe(preserve_without_haml_xss(*args, &block))
- end
-
- # Output is always HTML safe
- def list_of_with_haml_xss(*args, &block)
- Haml::Util.html_safe(list_of_without_haml_xss(*args, &block))
- end
-
- # Input is escaped, output is always HTML safe
- def surround_with_haml_xss(front, back = front, &block)
- Haml::Util.html_safe(
- surround_without_haml_xss(
- haml_xss_html_escape(front),
- haml_xss_html_escape(back),
- &block))
- end
-
- # Input is escaped, output is always HTML safe
- def precede_with_haml_xss(str, &block)
- Haml::Util.html_safe(precede_without_haml_xss(haml_xss_html_escape(str), &block))
- end
-
- # Input is escaped, output is always HTML safe
- def succeed_with_haml_xss(str, &block)
- Haml::Util.html_safe(succeed_without_haml_xss(haml_xss_html_escape(str), &block))
- end
-
- # Output is always HTML safe
- def capture_haml_with_haml_xss(*args, &block)
- Haml::Util.html_safe(capture_haml_without_haml_xss(*args, &block))
- end
-
- # Input is escaped
- def haml_concat_with_haml_xss(text = "")
- haml_concat_without_haml_xss(@_haml_concat_raw ? text : haml_xss_html_escape(text))
- end
-
- # Output is always HTML safe
- def haml_indent_with_haml_xss
- Haml::Util.html_safe(haml_indent_without_haml_xss)
- end
-
- # Input is escaped, haml_concat'ed output is always HTML safe
- def haml_tag_with_haml_xss(name, *rest, &block)
- name = haml_xss_html_escape(name.to_s)
- rest.unshift(haml_xss_html_escape(rest.shift.to_s)) unless [Symbol, Hash, NilClass].any? {|t| rest.first.is_a? t}
- with_raw_haml_concat {haml_tag_without_haml_xss(name, *rest, &block)}
- end
-
- # Output is always HTML safe
- def escape_once_with_haml_xss(*args)
- Haml::Util.html_safe(escape_once_without_haml_xss(*args))
- end
-
- private
-
- # Escapes the HTML in the text if and only if
- # Rails XSS protection is enabled *and* the `:escape_html` option is set.
- def haml_xss_html_escape(text)
- return text unless Haml::Util.rails_xss_safe? && haml_buffer.options[:escape_html]
- html_escape(text)
- end
- end
-
- class ErrorReturn
- # Any attempt to treat ErrorReturn as a string should cause it to blow up.
- alias_method :html_safe, :to_s
- alias_method :html_safe?, :to_s
- alias_method :html_safe!, :to_s
- end
- end
-end
-
-module ActionView
- module Helpers
- module CaptureHelper
- def with_output_buffer_with_haml_xss(*args, &block)
- res = with_output_buffer_without_haml_xss(*args, &block)
- case res
- when Array; res.map {|s| Haml::Util.html_safe(s)}
- when String; Haml::Util.html_safe(res)
- else; res
- end
- end
- alias_method :with_output_buffer_without_haml_xss, :with_output_buffer
- alias_method :with_output_buffer, :with_output_buffer_with_haml_xss
- end
-
- module FormTagHelper
- def form_tag_with_haml_xss(*args, &block)
- res = form_tag_without_haml_xss(*args, &block)
- res = Haml::Util.html_safe(res) unless block_given?
- res
- end
- alias_method :form_tag_without_haml_xss, :form_tag
- alias_method :form_tag, :form_tag_with_haml_xss
- end
-
- module FormHelper
- def form_for_with_haml_xss(*args, &block)
- res = form_for_without_haml_xss(*args, &block)
- return Haml::Util.html_safe(res) if res.is_a?(String)
- return res
- end
- alias_method :form_for_without_haml_xss, :form_for
- alias_method :form_for, :form_for_with_haml_xss
- end
-
- module TextHelper
- def concat_with_haml_xss(string)
- if is_haml?
- haml_buffer.buffer.concat(haml_xss_html_escape(string))
- else
- concat_without_haml_xss(string)
- end
- end
- alias_method :concat_without_haml_xss, :concat
- alias_method :concat, :concat_with_haml_xss
-
- # safe_concat was introduced in Rails 3.0
- if Haml::Util.has?(:instance_method, self, :safe_concat)
- def safe_concat_with_haml_xss(string)
- if is_haml?
- haml_buffer.buffer.concat(string)
- else
- safe_concat_without_haml_xss(string)
- end
- end
- alias_method :safe_concat_without_haml_xss, :safe_concat
- alias_method :safe_concat, :safe_concat_with_haml_xss
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/html.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/html.rb
deleted file mode 100644
index 7661652b77..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/html.rb
+++ /dev/null
@@ -1,412 +0,0 @@
-require File.dirname(__FILE__) + '/../haml'
-
-require 'haml/engine'
-require 'rubygems'
-require 'cgi'
-require 'hpricot'
-
-# Haml monkeypatches various Hpricot classes
-# to add methods for conversion to Haml.
-# @private
-module Hpricot
- # @see Hpricot
- module Node
- # Whether this node has already been converted to Haml.
- # Only used for text nodes and elements.
- #
- # @return [Boolean]
- attr_accessor :converted_to_haml
-
- # Returns the Haml representation of the given node.
- #
- # @param tabs [Fixnum] The indentation level of the resulting Haml.
- # @option options (see Haml::HTML#initialize)
- def to_haml(tabs, options)
- return "" if converted_to_haml || to_s.strip.empty?
- text = uninterp(self.to_s)
- node = next_node
- while node.is_a?(::Hpricot::Elem) && node.name == "haml:loud"
- node.converted_to_haml = true
- text << '#{' <<
- CGI.unescapeHTML(node.inner_text).gsub(/\n\s*/, ' ').strip << '}'
-
- if node.next_node.is_a?(::Hpricot::Text)
- node = node.next_node
- text << uninterp(node.to_s)
- node.converted_to_haml = true
- end
-
- node = node.next_node
- end
- return parse_text_with_interpolation(text, tabs)
- end
-
- private
-
- def erb_to_interpolation(text, options)
- return text unless options[:erb]
- text = CGI.escapeHTML(uninterp(text))
- %w[].each {|str| text.gsub!(CGI.escapeHTML(str), str)}
- ::Hpricot::XML(text).children.inject("") do |str, elem|
- if elem.is_a?(::Hpricot::Text)
- str + CGI.unescapeHTML(elem.to_s)
- else # element
- str + '#{' + CGI.unescapeHTML(elem.innerText.strip) + '}'
- end
- end
- end
-
- def tabulate(tabs)
- ' ' * tabs
- end
-
- def uninterp(text)
- text.gsub('#{', '\#{') #'
- end
-
- def attr_hash
- attributes.to_hash
- end
-
- def parse_text(text, tabs)
- parse_text_with_interpolation(uninterp(text), tabs)
- end
-
- def parse_text_with_interpolation(text, tabs)
- text.strip!
- return "" if text.empty?
-
- text.split("\n").map do |line|
- line.strip!
- "#{tabulate(tabs)}#{'\\' if Haml::Engine::SPECIAL_CHARACTERS.include?(line[0])}#{line}\n"
- end.join
- end
- end
-end
-
-# @private
-HAML_TAGS = %w[haml:block haml:loud haml:silent]
-
-HAML_TAGS.each do |t|
- Hpricot::ElementContent[t] = {}
- Hpricot::ElementContent.keys.each do |key|
- Hpricot::ElementContent[t][key.hash] = true
- end
-end
-
-Hpricot::ElementContent.keys.each do |k|
- HAML_TAGS.each do |el|
- val = Hpricot::ElementContent[k]
- val[el.hash] = true if val.is_a?(Hash)
- end
-end
-
-module Haml
- # Converts HTML documents into Haml templates.
- # Depends on [Hpricot](http://github.com/whymirror/hpricot) for HTML parsing.
- # If ERB conversion is being used, also depends on
- # [Erubis](http://www.kuwata-lab.com/erubis) to parse the ERB
- # and [ruby_parser](http://parsetree.rubyforge.org/) to parse the Ruby code.
- #
- # Example usage:
- #
- # Haml::HTML.new("Blat").render
- # #=> "%a{:href => 'http://google.com'} Blat"
- class HTML
- # @param template [String, Hpricot::Node] The HTML template to convert
- # @option options :erb [Boolean] (false) Whether or not to parse
- # ERB's `<%= %>` and `<% %>` into Haml's `=` and `-`
- # @option options :xhtml [Boolean] (false) Whether or not to parse
- # the HTML strictly as XHTML
- def initialize(template, options = {})
- @options = options
-
- if template.is_a? Hpricot::Node
- @template = template
- else
- if template.is_a? IO
- template = template.read
- end
-
- template = Haml::Util.check_encoding(template) {|msg, line| raise Haml::Error.new(msg, line)}
-
- if @options[:erb]
- require 'haml/html/erb'
- template = ERB.compile(template)
- end
-
- method = @options[:xhtml] ? Hpricot.method(:XML) : method(:Hpricot)
- @template = method.call(template.gsub('&', '&'))
- end
- end
-
- # Processes the document and returns the result as a string
- # containing the Haml template.
- def render
- @template.to_haml(0, @options)
- end
- alias_method :to_haml, :render
-
- TEXT_REGEXP = /^(\s*).*$/
-
- # @see Hpricot
- # @private
- class ::Hpricot::Doc
- # @see Haml::HTML::Node#to_haml
- def to_haml(tabs, options)
- (children || []).inject('') {|s, c| s << c.to_haml(0, options)}
- end
- end
-
- # @see Hpricot
- # @private
- class ::Hpricot::XMLDecl
- # @see Haml::HTML::Node#to_haml
- def to_haml(tabs, options)
- "#{tabulate(tabs)}!!! XML\n"
- end
- end
-
- # @see Hpricot
- # @private
- class ::Hpricot::CData
- # @see Haml::HTML::Node#to_haml
- def to_haml(tabs, options)
- content = parse_text_with_interpolation(
- erb_to_interpolation(self.content, options), tabs + 1)
- "#{tabulate(tabs)}:cdata\n#{content}"
- end
- end
-
- # @see Hpricot
- # @private
- class ::Hpricot::DocType
- # @see Haml::HTML::Node#to_haml
- def to_haml(tabs, options)
- attrs = public_id.nil? ? ["", "", ""] :
- public_id.scan(/DTD\s+([^\s]+)\s*([^\s]*)\s*([^\s]*)\s*\/\//)[0]
- raise Haml::SyntaxError.new("Invalid doctype") if attrs == nil
-
- type, version, strictness = attrs.map { |a| a.downcase }
- if type == "html"
- version = ""
- strictness = "strict" if strictness == ""
- end
-
- if version == "1.0" || version.empty?
- version = nil
- end
-
- if strictness == 'transitional' || strictness.empty?
- strictness = nil
- end
-
- version = " #{version.capitalize}" if version
- strictness = " #{strictness.capitalize}" if strictness
-
- "#{tabulate(tabs)}!!!#{version}#{strictness}\n"
- end
- end
-
- # @see Hpricot
- # @private
- class ::Hpricot::Comment
- # @see Haml::HTML::Node#to_haml
- def to_haml(tabs, options)
- content = self.content
- if content =~ /\A(\[[^\]]+\])>(.*) 1 # Multiline script block
- # Normalize the indentation so that the last line is the base
- indent_str = lines.last[/^[ \t]*/]
- indent_re = /^[ \t]{0,#{indent_str.count(" ") + 8 * indent_str.count("\t")}}/
- lines.map! {|s| s.gsub!(indent_re, '')}
-
- # Add an extra " " to make it indented relative to "= "
- lines[1..-1].each {|s| s.gsub!(/^/, " ")}
-
- # Add | at the end, properly aligned
- length = lines.map {|s| s.size}.max + 1
- lines.map! {|s| "%#{-length}s|" % s}
-
- if next_sibling && next_sibling.is_a?(Hpricot::Elem) && next_sibling.name == "haml:loud" &&
- next_sibling.inner_text.split("\n").reject {|s| s.strip.empty?}.size > 1
- lines << "-#"
- end
- end
- return lines.map {|s| output + s + "\n"}.join
- when "silent"
- return CGI.unescapeHTML(inner_text).split("\n").map do |line|
- next "" if line.strip.empty?
- "#{output}- #{line.strip}\n"
- end.join
- when "block"
- return render_children("", tabs, options)
- end
- end
-
- if self.next && self.next.text? && self.next.content =~ /\A[^\s]/
- if self.previous.nil? || self.previous.text? &&
- (self.previous.content =~ /[^\s]\Z/ ||
- self.previous.content =~ /\A\s*\Z/ && self.previous.previous.nil?)
- nuke_outer_whitespace = true
- else
- output << "= succeed #{self.next.content.slice!(/\A[^\s]+/).dump} do\n"
- tabs += 1
- output << tabulate(tabs)
- end
- end
-
- output << "%#{name}" unless name == 'div' &&
- (static_id?(options) ||
- static_classname?(options) &&
- attr_hash['class'].split(' ').any?(&method(:haml_css_attr?)))
-
- if attr_hash
- if static_id?(options)
- output << "##{attr_hash['id']}"
- remove_attribute('id')
- end
- if static_classname?(options)
- leftover = attr_hash['class'].split(' ').reject do |c|
- next unless haml_css_attr?(c)
- output << ".#{c}"
- end
- remove_attribute('class')
- set_attribute('class', leftover.join(' ')) unless leftover.empty?
- end
- output << haml_attributes(options) if attr_hash.length > 0
- end
-
- output << ">" if nuke_outer_whitespace
- output << "/" if empty? && !etag
-
- if children && children.size == 1
- child = children.first
- if child.is_a?(::Hpricot::Text)
- if !child.to_s.include?("\n")
- text = child.to_haml(tabs + 1, options)
- return output + " " + text.lstrip.gsub(/^\\/, '') unless text.chomp.include?("\n")
- return output + "\n" + text
- elsif ["pre", "textarea"].include?(name) ||
- (name == "code" && parent.is_a?(::Hpricot::Elem) && parent.name == "pre")
- return output + "\n#{tabulate(tabs + 1)}:preserve\n" +
- innerText.gsub(/^/, tabulate(tabs + 2))
- end
- elsif child.is_a?(::Hpricot::Elem) && child.name == "haml:loud"
- return output + child.to_haml(tabs + 1, options).lstrip
- end
- end
-
- render_children(output + "\n", tabs, options)
- end
-
- private
-
- def render_children(so_far, tabs, options)
- (self.children || []).inject(so_far) do |output, child|
- output + child.to_haml(tabs + 1, options)
- end
- end
-
- def dynamic_attributes
- @dynamic_attributes ||= begin
- Haml::Util.map_hash(attr_hash) do |name, value|
- next if value.empty?
- full_match = nil
- ruby_value = value.gsub(%r{\s*(.+?)\s*}) do
- full_match = $`.empty? && $'.empty?
- CGI.unescapeHTML(full_match ? $1: "\#{#{$1}}")
- end
- next if ruby_value == value
- [name, full_match ? ruby_value : %("#{ruby_value}")]
- end
- end
- end
-
- def to_haml_filter(filter, tabs, options)
- content =
- if children.first.is_a?(::Hpricot::CData)
- children.first.content
- else
- CGI.unescapeHTML(self.innerText)
- end
-
- content = erb_to_interpolation(content, options)
- content.gsub!(/\A\s*\n(\s*)/, '\1')
- original_indent = content[/\A(\s*)/, 1]
- if content.split("\n").all? {|l| l.strip.empty? || l =~ /^#{original_indent}/}
- content.gsub!(/^#{original_indent}/, tabulate(tabs + 1))
- end
-
- "#{tabulate(tabs)}:#{filter}\n#{content}"
- end
-
- def static_attribute?(name, options)
- attr_hash[name] && !dynamic_attribute?(name, options)
- end
-
- def dynamic_attribute?(name, options)
- options[:erb] and dynamic_attributes.key?(name)
- end
-
- def static_id?(options)
- static_attribute?('id', options) && haml_css_attr?(attr_hash['id'])
- end
-
- def static_classname?(options)
- static_attribute?('class', options)
- end
-
- def haml_css_attr?(attr)
- attr =~ /^[-:\w]+$/
- end
-
- # Returns a string representation of an attributes hash
- # that's prettier than that produced by Hash#inspect
- def haml_attributes(options)
- attrs = attr_hash.sort.map do |name, value|
- value = dynamic_attribute?(name, options) ? dynamic_attributes[name] : value.inspect
- name = name.index(/\W/) ? name.inspect : ":#{name}"
- "#{name} => #{value}"
- end
- "{#{attrs.join(', ')}}"
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/html/erb.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/html/erb.rb
deleted file mode 100644
index f1cff89fe2..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/html/erb.rb
+++ /dev/null
@@ -1,141 +0,0 @@
-require 'cgi'
-require 'erubis'
-require 'ruby_parser'
-
-module Haml
- class HTML
- # A class for converting ERB code into a format that's easier
- # for the {Haml::HTML} Hpricot-based parser to understand.
- #
- # Uses [Erubis](http://www.kuwata-lab.com/erubis)'s extensible parsing powers
- # to parse the ERB in a reliable way,
- # and [ruby_parser](http://parsetree.rubyforge.org/)'s Ruby knowledge
- # to figure out whether a given chunk of Ruby code starts a block or not.
- #
- # The ERB tags are converted to HTML tags in the following way.
- # `<% ... %>` is converted into ` ... `.
- # `<%= ... %>` is converted into ` ... `.
- # Finally, if either of these opens a Ruby block,
- # ` ... ` will wrap the entire contents of the block -
- # that is, everything that should be indented beneath the previous silent or loud tag.
- class ERB < Erubis::Basic::Engine
- # Compiles an ERB template into a HTML document containing `haml:` tags.
- #
- # @param template [String] The ERB template
- # @return [String] The output document
- # @see Haml::HTML::ERB
- def self.compile(template)
- new(template).src
- end
-
- # `html2haml` doesn't support HTML-escaped expressions.
- def escaped_expr(code)
- raise Haml::Error.new("html2haml doesn't support escaped expressions.")
- end
-
- # The ERB-to-Hamlized-HTML conversion has no preamble.
- def add_preamble(src); end
-
- # The ERB-to-Hamlized-HTML conversion has no postamble.
- def add_postamble(src); end
-
- # Concatenates the text onto the source buffer.
- #
- # @param src [String] The source buffer
- # @param text [String] The raw text to add to the buffer
- def add_text(src, text)
- src << text
- end
-
- # Concatenates a silent Ruby statement onto the source buffer.
- # This uses the `` tag,
- # and may close and/or open a Ruby block with the `` tag.
- #
- # In particular, a block is closed if this statement is some form of `end`,
- # opened if it's a block opener like `do`, `if`, or `begin`,
- # and both closed and opened if it's a mid-block keyword
- # like `else` or `when`.
- #
- # @param src [String] The source buffer
- # @param code [String] The Ruby statement to add to the buffer
- def add_stmt(src, code)
- src << '' if block_closer?(code) || mid_block?(code)
- src << '' << h(code) << '' unless code.strip == "end"
- src << '' if block_opener?(code) || mid_block?(code)
- end
-
- # Concatenates a Ruby expression that's printed to the document
- # onto the source buffer.
- # This uses the `` tag,
- # and may open a Ruby block with the `` tag.
- # An expression never closes a block.
- #
- # @param src [String] The source buffer
- # @param code [String] The Ruby expression to add to the buffer
- def add_expr_literal(src, code)
- src << '' << h(code) << ''
- src << '' if block_opener?(code)
- end
-
- # `html2haml` doesn't support debugging expressions.
- def add_expr_debug(src, code)
- raise Haml::Error.new("html2haml doesn't support debugging expressions.")
- end
-
- private
-
- # HTML-escaped some text (in practice, always Ruby code).
- # A utility method.
- #
- # @param text [String] The text to escape
- # @return [String] The escaped text
- def h(text)
- CGI.escapeHTML(text)
- end
-
- # Returns whether the code is valid Ruby code on its own.
- #
- # @param code [String] Ruby code to check
- # @return [Boolean]
- def valid_ruby?(code)
- RubyParser.new.parse(code)
- rescue Racc::ParseError => e
- false
- end
-
- # Checks if a string of Ruby code opens a block.
- # This could either be something like `foo do |a|`
- # or a keyword that requires a matching `end`
- # like `if`, `begin`, or `case`.
- #
- # @param code [String] Ruby code to check
- # @return [Boolean]
- def block_opener?(code)
- valid_ruby?(code + "\nend") ||
- valid_ruby?(code + "\nwhen foo\nend")
- end
-
- # Checks if a string of Ruby code closes a block.
- # This is always `end` followed optionally by some method calls.
- #
- # @param code [String] Ruby code to check
- # @return [Boolean]
- def block_closer?(code)
- valid_ruby?("begin\n" + code)
- end
-
- # Checks if a string of Ruby code comes in the middle of a block.
- # This could be a keyword like `else`, `rescue`, or `when`,
- # or even `end` with a method call that takes a block.
- #
- # @param code [String] Ruby code to check
- # @return [Boolean]
- def mid_block?(code)
- return if valid_ruby?(code)
- valid_ruby?("if foo\n#{code}\nend") || # else, elsif
- valid_ruby?("begin\n#{code}\nend") || # rescue, ensure
- valid_ruby?("case foo\n#{code}\nend") # when
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/parser.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/parser.rb
deleted file mode 100644
index cf57c94060..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/parser.rb
+++ /dev/null
@@ -1,711 +0,0 @@
-require 'strscan'
-require 'haml/shared'
-
-module Haml
- module Parser
- include Haml::Util
-
- # Designates an XHTML/XML element.
- ELEMENT = ?%
-
- # Designates a `
` element with the given class.
- DIV_CLASS = ?.
-
- # Designates a `
` element with the given id.
- DIV_ID = ?#
-
- # Designates an XHTML/XML comment.
- COMMENT = ?/
-
- # Designates an XHTML doctype or script that is never HTML-escaped.
- DOCTYPE = ?!
-
- # Designates script, the result of which is output.
- SCRIPT = ?=
-
- # Designates script that is always HTML-escaped.
- SANITIZE = ?&
-
- # Designates script, the result of which is flattened and output.
- FLAT_SCRIPT = ?~
-
- # Designates script which is run but not output.
- SILENT_SCRIPT = ?-
-
- # When following SILENT_SCRIPT, designates a comment that is not output.
- SILENT_COMMENT = ?#
-
- # Designates a non-parsed line.
- ESCAPE = ?\\
-
- # Designates a block of filtered text.
- FILTER = ?:
-
- # Designates a non-parsed line. Not actually a character.
- PLAIN_TEXT = -1
-
- # Keeps track of the ASCII values of the characters that begin a
- # specially-interpreted line.
- SPECIAL_CHARACTERS = [
- ELEMENT,
- DIV_CLASS,
- DIV_ID,
- COMMENT,
- DOCTYPE,
- SCRIPT,
- SANITIZE,
- FLAT_SCRIPT,
- SILENT_SCRIPT,
- ESCAPE,
- FILTER
- ]
-
- # The value of the character that designates that a line is part
- # of a multiline string.
- MULTILINE_CHAR_VALUE = ?|
-
- MID_BLOCK_KEYWORDS = %w[else elsif rescue ensure end when]
- START_BLOCK_KEYWORDS = %w[if begin case]
- # Try to parse assignments to block starters as best as possible
- START_BLOCK_KEYWORD_REGEX = /(?:\w+(?:,\s*\w+)*\s*=\s*)?(#{START_BLOCK_KEYWORDS.join('|')})/
- BLOCK_KEYWORD_REGEX = /^-\s*(?:(#{MID_BLOCK_KEYWORDS.join('|')})|#{START_BLOCK_KEYWORD_REGEX.source})\b/
-
- # The Regex that matches a Doctype command.
- DOCTYPE_REGEX = /(\d(?:\.\d)?)?[\s]*([a-z]*)\s*([^ ]+)?/i
-
- # The Regex that matches a literal string or symbol value
- LITERAL_VALUE_REGEX = /:(\w*)|(["'])((?![\\#]|\2).|\\.)*\2/
-
- private
-
- # @private
- class Line < Struct.new(:text, :unstripped, :full, :index, :compiler, :eod)
- alias_method :eod?, :eod
-
- # @private
- def tabs
- line = self
- @tabs ||= compiler.instance_eval do
- break 0 if line.text.empty? || !(whitespace = line.full[/^\s+/])
-
- if @indentation.nil?
- @indentation = whitespace
-
- if @indentation.include?(?\s) && @indentation.include?(?\t)
- raise SyntaxError.new("Indentation can't use both tabs and spaces.", line.index)
- end
-
- @flat_spaces = @indentation * (@template_tabs+1) if flat?
- break 1
- end
-
- tabs = whitespace.length / @indentation.length
- break tabs if whitespace == @indentation * tabs
- break @template_tabs + 1 if flat? && whitespace =~ /^#{@flat_spaces}/
-
- raise SyntaxError.new(< 1
- raise SyntaxError.new("The line was indented #{@next_line.tabs - @line.tabs} levels deeper than the previous line.", @next_line.index)
- end
-
- @line = @next_line
- end
-
- # Close all the open tags
- close until @parent.type == :root
- @root
- end
-
- # Processes and deals with lowering indentation.
- def process_indent(line)
- return unless line.tabs <= @template_tabs && @template_tabs > 0
-
- to_close = @template_tabs - line.tabs
- to_close.times {|i| close unless to_close - 1 - i == 0 && mid_block_keyword?(line.text)}
- end
-
- # Processes a single line of Haml.
- #
- # This method doesn't return anything; it simply processes the line and
- # adds the appropriate code to `@precompiled`.
- def process_line(text, index)
- @index = index + 1
-
- case text[0]
- when DIV_CLASS; push div(text)
- when DIV_ID
- return push plain(text) if text[1] == ?{
- push div(text)
- when ELEMENT; push tag(text)
- when COMMENT; push comment(text[1..-1].strip)
- when SANITIZE
- return push plain(text[3..-1].strip, :escape_html) if text[1..2] == "=="
- return push script(text[2..-1].strip, :escape_html) if text[1] == SCRIPT
- return push flat_script(text[2..-1].strip, :escape_html) if text[1] == FLAT_SCRIPT
- return push plain(text[1..-1].strip, :escape_html) if text[1] == ?\s
- push plain(text)
- when SCRIPT
- return push plain(text[2..-1].strip) if text[1] == SCRIPT
- push script(text[1..-1])
- when FLAT_SCRIPT; push flat_script(text[1..-1])
- when SILENT_SCRIPT; push silent_script(text)
- when FILTER; push filter(text[1..-1].downcase)
- when DOCTYPE
- return push doctype(text) if text[0...3] == '!!!'
- return push plain(text[3..-1].strip, !:escape_html) if text[1..2] == "=="
- return push script(text[2..-1].strip, !:escape_html) if text[1] == SCRIPT
- return push flat_script(text[2..-1].strip, !:escape_html) if text[1] == FLAT_SCRIPT
- return push plain(text[1..-1].strip, !:escape_html) if text[1] == ?\s
- push plain(text)
- when ESCAPE; push plain(text[1..-1])
- else; push plain(text)
- end
- end
-
- def block_keyword(text)
- return unless keyword = text.scan(BLOCK_KEYWORD_REGEX)[0]
- keyword[0] || keyword[1]
- end
-
- def mid_block_keyword?(text)
- MID_BLOCK_KEYWORDS.include?(block_keyword(text))
- end
-
- def push(node)
- @parent.children << node
- node.parent = @parent
- end
-
- def plain(text, escape_html = nil)
- if block_opened?
- raise SyntaxError.new("Illegal nesting: nesting within plain text is illegal.", @next_line.index)
- end
-
- unless contains_interpolation?(text)
- return ParseNode.new(:plain, @index, :text => text)
- end
-
- escape_html = @options[:escape_html] if escape_html.nil?
- script(unescape_interpolation(text, escape_html), !:escape_html)
- end
-
- def script(text, escape_html = nil, preserve = false)
- raise SyntaxError.new("There's no Ruby code for = to evaluate.") if text.empty?
- text = handle_ruby_multiline(text)
- escape_html = @options[:escape_html] if escape_html.nil?
-
- ParseNode.new(:script, @index, :text => text, :escape_html => escape_html,
- :preserve => preserve)
- end
-
- def flat_script(text, escape_html = nil)
- raise SyntaxError.new("There's no Ruby code for ~ to evaluate.") if text.empty?
- script(text, escape_html, :preserve)
- end
-
- def silent_script(text)
- return haml_comment(text[2..-1]) if text[1] == SILENT_COMMENT
-
- raise SyntaxError.new(< text[1..-1], :keyword => keyword)
- end
-
- def haml_comment(text)
- @haml_comment = block_opened?
- ParseNode.new(:haml_comment, @index, :text => text)
- end
-
- def tag(line)
- tag_name, attributes, attributes_hashes, object_ref, nuke_outer_whitespace,
- nuke_inner_whitespace, action, value, last_line = parse_tag(line)
-
- preserve_tag = @options[:preserve].include?(tag_name)
- nuke_inner_whitespace ||= preserve_tag
- preserve_tag = false if @options[:ugly]
- escape_html = (action == '&' || (action != '!' && @options[:escape_html]))
-
- case action
- when '/'; self_closing = true
- when '~'; parse = preserve_script = true
- when '='
- parse = true
- if value[0] == ?=
- value = unescape_interpolation(value[1..-1].strip, escape_html)
- escape_html = false
- end
- when '&', '!'
- if value[0] == ?= || value[0] == ?~
- parse = true
- preserve_script = (value[0] == ?~)
- if value[1] == ?=
- value = unescape_interpolation(value[2..-1].strip, escape_html)
- escape_html = false
- else
- value = value[1..-1].strip
- end
- elsif contains_interpolation?(value)
- value = unescape_interpolation(value, escape_html)
- parse = true
- escape_html = false
- end
- else
- if contains_interpolation?(value)
- value = unescape_interpolation(value, escape_html)
- parse = true
- escape_html = false
- end
- end
-
- attributes = Parser.parse_class_and_id(attributes)
- attributes_list = []
-
- if attributes_hashes[:new]
- static_attributes, attributes_hash = attributes_hashes[:new]
- Buffer.merge_attrs(attributes, static_attributes) if static_attributes
- attributes_list << attributes_hash
- end
-
- if attributes_hashes[:old]
- static_attributes = parse_static_hash(attributes_hashes[:old])
- Buffer.merge_attrs(attributes, static_attributes) if static_attributes
- attributes_list << attributes_hashes[:old] unless static_attributes || @options[:suppress_eval]
- end
-
- attributes_list.compact!
-
- raise SyntaxError.new("Illegal nesting: nesting within a self-closing tag is illegal.", @next_line.index) if block_opened? && self_closing
- raise SyntaxError.new("There's no Ruby code for #{action} to evaluate.", last_line - 1) if parse && value.empty?
- raise SyntaxError.new("Self-closing tags can't have content.", last_line - 1) if self_closing && !value.empty?
-
- if block_opened? && !value.empty? && !is_ruby_multiline?(value)
- raise SyntaxError.new("Illegal nesting: content can't be both given on the same line as %#{tag_name} and nested within it.", @next_line.index)
- end
-
- self_closing ||= !!(!block_opened? && value.empty? && @options[:autoclose].any? {|t| t === tag_name})
- value = nil if value.empty? && (block_opened? || self_closing)
- value = handle_ruby_multiline(value) if parse
-
- ParseNode.new(:tag, @index, :name => tag_name, :attributes => attributes,
- :attributes_hashes => attributes_list, :self_closing => self_closing,
- :nuke_inner_whitespace => nuke_inner_whitespace,
- :nuke_outer_whitespace => nuke_outer_whitespace, :object_ref => object_ref,
- :escape_html => escape_html, :preserve_tag => preserve_tag,
- :preserve_script => preserve_script, :parse => parse, :value => value)
- end
-
- # Renders a line that creates an XHTML tag and has an implicit div because of
- # `.` or `#`.
- def div(line)
- tag('%div' + line)
- end
-
- # Renders an XHTML comment.
- def comment(line)
- conditional, line = balance(line, ?[, ?]) if line[0] == ?[
- line.strip!
- conditional << ">" if conditional
-
- if block_opened? && !line.empty?
- raise SyntaxError.new('Illegal nesting: nesting within a tag that already has content is illegal.', @next_line.index)
- end
-
- ParseNode.new(:comment, @index, :conditional => conditional, :text => line)
- end
-
- # Renders an XHTML doctype or XML shebang.
- def doctype(line)
- raise SyntaxError.new("Illegal nesting: nesting within a header command is illegal.", @next_line.index) if block_opened?
- version, type, encoding = line[3..-1].strip.downcase.scan(DOCTYPE_REGEX)[0]
- ParseNode.new(:doctype, @index, :version => version, :type => type, :encoding => encoding)
- end
-
- def filter(name)
- raise Error.new("Invalid filter name \":#{name}\".") unless name =~ /^\w+$/
-
- @filter_buffer = String.new
-
- if filter_opened?
- @flat = true
- # If we don't know the indentation by now, it'll be set in Line#tabs
- @flat_spaces = @indentation * (@template_tabs+1) if @indentation
- end
-
- ParseNode.new(:filter, @index, :name => name, :text => @filter_buffer)
- end
-
- def close
- node, @parent = @parent, @parent.parent
- @template_tabs -= 1
- send("close_#{node.type}", node) if respond_to?("close_#{node.type}", :include_private)
- end
-
- def close_filter(_)
- @flat = false
- @flat_spaces = nil
- @filter_buffer = nil
- end
-
- def close_haml_comment(_)
- @haml_comment = false
- end
-
- def close_silent_script(node)
- # Post-process case statements to normalize the nesting of "when" clauses
- return unless node.value[:keyword] == "case"
- return unless first = node.children.first
- return unless first.type == :silent_script && first.value[:keyword] == "when"
- return if first.children.empty?
- # If the case node has a "when" child with children, it's the
- # only child. Then we want to put everything nested beneath it
- # beneath the case itself (just like "if").
- node.children = [first, *first.children]
- first.children = []
- end
-
- # This is a class method so it can be accessed from {Haml::Helpers}.
- #
- # Iterates through the classes and ids supplied through `.`
- # and `#` syntax, and returns a hash with them as attributes,
- # that can then be merged with another attributes hash.
- def self.parse_class_and_id(list)
- attributes = {}
- list.scan(/([#.])([-:_a-zA-Z0-9]+)/) do |type, property|
- case type
- when '.'
- if attributes['class']
- attributes['class'] += " "
- else
- attributes['class'] = ""
- end
- attributes['class'] += property
- when '#'; attributes['id'] = property
- end
- end
- attributes
- end
-
- def parse_static_hash(text)
- attributes = {}
- scanner = StringScanner.new(text)
- scanner.scan(/\s+/)
- until scanner.eos?
- return unless key = scanner.scan(LITERAL_VALUE_REGEX)
- return unless scanner.scan(/\s*=>\s*/)
- return unless value = scanner.scan(LITERAL_VALUE_REGEX)
- return unless scanner.scan(/\s*(?:,|$)\s*/)
- attributes[eval(key).to_s] = eval(value).to_s
- end
- attributes
- end
-
- # Parses a line into tag_name, attributes, attributes_hash, object_ref, action, value
- def parse_tag(line)
- raise SyntaxError.new("Invalid tag: \"#{line}\".") unless match = line.scan(/%([-:\w]+)([-:\w\.\#]*)(.*)/)[0]
-
- tag_name, attributes, rest = match
- raise SyntaxError.new("Illegal element: classes and ids must have values.") if attributes =~ /[\.#](\.|#|\z)/
-
- new_attributes_hash = old_attributes_hash = last_line = nil
- object_ref = "nil"
- attributes_hashes = {}
- while rest
- case rest[0]
- when ?{
- break if old_attributes_hash
- old_attributes_hash, rest, last_line = parse_old_attributes(rest)
- attributes_hashes[:old] = old_attributes_hash
- when ?(
- break if new_attributes_hash
- new_attributes_hash, rest, last_line = parse_new_attributes(rest)
- attributes_hashes[:new] = new_attributes_hash
- when ?[
- break unless object_ref == "nil"
- object_ref, rest = balance(rest, ?[, ?])
- else; break
- end
- end
-
- if rest
- nuke_whitespace, action, value = rest.scan(/(<>|><|[><])?([=\/\~&!])?(.*)?/)[0]
- nuke_whitespace ||= ''
- nuke_outer_whitespace = nuke_whitespace.include? '>'
- nuke_inner_whitespace = nuke_whitespace.include? '<'
- end
-
- value = value.to_s.strip
- [tag_name, attributes, attributes_hashes, object_ref, nuke_outer_whitespace,
- nuke_inner_whitespace, action, value, last_line || @index]
- end
-
- def parse_old_attributes(line)
- line = line.dup
- last_line = @index
-
- begin
- attributes_hash, rest = balance(line, ?{, ?})
- rescue SyntaxError => e
- if line.strip[-1] == ?, && e.message == "Unbalanced brackets."
- line << "\n" << @next_line.text
- last_line += 1
- next_line
- retry
- end
-
- raise e
- end
-
- attributes_hash = attributes_hash[1...-1] if attributes_hash
- return attributes_hash, rest, last_line
- end
-
- def parse_new_attributes(line)
- line = line.dup
- scanner = StringScanner.new(line)
- last_line = @index
- attributes = {}
-
- scanner.scan(/\(\s*/)
- loop do
- name, value = parse_new_attribute(scanner)
- break if name.nil?
-
- if name == false
- text = (Haml::Shared.balance(line, ?(, ?)) || [line]).first
- raise Haml::SyntaxError.new("Invalid attribute list: #{text.inspect}.", last_line - 1)
- end
- attributes[name] = value
- scanner.scan(/\s*/)
-
- if scanner.eos?
- line << " " << @next_line.text
- last_line += 1
- next_line
- scanner.scan(/\s*/)
- end
- end
-
- static_attributes = {}
- dynamic_attributes = "{"
- attributes.each do |name, (type, val)|
- if type == :static
- static_attributes[name] = val
- else
- dynamic_attributes << inspect_obj(name) << " => " << val << ","
- end
- end
- dynamic_attributes << "}"
- dynamic_attributes = nil if dynamic_attributes == "{}"
-
- return [static_attributes, dynamic_attributes], scanner.rest, last_line
- end
-
- def parse_new_attribute(scanner)
- unless name = scanner.scan(/[-:\w]+/)
- return if scanner.scan(/\)/)
- return false
- end
-
- scanner.scan(/\s*/)
- return name, [:static, true] unless scanner.scan(/=/) #/end
-
- scanner.scan(/\s*/)
- unless quote = scanner.scan(/["']/)
- return false unless var = scanner.scan(/(@@?|\$)?\w+/)
- return name, [:dynamic, var]
- end
-
- re = /((?:\\.|\#(?!\{)|[^#{quote}\\#])*)(#{quote}|#\{)/
- content = []
- loop do
- return false unless scanner.scan(re)
- content << [:str, scanner[1].gsub(/\\(.)/, '\1')]
- break if scanner[2] == quote
- content << [:ruby, balance(scanner, ?{, ?}, 1).first[0...-1]]
- end
-
- return name, [:static, content.first[1]] if content.size == 1
- return name, [:dynamic,
- '"' + content.map {|(t, v)| t == :str ? inspect_obj(v)[1...-1] : "\#{#{v}}"}.join + '"']
- end
-
- def raw_next_line
- text = @template.shift
- return unless text
-
- index = @template_index
- @template_index += 1
-
- return text, index
- end
-
- def next_line
- text, index = raw_next_line
- return unless text
-
- # :eod is a special end-of-document marker
- line =
- if text == :eod
- Line.new '-#', '-#', '-#', index, self, true
- else
- Line.new text.strip, text.lstrip.chomp, text, index, self, false
- end
-
- # `flat?' here is a little outdated,
- # so we have to manually check if either the previous or current line
- # closes the flat block, as well as whether a new block is opened.
- @line.tabs if @line
- unless (flat? && !closes_flat?(line) && !closes_flat?(@line)) ||
- (@line && @line.text[0] == ?: && line.full =~ %r[^#{@line.full[/^\s+/]}\s])
- return next_line if line.text.empty?
-
- handle_multiline(line)
- end
-
- @next_line = line
- end
-
- def closes_flat?(line)
- line && !line.text.empty? && line.full !~ /^#{@flat_spaces}/
- end
-
- def un_next_line(line)
- @template.unshift line
- @template_index -= 1
- end
-
- def handle_multiline(line)
- return unless is_multiline?(line.text)
- line.text.slice!(-1)
- while new_line = raw_next_line.first
- break if new_line == :eod
- next if new_line.strip.empty?
- break unless is_multiline?(new_line.strip)
- line.text << new_line.strip[0...-1]
- end
- un_next_line new_line
- end
-
- # Checks whether or not `line` is in a multiline sequence.
- def is_multiline?(text)
- text && text.length > 1 && text[-1] == MULTILINE_CHAR_VALUE && text[-2] == ?\s
- end
-
- def handle_ruby_multiline(text)
- text = text.rstrip
- return text unless is_ruby_multiline?(text)
- un_next_line @next_line.full
- begin
- new_line = raw_next_line.first
- break if new_line == :eod
- next if new_line.strip.empty?
- text << " " << new_line.strip
- end while is_ruby_multiline?(new_line.strip)
- next_line
- text
- end
-
- def is_ruby_multiline?(text)
- text && text.length > 1 && text[-1] == ?, && text[-2] != ?? && text[-3..-2] != "?\\"
- end
-
- def contains_interpolation?(str)
- str.include?('#{')
- end
-
- def unescape_interpolation(str, escape_html = nil)
- res = ''
- rest = Haml::Shared.handle_interpolation str.dump do |scan|
- escapes = (scan[2].size - 1) / 2
- res << scan.matched[0...-3 - escapes]
- if escapes % 2 == 1
- res << '#{'
- else
- content = eval('"' + balance(scan, ?{, ?}, 1)[0][0...-1] + '"')
- content = "Haml::Helpers.html_escape((#{content}))" if escape_html
- res << '#{' + content + "}"# Use eval to get rid of string escapes
- end
- end
- res + rest
- end
-
- def balance(*args)
- res = Haml::Shared.balance(*args)
- return res if res
- raise SyntaxError.new("Unbalanced brackets.")
- end
-
- def block_opened?
- @next_line.tabs > @line.tabs
- end
-
- # Same semantics as block_opened?, except that block_opened? uses Line#tabs,
- # which doesn't interact well with filter lines
- def filter_opened?
- @next_line.full =~ (@indentation ? /^#{@indentation * @template_tabs}/ : /^\s/)
- end
-
- def flat?
- @flat
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/railtie.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/railtie.rb
deleted file mode 100644
index 818cc352ea..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/railtie.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-if Haml::Util.ap_geq_3? && !Haml::Util.ap_geq?("3.0.0.beta4")
- raise < Object}]
- attr_accessor :options
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/template/patch.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/template/patch.rb
deleted file mode 100644
index 0c219c4e3c..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/template/patch.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-# This file makes Haml work with Rails
-# by monkeypatching the core template-compilation methods.
-# This is necessary for versions <= 2.0.1 because the template handler API
-# wasn't sufficiently powerful to deal with caching and so forth.
-
-# This module refers to the ActionView module that's part of Ruby on Rails.
-# Haml can be used as an alternate templating engine for it,
-# and includes several modifications to make it more Haml-friendly.
-# The documentation can be found
-# here[http://rubyonrails.org/api/classes/ActionView/Base.html].
-module ActionView
- class Base
- def delegate_template_exists_with_haml(template_path)
- template_exists?(template_path, :haml) && [:haml]
- end
- alias_method :delegate_template_exists_without_haml, :delegate_template_exists?
- alias_method :delegate_template_exists?, :delegate_template_exists_with_haml
-
- def compile_template_with_haml(extension, template, file_name, local_assigns)
- return compile_haml(template, file_name, local_assigns) if extension.to_s == "haml"
- compile_template_without_haml(extension, template, file_name, local_assigns)
- end
- alias_method :compile_template_without_haml, :compile_template
- alias_method :compile_template, :compile_template_with_haml
-
- def compile_haml(template, file_name, local_assigns)
- render_symbol = assign_method_name(:haml, template, file_name)
- locals = local_assigns.keys
-
- @@template_args[render_symbol] ||= {}
- locals_keys = @@template_args[render_symbol].keys | locals
- @@template_args[render_symbol] = Haml::Util.to_hash(locals_keys.map {|k| [k, true]})
-
- options = Haml::Template.options.dup
- options[:filename] = file_name || 'compiled-template'
-
- begin
- Haml::Engine.new(template, options).def_method(CompiledTemplates, render_symbol, *locals_keys)
- rescue Exception => e
- if logger
- logger.debug "ERROR: compiling #{render_symbol} RAISED #{e}"
- logger.debug "Backtrace: #{e.backtrace.join("\n")}"
- end
-
- base_path = if defined?(extract_base_path_from)
- # Rails 2.0.x
- extract_base_path_from(file_name) || view_paths.first
- else
- # Rails <=1.2.6
- @base_path
- end
- raise ActionView::TemplateError.new(base_path, file_name || template, @assigns, template, e)
- end
-
- @@compile_time[render_symbol] = Time.now
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/template/plugin.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/template/plugin.rb
deleted file mode 100644
index 734cab8ba5..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/template/plugin.rb
+++ /dev/null
@@ -1,123 +0,0 @@
-# This file makes Haml work with Rails
-# using the > 2.0.1 template handler API.
-
-module Haml
- # In Rails 3.1+, template handlers don't inherit from anything. In <= 3.0, they do.
- # To avoid messy logic figuring this out, we just inherit from whatever the ERB handler does.
- class Plugin < Haml::Util.av_template_class(:Handlers)::ERB.superclass
- if ((defined?(ActionView::TemplateHandlers) &&
- defined?(ActionView::TemplateHandlers::Compilable)) ||
- (defined?(ActionView::Template) &&
- defined?(ActionView::Template::Handlers) &&
- defined?(ActionView::Template::Handlers::Compilable))) &&
- # In Rails 3.1+, we don't need to include Compilable.
- Haml::Util.av_template_class(:Handlers)::ERB.include?(
- Haml::Util.av_template_class(:Handlers)::Compilable)
- include Haml::Util.av_template_class(:Handlers)::Compilable
- end
-
- def handles_encoding?; true; end
-
- def compile(template)
- options = Haml::Template.options.dup
-
- # template is a template object in Rails >=2.1.0,
- # a source string previously
- if template.respond_to? :source
- # Template has a generic identifier in Rails >=3.0.0
- options[:filename] = template.respond_to?(:identifier) ? template.identifier : template.filename
- source = template.source
- else
- source = template
- end
-
- Haml::Engine.new(source, options).send(:precompiled_with_ambles, [])
- end
-
- # In Rails 3.1+, #call takes the place of #compile
- def self.call(template)
- new.compile(template)
- end
-
- def cache_fragment(block, name = {}, options = nil)
- @view.fragment_for(block, name, options) do
- eval("_hamlout.buffer", block.binding)
- end
- end
- end
-
- # Rails 3.0 prints a deprecation warning when block helpers
- # return strings that go unused.
- # We want to print the same deprecation warning,
- # so we have to compile in a method call to check for it.
- #
- # I don't like having this in the compilation pipeline,
- # and I'd like to get rid of it once Rails 3.1 is well-established.
- if defined?(ActionView::OutputBuffer) &&
- Haml::Util.has?(:instance_method, ActionView::OutputBuffer, :append_if_string=)
- module Compiler
- def compile_silent_script_with_haml_block_deprecation(&block)
- unless block && !@node.value[:keyword] &&
- @node.value[:text] =~ ActionView::Template::Handlers::Erubis::BLOCK_EXPR
- return compile_silent_script_without_haml_block_deprecation(&block)
- end
-
- @node.value[:text] = "_hamlout.append_if_string= #{@node.value[:text]}"
- compile_silent_script_without_haml_block_deprecation(&block)
- end
- alias_method :compile_silent_script_without_haml_block_deprecation, :compile_silent_script
- alias_method :compile_silent_script, :compile_silent_script_with_haml_block_deprecation
- end
-
- class Buffer
- def append_if_string=(value)
- if value.is_a?(String) && !value.is_a?(ActionView::NonConcattingString)
- ActiveSupport::Deprecation.warn("- style block helpers are deprecated. Please use =", caller)
- buffer << value
- end
- end
- end
- end
-end
-
-if defined? ActionView::Template and ActionView::Template.respond_to? :register_template_handler
- ActionView::Template
-else
- ActionView::Base
-end.register_template_handler(:haml, Haml::Plugin)
-
-# In Rails 2.0.2, ActionView::TemplateError took arguments
-# that we can't fill in from the Haml::Plugin context.
-# Thus, we've got to monkeypatch ActionView::Base to catch the error.
-if defined?(ActionView::TemplateError) &&
- ActionView::TemplateError.instance_method(:initialize).arity == 5
- class ActionView::Base
- def compile_template(handler, template, file_name, local_assigns)
- render_symbol = assign_method_name(handler, template, file_name)
-
- # Move begin up two lines so it captures compilation exceptions.
- begin
- render_source = create_template_source(handler, template, render_symbol, local_assigns.keys)
- line_offset = @@template_args[render_symbol].size + handler.line_offset
-
- file_name = 'compiled-template' if file_name.blank?
- CompiledTemplates.module_eval(render_source, file_name, -line_offset)
- rescue Exception => e # errors from template code
- if logger
- logger.debug "ERROR: compiling #{render_symbol} RAISED #{e}"
- logger.debug "Function body: #{render_source}"
- logger.debug "Backtrace: #{e.backtrace.join("\n")}"
- end
-
- # There's no way to tell Haml about the filename,
- # so we've got to insert it ourselves.
- e.backtrace[0].gsub!('(haml)', file_name) if e.is_a?(Haml::Error)
-
- raise ActionView::TemplateError.new(extract_base_path_from(file_name) || view_paths.first, file_name || template, @assigns, template, e)
- end
-
- @@compile_time[render_symbol] = Time.now
- # logger.debug "Compiled template #{file_name || template}\n ==> #{render_symbol}" if logger
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/util.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/util.rb
deleted file mode 100644
index 7e7b887146..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/util.rb
+++ /dev/null
@@ -1,842 +0,0 @@
-require 'erb'
-require 'set'
-require 'enumerator'
-require 'stringio'
-require 'strscan'
-require 'rbconfig'
-
-require 'haml/root'
-
-module Haml
- # A module containing various useful functions.
- module Util
- extend self
-
- # An array of ints representing the Ruby version number.
- # @api public
- RUBY_VERSION = ::RUBY_VERSION.split(".").map {|s| s.to_i}
-
- # The Ruby engine we're running under. Defaults to `"ruby"`
- # if the top-level constant is undefined.
- # @api public
- RUBY_ENGINE = defined?(::RUBY_ENGINE) ? ::RUBY_ENGINE : "ruby"
-
- # Returns the path of a file relative to the Haml root directory.
- #
- # @param file [String] The filename relative to the Haml root
- # @return [String] The filename relative to the the working directory
- def scope(file)
- File.join(Haml::ROOT_DIR, file)
- end
-
- # Converts an array of `[key, value]` pairs to a hash.
- #
- # @example
- # to_hash([[:foo, "bar"], [:baz, "bang"]])
- # #=> {:foo => "bar", :baz => "bang"}
- # @param arr [Array<(Object, Object)>] An array of pairs
- # @return [Hash] A hash
- def to_hash(arr)
- Hash[arr.compact]
- end
-
- # Maps the keys in a hash according to a block.
- #
- # @example
- # map_keys({:foo => "bar", :baz => "bang"}) {|k| k.to_s}
- # #=> {"foo" => "bar", "baz" => "bang"}
- # @param hash [Hash] The hash to map
- # @yield [key] A block in which the keys are transformed
- # @yieldparam key [Object] The key that should be mapped
- # @yieldreturn [Object] The new value for the key
- # @return [Hash] The mapped hash
- # @see #map_vals
- # @see #map_hash
- def map_keys(hash)
- to_hash(hash.map {|k, v| [yield(k), v]})
- end
-
- # Maps the values in a hash according to a block.
- #
- # @example
- # map_values({:foo => "bar", :baz => "bang"}) {|v| v.to_sym}
- # #=> {:foo => :bar, :baz => :bang}
- # @param hash [Hash] The hash to map
- # @yield [value] A block in which the values are transformed
- # @yieldparam value [Object] The value that should be mapped
- # @yieldreturn [Object] The new value for the value
- # @return [Hash] The mapped hash
- # @see #map_keys
- # @see #map_hash
- def map_vals(hash)
- to_hash(hash.map {|k, v| [k, yield(v)]})
- end
-
- # Maps the key-value pairs of a hash according to a block.
- #
- # @example
- # map_hash({:foo => "bar", :baz => "bang"}) {|k, v| [k.to_s, v.to_sym]}
- # #=> {"foo" => :bar, "baz" => :bang}
- # @param hash [Hash] The hash to map
- # @yield [key, value] A block in which the key-value pairs are transformed
- # @yieldparam [key] The hash key
- # @yieldparam [value] The hash value
- # @yieldreturn [(Object, Object)] The new value for the `[key, value]` pair
- # @return [Hash] The mapped hash
- # @see #map_keys
- # @see #map_vals
- def map_hash(hash, &block)
- to_hash(hash.map(&block))
- end
-
- # Computes the powerset of the given array.
- # This is the set of all subsets of the array.
- #
- # @example
- # powerset([1, 2, 3]) #=>
- # Set[Set[], Set[1], Set[2], Set[3], Set[1, 2], Set[2, 3], Set[1, 3], Set[1, 2, 3]]
- # @param arr [Enumerable]
- # @return [Set] The subsets of `arr`
- def powerset(arr)
- arr.inject([Set.new].to_set) do |powerset, el|
- new_powerset = Set.new
- powerset.each do |subset|
- new_powerset << subset
- new_powerset << subset + [el]
- end
- new_powerset
- end
- end
-
- # Restricts a number to falling within a given range.
- # Returns the number if it falls within the range,
- # or the closest value in the range if it doesn't.
- #
- # @param value [Numeric]
- # @param range [Range]
- # @return [Numeric]
- def restrict(value, range)
- [[value, range.first].max, range.last].min
- end
-
- # Concatenates all strings that are adjacent in an array,
- # while leaving other elements as they are.
- #
- # @example
- # merge_adjacent_strings([1, "foo", "bar", 2, "baz"])
- # #=> [1, "foobar", 2, "baz"]
- # @param arr [Array]
- # @return [Array] The enumerable with strings merged
- def merge_adjacent_strings(arr)
- # Optimize for the common case of one element
- return arr if arr.size < 2
- arr.inject([]) do |a, e|
- if e.is_a?(String)
- if a.last.is_a?(String)
- a.last << e
- else
- a << e.dup
- end
- else
- a << e
- end
- a
- end
- end
-
- # Intersperses a value in an enumerable, as would be done with `Array#join`
- # but without concatenating the array together afterwards.
- #
- # @param enum [Enumerable]
- # @param val
- # @return [Array]
- def intersperse(enum, val)
- enum.inject([]) {|a, e| a << e << val}[0...-1]
- end
-
- # Substitutes a sub-array of one array with another sub-array.
- #
- # @param ary [Array] The array in which to make the substitution
- # @param from [Array] The sequence of elements to replace with `to`
- # @param to [Array] The sequence of elements to replace `from` with
- def substitute(ary, from, to)
- res = ary.dup
- i = 0
- while i < res.size
- if res[i...i+from.size] == from
- res[i...i+from.size] = to
- end
- i += 1
- end
- res
- end
-
- # Destructively strips whitespace from the beginning and end
- # of the first and last elements, respectively,
- # in the array (if those elements are strings).
- #
- # @param arr [Array]
- # @return [Array] `arr`
- def strip_string_array(arr)
- arr.first.lstrip! if arr.first.is_a?(String)
- arr.last.rstrip! if arr.last.is_a?(String)
- arr
- end
-
- # Return an array of all possible paths through the given arrays.
- #
- # @param arrs [Array]
- # @return [Array]
- #
- # @example
- # paths([[1, 2], [3, 4], [5]]) #=>
- # # [[1, 3, 5],
- # # [2, 3, 5],
- # # [1, 4, 5],
- # # [2, 4, 5]]
- def paths(arrs)
- arrs.inject([[]]) do |paths, arr|
- flatten(arr.map {|e| paths.map {|path| path + [e]}}, 1)
- end
- end
-
- # Computes a single longest common subsequence for `x` and `y`.
- # If there are more than one longest common subsequences,
- # the one returned is that which starts first in `x`.
- #
- # @param x [Array]
- # @param y [Array]
- # @yield [a, b] An optional block to use in place of a check for equality
- # between elements of `x` and `y`.
- # @yieldreturn [Object, nil] If the two values register as equal,
- # this will return the value to use in the LCS array.
- # @return [Array] The LCS
- def lcs(x, y, &block)
- x = [nil, *x]
- y = [nil, *y]
- block ||= proc {|a, b| a == b && a}
- lcs_backtrace(lcs_table(x, y, &block), x, y, x.size-1, y.size-1, &block)
- end
-
- # Returns information about the caller of the previous method.
- #
- # @param entry [String] An entry in the `#caller` list, or a similarly formatted string
- # @return [[String, Fixnum, (String, nil)]] An array containing the filename, line, and method name of the caller.
- # The method name may be nil
- def caller_info(entry = caller[1])
- info = entry.scan(/^(.*?):(-?.*?)(?::.*`(.+)')?$/).first
- info[1] = info[1].to_i
- # This is added by Rubinius to designate a block, but we don't care about it.
- info[2].sub!(/ \{\}\Z/, '') if info[2]
- info
- end
-
- # Returns whether one version string represents a more recent version than another.
- #
- # @param v1 [String] A version string.
- # @param v2 [String] Another version string.
- # @return [Boolean]
- def version_gt(v1, v2)
- # Construct an array to make sure the shorter version is padded with nil
- Array.new([v1.length, v2.length].max).zip(v1.split("."), v2.split(".")) do |_, p1, p2|
- p1 ||= "0"
- p2 ||= "0"
- release1 = p1 =~ /^[0-9]+$/
- release2 = p2 =~ /^[0-9]+$/
- if release1 && release2
- # Integer comparison if both are full releases
- p1, p2 = p1.to_i, p2.to_i
- next if p1 == p2
- return p1 > p2
- elsif !release1 && !release2
- # String comparison if both are prereleases
- next if p1 == p2
- return p1 > p2
- else
- # If only one is a release, that one is newer
- return release1
- end
- end
- end
-
- # Returns whether one version string represents the same or a more
- # recent version than another.
- #
- # @param v1 [String] A version string.
- # @param v2 [String] Another version string.
- # @return [Boolean]
- def version_geq(v1, v2)
- version_gt(v1, v2) || !version_gt(v2, v1)
- end
-
- # A wrapper for `Marshal.dump` that calls `#_before_dump` on the object
- # before dumping it, `#_after_dump` afterwards.
- # It also calls `#_around_dump` and passes it a block in which the object is dumped.
- #
- # If any of these methods are undefined, they are not called.
- #
- # @param obj [Object] The object to dump.
- # @return [String] The dumped data.
- def dump(obj)
- obj._before_dump if obj.respond_to?(:_before_dump)
- return Marshal.dump(obj) unless obj.respond_to?(:_around_dump)
- res = nil
- obj._around_dump {res = Marshal.dump(obj)}
- res
- ensure
- obj._after_dump if obj.respond_to?(:_after_dump)
- end
-
- # A wrapper for `Marshal.load` that calls `#_after_load` on the object
- # after loading it, if it's defined.
- #
- # @param data [String] The data to load.
- # @return [Object] The loaded object.
- def load(data)
- obj = Marshal.load(data)
- obj._after_load if obj.respond_to?(:_after_load)
- obj
- end
-
- # Throws a NotImplementedError for an abstract method.
- #
- # @param obj [Object] `self`
- # @raise [NotImplementedError]
- def abstract(obj)
- raise NotImplementedError.new("#{obj.class} must implement ##{caller_info[2]}")
- end
-
- # Silence all output to STDERR within a block.
- #
- # @yield A block in which no output will be printed to STDERR
- def silence_warnings
- the_real_stderr, $stderr = $stderr, StringIO.new
- yield
- ensure
- $stderr = the_real_stderr
- end
-
- @@silence_warnings = false
- # Silences all Haml warnings within a block.
- #
- # @yield A block in which no Haml warnings will be printed
- def silence_haml_warnings
- old_silence_warnings = @@silence_warnings
- @@silence_warnings = true
- yield
- ensure
- @@silence_warnings = old_silence_warnings
- end
-
- # The same as `Kernel#warn`, but is silenced by \{#silence\_haml\_warnings}.
- #
- # @param msg [String]
- def haml_warn(msg)
- return if @@silence_warnings
- warn(msg)
- end
-
- # Try loading Sass. If the `sass` gem isn't installed,
- # print a warning and load from the vendored gem.
- #
- # @return [Boolean] True if Sass was successfully loaded from the `sass` gem,
- # false otherwise.
- def try_sass
- return true if defined?(::SASS_BEGUN_TO_LOAD)
- begin
- require 'sass/version'
- loaded = Sass.respond_to?(:version) && Sass.version[:major] &&
- Sass.version[:minor] && ((Sass.version[:major] > 3 && Sass.version[:minor] > 1) ||
- ((Sass.version[:major] == 3 && Sass.version[:minor] == 1) &&
- (Sass.version[:prerelease] || Sass.version[:name] != "Bleeding Edge")))
- rescue LoadError => e
- loaded = false
- end
-
- unless loaded
- haml_warn(<= 3
- return false unless defined?(ActionPack) && defined?(ActionPack::VERSION) &&
- defined?(ActionPack::VERSION::STRING)
-
- version_geq(ActionPack::VERSION::STRING, version)
- end
-
- # Returns an ActionView::Template* class.
- # In pre-3.0 versions of Rails, most of these classes
- # were of the form `ActionView::TemplateFoo`,
- # while afterwards they were of the form `ActionView;:Template::Foo`.
- #
- # @param name [#to_s] The name of the class to get.
- # For example, `:Error` will return `ActionView::TemplateError`
- # or `ActionView::Template::Error`.
- def av_template_class(name)
- return ActionView.const_get("Template#{name}") if ActionView.const_defined?("Template#{name}")
- return ActionView::Template.const_get(name.to_s)
- end
-
- ## Rails XSS Safety
-
- # Whether or not ActionView's XSS protection is available and enabled,
- # as is the default for Rails 3.0+, and optional for version 2.3.5+.
- # Overridden in haml/template.rb if this is the case.
- #
- # @return [Boolean]
- def rails_xss_safe?
- false
- end
-
- # Returns the given text, marked as being HTML-safe.
- # With older versions of the Rails XSS-safety mechanism,
- # this destructively modifies the HTML-safety of `text`.
- #
- # @param text [String, nil]
- # @return [String, nil] `text`, marked as HTML-safe
- def html_safe(text)
- return unless text
- return text.html_safe if defined?(ActiveSupport::SafeBuffer)
- text.html_safe!
- end
-
- # Assert that a given object (usually a String) is HTML safe
- # according to Rails' XSS handling, if it's loaded.
- #
- # @param text [Object]
- def assert_html_safe!(text)
- return unless rails_xss_safe? && text && !text.to_s.html_safe?
- raise Haml::Error.new("Expected #{text.inspect} to be HTML-safe.")
- end
-
- # The class for the Rails SafeBuffer XSS protection class.
- # This varies depending on Rails version.
- #
- # @return [Class]
- def rails_safe_buffer_class
- # It's important that we check ActiveSupport first,
- # because in Rails 2.3.6 ActionView::SafeBuffer exists
- # but is a deprecated proxy object.
- return ActiveSupport::SafeBuffer if defined?(ActiveSupport::SafeBuffer)
- return ActionView::SafeBuffer
- end
-
- ## Cross-OS Compatibility
-
- # Whether or not this is running on Windows.
- #
- # @return [Boolean]
- def windows?
- RbConfig::CONFIG['host_os'] =~ /mswin|windows|mingw/i
- end
-
- # Whether or not this is running on IronRuby.
- #
- # @return [Boolean]
- def ironruby?
- RUBY_ENGINE == "ironruby"
- end
-
- ## Cross-Ruby-Version Compatibility
-
- # Whether or not this is running under Ruby 1.8 or lower.
- #
- # Note that IronRuby counts as Ruby 1.8,
- # because it doesn't support the Ruby 1.9 encoding API.
- #
- # @return [Boolean]
- def ruby1_8?
- # IronRuby says its version is 1.9, but doesn't support any of the encoding APIs.
- # We have to fall back to 1.8 behavior.
- ironruby? || (Haml::Util::RUBY_VERSION[0] == 1 && Haml::Util::RUBY_VERSION[1] < 9)
- end
-
- # Whether or not this is running under Ruby 1.8.6 or lower.
- # Note that lower versions are not officially supported.
- #
- # @return [Boolean]
- def ruby1_8_6?
- ruby1_8? && Haml::Util::RUBY_VERSION[2] < 7
- end
-
- # Checks that the encoding of a string is valid in Ruby 1.9
- # and cleans up potential encoding gotchas like the UTF-8 BOM.
- # If it's not, yields an error string describing the invalid character
- # and the line on which it occurrs.
- #
- # @param str [String] The string of which to check the encoding
- # @yield [msg] A block in which an encoding error can be raised.
- # Only yields if there is an encoding error
- # @yieldparam msg [String] The error message to be raised
- # @return [String] `str`, potentially with encoding gotchas like BOMs removed
- def check_encoding(str)
- if ruby1_8?
- return str.gsub(/\A\xEF\xBB\xBF/, '') # Get rid of the UTF-8 BOM
- elsif str.valid_encoding?
- # Get rid of the Unicode BOM if possible
- if str.encoding.name =~ /^UTF-(8|16|32)(BE|LE)?$/
- return str.gsub(Regexp.new("\\A\uFEFF".encode(str.encoding.name)), '')
- else
- return str
- end
- end
-
- encoding = str.encoding
- newlines = Regexp.new("\r\n|\r|\n".encode(encoding).force_encoding("binary"))
- str.force_encoding("binary").split(newlines).each_with_index do |line, i|
- begin
- line.encode(encoding)
- rescue Encoding::UndefinedConversionError => e
- yield < true
- #
- # Method collections like `Class#instance_methods`
- # return strings in Ruby 1.8 and symbols in Ruby 1.9 and on,
- # so this handles checking for them in a compatible way.
- #
- # @param attr [#to_s] The (singular) name of the method-collection method
- # (e.g. `:instance_methods`, `:private_methods`)
- # @param klass [Module] The class to check the methods of which to check
- # @param method [String, Symbol] The name of the method do check for
- # @return [Boolean] Whether or not the given collection has the given method
- def has?(attr, klass, method)
- klass.send("#{attr}s").include?(ruby1_8? ? method.to_s : method.to_sym)
- end
-
- # A version of `Enumerable#enum_with_index` that works in Ruby 1.8 and 1.9.
- #
- # @param enum [Enumerable] The enumerable to get the enumerator for
- # @return [Enumerator] The with-index enumerator
- def enum_with_index(enum)
- ruby1_8? ? enum.enum_with_index : enum.each_with_index
- end
-
- # A version of `Enumerable#enum_cons` that works in Ruby 1.8 and 1.9.
- #
- # @param enum [Enumerable] The enumerable to get the enumerator for
- # @param n [Fixnum] The size of each cons
- # @return [Enumerator] The consed enumerator
- def enum_cons(enum, n)
- ruby1_8? ? enum.enum_cons(n) : enum.each_cons(n)
- end
-
- # A version of `Enumerable#enum_slice` that works in Ruby 1.8 and 1.9.
- #
- # @param enum [Enumerable] The enumerable to get the enumerator for
- # @param n [Fixnum] The size of each slice
- # @return [Enumerator] The consed enumerator
- def enum_slice(enum, n)
- ruby1_8? ? enum.enum_slice(n) : enum.each_slice(n)
- end
-
- # Returns the ASCII code of the given character.
- #
- # @param c [String] All characters but the first are ignored.
- # @return [Fixnum] The ASCII code of `c`.
- def ord(c)
- ruby1_8? ? c[0] : c.ord
- end
-
- # Flattens the first `n` nested arrays in a cross-version manner.
- #
- # @param arr [Array] The array to flatten
- # @param n [Fixnum] The number of levels to flatten
- # @return [Array] The flattened array
- def flatten(arr, n)
- return arr.flatten(n) unless ruby1_8_6?
- return arr if n == 0
- arr.inject([]) {|res, e| e.is_a?(Array) ? res.concat(flatten(e, n - 1)) : res << e}
- end
-
- # Returns the hash code for a set in a cross-version manner.
- # Aggravatingly, this is order-dependent in Ruby 1.8.6.
- #
- # @param set [Set]
- # @return [Fixnum] The order-independent hashcode of `set`
- def set_hash(set)
- return set.hash unless ruby1_8_6?
- set.map {|e| e.hash}.uniq.sort.hash
- end
-
- # Tests the hash-equality of two sets in a cross-version manner.
- # Aggravatingly, this is order-dependent in Ruby 1.8.6.
- #
- # @param set1 [Set]
- # @param set2 [Set]
- # @return [Boolean] Whether or not the sets are hashcode equal
- def set_eql?(set1, set2)
- return set1.eql?(set2) unless ruby1_8_6?
- set1.to_a.uniq.sort_by {|e| e.hash}.eql?(set2.to_a.uniq.sort_by {|e| e.hash})
- end
-
- # Like `Object#inspect`, but preserves non-ASCII characters rather than escaping them under Ruby 1.9.2.
- # This is necessary so that the precompiled Haml template can be `#encode`d into `@options[:encoding]`
- # before being evaluated.
- #
- # @param obj {Object}
- # @return {String}
- def inspect_obj(obj)
- return obj.inspect unless version_geq(::RUBY_VERSION, "1.9.2")
- return ':' + inspect_obj(obj.to_s) if obj.is_a?(Symbol)
- return obj.inspect unless obj.is_a?(String)
- '"' + obj.gsub(/[\x00-\x7F]+/) {|s| s.inspect[1...-1]} + '"'
- end
-
- ## Static Method Stuff
-
- # The context in which the ERB for \{#def\_static\_method} will be run.
- class StaticConditionalContext
- # @param set [#include?] The set of variables that are defined for this context.
- def initialize(set)
- @set = set
- end
-
- # Checks whether or not a variable is defined for this context.
- #
- # @param name [Symbol] The name of the variable
- # @return [Boolean]
- def method_missing(name, *args, &block)
- super unless args.empty? && block.nil?
- @set.include?(name)
- end
- end
-
- # This is used for methods in {Haml::Buffer} that need to be very fast,
- # and take a lot of boolean parameters
- # that are known at compile-time.
- # Instead of passing the parameters in normally,
- # a separate method is defined for every possible combination of those parameters;
- # these are then called using \{#static\_method\_name}.
- #
- # To define a static method, an ERB template for the method is provided.
- # All conditionals based on the static parameters
- # are done as embedded Ruby within this template.
- # For example:
- #
- # def_static_method(Foo, :my_static_method, [:foo, :bar], :baz, :bang, <
- # return foo + bar
- # <% elsif baz || bang %>
- # return foo - bar
- # <% else %>
- # return 17
- # <% end %>
- # RUBY
- #
- # \{#static\_method\_name} can be used to call static methods.
- #
- # @overload def_static_method(klass, name, args, *vars, erb)
- # @param klass [Module] The class on which to define the static method
- # @param name [#to_s] The (base) name of the static method
- # @param args [Array] The names of the arguments to the defined methods
- # (**not** to the ERB template)
- # @param vars [Array] The names of the static boolean variables
- # to be made available to the ERB template
- # @param erb [String] The template for the method code
- def def_static_method(klass, name, args, *vars)
- erb = vars.pop
- info = caller_info
- powerset(vars).each do |set|
- context = StaticConditionalContext.new(set).instance_eval {binding}
- klass.class_eval(<] The static variable assignment
- # @return [String] The real name of the static method
- def static_method_name(name, *vars)
- "#{name}_#{vars.map {|v| !!v}.join('_')}"
- end
-
- private
-
- # Calculates the memoization table for the Least Common Subsequence algorithm.
- # Algorithm from [Wikipedia](http://en.wikipedia.org/wiki/Longest_common_subsequence_problem#Computing_the_length_of_the_LCS)
- def lcs_table(x, y)
- c = Array.new(x.size) {[]}
- x.size.times {|i| c[i][0] = 0}
- y.size.times {|j| c[0][j] = 0}
- (1...x.size).each do |i|
- (1...y.size).each do |j|
- c[i][j] =
- if yield x[i], y[j]
- c[i-1][j-1] + 1
- else
- [c[i][j-1], c[i-1][j]].max
- end
- end
- end
- return c
- end
-
- # Computes a single longest common subsequence for arrays x and y.
- # Algorithm from [Wikipedia](http://en.wikipedia.org/wiki/Longest_common_subsequence_problem#Reading_out_an_LCS)
- def lcs_backtrace(c, x, y, i, j, &block)
- return [] if i == 0 || j == 0
- if v = yield(x[i], y[j])
- return lcs_backtrace(c, x, y, i-1, j-1, &block) << v
- end
-
- return lcs_backtrace(c, x, y, i, j-1, &block) if c[i][j-1] > c[i-1][j]
- return lcs_backtrace(c, x, y, i-1, j, &block)
- end
-
- # Parses a magic comment at the beginning of a Haml file.
- # The parsing rules are basically the same as Ruby's.
- #
- # @return [(Boolean, String or nil)]
- # Whether the document begins with a UTF-8 BOM,
- # and the declared encoding of the document (or nil if none is declared)
- def parse_haml_magic_comment(str)
- scanner = StringScanner.new(str.dup.force_encoding("BINARY"))
- bom = scanner.scan(/\xEF\xBB\xBF/n)
- return bom unless scanner.scan(/-\s*#\s*/n)
- if coding = try_parse_haml_emacs_magic_comment(scanner)
- return bom, coding
- end
-
- return bom unless scanner.scan(/.*?coding[=:]\s*([\w-]+)/in)
- return bom, scanner[1]
- end
-
- def try_parse_haml_emacs_magic_comment(scanner)
- pos = scanner.pos
- return unless scanner.scan(/.*?-\*-\s*/n)
- # From Ruby's parse.y
- return unless scanner.scan(/([^\s'":;]+)\s*:\s*("(?:\\.|[^"])*"|[^"\s;]+?)[\s;]*-\*-/n)
- name, val = scanner[1], scanner[2]
- return unless name =~ /(en)?coding/in
- val = $1 if val =~ /^"(.*)"$/n
- return val
- ensure
- scanner.pos = pos
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/version.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/version.rb
deleted file mode 100644
index bd58c23b9b..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/haml/version.rb
+++ /dev/null
@@ -1,109 +0,0 @@
-require 'haml/util'
-
-module Haml
- # Handles Haml version-reporting.
- # Haml not only reports the standard three version numbers,
- # but its Git revision hash as well,
- # if it was installed from Git.
- module Version
- include Haml::Util
-
- # Returns a hash representing the version of Haml.
- # The `:major`, `:minor`, and `:teeny` keys have their respective numbers as Fixnums.
- # The `:name` key has the name of the version.
- # The `:string` key contains a human-readable string representation of the version.
- # The `:number` key is the major, minor, and teeny keys separated by periods.
- # If Haml is checked out from Git, the `:rev` key will have the revision hash.
- # For example:
- #
- # {
- # :string => "2.1.0.9616393",
- # :rev => "9616393b8924ef36639c7e82aa88a51a24d16949",
- # :number => "2.1.0",
- # :major => 2, :minor => 1, :teeny => 0
- # }
- #
- # If a prerelease version of Haml is being used,
- # the `:string` and `:number` fields will reflect the full version
- # (e.g. `"2.2.beta.1"`), and the `:teeny` field will be `-1`.
- # A `:prerelease` key will contain the name of the prerelease (e.g. `"beta"`),
- # and a `:prerelease_number` key will contain the rerelease number.
- # For example:
- #
- # {
- # :string => "3.0.beta.1",
- # :number => "3.0.beta.1",
- # :major => 3, :minor => 0, :teeny => -1,
- # :prerelease => "beta",
- # :prerelease_number => 1
- # }
- #
- # @return [{Symbol => String/Fixnum}] The version hash
- def version
- return @@version if defined?(@@version)
-
- numbers = File.read(scope('VERSION')).strip.split('.').
- map {|n| n =~ /^[0-9]+$/ ? n.to_i : n}
- name = File.read(scope('VERSION_NAME')).strip
- @@version = {
- :major => numbers[0],
- :minor => numbers[1],
- :teeny => numbers[2],
- :name => name
- }
-
- if numbers[3].is_a?(String)
- @@version[:teeny] = -1
- @@version[:prerelease] = numbers[3]
- @@version[:prerelease_number] = numbers[4]
- end
-
- @@version[:number] = numbers.join('.')
- @@version[:string] = @@version[:number].dup
-
- if rev = revision_number
- @@version[:rev] = rev
- unless rev[0] == ?(
- @@version[:string] << "." << rev[0...7]
- end
- end
-
- @@version[:string] << " (#{name})"
- @@version
- end
-
- private
-
- def revision_number
- if File.exists?(scope('REVISION'))
- rev = File.read(scope('REVISION')).strip
- return rev unless rev =~ /^([a-f0-9]+|\(.*\))$/ || rev == '(unknown)'
- end
-
- return unless File.exists?(scope('.git/HEAD'))
- rev = File.read(scope('.git/HEAD')).strip
- return rev unless rev =~ /^ref: (.*)$/
-
- ref_name = $1
- ref_file = scope(".git/#{ref_name}")
- info_file = scope(".git/info/refs")
- return File.read(ref_file).strip if File.exists?(ref_file)
- return unless File.exists?(info_file)
- File.open(info_file) do |f|
- f.each do |l|
- sha, ref = l.strip.split("\t", 2)
- next unless ref == ref_name
- return sha
- end
- end
- return nil
- end
- end
-
- extend Haml::Version
-
- # A string representing the version of Haml.
- # A more fine-grained representation is available from Haml.version.
- # @api public
- VERSION = version[:string] unless defined?(Haml::VERSION)
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/sass.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/sass.rb
deleted file mode 100644
index 87ba927ffc..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/sass.rb
+++ /dev/null
@@ -1,8 +0,0 @@
-dir = File.dirname(__FILE__)
-$LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
-
-require 'haml'
-
-unless Haml::Util.try_sass
- load Haml::Util.scope('vendor/sass/lib/sass.rb')
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/sass/plugin.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/sass/plugin.rb
deleted file mode 100644
index e5a3bc505e..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/sass/plugin.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-dir = File.dirname(File.dirname(__FILE__))
-$LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
-
-require 'haml'
-
-if Haml::Util.try_sass
- load Sass::Util.scope('lib/sass/plugin.rb')
-else
- load Haml::Util.scope('vendor/sass/lib/sass/plugin.rb')
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/sass/rails2_shim.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/sass/rails2_shim.rb
deleted file mode 100644
index ea61cc777a..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/lib/sass/rails2_shim.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-Haml::Util.try_sass
-Haml::Util.haml_warn(<=2.1.0
- base = ActionView::Base.new
- base.finder.append_view_path(File.dirname(__FILE__))
- base
-end
-
-def render(view, file)
- view.render :file => file
-end
-
-RBench.run(times) do
- column :haml, :title => "Haml"
- column :haml_ugly, :title => "Haml :ugly"
- column :erb, :title => "ERB"
- column :erubis, :title => "Erubis"
-
- template_name = 'standard'
- directory = File.dirname(__FILE__) + '/haml'
- haml_template = File.read("#{directory}/templates/#{template_name}.haml")
- erb_template = File.read("#{directory}/erb/#{template_name}.erb")
-
- report "Cached" do
- obj = Object.new
-
- Haml::Engine.new(haml_template).def_method(obj, :haml)
- Haml::Engine.new(haml_template, :ugly => true).def_method(obj, :haml_ugly)
- Erubis::Eruby.new(erb_template).def_method(obj, :erubis)
- obj.instance_eval("def erb; #{ERB.new(erb_template, nil, '-').src}; end")
-
- haml { obj.haml }
- haml_ugly { obj.haml_ugly }
- erb { obj.erb }
- erubis { obj.erubis }
- end
-
- report "ActionView" do
- @base = view
-
- @base.unmemoize_all
- Haml::Template.options[:ugly] = false
- # To cache the template
- render @base, 'haml/templates/standard'
- render @base, 'haml/erb/standard'
-
- haml { render @base, 'haml/templates/standard' }
- erb { render @base, 'haml/erb/standard' }
-
- Haml::Template.options[:ugly] = true
- render @base, 'haml/templates/standard_ugly'
- haml_ugly { render @base, 'haml/templates/standard_ugly' }
- end
-
- report "ActionView with deep partials" do
- @base = view
-
- @base.unmemoize_all
- Haml::Template.options[:ugly] = false
- # To cache the template
- render @base, 'haml/templates/action_view'
- render @base, 'haml/erb/action_view'
-
- haml { render @base, 'haml/templates/action_view' }
- erb { render @base, 'haml/erb/action_view' }
-
- Haml::Template.options[:ugly] = true
- render @base, 'haml/templates/action_view_ugly'
- haml_ugly { render @base, 'haml/templates/action_view_ugly' }
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/engine_test.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/engine_test.rb
deleted file mode 100755
index 1235ce73a3..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/engine_test.rb
+++ /dev/null
@@ -1,1911 +0,0 @@
-#!/usr/bin/env ruby
-# -*- coding: utf-8 -*-
-require File.dirname(__FILE__) + '/../test_helper'
-
-class EngineTest < Test::Unit::TestCase
- # A map of erroneous Haml documents to the error messages they should produce.
- # The error messages may be arrays;
- # if so, the second element should be the line number that should be reported for the error.
- # If this isn't provided, the tests will assume the line number should be the last line of the document.
- EXCEPTION_MAP = {
- "!!!\n a" => "Illegal nesting: nesting within a header command is illegal.",
- "a\n b" => "Illegal nesting: nesting within plain text is illegal.",
- "/ a\n b" => "Illegal nesting: nesting within a tag that already has content is illegal.",
- "% a" => 'Invalid tag: "% a".',
- "%p a\n b" => "Illegal nesting: content can't be both given on the same line as %p and nested within it.",
- "%p=" => "There's no Ruby code for = to evaluate.",
- "%p~" => "There's no Ruby code for ~ to evaluate.",
- "~" => "There's no Ruby code for ~ to evaluate.",
- "=" => "There's no Ruby code for = to evaluate.",
- "%p/\n a" => "Illegal nesting: nesting within a self-closing tag is illegal.",
- ":a\n b" => ['Filter "a" is not defined.', 1],
- ":a= b" => 'Invalid filter name ":a= b".',
- "." => "Illegal element: classes and ids must have values.",
- ".#" => "Illegal element: classes and ids must have values.",
- ".{} a" => "Illegal element: classes and ids must have values.",
- ".() a" => "Illegal element: classes and ids must have values.",
- ".= a" => "Illegal element: classes and ids must have values.",
- "%p..a" => "Illegal element: classes and ids must have values.",
- "%a/ b" => "Self-closing tags can't have content.",
- "%p{:a => 'b',\n:c => 'd'}/ e" => ["Self-closing tags can't have content.", 2],
- "%p{:a => 'b',\n:c => 'd'}=" => ["There's no Ruby code for = to evaluate.", 2],
- "%p.{:a => 'b',\n:c => 'd'} e" => ["Illegal element: classes and ids must have values.", 1],
- "%p{:a => 'b',\n:c => 'd',\n:e => 'f'}\n%p/ a" => ["Self-closing tags can't have content.", 4],
- "%p{:a => 'b',\n:c => 'd',\n:e => 'f'}\n- raise 'foo'" => ["foo", 4],
- "%p{:a => 'b',\n:c => raise('foo'),\n:e => 'f'}" => ["foo", 2],
- "%p{:a => 'b',\n:c => 'd',\n:e => raise('foo')}" => ["foo", 3],
- " %p foo" => "Indenting at the beginning of the document is illegal.",
- " %p foo" => "Indenting at the beginning of the document is illegal.",
- "- end" => < ["Indenting at the beginning of the document is illegal.", 3],
- "\n\n %p foo" => ["Indenting at the beginning of the document is illegal.", 3],
- "%p\n foo\n foo" => ["Inconsistent indentation: 1 space was used for indentation, but the rest of the document was indented using 2 spaces.", 3],
- "%p\n foo\n%p\n foo" => ["Inconsistent indentation: 1 space was used for indentation, but the rest of the document was indented using 2 spaces.", 4],
- "%p\n\t\tfoo\n\tfoo" => ["Inconsistent indentation: 1 tab was used for indentation, but the rest of the document was indented using 2 tabs.", 3],
- "%p\n foo\n foo" => ["Inconsistent indentation: 3 spaces were used for indentation, but the rest of the document was indented using 2 spaces.", 3],
- "%p\n foo\n %p\n bar" => ["Inconsistent indentation: 3 spaces were used for indentation, but the rest of the document was indented using 2 spaces.", 4],
- "%p\n :plain\n bar\n \t baz" => ['Inconsistent indentation: " \t " was used for indentation, but the rest of the document was indented using 2 spaces.', 4],
- "%p\n foo\n%p\n bar" => ["The line was indented 2 levels deeper than the previous line.", 4],
- "%p\n foo\n %p\n bar" => ["The line was indented 3 levels deeper than the previous line.", 4],
- "%p\n \tfoo" => ["Indentation can't use both tabs and spaces.", 2],
- "%p(" => "Invalid attribute list: \"(\".",
- "%p(foo=\nbar)" => ["Invalid attribute list: \"(foo=\".", 1],
- "%p(foo=)" => "Invalid attribute list: \"(foo=)\".",
- "%p(foo 'bar')" => "Invalid attribute list: \"(foo 'bar')\".",
- "%p(foo 'bar'\nbaz='bang')" => ["Invalid attribute list: \"(foo 'bar'\".", 1],
- "%p(foo='bar'\nbaz 'bang'\nbip='bop')" => ["Invalid attribute list: \"(foo='bar' baz 'bang'\".", 2],
- "%p{:foo => 'bar' :bar => 'baz'}" => :compile,
- "%p{:foo => }" => :compile,
- "%p{=> 'bar'}" => :compile,
- "%p{:foo => 'bar}" => :compile,
- "%p{'foo => 'bar'}" => :compile,
- "%p{:foo => 'bar\"}" => :compile,
-
- # Regression tests
- "- raise 'foo'\n\n\n\nbar" => ["foo", 1],
- "= 'foo'\n-raise 'foo'" => ["foo", 2],
- "\n\n\n- raise 'foo'" => ["foo", 4],
- "%p foo |\n bar |\n baz |\nbop\n- raise 'foo'" => ["foo", 5],
- "foo\n\n\n bar" => ["Illegal nesting: nesting within plain text is illegal.", 4],
- "%p/\n\n bar" => ["Illegal nesting: nesting within a self-closing tag is illegal.", 3],
- "%p foo\n\n bar" => ["Illegal nesting: content can't be both given on the same line as %p and nested within it.", 3],
- "/ foo\n\n bar" => ["Illegal nesting: nesting within a tag that already has content is illegal.", 3],
- "!!!\n\n bar" => ["Illegal nesting: nesting within a header command is illegal.", 3],
- "foo\n:ruby\n 1\n 2\n 3\n- raise 'foo'" => ["foo", 6],
- "foo\n:erb\n 1\n 2\n 3\n- raise 'foo'" => ["foo", 6],
- "foo\n:plain\n 1\n 2\n 3\n- raise 'foo'" => ["foo", 6],
- "foo\n:plain\n 1\n 2\n 3\n4\n- raise 'foo'" => ["foo", 7],
- "foo\n:plain\n 1\n 2\n 3\#{''}\n- raise 'foo'" => ["foo", 6],
- "foo\n:plain\n 1\n 2\n 3\#{''}\n4\n- raise 'foo'" => ["foo", 7],
- "foo\n:plain\n 1\n 2\n \#{raise 'foo'}" => ["foo", 5],
- "= raise 'foo'\nfoo\nbar\nbaz\nbang" => ["foo", 1],
- "- case 1\n\n- when 1\n - raise 'foo'" => ["foo", 4],
- }
-
- User = Struct.new('User', :id)
- class CustomHamlClass < Struct.new(:id)
- def haml_object_ref
- "my_thing"
- end
- end
-
- def render(text, options = {}, &block)
- scope = options.delete(:scope) || Object.new
- locals = options.delete(:locals) || {}
- engine(text, options).to_html(scope, locals, &block)
- end
-
- def engine(text, options = {})
- unless options[:filename]
- # use caller method name as fake filename. useful for debugging
- i = -1
- caller[i+=1] =~ /`(.+?)'/ until $1 and $1.index('test_') == 0
- options[:filename] = "(#{$1})"
- end
- Haml::Engine.new(text, options)
- end
-
- def setup
- return if Haml::Util.ruby1_8?
- @old_default_internal = Encoding.default_internal
- Encoding.default_internal = nil
- end
-
- def teardown
- return if Haml::Util.ruby1_8?
- Encoding.default_internal = @old_default_internal
- end
-
- def test_empty_render
- assert_equal "", render("")
- end
-
- def test_flexible_tabulation
- assert_equal("
- Yes, ladies and gentileman. He is just that egotistical.
- Fantastic! This should be multi-line output
- The question is if this would translate! Ahah!
- <%= 1 + 9 + 8 + 2 %>
- <%# numbers should work and this should be ignored %>
-
- <% 120.times do |number| -%>
- <%= number %>
- <% end -%>
-
<%= " Quotes should be loved! Just like people!" %>
- Yes, ladies and gentileman. He is just that egotistical.
- Fantastic! This should be multi-line output
- The question is if this would translate! Ahah!
- <%= 1 + 9 + 8 + 2 %>
- <%# numbers should work and this should be ignored %>
-
- <% 120.times do |number| -%>
- <%= number %>
- <% end -%>
-
<%= " Quotes should be loved! Just like people!" %>
", render("= nested_tag", :action_view).strip
- end
-
- def test_error_return
- assert_raise(Haml::Error, < e
- assert_equal 2, e.backtrace[1].scan(/:(\d+)/).first.first.to_i
- end
-
- def test_error_return_line_in_helper
- render("- something_that_uses_haml_concat")
- assert false, "Expected Haml::Error"
- rescue Haml::Error => e
- assert_equal 16, e.backtrace[0].scan(/:(\d+)/).first.first.to_i
- end
-
- class ActsLikeTag
- # We want to be able to have people include monkeypatched ActionView helpers
- # without redefining is_haml?.
- # This is accomplished via Object#is_haml?, and this is a test for it.
- include ActionView::Helpers::TagHelper
- def to_s
- content_tag :p, 'some tag content'
- end
- end
-
- def test_random_class_includes_tag_helper
- assert_equal "
-<% end %>
-ERB
- end
-
- def test_block_parsing_with_args
- assert_equal(<
-
bar
-<% end %>
-ERB
- end
-
- def test_block_parsing_with_equals
- assert_equal(<
-
bar
-<% end %>
-ERB
- end
-
- def test_block_parsing_with_modified_end
- assert_equal(<
- blah
-<% end.bip %>
-ERB
- end
-
- def test_block_parsing_with_modified_end_with_block
- assert_equal(<
- blah
-<% end.bip do %>
- brang
-<% end %>
-ERB
- end
-
- def test_multiline_block_opener
- assert_equal(<
- foo
-<% end %>
-ERB
- end
-
- def test_if_elsif_else_parsing
- assert_equal(<
-
bar
-<% elsif bar.foo("zip") %>
-
baz
-<% else %>
- bibble
-<% end %>
-ERB
- end
-
- def test_case_when_parsing
- assert_equal(<
-<% when "bip" %>
-
bip
-<% when "bop" %>
-
BOP
-<% when bizzle.bang.boop.blip %>
- BIZZLE BANG BOOP BLIP
-<% end %>
-ERB
-
- assert_equal(<
-
bip
-<% when "bop" %>
-
BOP
-<% when bizzle.bang.boop.blip %>
- BIZZLE BANG BOOP BLIP
-<% end %>
-ERB
- end
-
- def test_begin_rescue_ensure
- assert_equal(< e
- %p b
-- ensure
- %p c
-HAML
-<% begin %>
-
a
-<% rescue FooException => e %>
-
b
-<% ensure %>
-
c
-<% end %>
-ERB
- end
-
- # Regression
-
- def test_tag_inside_block
- assert_equal(<
- <% foo.each do %>
-
-HTML
- assert_equal(<foo
-
-HTML
- end
-
- def test_script_tag
- assert_equal(<
- function foo() {
- return "12" & "13";
- }
-
-HTML
- end
-
- def test_script_tag_with_cdata
- assert_equal(<
-
-
-HTML
- end
-
- def test_pre
- assert_equal(<foo
- bar
-baz
-HTML
- end
-
- def test_pre_code
- assert_equal(<foo
- bar
-baz
-HTML
- end
-
- def test_code_without_pre
- assert_equal(<foo
- bar
-baz
-HTML
- end
-
- def test_conditional_comment
- assert_equal(<
- bar
- baz
-
-HTML
- end
-
- def test_style_to_css_filter
- assert_equal(<
- foo {
- bar: baz;
- }
-
-HTML
- end
-
- def test_inline_conditional_comment
- assert_equal(< bar baz
-HTML
- end
-
- def test_minus_in_tag
- assert_equal("%p - foo bar -", render("
- foo bar -
"))
- end
-
- def test_equals_in_tag
- assert_equal("%p = foo bar =", render("
= foo bar =
"))
- end
-
- def test_hash_in_tag
- assert_equal("%p # foo bar #", render("
# foo bar #
"))
- end
-
- def test_comma_post_tag
- assert_equal(< Foo
- ,
- %span bar
- Foo
- %span> bar
- ,
- %span baz
-HAML
-
- Foo, bar
- Foobar, baz
-
-HTML
- end
-
- def test_comma_post_tag_with_text_before
- assert_equal(<
- Batch
- Foo, Bar
-
-HTML
- end
-
- begin
- require 'haml/html/erb'
- include ErbTests
- rescue LoadError => e
- puts "\n** Couldn't require #{e.message[/-- (.*)$/, 1]}, skipping some tests"
- end
-
- # Encodings
-
- unless Haml::Util.ruby1_8?
- def test_encoding_error
- render("foo\nbar\nb\xFEaz".force_encoding("utf-8"))
- assert(false, "Expected exception")
- rescue Haml::Error => e
- assert_equal(3, e.line)
- assert_equal('Invalid UTF-8 character "\xFE"', e.message)
- end
-
- def test_ascii_incompatible_encoding_error
- template = "foo\nbar\nb_z".encode("utf-16le")
- template[9] = "\xFE".force_encoding("utf-16le")
- render(template)
- assert(false, "Expected exception")
- rescue Haml::Error => e
- assert_equal(3, e.line)
- assert_equal('Invalid UTF-16LE character "\xFE"', e.message)
- end
- end
-
- # Regression Tests
-
- def test_xhtml_strict_doctype
- assert_equal('!!! Strict', render(<
-HTML
- end
-
- protected
-
- def render(text, options = {})
- Haml::HTML.new(text, options).render.rstrip
- end
-
- def render_erb(text)
- render(text, :erb => true)
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/markaby/standard.mab b/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/markaby/standard.mab
deleted file mode 100644
index aff8641624..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/markaby/standard.mab
+++ /dev/null
@@ -1,52 +0,0 @@
-self << ''
-html(:xmlns=>'http://www.w3.org/1999/xhtml', 'xml:lang'=>'en-US') do
- head do
- title "Hampton Catlin Is Totally Awesome"
- meta("http-equiv" => "Content-Type", :content => "text/html; charset=utf-8")
- end
- body do
- # You're In my house now!
- div :class => "header" do
- self << %|Yes, ladies and gentileman. He is just that egotistical.
- Fantastic! This should be multi-line output
- The question is if this would translate! Ahah!|
- self << 1 + 9 + 8 + 2 #numbers should work and this should be ignored
- end
- div(:id => "body") { self << "Quotes should be loved! Just like people!"}
- 120.times do |number|
- number
- end
- self << "Wow.|"
- p do
- self << "Holy cow " +
- "multiline " +
- "tags! " +
- "A pipe (|) even!"
- self << [1, 2, 3].collect { |n| "PipesIgnored|" }
- self << [1, 2, 3].collect { |n|
- n.to_s
- }.join("|")
- end
- div(:class => "silent") do
- foo = String.new
- foo << "this"
- foo << " shouldn't"
- foo << " evaluate"
- self << foo + " but now it should!"
- # Woah crap a comment!
- end
- # That was a line that shouldn't close everything.
- ul(:class => "really cool") do
- ('a'..'f').each do |a|
- li a
- end
- end
- div((@should_eval = "with this text"), :id => "combo", :class => "of_divs_with_underscore")
- [ 104, 101, 108, 108, 111 ].map do |byte|
- byte.chr
- end
- div(:class => "footer") do
- strong("This is a really long ruby quote. It should be loved and wrapped because its more than 50 characters. This value may change in the future and this test may look stupid. \nSo, I'm just making it *really* long. God, I hope this works", :class => "shout")
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/mocks/article.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/mocks/article.rb
deleted file mode 100644
index 805f8cad3d..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/mocks/article.rb
+++ /dev/null
@@ -1,6 +0,0 @@
-class Article
- attr_accessor :id, :title, :body
- def initialize
- @id, @title, @body = 1, 'Hello', 'World'
- end
-end
\ No newline at end of file
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/results/content_for_layout.xhtml b/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/results/content_for_layout.xhtml
deleted file mode 100644
index 63bbd2297e..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/results/content_for_layout.xhtml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
- Yes, ladies and gentileman. He is just that egotistical.
- Fantastic! This should be multi-line output
- The question is if this would translate! Ahah!
- 20
-
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/spec/README.md b/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/spec/README.md
deleted file mode 100644
index 95740c51c0..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/spec/README.md
+++ /dev/null
@@ -1,97 +0,0 @@
-# Haml Spec #
-
-Haml Spec provides a basic suite of tests for Haml interpreters.
-
-It is intented for developers who are creating or maintaining an implementation
-of the [Haml](http://haml-lang.com) markup language.
-
-At the moment, there are test runners for the [original Haml](http://github.com/nex3/haml)
-in Ruby, and for [Lua Haml](http://github.com/norman/lua-haml). Support for
-other versions of Haml will be added if their developers/maintainers
-are interested in using it.
-
-## The Tests ##
-
-The tests are kept in JSON format for portability across languages. Each test
-is a JSON object with expected input, output, local variables and configuration
-parameters (see below). The test suite only provides tests for features which
-are portable, therefore no tests for script are provided, nor for external
-filters such as :markdown or :textile.
-
-The one major exception to this are the tests for interpolation, which you may
-need to modify with a regular expression to run under PHP or Perl, which
-require a symbol before variable names. These tests are included despite being
-less than 100% portable because interpolation is an important part of Haml and
-can be tricky to implement.
-
-## Running the Tests ##
-
-### Ruby ###
-
-In order to make it as easy as possible for non-Ruby programmers to run the
-Ruby Haml tests, the Ruby test runner uses test/unit, rather than something
-fancier like Rspec. To run them you probably only need to install `haml`, and
-possibly `ruby` if your platform doesn't come with it by default. If you're
-using Ruby 1.8.x, you'll also need to install `json`:
-
- sudo gem install haml
- # for Ruby 1.8.x; check using "ruby --version" if unsure
- sudo gem install json
-
-Then, running the Ruby test suite is easy:
-
- ruby ruby_haml_test.rb
-
-### Lua ###
-
-The Lua test depends on [Telescope](http://telescope.luaforge.net/),
-[jason4lua](http://json.luaforge.net/), and
-[Lua Haml](http://github.com/norman/lua-haml). Install and
-run `tsc lua_haml_spec.lua`.
-
-## Contributing ##
-
-### Getting it ###
-
-You can access the [Git repository](http://github.com/norman/haml-spec) at:
-
- git://github.com/norman/haml-spec.git
-
-Patches are *very* welcome, as are test runners for your Haml implementation.
-
-As long as any test you add run against Ruby Haml and are not redundant, I'll
-be very happy to add them.
-
-### Test JSON format ###
-
- "test name" : {
- "haml" : "haml input",
- "html" : "expected html output",
- "result" : "expected test result",
- "locals" : "local vars",
- "config" : "config params"
- }
-
-* test name: This should be a *very* brief description of what's being tested. It can
- be used by the test runners to name test methods, or to exclude certain tests from being
- run.
-* haml: The Haml code to be evaluated. Always required.
-* html: The HTML output that should be generated. Required unless "result" is "error".
-* result: Can be "pass" or "error". If it's absent, then "pass" is assumed. If it's "error",
- then the goal of the test is to make sure that malformed Haml code generates an error.
-* locals: An object containing local variables needed for the test.
-* config: An object containing configuration parameters used to run the test.
- The configuration parameters should be usable directly by Ruby's Haml with no
- modification. If your implementation uses config parameters with different
- names, you may need to process them to make them match your implementation.
- If your implementation has options that do not exist in Ruby's Haml, then you
- should add tests for this in your implementation's test rather than here.
-
-## License ##
-
- This project is released under the [WTFPL](http://sam.zoy.org/wtfpl/) in order
- to be as usable as possible in any project, commercial or free.
-
-## Author ##
-
- [Norman Clarke](mailto:norman@njclarke.com)
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/spec/lua_haml_spec.lua b/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/spec/lua_haml_spec.lua
deleted file mode 100644
index 6cf4473508..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/spec/lua_haml_spec.lua
+++ /dev/null
@@ -1,30 +0,0 @@
-require 'luarocks.require'
-require 'json'
-require 'telescope'
-require 'haml'
-
-local function get_tests(filename)
- local self = debug.getinfo(1).short_src
- if self:match("/") then return "./" .. self:gsub("[^/]*%.lua$", "/" .. filename)
- elseif self:match("\\") then return self:gsub("[^\\]*%.lua$", "\\" .. filename)
- else return filename
- end
-end
-
-local fh = assert(io.open(get_tests("tests.json")))
-local input = fh:read '*a'
-fh:close()
-
-local contexts = json.decode(input)
-
-describe("LuaHaml", function()
- for context, expectations in pairs(contexts) do
- describe("When handling " .. context, function()
- for name, exp in pairs(expectations) do
- it(string.format("should correctly render %s", name), function()
- assert_equal(haml.render(exp.haml, exp.config or {}, exp.locals or {}), exp.html)
- end)
- end
- end)
- end
-end)
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/spec/ruby_haml_test.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/spec/ruby_haml_test.rb
deleted file mode 100644
index 444ba2dead..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/spec/ruby_haml_test.rb
+++ /dev/null
@@ -1,19 +0,0 @@
-require "test/unit"
-require "json"
-require "haml"
-
-class HamlTest < Test::Unit::TestCase
- contexts = JSON.parse(File.read(File.dirname(__FILE__) + "/tests.json"))
- contexts.each do |context|
- context[1].each do |name, test|
- class_eval(<<-EOTEST)
- def test_#{name.gsub(/\s+|[^a-zA-Z0-9_]/, "_")}
- locals = Hash[*(#{test}["locals"] || {}).collect {|k, v| [k.to_sym, v] }.flatten]
- options = Hash[*(#{test}["config"] || {}).collect {|k, v| [k.to_sym, v.to_sym] }.flatten]
- engine = Haml::Engine.new(#{test}["haml"], options)
- assert_equal(engine.render(Object.new, locals).chomp, #{test}["html"])
- end
- EOTEST
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/spec/tests.json b/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/spec/tests.json
deleted file mode 100644
index e8f04542d9..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/spec/tests.json
+++ /dev/null
@@ -1,534 +0,0 @@
-{
- "headers" : {
-
- "an XHTML XML prolog" : {
- "haml" : "!!! XML",
- "html" : ""
- },
-
- "an XHTML default (transitional) doctype" : {
- "haml" : "!!!",
- "html" : ""
- },
-
- "an XHTML 1.1 doctype" : {
- "haml" : "!!! 1.1",
- "html" : ""
- },
-
- "an XHTML 1.2 mobile doctype" : {
- "haml" : "!!! mobile",
- "html" : ""
- },
-
- "an XHTML 1.1 basic doctype" : {
- "haml" : "!!! basic",
- "html" : ""
- },
-
- "an XHTML 1.0 frameset doctype" : {
- "haml" : "!!! frameset",
- "html" : ""
- },
-
- "an HTML 5 doctype with XHTML syntax" : {
- "haml" : "!!! 5",
- "html" : ""
- },
-
- "an HTML 5 XML prolog (silent)" : {
- "haml" : "!!! XML",
- "html" : "",
- "config" : {
- "format" : "html5"
- }
- },
-
- "an HTML 5 doctype" : {
- "haml" : "!!!",
- "html" : "",
- "config" : {
- "format" : "html5"
- }
- },
-
- "an HTML 4 XML prolog (silent)" : {
- "haml" : "!!! XML",
- "html" : "",
- "config" : {
- "format" : "html4"
- }
- },
-
- "an HTML 4 default (transitional) doctype" : {
- "haml" : "!!!",
- "html" : "",
- "config" : {
- "format" : "html4"
- }
- },
-
- "an HTML 4 frameset doctype" : {
- "haml" : "!!! frameset",
- "html" : "",
- "config" : {
- "format" : "html4"
- }
- },
-
- "an HTML 4 strict doctype" : {
- "haml" : "!!! strict",
- "html" : "",
- "config" : {
- "format" : "html4"
- }
- }
-
- },
-
- "basic Haml tags and CSS": {
-
- "a simple Haml tag" : {
- "haml" : "%p",
- "html" : ""
- },
-
- "a self-closing tag (XHTML)" : {
- "haml" : "%meta",
- "html" : ""
- },
-
- "a self-closing tag (HTML4)" : {
- "haml" : "%meta",
- "html" : "",
- "config" : {
- "format" : "html4"
- }
- },
-
- "a self-closing tag (HTML5)" : {
- "haml" : "%meta",
- "html" : "",
- "config" : {
- "format" : "html5"
- }
- },
-
- "a tag with a CSS class" : {
- "haml" : "%p.class1",
- "html" : ""
- },
-
- "a tag with multiple CSS classes" : {
- "haml" : "%p.class1.class2",
- "html" : ""
- },
-
- "a tag with a CSS id" : {
- "haml" : "%p#id1",
- "html" : ""
- },
-
- "a tag with multiple CSS id's" : {
- "haml" : "%p#id1#id2",
- "html" : ""
- },
-
- "a tag with a class followed by an id" : {
- "haml" : "%p.class1#id1",
- "html" : ""
- },
-
- "a tag with an id followed by a class" : {
- "haml" : "%p#id1.class1",
- "html" : ""
- },
-
- "an implicit div with a CSS id" : {
- "haml" : "#id1",
- "html" : ""
- },
-
- "an implicit div with a CSS class" : {
- "haml" : ".class1",
- "html" : ""
- },
-
- "multiple simple Haml tags" : {
- "haml" : "%div\n %div\n %p",
- "html" : "
\n
\n \n
\n
"
- }
- },
-
- "tags with unusual HTML characters" : {
-
- "a tag with colons" : {
- "haml" : "%ns:tag",
- "html" : ""
- },
-
- "a tag with underscores" : {
- "haml" : "%snake_case",
- "html" : ""
- },
-
- "a tag with dashes" : {
- "haml" : "%dashed-tag",
- "html" : ""
- },
-
- "a tag with camelCase" : {
- "haml" : "%camelCase",
- "html" : ""
- },
-
- "a tag with PascalCase" : {
- "haml" : "%PascalCase",
- "html" : ""
- }
- },
-
- "tags with unusual CSS identifiers" : {
-
- "an all-numeric class" : {
- "haml" : ".123",
- "html" : ""
- },
-
- "a class with underscores" : {
- "haml" : ".__",
- "html" : ""
- },
-
- "a class with dashes" : {
- "haml" : ".--",
- "html" : ""
- }
-
- },
-
- "tags with inline content" : {
-
- "a simple tag" : {
- "haml" : "%p hello",
- "html" : "
hello
"
- },
-
- "a tag with CSS" : {
- "haml" : "%p.class1 hello",
- "html" : "
")
- %p= find_and_preserve("foo\nbar")
- %pre
- :preserve
- ___
- ,o88888
- ,o8888888'
- ,:o:o:oooo. ,8O88Pd8888"
- ,.::.::o:ooooOoOoO. ,oO8O8Pd888'"
- ,.:.::o:ooOoOoOO8O8OOo.8OOPd8O8O"
- , ..:.::o:ooOoOOOO8OOOOo.FdO8O8"
- , ..:.::o:ooOoOO8O888O8O,COCOO"
- , . ..:.::o:ooOoOOOO8OOOOCOCO"
- . ..:.::o:ooOoOoOO8O8OCCCC"o
- . ..:.::o:ooooOoCoCCC"o:o
- . ..:.::o:o:,cooooCo"oo:o:
- ` . . ..:.:cocoooo"'o:o:::'
- .` . ..::ccccoc"'o:o:o:::'
- :.:. ,c:cccc"':.:.:.:.:.'
- ..:.:"'`::::c:"'..:.:.:.:.:.' http://www.chris.com/ASCII/
- ...:.'.:.::::"' . . . . .'
- .. . ....:."' ` . . . ''
- . . . ...."'
- .. . ."' -hrr-
- .
-
-
- It's a planet!
- %strong This shouldn't be bold!
- %strong This should!
- %textarea
- :preserve
- ___ ___ ___ ___
- /\__\ /\ \ /\__\ /\__\
- /:/ / /::\ \ /::| | /:/ /
- /:/__/ /:/\:\ \ /:|:| | /:/ /
- /::\ \ ___ /::\~\:\ \ /:/|:|__|__ /:/ /
- /:/\:\ /\__\ /:/\:\ \:\__\ /:/ |::::\__\ /:/__/
- \/__\:\/:/ / \/__\:\/:/ / \/__/~~/:/ / \:\ \
- \::/ / \::/ / /:/ / \:\ \
- /:/ / /:/ / /:/ / \:\ \
- /:/ / /:/ / /:/ / \:\__\
- \/__/ \/__/ \/__/ \/__/
-
- Many
- thanks
- to
- http://www.network-science.de/ascii/
- %strong indeed!
-.foo
- = find_and_preserve(13)
-%pre
- :preserve
- __ ______ __ ______
- .----.| |--.|__ |.----.| |--..--------.| __ |
- | __|| ||__ || __|| < | || __ |
- |____||__|__||______||____||__|__||__|__|__||______|
-%pre
- :preserve
- foo
- bar
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/util_test.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/util_test.rb
deleted file mode 100755
index fdcdee74c3..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/haml/util_test.rb
+++ /dev/null
@@ -1,300 +0,0 @@
-#!/usr/bin/env ruby
-require File.dirname(__FILE__) + '/../test_helper'
-require 'pathname'
-
-class UtilTest < Test::Unit::TestCase
- include Haml::Util
-
- class Dumpable
- attr_reader :arr
- def initialize; @arr = []; end
- def _before_dump; @arr << :before; end
- def _after_dump; @arr << :after; end
- def _around_dump
- @arr << :around_before
- yield
- @arr << :around_after
- end
- def _after_load; @arr << :loaded; end
- end
-
- def test_scope
- assert(File.exist?(scope("Rakefile")))
- end
-
- def test_to_hash
- assert_equal({
- :foo => 1,
- :bar => 2,
- :baz => 3
- }, to_hash([[:foo, 1], [:bar, 2], [:baz, 3]]))
- end
-
- def test_map_keys
- assert_equal({
- "foo" => 1,
- "bar" => 2,
- "baz" => 3
- }, map_keys({:foo => 1, :bar => 2, :baz => 3}) {|k| k.to_s})
- end
-
- def test_map_vals
- assert_equal({
- :foo => "1",
- :bar => "2",
- :baz => "3"
- }, map_vals({:foo => 1, :bar => 2, :baz => 3}) {|k| k.to_s})
- end
-
- def test_map_hash
- assert_equal({
- "foo" => "1",
- "bar" => "2",
- "baz" => "3"
- }, map_hash({:foo => 1, :bar => 2, :baz => 3}) {|k, v| [k.to_s, v.to_s]})
- end
-
- def test_powerset
- return unless Set[Set[]] == Set[Set[]] # There's a bug in Ruby 1.8.6 that breaks nested set equality
- assert_equal([[].to_set].to_set,
- powerset([]))
- assert_equal([[].to_set, [1].to_set].to_set,
- powerset([1]))
- assert_equal([[].to_set, [1].to_set, [2].to_set, [1, 2].to_set].to_set,
- powerset([1, 2]))
- assert_equal([[].to_set, [1].to_set, [2].to_set, [3].to_set,
- [1, 2].to_set, [2, 3].to_set, [1, 3].to_set, [1, 2, 3].to_set].to_set,
- powerset([1, 2, 3]))
- end
-
- def test_restrict
- assert_equal(0.5, restrict(0.5, 0..1))
- assert_equal(1, restrict(2, 0..1))
- assert_equal(1.3, restrict(2, 0..1.3))
- assert_equal(0, restrict(-1, 0..1))
- end
-
- def test_merge_adjacent_strings
- assert_equal(["foo bar baz", :bang, "biz bop", 12],
- merge_adjacent_strings(["foo ", "bar ", "baz", :bang, "biz", " bop", 12]))
- str = "foo"
- assert_equal(["foo foo foo", :bang, "foo foo", 12],
- merge_adjacent_strings([str, " ", str, " ", str, :bang, str, " ", str, 12]))
- end
-
- def test_intersperse
- assert_equal(["foo", " ", "bar", " ", "baz"],
- intersperse(%w[foo bar baz], " "))
- assert_equal([], intersperse([], " "))
- end
-
- def test_substitute
- assert_equal(["foo", "bar", "baz", 3, 4],
- substitute([1, 2, 3, 4], [1, 2], ["foo", "bar", "baz"]))
- assert_equal([1, "foo", "bar", "baz", 4],
- substitute([1, 2, 3, 4], [2, 3], ["foo", "bar", "baz"]))
- assert_equal([1, 2, "foo", "bar", "baz"],
- substitute([1, 2, 3, 4], [3, 4], ["foo", "bar", "baz"]))
-
- assert_equal([1, "foo", "bar", "baz", 2, 3, 4],
- substitute([1, 2, 2, 2, 3, 4], [2, 2], ["foo", "bar", "baz"]))
- end
-
- def test_strip_string_array
- assert_equal(["foo ", " bar ", " baz"],
- strip_string_array([" foo ", " bar ", " baz "]))
- assert_equal([:foo, " bar ", " baz"],
- strip_string_array([:foo, " bar ", " baz "]))
- assert_equal(["foo ", " bar ", :baz],
- strip_string_array([" foo ", " bar ", :baz]))
- end
-
- def test_paths
- assert_equal([[1, 3, 5], [2, 3, 5], [1, 4, 5], [2, 4, 5]],
- paths([[1, 2], [3, 4], [5]]))
- assert_equal([[]], paths([]))
- assert_equal([[1, 2, 3]], paths([[1], [2], [3]]))
- end
-
- def test_lcs
- assert_equal([1, 2, 3], lcs([1, 2, 3], [1, 2, 3]))
- assert_equal([], lcs([], [1, 2, 3]))
- assert_equal([], lcs([1, 2, 3], []))
- assert_equal([1, 2, 3], lcs([5, 1, 4, 2, 3, 17], [0, 0, 1, 2, 6, 3]))
-
- assert_equal([1], lcs([1, 2, 3, 4], [4, 3, 2, 1]))
- assert_equal([1, 2], lcs([1, 2, 3, 4], [3, 4, 1, 2]))
- end
-
- def test_lcs_with_block
- assert_equal(["1", "2", "3"],
- lcs([1, 4, 2, 5, 3], [1, 2, 3]) {|a, b| a == b && a.to_s})
- assert_equal([-4, 2, 8],
- lcs([-5, 3, 2, 8], [-4, 1, 8]) {|a, b| (a - b).abs <= 1 && [a, b].max})
- end
-
- def test_silence_warnings
- old_stderr, $stderr = $stderr, StringIO.new
- warn "Out"
- assert_equal("Out\n", $stderr.string)
- silence_warnings {warn "In"}
- assert_equal("Out\n", $stderr.string)
- ensure
- $stderr = old_stderr
- end
-
- def test_haml_warn
- assert_warning("Foo!") {haml_warn "Foo!"}
- end
-
- def test_silence_haml_warnings
- old_stderr, $stderr = $stderr, StringIO.new
- silence_haml_warnings {warn "Out"}
- assert_equal("Out\n", $stderr.string)
- silence_haml_warnings {haml_warn "In"}
- assert_equal("Out\n", $stderr.string)
- ensure
- $stderr = old_stderr
- end
-
- def test_has
- assert(has?(:instance_method, String, :chomp!))
- assert(has?(:private_instance_method, Haml::Engine, :set_locals))
- end
-
- def test_enum_with_index
- assert_equal(%w[foo0 bar1 baz2],
- enum_with_index(%w[foo bar baz]).map {|s, i| "#{s}#{i}"})
- end
-
- def test_enum_cons
- assert_equal(%w[foobar barbaz],
- enum_cons(%w[foo bar baz], 2).map {|s1, s2| "#{s1}#{s2}"})
- end
-
- def test_ord
- assert_equal(102, ord("f"))
- assert_equal(98, ord("bar"))
- end
-
- def test_flatten
- assert_equal([1, 2, 3], flatten([1, 2, 3], 0))
- assert_equal([1, 2, 3], flatten([1, 2, 3], 1))
- assert_equal([1, 2, 3], flatten([1, 2, 3], 2))
-
- assert_equal([[1, 2], 3], flatten([[1, 2], 3], 0))
- assert_equal([1, 2, 3], flatten([[1, 2], 3], 1))
- assert_equal([1, 2, 3], flatten([[1, 2], 3], 2))
-
- assert_equal([[[1], 2], [3], 4], flatten([[[1], 2], [3], 4], 0))
- assert_equal([[1], 2, 3, 4], flatten([[[1], 2], [3], 4], 1))
- assert_equal([1, 2, 3, 4], flatten([[[1], 2], [3], 4], 2))
- end
-
- def test_set_hash
- assert(set_hash(Set[1, 2, 3]) == set_hash(Set[3, 2, 1]))
- assert(set_hash(Set[1, 2, 3]) == set_hash(Set[1, 2, 3]))
-
- s1 = Set[]
- s1 << 1
- s1 << 2
- s1 << 3
- s2 = Set[]
- s2 << 3
- s2 << 2
- s2 << 1
- assert(set_hash(s1) == set_hash(s2))
- end
-
- def test_set_eql
- assert(set_eql?(Set[1, 2, 3], Set[3, 2, 1]))
- assert(set_eql?(Set[1, 2, 3], Set[1, 2, 3]))
-
- s1 = Set[]
- s1 << 1
- s1 << 2
- s1 << 3
- s2 = Set[]
- s2 << 3
- s2 << 2
- s2 << 1
- assert(set_eql?(s1, s2))
- end
-
- def test_caller_info
- assert_equal(["/tmp/foo.rb", 12, "fizzle"], caller_info("/tmp/foo.rb:12: in `fizzle'"))
- assert_equal(["/tmp/foo.rb", 12, nil], caller_info("/tmp/foo.rb:12"))
- assert_equal(["(haml)", 12, "blah"], caller_info("(haml):12: in `blah'"))
- assert_equal(["", 12, "boop"], caller_info(":12: in `boop'"))
- assert_equal(["/tmp/foo.rb", -12, "fizzle"], caller_info("/tmp/foo.rb:-12: in `fizzle'"))
- assert_equal(["/tmp/foo.rb", 12, "fizzle"], caller_info("/tmp/foo.rb:12: in `fizzle {}'"))
- end
-
- def test_version_gt
- assert_version_gt("2.0.0", "1.0.0")
- assert_version_gt("1.1.0", "1.0.0")
- assert_version_gt("1.0.1", "1.0.0")
- assert_version_gt("1.0.0", "1.0.0.rc")
- assert_version_gt("1.0.0.1", "1.0.0.rc")
- assert_version_gt("1.0.0.rc", "0.9.9")
- assert_version_gt("1.0.0.beta", "1.0.0.alpha")
-
- assert_version_eq("1.0.0", "1.0.0")
- assert_version_eq("1.0.0", "1.0.0.0")
- end
-
- def assert_version_gt(v1, v2)
- #assert(version_gt(v1, v2), "Expected #{v1} > #{v2}")
- assert(!version_gt(v2, v1), "Expected #{v2} < #{v1}")
- end
-
- def assert_version_eq(v1, v2)
- assert(!version_gt(v1, v2), "Expected #{v1} = #{v2}")
- assert(!version_gt(v2, v1), "Expected #{v2} = #{v1}")
- end
-
- def test_dump_and_load
- obj = Dumpable.new
- data = dump(obj)
- assert_equal([:before, :around_before, :around_after, :after], obj.arr)
- obj2 = load(data)
- assert_equal([:before, :around_before, :loaded], obj2.arr)
- end
-
- class FooBar
- def foo
- Haml::Util.abstract(self)
- end
- end
-
- def test_abstract
- assert_raise_message(NotImplementedError,
- "UtilTest::FooBar must implement #foo") {FooBar.new.foo}
- end
-
- def test_def_static_method
- klass = Class.new
- def_static_method(klass, :static_method, [:arg1, :arg2],
- :sarg1, :sarg2, <and<% else %>but never<% end %> " << arg2
-
- <% if sarg2 %>
- s << "."
- <% end %>
-RUBY
- c = klass.new
- assert_equal("Always brush your teeth and comb your hair.",
- c.send(static_method_name(:static_method, true, true),
- "brush your teeth", "comb your hair"))
- assert_equal("Always brush your teeth and comb your hair",
- c.send(static_method_name(:static_method, true, false),
- "brush your teeth", "comb your hair"))
- assert_equal("Always brush your teeth but never play with fire.",
- c.send(static_method_name(:static_method, false, true),
- "brush your teeth", "play with fire"))
- assert_equal("Always brush your teeth but never play with fire",
- c.send(static_method_name(:static_method, false, false),
- "brush your teeth", "play with fire"))
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/linked_rails.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/test/linked_rails.rb
deleted file mode 100644
index 56f3bb8201..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/linked_rails.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-# allows testing with edge Rails by creating a test/rails symlink
-linked_rails = File.dirname(__FILE__) + '/rails'
-
-if File.exists?(linked_rails) && !$:.include?(linked_rails + '/activesupport/lib')
- puts "[ using linked Rails ]"
- $:.unshift linked_rails + '/activesupport/lib'
- $:.unshift linked_rails + '/actionpack/lib'
- $:.unshift linked_rails + '/railties/lib'
-end
-require 'rubygems'
-require 'action_controller'
-require 'action_view'
-
-begin
- # Necessary for Rails 3
- require 'rails'
-rescue LoadError
- # Necessary for Rails 2.3.7
- require 'initializer'
-rescue LoadError
-end
-
-if defined?(Rails::Application) # Rails 3
- class TestApp < Rails::Application
- config.root = File.join(File.dirname(__FILE__), "../..")
- end
- Rails.application = TestApp
-elsif defined?(RAILS_ROOT)
- RAILS_ROOT.replace(File.join(File.dirname(__FILE__), "../.."))
-else
- RAILS_ROOT = File.join(File.dirname(__FILE__), "../..")
-end
-
-ActionController::Base.logger = Logger.new(nil)
-
-# Load plugins from test/plugins.
-# This will only work with very basic plugins,
-# since we don't want to load the entirety of Rails.
-Dir[File.dirname(__FILE__) + '/plugins/*'].each do |plugin|
- $: << plugin + '/lib'
- eval(File.read(plugin + '/init.rb'))
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/test_helper.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/test/test_helper.rb
deleted file mode 100644
index c8c31d6c13..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/test/test_helper.rb
+++ /dev/null
@@ -1,75 +0,0 @@
-lib_dir = File.dirname(__FILE__) + '/../lib'
-require File.dirname(__FILE__) + '/linked_rails'
-
-require 'test/unit'
-require 'fileutils'
-$:.unshift lib_dir unless $:.include?(lib_dir)
-require 'haml'
-
-require 'haml/template'
-Haml::Template.options[:ugly] = false
-Haml::Template.options[:format] = :xhtml
-
-class Test::Unit::TestCase
- def assert_warning(message)
- the_real_stderr, $stderr = $stderr, StringIO.new
- yield
-
- if message.is_a?(Regexp)
- assert_match message, $stderr.string.strip
- else
- assert_equal message.strip, $stderr.string.strip
- end
- ensure
- $stderr = the_real_stderr
- end
-
- def silence_warnings(&block)
- Haml::Util.silence_warnings(&block)
- end
-
- def rails_block_helper_char
- return '=' if Haml::Util.ap_geq_3?
- return '-'
- end
-
- def form_for_calling_convention(name)
- return "@#{name}, :as => :#{name}, :html => {:class => nil, :id => nil}" if Haml::Util.ap_geq_3?
- return ":#{name}, @#{name}"
- end
-
- def rails_form_attr
- return 'accept-charset="UTF-8" ' if Haml::Util.ap_geq?("3.0.0.rc")
- return ''
- end
-
- def rails_form_opener
- return '' unless Haml::Util.ap_geq?("3.0.0.rc")
- if Haml::Util.ap_geq?("3.0.0.rc2")
- encoding = 'utf8'
- char = '✓'
- else
- encoding = '_snowman'
- char = '☃'
- end
- return ''
- end
-
- def assert_raise_message(klass, message)
- yield
- rescue Exception => e
- assert_instance_of(klass, e)
- assert_equal(message, e.message)
- else
- flunk "Expected exception #{klass}, none raised"
- end
-
- def assert_raise_line(line)
- yield
- rescue Sass::SyntaxError => e
- assert_equal(line, e.sass_line)
- else
- flunk "Expected exception on line #{line}, none raised"
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/CONTRIBUTING b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/CONTRIBUTING
deleted file mode 100644
index be466d3920..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/CONTRIBUTING
+++ /dev/null
@@ -1,3 +0,0 @@
-Contributions are welcomed. Please see the following sites for guidelines:
-
- http://sass-lang.com/development.html#contributing
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/MIT-LICENSE b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/MIT-LICENSE
deleted file mode 100644
index 68b7aefb1a..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/MIT-LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-Copyright (c) 2006-2009 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/README.md b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/README.md
deleted file mode 100644
index 0daa35d7b3..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/README.md
+++ /dev/null
@@ -1,201 +0,0 @@
-# Sass
-
-**Sass makes CSS fun again**. Sass is an extension of CSS3,
-adding nested rules, variables, mixins, selector inheritance, and more.
-It's translated to well-formatted, standard CSS
-using the command line tool or a web-framework plugin.
-
-Sass has two syntaxes. The new main syntax (as of Sass 3)
-is known as "SCSS" (for "Sassy CSS"),
-and is a superset of CSS3's syntax.
-This means that every valid CSS3 stylesheet is valid SCSS as well.
-SCSS files use the extension `.scss`.
-
-The second, older syntax is known as the indented syntax (or just "Sass").
-Inspired by Haml's terseness, it's intended for people
-who prefer conciseness over similarity to CSS.
-Instead of brackets and semicolons,
-it uses the indentation of lines to specify blocks.
-Although no longer the primary syntax,
-the indented syntax will continue to be supported.
-Files in the indented syntax use the extension `.sass`.
-
-## Using
-
-Sass can be used from the command line
-or as part of a web framework.
-The first step is to install the gem:
-
- gem install sass
-
-After you convert some CSS to Sass, you can run
-
- sass style.scss
-
-to compile it back to CSS.
-For more information on these commands, check out
-
- sass --help
-
-To install Sass in Rails 2,
-just add `config.gem "sass"` to `config/environment.rb`.
-In Rails 3, add `gem "sass"` to your Gemfile instead.
-`.sass` or `.scss` files should be placed in `public/stylesheets/sass`,
-where they'll be automatically compiled
-to corresponding CSS files in `public/stylesheets` when needed
-(the Sass template directory is customizable...
-see [the Sass reference](http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#template_location-option) for details).
-
-Sass can also be used with any Rack-enabled web framework.
-To do so, just add
-
- require 'sass/plugin/rack'
- use Sass::Plugin::Rack
-
-to `config.ru`.
-Then any Sass files in `public/stylesheets/sass`
-will be compiled CSS files in `public/stylesheets` on every request.
-
-To use Sass programatically,
-check out the [YARD documentation](http://sass-lang.com/docs/yardoc/).
-
-## Formatting
-
-Sass is an extension of CSS
-that adds power and elegance to the basic language.
-It allows you to use [variables][vars], [nested rules][nested],
-[mixins][mixins], [inline imports][imports],
-and more, all with a fully CSS-compatible syntax.
-Sass helps keep large stylesheets well-organized,
-and get small stylesheets up and running quickly,
-particularly with the help of
-[the Compass style library](http://compass-style.org).
-
-[vars]: http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#variables_
-[nested]: http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#nested_rules_
-[mixins]: http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#mixins
-[imports]: http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#import
-
-Sass has two syntaxes.
-The one presented here, known as "SCSS" (for "Sassy CSS"),
-is fully CSS-compatible.
-The other (older) syntax, known as the indented syntax or just "Sass",
-is whitespace-sensitive and indentation-based.
-For more information, see the [reference documentation][syntax].
-
-[syntax]: http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#syntax
-
-To run the following examples and see the CSS they produce,
-put them in a file called `test.scss` and run `sass test.scss`.
-
-### Nesting
-
-Sass avoids repetition by nesting selectors within one another.
-The same thing works for properties.
-
- table.hl {
- margin: 2em 0;
- td.ln { text-align: right; }
- }
-
- li {
- font: {
- family: serif;
- weight: bold;
- size: 1.2em;
- }
- }
-
-### Variables
-
-Use the same color all over the place?
-Need to do some math with height and width and text size?
-Sass supports variables, math operations, and many useful functions.
-
- $blue: #3bbfce;
- $margin: 16px;
-
- .content_navigation {
- border-color: $blue;
- color: darken($blue, 10%);
- }
-
- .border {
- padding: $margin / 2;
- margin: $margin / 2;
- border-color: $blue;
- }
-
-### Mixins
-
-Even more powerful than variables,
-mixins allow you to re-use whole chunks of CSS,
-properties or selectors.
-You can even give them arguments.
-
- @mixin table-scaffolding {
- th {
- text-align: center;
- font-weight: bold;
- }
- td, th { padding: 2px; }
- }
-
- @mixin left($dist) {
- float: left;
- margin-left: $dist;
- }
-
- #data {
- @include left(10px);
- @include table-scaffolding;
- }
-
-A comprehensive list of features is available
-in the [Sass reference](http://beta.sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html).
-
-## Executables
-
-The Sass gem includes several executables that are useful
-for dealing with Sass from the command line.
-
-### `sass`
-
-The `sass` executable transforms a source Sass file into CSS.
-See `sass --help` for further information and options.
-
-### `sass-convert`
-
-The `sass-convert` executable converts between CSS, Sass, and SCSS.
-When converting from CSS to Sass or SCSS,
-nesting is applied where appropriate.
-See `sass-convert --help` for further information and options.
-
-## Authors
-
-Sass was envisioned by [Hampton Catlin](http://hamptoncatlin.com) (hcatlin).
-However, Hampton doesn't even know his way around the code anymore and now
-occasionally consults on the language issues. Hampton lives in Jacksonville,
-Florida and is the lead mobile developer for Wikimedia.
-
-[Nathan Weizenbaum](http://nex-3.com) is the primary developer and architect of
-Sass. His hard work has kept the project alive by endlessly answering forum
-posts, fixing bugs, refactoring, finding speed improvements, writing
-documentation, implementing new features, and getting Hampton coffee (a fitting
-task for a boy-genius). Nathan lives in Seattle, Washington and while not being
-a student at the University of Washington or working at an internship, he
-consults for Unspace Interactive.
-
-[Chris Eppstein](http://acts-as-architect.blogspot.com) is a core contributor to
-Sass and the creator of Compass, the first Sass-based framework. Chris focuses
-on making Sass more powerful, easy to use, and on ways to speed its adoption
-through the web development community. Chris lives in San Jose, California with
-his wife and daughter. He is the Software Architect for
-[Caring.com](http://caring.com), a website devoted to the 34 Million caregivers
-whose parents are sick or elderly, that uses Haml and Sass.
-
-If you use this software, you must pay Hampton a compliment. And
-buy Nathan some jelly beans. Maybe pet a kitten. Yeah. Pet that kitty.
-
-Beyond that, the implementation is licensed under the MIT License.
-Okay, fine, I guess that means compliments aren't __required__.
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/Rakefile b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/Rakefile
deleted file mode 100644
index bce0d84e14..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/Rakefile
+++ /dev/null
@@ -1,339 +0,0 @@
-# ----- Utility Functions -----
-
-def scope(path)
- File.join(File.dirname(__FILE__), path)
-end
-
-# ----- Default: Testing ------
-
-task :default => :test
-
-require 'rake/testtask'
-
-Rake::TestTask.new do |t|
- t.libs << 'test'
- test_files = FileList[scope('test/**/*_test.rb')]
- test_files.exclude(scope('test/rails/*'))
- test_files.exclude(scope('test/plugins/*'))
- t.test_files = test_files
- t.verbose = true
-end
-
-# ----- Packaging -----
-
-# Don't use Rake::GemPackageTast because we want prerequisites to run
-# before we load the gemspec.
-desc "Build all the packages."
-task :package => [:revision_file, :submodules, :permissions] do
- version = get_version
- File.open(scope('VERSION'), 'w') {|f| f.puts(version)}
- load scope('sass.gemspec')
- Gem::Builder.new(SASS_GEMSPEC).build
- sh %{git checkout VERSION}
-
- pkg = "#{SASS_GEMSPEC.name}-#{SASS_GEMSPEC.version}"
- mkdir_p "pkg"
- verbose(true) {mv "#{pkg}.gem", "pkg/#{pkg}.gem"}
-
- sh %{rm -f pkg/#{pkg}.tar.gz}
- verbose(false) {SASS_GEMSPEC.files.each {|f| sh %{tar rf pkg/#{pkg}.tar #{f}}}}
- sh %{gzip pkg/#{pkg}.tar}
-end
-
-task :permissions do
- sh %{chmod -R a+rx bin}
- sh %{chmod -R a+r .}
- require 'shellwords'
- Dir.glob('test/**/*_test.rb') do |file|
- next if file =~ %r{^test/haml/spec/}
- sh %{chmod a+rx #{file}}
- end
-end
-
-task :revision_file do
- require 'lib/sass'
-
- release = Rake.application.top_level_tasks.include?('release') || File.exist?(scope('EDGE_GEM_VERSION'))
- if Sass.version[:rev] && !release
- File.open(scope('REVISION'), 'w') { |f| f.puts Sass.version[:rev] }
- elsif release
- File.open(scope('REVISION'), 'w') { |f| f.puts "(release)" }
- else
- File.open(scope('REVISION'), 'w') { |f| f.puts "(unknown)" }
- end
-end
-
-# We also need to get rid of this file after packaging.
-at_exit { File.delete(scope('REVISION')) rescue nil }
-
-desc "Install Sass as a gem. Use SUDO=1 to install with sudo."
-task :install => [:package] do
- gem = RUBY_PLATFORM =~ /java/ ? 'jgem' : 'gem'
- sh %{#{'sudo ' if ENV["SUDO"]}#{gem} install --no-ri pkg/sass-#{get_version}}
-end
-
-desc "Release a new Sass package to Rubyforge."
-task :release => [:check_release, :package] do
- name = File.read(scope("VERSION_NAME")).strip
- version = File.read(scope("VERSION")).strip
- sh %{rubyforge add_release sass sass "#{name} (v#{version})" pkg/sass-#{version}.gem}
- sh %{rubyforge add_file sass sass "#{name} (v#{version})" pkg/sass-#{version}.tar.gz}
- sh %{gem push pkg/sass-#{version}.gem}
-end
-
-# Ensures that the VERSION file has been updated for a new release.
-task :check_release do
- version = File.read(scope("VERSION")).strip
- raise "There have been changes since current version (#{version})" if changed_since?(version)
- raise "VERSION_NAME must not be 'Bleeding Edge'" if File.read(scope("VERSION_NAME")) == "Bleeding Edge"
-end
-
-# Reads a password from the command line.
-#
-# @param name [String] The prompt to use to read the password
-def read_password(prompt)
- require 'readline'
- system "stty -echo"
- Readline.readline("#{prompt}: ").strip
-ensure
- system "stty echo"
- puts
-end
-
-# Returns whether or not the repository, or specific files,
-# has/have changed since a given revision.
-#
-# @param rev [String] The revision to check against
-# @param files [Array] The files to check.
-# If this is empty, checks the entire repository
-def changed_since?(rev, *files)
- IO.popen("git diff --exit-code #{rev} #{files.join(' ')}") {}
- return !$?.success?
-end
-
-task :submodules do
- if File.exist?(File.dirname(__FILE__) + "/.git")
- sh %{git submodule sync}
- sh %{git submodule update --init}
- elsif !File.exist?(File.dirname(__FILE__) + "/vendor/fssm/lib")
- warn < :yard
- task :redoc => :yard
-rescue LoadError
- desc "Generate Documentation"
- task :doc => :rdoc
- task :yard => :rdoc
-end
-
-task :pages do
- ensure_git_cleanup do
- puts "#{'=' * 50} Running rake pages"
- sh %{git checkout sass-pages}
- sh %{git reset --hard origin/sass-pages}
-
- Dir.chdir("/var/www/sass-pages") do
- sh %{git fetch origin}
-
- sh %{git checkout stable}
- sh %{git reset --hard origin/stable}
-
- sh %{git checkout sass-pages}
- sh %{git reset --hard origin/sass-pages}
- sh %{rake build --trace}
- sh %{mkdir -p tmp}
- sh %{touch tmp/restart.txt}
- end
- end
-end
-
-# ----- Coverage -----
-
-begin
- require 'rcov/rcovtask'
-
- Rcov::RcovTask.new do |t|
- t.test_files = FileList[scope('test/**/*_test.rb')]
- t.rcov_opts << '-x' << '"^\/"'
- if ENV['NON_NATIVE']
- t.rcov_opts << "--no-rcovrt"
- end
- t.verbose = true
- end
-rescue LoadError; end
-
-# ----- Profiling -----
-
-begin
- require 'ruby-prof'
-
- desc < e
- IO.popen("sendmail nex342@gmail.com", "w") do |sm|
- sm << "From: nex3@nex-3.com\n" <<
- "To: nex342@gmail.com\n" <<
- "Subject: Exception when running rake #{Rake.application.top_level_tasks.join(', ')}\n" <<
- e.message << "\n\n" <<
- e.backtrace.join("\n")
- end
-ensure
- raise e if e
-end
-
-def ensure_git_cleanup
- email_on_error {yield}
-ensure
- sh %{git reset --hard HEAD}
- sh %{git clean -xdf}
- sh %{git checkout master}
-end
-
-task :handle_update do
- email_on_error do
- unless ENV["REF"] =~ %r{^refs/heads/(master|stable|sass-pages)$}
- puts "#{'=' * 20} Ignoring rake handle_update REF=#{ENV["REF"].inspect}"
- next
- end
- branch = $1
-
- puts
- puts
- puts '=' * 150
- puts "Running rake handle_update REF=#{ENV["REF"].inspect}"
-
- sh %{git fetch origin}
- sh %{git checkout stable}
- sh %{git reset --hard origin/stable}
- sh %{git checkout master}
- sh %{git reset --hard origin/master}
-
- case branch
- when "master"
- sh %{rake release_edge --trace}
- when "stable", "sass-pages"
- sh %{rake pages --trace}
- end
-
- puts 'Done running handle_update'
- puts '=' * 150
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/TODO b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/TODO
deleted file mode 100644
index b3591b8b08..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/TODO
+++ /dev/null
@@ -1,39 +0,0 @@
-# -*- mode: org -*-
-#+STARTUP: nofold
-
-* Documentation
- Redo tutorial?
- Syntax highlighting?
-
-* Code
- Keep track of error offsets everywhere
- Use this to show error location in messages
- Just clean up SassScript syntax errors in general
- Lexer errors in particular are icky
- See in particular error changes made in c07b5c8
-** Sass
- Benchmark the effects of storing the raw template in sassc
- If it's expensive, overload RootNode dumping/loading to dup and set @template to nil
- Then fall back on reading from actual file
- Make Rack middleware the default for Rails and Merb versions that support it
- CSS superset
- Classes are mixins
- Can refer to specific property values? Syntax?
- Pull in Compass watcher stuff
- Internationalization
- Particularly word constituents in Regexps
- Optimization
- http://csstidy.sourceforge.net/
- http://developer.yahoo.com/yui/compressor/
- Also comma-folding identical rules where possible
- Multiple levels
- 0: No optimization
- 1: Nothing that changes doc structure
- No comma-folding
- 2: Anything that keeps functionality identical to O2 (default)
- 3: Assume order of rules doesn't matter
- Comma-fold even if there are intervening rules that might interfere
- CSS3
- Add (optional) support for http://www.w3.org/TR/css3-values/#calc
- Cross-unit arithmetic should compile into this
- Should we use "mod" in Sass for consistency?
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/VERSION b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/VERSION
deleted file mode 100644
index fd2a01863f..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-3.1.0
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/VERSION_NAME b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/VERSION_NAME
deleted file mode 100644
index 696137c3c7..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/VERSION_NAME
+++ /dev/null
@@ -1 +0,0 @@
-Brainy Betty
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/bin/sass b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/bin/sass
deleted file mode 100755
index 2b01e92eee..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/bin/sass
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env ruby
-# The command line Sass parser.
-
-require File.dirname(__FILE__) + '/../lib/sass'
-require 'sass/exec'
-
-opts = Sass::Exec::Sass.new(ARGV)
-opts.parse!
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/bin/sass-convert b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/bin/sass-convert
deleted file mode 100755
index 97ee024f33..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/bin/sass-convert
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env ruby
-
-require File.dirname(__FILE__) + '/../lib/sass'
-require 'sass/exec'
-
-opts = Sass::Exec::SassConvert.new(ARGV)
-opts.parse!
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/bin/scss b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/bin/scss
deleted file mode 100755
index 0791cfb50d..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/bin/scss
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env ruby
-# The command line Sass parser.
-
-require File.dirname(__FILE__) + '/../lib/sass'
-require 'sass/exec'
-
-opts = Sass::Exec::Scss.new(ARGV)
-opts.parse!
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/doc-src/FAQ.md b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/doc-src/FAQ.md
deleted file mode 100644
index e919ccdc96..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/doc-src/FAQ.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# Frequently Asked Questions
-
-* Table of contents
-{:toc}
-
-## Can I use a variable from my controller in my Sass file?
-{#q-ruby-code}
-
-No. Sass files aren't views.
-They're compiled once into static CSS files,
-then left along until they're changed and need to be compiled again.
-Not only don't you want to be running a full request cycle
-every time someone requests a stylesheet,
-but it's not a great idea to put much logic in there anyway
-due to how browsers handle them.
-
-If you really need some sort of dynamic CSS,
-you can define your own {Sass::Script::Functions Sass functions} using Ruby
-that can access the database or other configuration.
-*Be aware when doing this that Sass files are by default only compiled once
-and then served statically.*
-
-If you really, really need to compile Sass on each request,
-first make sure you have adequate caching set up.
-Then you can use {Sass::Engine} to render the code,
-using the {file:SASS_REFERENCE.md#custom-option `:custom` option}
-to pass in data that {Sass::Script::Functions::EvaluationContext#options can be accessed}
-from your Sass functions.
-
-# You still haven't answered my question!
-
-Sorry! Try looking at the [Sass](http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html) reference,
-If you can't find an answer there,
-feel free to ask in `#sass` on irc.freenode.net
-or send an email to the [mailing list](http://groups.google.com/group/sass-lang).
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/doc-src/INDENTED_SYNTAX.md b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/doc-src/INDENTED_SYNTAX.md
deleted file mode 100644
index f6b286c707..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/doc-src/INDENTED_SYNTAX.md
+++ /dev/null
@@ -1,210 +0,0 @@
-# Sass Indented Syntax
-
-* Table of contents
-{:toc}
-
-Sass's indented syntax (also known simply as "Sass")
-is designed to provide a more concise
-and, for some, more aesthetically appealing alternative
-to the CSS-based SCSS syntax.
-It's not compatible with CSS;
-instead of using `{` and `}` to delimit blocks of styles,
-it uses indentation,
-and instead of using semicolons to separate statements it uses newlines.
-This usually leads to substantially less text
-when saying the same thing.
-
-Each statement in Sass, such as property declarations and selectors,
-must be placed on its own line.
-In addition, everything that would be within `{` and `}` after a statement
-must be on a new line and indented one level deeper than that statement.
-For example, this CSS:
-
- #main {
- color: blue;
- font-size: 0.3em;
- }
-
-would be this Sass:
-
- #main
- color: blue
- font-size: 0.3em
-
-Similarly, this SCSS:
-
- #main {
- color: blue;
- font-size: 0.3em;
-
- a {
- font: {
- weight: bold;
- family: serif;
- }
- &:hover {
- background-color: #eee;
- }
- }
- }
-
-would be this Sass:
-
- #main
- color: blue
- font-size: 0.3em
-
- a
- font:
- weight: bold
- family: serif
- &:hover
- background-color: #eee
-
-## Sass Syntax Differences
-
-In general, most CSS and SCSS syntax
-works straightforwardly in Sass
-by using newlines instead of semicolons
-and indentation instead of braces.
-However, there are some cases where there are differences or subtleties,
-which are detailed below.
-
-## Property Synax
-
-The indented syntax supports two ways of declaring CSS properties.
-The first is just like CSS, except without the semicolon.
-The second, however, places the colon *before* the property name.
-For example:
-
- #main
- :color blue
- :font-size 0.3em
-
-By default, both ways may be used.
-However, the {file:SASS_REFERENCE.md#property_syntax-option `:property_syntax` option}
-may be used to specify that only one property syntax is allowed.
-
-### Multiline Selectors
-
-Normally in the indented syntax, a single selector must take up a single line.
-There is one exception, however:
-selectors can contain newlines as long as they only appear after commas.
-For example:
-
- .users #userTab,
- .posts #postTab
- width: 100px
- height: 30px
-
-### Comments
-
-Like everything else in the indented syntax,
-comments are line-based.
-This means that they don't work the same way as in SCSS.
-They must take up an entire line,
-and they also encompass all text nested beneath them.
-
-Like SCSS, the indented syntax supports two kinds of comments.
-Comments beginning with `/*` are preserved in the CSS output,
-although unlike SCSS they don't require a closing `*/`.
-Comments beginning with `//` are removed entirely.
-For example:
-
- /* This comment will appear in the CSS output.
- This is nested beneath the comment,
- so it's part of it
- body
- color: black
-
- // This comment will not appear in the CSS output.
- This is nested beneath the comment as well,
- so it also won't appear
- a
- color: green
-
-is compiled to:
-
- /* This comment will appear in the CSS output.
- * This is nested beneath the comment,
- * so it's part of it */
- body {
- color: black; }
-
- a {
- color: green; }
-
-### `@import`
-
-The `@import` directive in Sass does not require quotes, although they may be used.
-For example, this SCSS:
-
- @import "themes/dark";
- @import "font.sass";
-
-would be this Sass:
-
- @import themes/dark
- @import font.sass
-
-### Mixin Directives
-
-Sass supports shorthands for the `@mixin` and `@include` directives.
-Instead of writing `@mixin`, you can use the character `=`;
-instead of writing `@include`, you can use the character `+`.
-For example:
-
- =large-text
- font:
- family: Arial
- size: 20px
- weight: bold
- color: #ff0000
-
- h1
- +large-text
-
-is the same as:
-
- @mixin large-text
- font:
- family: Arial
- size: 20px
- weight: bold
- color: #ff0000
-
- h1
- @include large-text
-
-## Deprecated Syntax
-
-Since the indented syntax has been around for a while,
-previous versions have made some syntactic decisions
-that have since been changed.
-Some of the old syntax still works, though,
-so it's documented here.
-
-**Note that this syntax is not recommended
-for use in new Sass files**.
-It will print a warning if it's used,
-and it will be removed in a future version.
-
-### `=` for Properties and Variables
-
-`=` used to be used instead of `:` when setting variables
-and when setting properties to SassScript values.
-It has slightly different semantics than `:`;
-see {file:SASS_CHANGELOG.md#3-0-0-sass-script-context this changelog entry} for details.
-
-### `||=` for Default Variables
-
-`||=` used to be used instead of `:` when setting the default value of a variable.
-The `!default` flag was not used.
-The variable value has the same semantics as `=`;
-see {file:SASS_CHANGELOG.md#3-0-0-sass-script-context this changelog entry} for details.
-
-### `!` Prefix for Variables
-
-`!` used to be used as the variable prefix instead of `$`.
-This had no difference in functionality;
-it was a purely aesthetic change.
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/doc-src/SASS_CHANGELOG.md b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/doc-src/SASS_CHANGELOG.md
deleted file mode 100644
index f4d1ac97c7..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/doc-src/SASS_CHANGELOG.md
+++ /dev/null
@@ -1,2214 +0,0 @@
-# Sass Changelog
-
-* Table of contents
-{:toc}
-
-## 3.1.0 (Unreleased)
-
-* Add an {Sass::Script::Functions#invert `invert` function} that takes the inverse of colors.
-
-* A new sass function called `if` can be used to emit one of two values
- based on the truth value of the first argument.
- For example, `if(true, 1px, 2px)` returns `1px` and `if(false, 1px, 2px)` returns `2px`.
-
-* Compass users can now use the `--compass` flag
- to make the Compass libraries available for import.
- This will also load the Compass project configuration
- if run from the project root.
-
-* Many performance optimizations have been made by [thedarkone](http://github.com/thedarkone).
-
-* Allow selectors to contain extra commas to make them easier to modify.
- Extra commas will be removed when the selectors are converted to CSS.
-
-* `@import` may now be used within CSS or `@media` rules.
- The imported file will be treated as though it were nested within the rule.
- Files with mixins may not be imported in nested contexts.
-
-* If a comment starts with `!`, that comment will now be interpolated
- (`#{...}` will be replaced with the resulting value of the expression
- inside) and the comment will always be printed out in the generated CSS
- file -- even with compressed output. This is useful for adding copyright
- notices to your stylesheets.
-
-* A new executable named `scss` is now available. It is exactly like the
- `sass` executable except it defaults to assuming input is in the SCSS syntax.
- Both programs will use the source file's extension to determine the syntax where
- possible.
-
-### Sass-based Functions
-
-While it has always been possible to add functions to Sass with Ruby, this release adds the ability to define new functions within Sass files directly.
-For example:
-
- $grid-width: 40px;
- $gutter-width: 10px;
-
- @function grid-width($n) {
- @return $n * $grid-width + ($n - 1) * $gutter-width;
- }
-
- #sidebar { width: grid-width(5); }
-
-Becomes:
-
- #sidebar {
- width: 240px; }
-
-### Keyword Arguments
-
-Both mixins and Sass functions now support the ability to pass in keyword arguments.
-For example, with mixins:
-
- @mixin border-radius($value, $moz: true, $webkit: true, $css3: true) {
- @if $moz { -moz-border-radius: $value }
- @if $webkit { -webkit-border-radius: $value }
- @if $css3 { border-radius: $value }
- }
-
- @include border-radius(10px, $webkit: false);
-
-And with functions:
-
- p {
- color: hsl($hue: 180, $saturation: 78%, $lightness: 57%);
- }
-
-Keyword arguments are of the form `$name: value` and come after normal arguments.
-They can be used for either optional or required arguments.
-For mixins, the names are the same as the argument names for the mixins.
-For functions, the names are defined along with the functions.
-The argument names for the built-in functions are listed
-{Sass::Script::Functions in the function documentation}.
-
-Sass functions defined in Ruby can use the {Sass::Script::Functions.declare} method
-to declare the names of the arguments they take.
-
-#### New Keyword Functions
-
-The new keyword argument functionality enables new Sass color functions
-that use keywords to encompass a large amount of functionality in one function.
-
-* The {Sass::Script::Functions#adjust_color adjust-color} function works like the old
- `lighten`, `saturate`, and `adjust-hue` methods.
- It increases and/or decreases the values of a color's properties by fixed amounts.
- For example, `adjust-color($color, $lightness: 10%)` is the same as `lighten($color, 10%)`:
- it returns `$color` with its lightness increased by 10%.
-
-* The {Sass::Script::Functions#scale_color scale_color} function
- is similar to {Sass::Script::Functions#adjust adjust},
- but instead of increasing and/or decreasing a color's properties by fixed amounts,
- it scales them fluidly by percentages.
- The closer the percentage is to 100% (or -100%),
- the closer the new property value will be to its maximum (or minimum).
- For example, `scale-color(hsl(120, 70, 80), $lightness: 50%)`
- will change the lightness from 80% to 90%,
- because 90% is halfway between 80% and 100%.
- Similarly, `scale-color(hsl(120, 70, 50), $lightness: 50%)`
- will change the lightness from 50% to 75%.
-
-* The {Sass::Script::Functions#change_color change-color} function simply changes a color's properties
- regardless of their old values.
- For example `change-color($color, $lightness: 10%)` returns `$color` with 10% lightness,
- and `change-color($color, $alpha: 0.7)` returns color with opacity 0.7.
-
-Each keyword function accepts `$hue`, `$saturation`, `$value`,
-`$red`, `$green`, `$blue`, and `$alpha` keywords,
-with the exception of `scale-color()` which doesn't accept `$hue`.
-These keywords modify the respective properties of the given color.
-
-Each keyword function can modify multiple properties at once.
-For example, `adjust-color($color, $lightness: 15%, $saturation: -10%)`
-both lightens and desaturates `$color`.
-HSL properties cannot be modified at the same time as RGB properties, though.
-
-### Lists
-
-Lists are now a first-class data type in Sass,
-alongside strings, numbers, colors, and booleans.
-They can be assigned to variables, passed to mixins,
-and used in CSS declarations.
-Just like the other data types (except booleans),
-Sass lists look just like their CSS counterparts.
-They can be separated either by spaces (e.g. `1px 2px 0 10px`)
-or by commas (e.g. `Helvetica, Arial, sans-serif`).
-In addition, individual values count as single-item lists.
-
-Lists won't behave any differently in Sass 3.1 than they did in 3.0.
-However, you can now do more with them using the new {file:Sass/Script/Functions.html#list-functions list functions}:
-
-* The {Sass::Script::Functions#nth `nth($list, $n)` function} returns the nth item in a list.
- For example, `nth(1px 2px 10px, 2)` returns the second item, `2px`.
- Note that lists in Sass start at 1, not at 0 like they do in some other languages.
-
-* The {Sass::Script::Functions#join `join($list1, $list2)` function}
- joins together two lists into one.
- For example, `join(1px 2px, 10px 5px)` returns `1px 2px 10px 5px`.
-
-* The {Sass::Script::Functions#append `append($list, $val)` function}
- appends values to the end of a list.
- For example, `append(1px 2px, 10px)` returns `1px 2px 10px`.
-
-* The {Sass::Script::Functions#join `length($list)` function}
- returns the length of a list.
- For example, `length(1px 2px 10px 5px)` returns `4`.
-
-For more details about lists see {file:SASS_REFERENCE.md#lists the reference}.
-
-#### `@each`
-
-There's also a new directive that makes use of lists.
-The {file:SASS_REFERENCE.md#each-directive `@each` directive} assigns a variable to each item in a list in turn,
-like `@for` does for numbers.
-This is useful for writing a bunch of similar styles
-without having to go to the trouble of creating a mixin.
-For example:
-
- @each $animal in puma, sea-slug, egret, salamander {
- .#{$animal}-icon {
- background-image: url('/images/#{$animal}.png');
- }
- }
-
-is compiled to:
-
- .puma-icon {
- background-image: url('/images/puma.png'); }
- .sea-slug-icon {
- background-image: url('/images/sea-slug.png'); }
- .egret-icon {
- background-image: url('/images/egret.png'); }
- .salamander-icon {
- background-image: url('/images/salamander.png'); }
-
-### `@media` Bubbling
-
-Modern stylesheets often use `@media` rules to target styles
-at certain sorts of devices, screen resolutions, or even orientations.
-They're also useful for print and aural styling.
-Unfortunately, it's annoying and repetitive to break the flow of a stylesheet
-and add a `@media` rule containing selectors you've already written
-just to tweak the style a little.
-
-Thus, Sass 3.1 now allows you to nest `@media` rules within selectors.
-It will automatically bubble them up to the top level,
-putting all the selectors on the way inside the rule.
-For example:
-
- .sidebar {
- width: 300px;
- @media screen and (orientation: landscape) {
- width: 500px;
- }
- }
-
-is compiled to:
-
- .sidebar {
- width: 300px;
- }
- @media screen and (orientation: landscape) {
- .sidebar {
- width: 500px;
- }
- }
-
-You can also nest `@media` directives within one another.
-The queries will then be combined using the `and` operator.
-For example:
-
- @media screen {
- .sidebar {
- @media (orientation: landscape) {
- width: 500px;
- }
- }
- }
-
-is compiled to:
-
- @media screen and (orientation: landscape) {
- .sidebar {
- width: 500px;
- }
- }
-
-### Nested `@import`
-
-The `@import` statement can now be nested within other structures
-such as CSS rules and `@media` rules. For example:
-
- @media print {
- @import "print";
- }
-
-This imports `print.scss` and places all rules so imported within the `@media print` block.
-This makes it easier to create stylesheets for specific media or sections of the document
-and distributing those stylesheets across multiple files.
-
-### Backwards Incompatibilities -- Must Read!
-
-* When `@import` is given a path without `.sass`, `.scss`, or `.css` extension,
- and no file exists at that path, it will now throw an error.
- The old behavior of becoming a plain-CSS `@import` was deprecated
- and has now been removed.
-
-* Get rid of the `--rails` flag for the `sass` executable.
- This flag hasn't been necessary since Rails 2.0.
- Existing Rails 2.0 installations will continue to work.
-
-* Removed deprecated support for ! prefixed variables. Use $ to prefix variables now.
-
-* Removed the deprecated css2sass executable. Use sass-convert now.
-
-* Removed support for the equals operator in variable assignment. Use : now.
-
-* Removed the sass2 mode from sass-convert. Users who have to migrate from sass2
- should install Sass 3.0 and quiet all deprecation warnings before installing Sass 3.1.
-
-### Sass Internals
-
-* It is now possible to define a custom importer that can be used to find imports using different import semantics than the default filesystem importer that Sass provides. For instance, you can use this to generate imports on the fly, look them up from a database, or implement different file naming conventions. See the {Sass::Importers::Base Importer Base class} for more information.
-
-* It is now possible to define a custom cache store to allow for efficient caching of Sass files using alternative cache stores like memcached in environments where a writable filesystem is not available or where the cache need to be shared across many servers for dynamically generated stylesheet environments. See the {Sass::CacheStores::Base CacheStore Base class} for more information.
-
-## 3.0.26 (Unreleased)
-
-* Fix a performance bug in large SCSS stylesheets with many nested selectors.
- This should dramatically decrease compilation time of such stylesheets.
-
-* Upgrade the bundled FSSM to version 0.2.3.
- This means `sass --watch` will work out of the box with Rubinius.
-
-## 3.0.25
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.25).
-
-* When displaying a Sass error in an imported stylesheet,
- use the imported stylesheet's contents rather than the top-level stylesheet.
-
-* Fix a bug that caused some lines with non-ASCII characters to be ignored in Ruby 1.8.
-
-* Fix a bug where boolean operators (`and`, `or`, and `not`) wouldn't work at the end of a line
- in a multiline SassScript expression.
-
-* When using `sass --update`, only update individual files when they've changed.
-
-## 3.0.24
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.24).
-
-* Raise an error when `@else` appears without an `@if` in SCSS.
-
-* Fix some cases where `@if` rules were causing the line numbers in error reports
- to become incorrect.
-
-## 3.0.23
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.23).
-
-* Fix the error message for unloadable modules when running the executables under Ruby 1.9.2.
-
-### `@charset` Change
-
-The behavior of `@charset` has changed in version 3.0.23
-in order to work around a bug in Safari,
-where `@charset` declarations placed anywhere other than the beginning of the document
-cause some CSS rules to be ignored.
-This change also makes `@charset`s in imported files behave in a more useful way.
-
-#### Ruby 1.9
-
-When using Ruby 1.9, which keeps track of the character encoding of the Sass document internally,
-`@charset` directive in the Sass stylesheet and any stylesheets it imports
-are no longer directly output to the generated CSS.
-They're still used for determining the encoding of the input and output stylesheets,
-but they aren't rendered in the same way other directives are.
-
-Instead, Sass adds a single `@charset` directive at the beginning of the output stylesheet
-if necessary, whether or not the input stylesheet had a `@charset` directive.
-It will add this directive if and only if the output stylesheet contains non-ASCII characters.
-By default, the declared charset will be UTF-8,
-but if the Sass stylesheet declares a different charset then that will be used instead if possible.
-
-One important consequence of this scheme is that it's possible for a Sass file
-to import partials with different encodings (e.g. one encoded as UTF-8 and one as IBM866).
-The output will then be UTF-8, unless the importing stylesheet
-declares a different charset.
-
-#### Ruby 1.8
-
-Ruby 1.8 doesn't have good support for encodings, so it uses a simpler but less accurate
-scheme for figuring out what `@charset` declaration to use for the output stylesheet.
-It just takes the first `@charset` declaration to appear in the stylesheet
-or any of its imports and moves it to the beginning of the document.
-This means that under Ruby 1.8 it's *not* safe to import files with different encodings.
-
-## 3.0.22
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.22).
-
-* Remove `vendor/sass`, which snuck into the gem by mistake
- and was causing trouble for Heroku users (thanks to [Jacques Crocker](http://railsjedi.com/)).
-
-* `sass-convert` now understands better when it's acceptable
- to remove parentheses from expressions.
-
-## 3.0.21
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.21).
-
-* Fix the permissions errors for good.
-
-* Fix more `#options` attribute errors.
-
-## 3.0.20
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.20).
-
-* Fix some permissions errors.
-
-* Fix `#options` attribute errors when CSS functions were used with commas.
-
-## 3.0.19
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.19).
-
-* Make the alpha value for `rgba` colors respect {Sass::Script::Number::PRECISION}.
-
-* Remove all newlines in selectors in `:compressed` mode.
-
-* Make color names case-insensitive.
-
-* Properly detect SCSS files when using `sass -c`.
-
-* Remove spaces after commas in `:compressed` mode.
-
-* Allow the `--unix-newlines` flag to work on Unix, where it's a no-op.
-
-## 3.0.18
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.18).
-
-* Don't require `rake` in the gemspec, for bundler compatibility under
- JRuby. Thanks to [Gordon McCreight](http://www.gmccreight.com/blog).
-
-* Add a command-line option `--stop-on-error` that causes Sass to exit
- when a file fails to compile using `--watch` or `--update`.
-
-* Fix a bug in `haml_tag` that would allow duplicate attributes to be added
- and make `data-` attributes not work.
-
-* Get rid of the annoying RDoc errors on install.
-
-* Disambiguate references to the `Rails` module when `haml-rails` is installed.
-
-* Allow `@import` in SCSS to import multiple files in the same `@import` rule.
-
-## 3.0.17
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.17).
-
-* Disallow `#{}` interpolation in `@media` queries or unrecognized directives.
- This was never allowed, but now it explicitly throws an error
- rather than just producing invalid CSS.
-
-* Make `sass --watch` not throw an error when passed a single file or directory.
-
-* Understand that mingw counts as Windows.
-
-* Make `sass --update` return a non-0 exit code if one or more files being updated
- contained an error.
-
-## 3.0.16
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.16).
-
-* Fix a bug where certain sorts of comments would get improperly
- rendered in the `:compact` style.
-
-* Always allow a trailing `*/` in loud comments in the indented syntax.
-
-* Fix a performance issue with SCSS parsing in rare cases.
- Thanks to [Chris Eppstein](http://chriseppstein.github.com).
-
-* Use better heuristics for figuring out when someone might be using
- the wrong syntax with `sass --watch`.
-
-## 3.0.15
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.15).
-
-* Fix a bug where `sass --watch` and `sass --update` were completely broken.
-
-* Allow `@import`ed values to contain commas.
-
-## 3.0.14
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.14).
-
-* Properly parse paths with drive letters on Windows (e.g. `C:\Foo\Bar.sass`)
- in the Sass executable.
-
-* Compile Sass files in a deterministic order.
-
-* Fix a bug where comments after `@if` statements in SCSS
- weren't getting passed through to the output document.
-
-## 3.0.13
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.13).
-
-## CSS `@import` Directives
-
-Sass is now more intelligent about when to compile `@import` directives to plain CSS.
-Any of the following conditions will cause a literal CSS `@import`:
-
-* Importing a path with a `.css` extension (e.g. `@import "foo.css"`).
-* Importing a path with a media type (e.g. `@import "foo" screen;`).
-* Importing an HTTP path (e.g. `@import "http://foo.com/style.css"`).
-* Importing any URL (e.g. `@import url(foo)`).
-
-The former two conditions always worked, but the latter two are new.
-
-## `-moz-calc` Support
-
-The new [`-moz-calc()` function](http://hacks.mozilla.org/2010/06/css3-calc/) in Firefox 4
-will now be properly parsed by Sass.
-`calc()` was already supported, but because the parsing rules are different
-than for normal CSS functions, this had to be expanded to include `-moz-calc`.
-
-In anticipation of wider browser support, in fact,
-*any* function named `-*-calc` (such as `-webkit-calc` or `-ms-calc`)
-will be parsed the same as the `calc` function.
-
-## `:-moz-any` Support
-
-The [`:-moz-any` pseudoclass selector](http://hacks.mozilla.org/2010/05/moz-any-selector-grouping/)
-is now parsed by Sass.
-
-## `--require` Flag
-
-The Sass command-line executable can now require Ruby files
-using the `--require` flag (or `-r` for short).
-
-## Rails Support
-
-Make sure the default Rails options take precedence over the default non-Rails options.
-This makes `./script/server --daemon` work again.
-
-### Rails 3 Support
-
-Support for Rails 3 versions prior to beta 4 has been removed.
-Upgrade to Rails 3.0.0.beta4 if you haven't already.
-
-## 3.0.12
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.12).
-
-## Rails 3 Support
-
-Apparently the last version broke in new and exciting ways under Rails 3,
-due to the inconsistent load order caused by certain combinations of gems.
-3.0.12 hacks around that inconsistency, and *should* be fully Rails 3-compatible.
-
-### Deprecated: Rails 3 Beta 3
-
-Haml's support for Rails 3.0.0.beta.3 has been deprecated.
-Haml 3.0.13 will only support 3.0.0.beta.4.
-
-## 3.0.11
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.11).
-
-There were no changes made to Haml between versions 3.0.10 and 3.0.11.
-
-## Rails 3 Support
-
-Make sure Sass *actually* regenerates stylesheets under Rails 3.
-The fix in 3.0.10 didn't work because the Rack stack we were modifying
-wasn't reloaded at the proper time.
-
-## Bug Fixes
-
-* Give a decent error message when `--recursive` is used
- in `sass-convert` without a directory.
-
-## 3.0.10
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.10).
-
-### Appengine-JRuby Support
-
-The way we determine the location of the Haml installation
-no longer breaks the version of JRuby
-used by [`appengine-jruby`](http://code.google.com/p/appengine-jruby/).
-
-### Rails 3 Support
-
-Sass will regenerate stylesheets under Rails 3
-even when no controllers are being accessed.
-
-### Other Improvements
-
-* When using `sass-convert --from sass2 --to sass --recursive`,
- suggest the use of `--in-place` as well.
-
-## 3.0.9
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.9).
-
-There were no changes made to Sass between versions 3.0.8 and 3.0.9.
-A bug in Gemcutter caused the gem to be uploaded improperly.
-
-## 3.0.8
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.8).
-
-* Fix a bug with Rails versions prior to Rails 3.
-
-## 3.0.7
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.7).
-
-### Encoding Support
-
-Sass 3.0.7 adds support for `@charset` for declaring the encoding of a stylesheet.
-For details see {file:SASS_REFERENCE.md#encodings the reference}.
-
-The `sass` and `sass-convert` executables also now take an `-E` option
-for specifying the encoding of Sass/SCSS/CSS files.
-
-### Bug Fixes
-
-* When compiling a file named `.sass` but with SCSS syntax specified,
- use the latter (and vice versa).
-
-* Fix a bug where interpolation would cause some selectors to render improperly.
-
-* If a line in a Sass comment starts with `*foo`,
- render it as `*foo` rather than `* *foo`.
-
-## 3.0.6
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.6).
-
-There were no changes made to Sass between versions 3.0.5 and 3.0.6.
-
-## 3.0.5
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.5).
-
-### `#{}` Interpolation in Properties
-
-Previously, using `#{}` in some places in properties
-would cause a syntax error.
-Now it can be used just about anywhere.
-
-Note that when `#{}` is used near operators like `/`,
-those operators are treated as plain CSS
-rather than math operators.
-For example:
-
- p {
- $font-size: 12px;
- $line-height: 30px;
- font: #{$font-size}/#{$line-height};
- }
-
-is compiled to:
-
- p {
- font: 12px/30px;
- }
-
-This is useful, since normally {file:SASS_REFERENCE.md#division-and-slash
-a slash with variables is treated as division}.
-
-### Recursive Mixins
-
-Mixins that include themselves will now print
-much more informative error messages.
-For example:
-
- @mixin foo {@include bar}
- @mixin bar {@include foo}
- @include foo
-
-will print:
-
- An @include loop has been found:
- foo includes bar
- bar includes foo
-
-Although it was previously possible to use recursive mixins
-without causing infinite looping, this is now disallowed,
-since there's no good reason to do it.
-
-### Rails 3 Support
-
-Fix Sass configuration under Rails 3.
-Thanks [Dan Cheail](http://github.com/codeape).
-
-### `sass --no-cache`
-
-Make the `--no-cache` flag properly forbid Sass from writing `.sass-cache` files.
-
-## 3.0.4
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.4).
-
-* Raise an informative error when function arguments have a mispaced comma,
- as in `foo(bar, )`.
-
-* Fix a performance problem when using long function names
- such as `-moz-linear-gradient`.
-
-## 3.0.3
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.3).
-
-### Rails 3 Support
-
-Make sure Sass is loaded properly when using Rails 3
-along with non-Rails-3-compatible plugins like some versions of `will_paginate`.
-
-Also, In order to make some Rails loading errors like the above easier to debug,
-Sass will now raise an error if `Rails.root` is `nil` when Sass is loading.
-Previously, this would just cause the paths to be mis-set.
-
-### Merb Support
-
-Merb, including 1.1.0 as well as earlier versions,
-should *really* work with this release.
-
-### Bug Fixes
-
-* Raise an informative error when mixin arguments have a mispaced comma,
- as in `@include foo(bar, )`.
-
-* Make sure SassScript subtraction happens even when nothing else dynamic is going on.
-
-* Raise an error when colors are used with the wrong number of digits.
-
-## 3.0.2
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.2).
-
-### Merb 1.1.0 Support
-
-Fixed a bug inserting the Sass plugin into the Merb 1.1.0 Rack application.
-
-### Bug Fixes
-
-* Allow identifiers to begin with multiple underscores.
-
-* Don't raise an error when using `haml --rails` with older Rails versions.
-
-## 3.0.1
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.1).
-
-### Installation in Rails
-
-`haml --rails` is no longer necessary for installing Sass in Rails.
-Now all you need to do is add `gem "haml"` to the Gemfile for Rails 3,
-or add `config.gem "haml"` to `config/environment.rb` for previous versions.
-
-`haml --rails` will still work,
-but it has been deprecated and will print an error message.
-It will not work in the next version of Sass.
-
-### Rails 3 Beta Integration
-
-* Make sure manually importing the Sass Rack plugin still works with Rails,
- even though it's not necessary now.
-
-* Allow Sass to be configured in Rails even when it's being lazy-loaded.
-
-### `:template_location` Methods
-
-The {file:SASS_REFERENCE.md#template_location-option `:template_location` option}
-can be either a String, a Hash, or an Array.
-This makes it difficult to modify or use with confidence.
-Thus, three new methods have been added for handling it:
-
-* {Sass::Plugin::Configuration#template_location_array Sass::Plugin#template_location_array} --
- Returns the template locations and CSS locations formatted as an array.
-
-* {Sass::Plugin::Configuration#add_template_location Sass::Plugin#add_template_location} --
- Converts the template location option to an array and adds a new location.
-
-* {Sass::Plugin::Configuration#remove_template_location Sass::Plugin#remove_template_location} --
- Converts the template location option to an array and removes an existing location.
-
-## 3.0.0
-{#3-0-0}
-
-[Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.0).
-
-### Deprecations -- Must Read!
-{#3-0-0-deprecations}
-
-* Using `=` for SassScript properties and variables is deprecated,
- and will be removed in Sass 3.2.
- Use `:` instead.
- See also [this changelog entry](#3-0-0-sass-script-context)
-
-* Because of the above, property values using `:`
- will be parsed more thoroughly than they were before.
- Although all valid CSS3 properties
- as well as most hacks and proprietary syntax should be supported,
- it's possible that some properties will break.
- If this happens, please report it to [the Sass mailing list](http://groups.google.com/group/haml).
-
-* In addition, setting the default value of variables
- with `||=` is now deprecated
- and will be removed in Sass 3.2.
- Instead, add `!default` to the end of the value.
- See also [this changelog entry](#3-0-0-default-flag)
-
-* The `!` prefix for variables is deprecated,
- and will be removed in Sass 3.2.
- Use `$` as a prefix instead.
- See also [this changelog entry](#3-0-0-dollar-prefix).
-
-* The `css2sass` command-line tool has been deprecated,
- and will be removed in Sass 3.2.
- Use the new `sass-convert` tool instead.
- See also [this changelog entry](#3-0-0-sass-convert).
-
-* Selector parent references using `&` can now only be used
- where element names are valid.
- This is because Sass 3 fully parses selectors
- to support the new [`@extend` directive](#3-0-0-extend),
- and it's possible that the `&` could be replaced by an element name.
-
-### SCSS (Sassy CSS)
-
-Sass 3 introduces a new syntax known as SCSS
-which is fully compatible with the syntax of CSS3,
-while still supporting the full power of Sass.
-This means that every valid CSS3 stylesheet
-is a valid SCSS file with the same meaning.
-In addition, SCSS understands most CSS hacks
-and vendor-specific syntax, such as [IE's old `filter` syntax](http://msdn.microsoft.com/en-us/library/ms533754%28VS.85%29.aspx).
-
-SCSS files use the `.scss` extension.
-They can import `.sass` files, and vice-versa.
-Their syntax is fully described in the {file:SASS_REFERENCE.md Sass reference};
-if you're already familiar with Sass, though,
-you may prefer the {file:SCSS_FOR_SASS_USERS.md intro to SCSS for Sass users}.
-
-Since SCSS is a much more approachable syntax for those new to Sass,
-it will be used as the default syntax for the reference,
-as well as for most other Sass documentation.
-The indented syntax will continue to be fully supported, however.
-
-Sass files can be converted to SCSS using the new `sass-convert` command-line tool.
-For example:
-
- # Convert a Sass file to SCSS
- $ sass-convert style.sass style.scss
-
-**Note that if you're converting a Sass file written for Sass 2**,
-you should use the `--from sass2` flag.
-For example:
-
- # Convert a Sass file to SCSS
- $ sass-convert --from sass2 style.sass style.scss
-
- # Convert all Sass files to SCSS
- $ sass-convert --recursive --in-place --from sass2 --to scss stylesheets/
-
-### Syntax Changes {#3-0-0-syntax-changes}
-
-#### SassScript Context
-{#3-0-0-sass-script-context}
-
-The `=` character is no longer required for properties that use SassScript
-(that is, variables and operations).
-All properties now use SassScript automatically;
-this means that `:` should be used instead.
-Variables should also be set with `:`.
-For example, what used to be
-
- // Indented syntax
- .page
- color = 5px + 9px
-
-should now be
-
- // Indented syntax
- .page
- color: 5px + 9px
-
-This means that SassScript is now an extension of the CSS3 property syntax.
-All valid CSS3 properties are valid SassScript,
-and will compile without modification
-(some invalid properties work as well, such as Microsoft's proprietary `filter` syntax).
-This entails a few changes to SassScript to make it fully CSS3-compatible,
-which are detailed below.
-
-This also means that Sass will now be fully parsing all property values,
-rather than passing them through unchanged to the CSS.
-Although care has been taken to support all valid CSS3,
-as well as hacks and proprietary syntax,
-it's possible that a property that worked in Sass 2 won't work in Sass 3.
-If this happens, please report it to [the Sass mailing list](http://groups.google.com/group/haml).
-
-Note that if `=` is used,
-SassScript will be interpreted as backwards-compatibly as posssible.
-In particular, the changes listed below don't apply in an `=` context.
-
-The `sass-convert` command-line tool can be used
-to upgrade Sass files to the new syntax using the `--in-place` flag.
-For example:
-
- # Upgrade style.sass:
- $ sass-convert --in-place style.sass
-
- # Upgrade all Sass files:
- $ sass-convert --recursive --in-place --from sass2 --to sass stylesheets/
-
-##### Quoted Strings
-
-Quoted strings (e.g. `"foo"`) in SassScript now render with quotes.
-In addition, unquoted strings are no longer deprecated,
-and render without quotes.
-This means that almost all strings that had quotes in Sass 2
-should not have quotes in Sass 3.
-
-Although quoted strings render with quotes when used with `:`,
-they do not render with quotes when used with `#{}`.
-This allows quoted strings to be used for e.g. selectors
-that are passed to mixins.
-
-Strings can be forced to be quoted and unquoted using the new
-\{Sass::Script::Functions#unquote unquote} and \{Sass::Script::Functions#quote quote}
-functions.
-
-##### Division and `/`
-
-Two numbers separated by a `/` character
-are allowed as property syntax in CSS,
-e.g. for the `font` property.
-SassScript also uses `/` for division, however,
-which means it must decide what to do
-when it encounters numbers separated by `/`.
-
-For CSS compatibility, SassScript does not perform division by default.
-However, division will be done in almost all cases where division is intended.
-In particular, SassScript will perform division
-in the following three situations:
-
-1. If the value, or any part of it, is stored in a variable.
-2. If the value is surrounded by parentheses.
-3. If the value is used as part of another arithmetic expression.
-
-For example:
-
- p
- font: 10px/8px
- $width: 1000px
- width: $width/2
- height: (500px/2)
- margin-left: 5px + 8px/2px
-
-is compiled to:
-
- p {
- font: 10px/8px;
- width: 500px;
- height: 250px;
- margin-left: 9px; }
-
-##### Variable Defaults
-
-Since `=` is no longer used for variable assignment,
-assigning defaults to variables with `||=` no longer makes sense.
-Instead, the `!default` flag
-should be added to the end of the variable value.
-This syntax is meant to be similar to CSS's `!important` flag.
-For example:
-
- $var: 12px !default;
-
-#### Variable Prefix Character
-{#3-0-0-dollar-prefix}
-
-The Sass variable character has been changed from `!`
-to the more aesthetically-appealing `$`.
-For example, what used to be
-
- !width = 13px
- .icon
- width = !width
-
-should now be
-
- $width: 13px
- .icon
- width: $width
-
-The `sass-convert` command-line tool can be used
-to upgrade Sass files to the new syntax using the `--in-place` flag.
-For example:
-
- # Upgrade style.sass:
- $ sass-convert --in-place style.sass
-
- # Upgrade all Sass files:
- $ sass-convert --recursive --in-place --from sass2 --to sass stylesheets/
-
-`!` may still be used, but it's deprecated and will print a warning.
-It will be removed in the next version of Sass, 3.2.
-
-#### Variable and Mixin Names
-
-SassScript variable and mixin names may now contain hyphens.
-In fact, they may be any valid CSS3 identifier.
-For example:
-
- $prettiest-color: #542FA9
- =pretty-text
- color: $prettiest-color
-
-In order to allow frameworks like [Compass](http://compass-style.org)
-to use hyphens in variable names
-while maintaining backwards-compatibility,
-variables and mixins using hyphens may be referred to
-with underscores, and vice versa.
-For example:
-
- $prettiest-color: #542FA9
- .pretty
- // Using an underscore instead of a hyphen works
- color: $prettiest_color
-
-#### Single-Quoted Strings
-
-SassScript now supports single-quoted strings.
-They behave identically to double-quoted strings,
-except that single quotes need to be backslash-escaped
-and double quotes do not.
-
-#### Mixin Definition and Inclusion
-
-Sass now supports the `@mixin` directive as a way of defining mixins (like `=`),
-as well as the `@include` directive as a way of including them (like `+`).
-The old syntax is *not* deprecated,
-and the two are fully compatible.
-For example:
-
- @mixin pretty-text
- color: $prettiest-color
-
- a
- @include pretty-text
-
-is the same as:
-
- =pretty-text
- color: $prettiest-color
-
- a
- +pretty-text
-
-#### Sass Properties
-
-New-style properties (with the colon after the name) in indented syntax
-now allow whitespace before the colon. For example:
-
- foo
- color : blue
-
-#### Sass `@import`
-
-The Sass `@import` statement now allows non-CSS files to be specified with quotes,
-for similarity with the SCSS syntax. For example, `@import "foo.sass"`
-will now import the `foo.sass` file, rather than compiling to `@import "foo.sass";`.
-
-### `@extend`
-{#3-0-0-extend}
-
-There are often cases when designing a page
-when one class should have all the styles of another class,
-as well as its own specific styles.
-The most common way of handling this is to use both the more general class
-and the more specific class in the HTML.
-For example, suppose we have a design for a normal error
-and also for a serious error. We might write our markup like so:
-
-
- Oh no! You've been hacked!
-
-
-And our styles like so:
-
- .error {
- border: 1px #f00;
- background-color: #fdd;
- }
- .seriousError {
- border-width: 3px;
- }
-
-Unfortunately, this means that we have to always remember
-to use `.error` with `.seriousError`.
-This is a maintenance burden, leads to tricky bugs,
-and can bring non-semantic style concerns into the markup.
-
-The `@extend` directive avoids these problems
-by telling Sass that one selector should inherit the styles of another selector.
-For example:
-
- .error {
- border: 1px #f00;
- background-color: #fdd;
- }
- .seriousError {
- @extend .error;
- border-width: 3px;
- }
-
-This means that all styles defined for `.error`
-are also applied to `.seriousError`,
-in addition to the styles specific to `.seriousError`.
-In effect, everything with class `.seriousError` also has class `.error`.
-
-Other rules that use `.error` will work for `.seriousError` as well.
-For example, if we have special styles for errors caused by hackers:
-
- .error.intrusion {
- background-image: url("/image/hacked.png");
- }
-
-Then `
-
-And our styles like so:
-
- .error {
- border: 1px #f00;
- background-color: #fdd;
- }
- .seriousError {
- border-width: 3px;
- }
-
-Unfortunately, this means that we have to always remember
-to use `.error` with `.seriousError`.
-This is a maintenance burden, leads to tricky bugs,
-and can bring non-semantic style concerns into the markup.
-
-The `@extend` directive avoids these problems
-by telling Sass that one selector should inherit the styles of another selector.
-For example:
-
- .error {
- border: 1px #f00;
- background-color: #fdd;
- }
- .seriousError {
- @extend .error;
- border-width: 3px;
- }
-
-This means that all styles defined for `.error`
-are also applied to `.seriousError`,
-in addition to the styles specific to `.seriousError`.
-In effect, everything with class `.seriousError` also has class `.error`.
-
-Other rules that use `.error` will work for `.seriousError` as well.
-For example, if we have special styles for errors caused by hackers:
-
- .error.intrusion {
- background-image: url("/image/hacked.png");
- }
-
-Then `
`
-will have the `hacked.png` background image as well.
-
-#### How it Works
-
-`@extend` works by inserting the extending selector (e.g. `.seriousError`)
-anywhere in the stylesheet that the extended selector (.e.g `.error`) appears.
-Thus the example above:
-
- .error {
- border: 1px #f00;
- background-color: #fdd;
- }
- .error.intrusion {
- background-image: url("/image/hacked.png");
- }
- .seriousError {
- @extend .error;
- border-width: 3px;
- }
-
-is compiled to:
-
- .error, .seriousError {
- border: 1px #f00;
- background-color: #fdd; }
-
- .error.intrusion, .seriousError.intrusion {
- background-image: url("/image/hacked.png"); }
-
- .seriousError {
- border-width: 3px; }
-
-When merging selectors, `@extend` is smart enough
-to avoid unnecessary duplication,
-so something like `.seriousError.seriousError` gets translated to `.seriousError`.
-In addition, it won't produce selectors that can't match anything, like `#main#footer`.
-
-#### Extending Complex Selectors
-
-Class selectors aren't the only things that can be extended.
-It's possible to extend any selector involving only a single element,
-such as `.special.cool`, `a:hover`, or `a.user[href^="http://"]`.
-For example:
-
- .hoverlink {@extend a:hover}
-
-Just like with classes, this means that all styles defined for `a:hover`
-are also applied to `.hoverlink`.
-For example:
-
- .hoverlink {@extend a:hover}
- a:hover {text-decoration: underline}
-
-is compiled to:
-
- a:hover, .hoverlink {text-decoration: underline}
-
-Just like with `.error.intrusion` above,
-any rule that uses `a:hover` will also work for `.hoverlink`,
-even if they have other selectors as well.
-For example:
-
- .hoverlink {@extend a:hover}
- .comment a.user:hover {font-weight: bold}
-
-is compiled to:
-
- .comment a.user:hover, .comment .hoverlink.user {font-weight: bold}
-
-#### Multiple Extends
-
-A single selector can extend more than one selector.
-This means that it inherits the styles of all the extended selectors.
-For example:
-
- .error {
- border: 1px #f00;
- background-color: #fdd;
- }
- .attention {
- font-size: 3em;
- background-color: #ff0;
- }
- .seriousError {
- @extend .error;
- @extend .attention;
- border-width: 3px;
- }
-
-is compiled to:
-
- .error, .seriousError {
- border: 1px #f00;
- background-color: #fdd; }
-
- .attention, .seriousError {
- font-size: 3em;
- background-color: #ff0; }
-
- .seriousError {
- border-width: 3px; }
-
-In effect, everything with class `.seriousError`
-also has class `.error` *and* class `.attention`.
-Thus, the styles defined later in the document take precedence:
-`.seriousError` has background color `#ff0` rather than `#fdd`,
-since `.attention` is defined later than `.error`.
-
-#### Chaining Extends
-
-It's possible for one selector to extend another selector
-that in turn extends a third.
-For example:
-
- .error {
- border: 1px #f00;
- background-color: #fdd;
- }
- .seriousError {
- @extend .error;
- border-width: 3px;
- }
- .criticalError {
- @extend .seriousError;
- position: fixed;
- top: 10%;
- bottom: 10%;
- left: 10%;
- right: 10%;
- }
-
-Now everything with class `.seriousError` also has class `.error`,
-and everything with class `.criticalError` has class `.seriousError`
-*and* class `.error`.
-It's compiled to:
-
- .error, .seriousError, .criticalError {
- border: 1px #f00;
- background-color: #fdd; }
-
- .seriousError, .criticalError {
- border-width: 3px; }
-
- .criticalError {
- position: fixed;
- top: 10%;
- bottom: 10%;
- left: 10%;
- right: 10%; }
-
-#### Selector Sequences
-
-Selector sequences, such as `.foo .bar` or `.foo + .bar`, currently can't be extended.
-However, it is possible for nested selectors themselves to use `@extend`.
-For example:
-
- #fake-links .link {@extend a}
-
- a {
- color: blue;
- &:hover {text-decoration: underline}
- }
-
-is compiled to
-
- a, #fake-links .link {
- color: blue; }
- a:hover, #fake-links .link:hover {
- text-decoration: underline; }
-
-##### Merging Selector Sequences
-
-Sometimes a selector sequence extends another selector that appears in another sequence.
-In this case, the two sequences need to be merged.
-For example:
-
- #admin .tabbar a {font-weight: bold}
- #demo .overview .fakelink {@extend a}
-
-While it would technically be possible
-to generate all selectors that could possibly match either sequence,
-this would make the stylesheet far too large.
-The simple example above, for instance, would require ten selectors.
-Instead, Sass generates only selectors that are likely to be useful.
-
-When the two sequences being merged have no selectors in common,
-then two new selectors are generated:
-one with the first sequence before the second,
-and one with the second sequence before the first.
-For example:
-
- #admin .tabbar a {font-weight: bold}
- #demo .overview .fakelink {@extend a}
-
-is compiled to:
-
- #admin .tabbar a,
- #admin .tabbar #demo .overview .fakelink,
- #demo .overview #admin .tabbar .fakelink {
- font-weight: bold; }
-
-If the two sequences do share some selectors,
-then those selectors will be merged together
-and only the differences (if any still exist) will alternate.
-In this example, both sequences contain the id `#admin`,
-so the resulting selectors will merge those two ids:
-
- #admin .tabbar a {font-weight: bold}
- #admin .overview .fakelink {@extend a}
-
-This is compiled to:
-
- #admin .tabbar a,
- #admin .tabbar .overview .fakelink,
- #admin .overview .tabbar .fakelink {
- font-weight: bold; }
-
-### `@debug`
-
-The `@debug` directive prints the value of a SassScript expression
-to the standard error output stream.
-It's useful for debugging Sass files
-that have complicated SassScript going on.
-For example:
-
- @debug 10em + 12em;
-
-outputs:
-
- Line 1 DEBUG: 22em
-
-### `@warn`
-
-The `@warn` directive prints the value of a SassScript expression
-to the standard error output stream.
-It's useful for libraries that need to warn users of deprecations
-or recovering from minor mixin usage mistakes.
-There are two major distinctions between `@warn` and `@debug`:
-
-1. You can turn warnings off with the `--quiet` command-line option
- or the `:quiet` Sass option.
-2. A stylesheet trace will be printed out along with the message
- so that the user being warned can see where their styles caused the warning.
-
-Usage Example:
-
- @mixin adjust-location($x, $y) {
- @if unitless($x) {
- @warn "Assuming #{$x} to be in pixels";
- $x: 1px * $x;
- }
- @if unitless($y) {
- @warn "Assuming #{$y} to be in pixels";
- $y: 1px * $y;
- }
- position: relative; left: $x; top: $y;
- }
-
-## Control Directives
-
-SassScript supports basic control directives
-for including styles only under some conditions
-or including the same style several times with variations.
-
-**Note that control directives are an advanced feature,
-and are not recommended in the course of day-to-day styling**.
-They exist mainly for use in [mixins](#mixins),
-particularly those that are part of libraries like [Compass](http://compass-style.org),
-and so require substantial flexibility.
-
-### `@if`
-
-The `@if` directive takes a SassScript expression
-and uses the styles nested beneath it if the expression returns
-anything other than `false`:
-
- p {
- @if 1 + 1 == 2 { border: 1px solid; }
- @if 5 < 3 { border: 2px dotted; }
- }
-
-is compiled to:
-
- p {
- border: 1px solid; }
-
-The `@if` statement can be followed by several `@else if` statements
-and one `@else` statement.
-If the `@if` statement fails,
-the `@else if` statements are tried in order
-until one succeeds or the `@else` is reached.
-For example:
-
- $type: monster;
- p {
- @if $type == ocean {
- color: blue;
- } @else if $type == matador {
- color: red;
- } @else if $type == monster {
- color: green;
- } @else {
- color: black;
- }
- }
-
-is compiled to:
-
- p {
- color: green; }
-
-### `@for`
-
-The `@for` directive has two forms:
-`@for $var from to ` or
-`@for $var from through `.
-`$var` can be any variable name, like `$i`,
-and `` and `` are SassScript expressions
-that should return integers.
-
-The `@for` statement sets `$var` to each number
-from `` to ``,
-including `` if `through` is used.
-Then it outputs the nested styles
-using that value of `$var`.
-For example:
-
- @for $i from 1 through 3 {
- .item-#{$i} { width: 2em * $i; }
- }
-
-is compiled to:
-
- .item-1 {
- width: 2em; }
- .item-2 {
- width: 4em; }
- .item-3 {
- width: 6em; }
-
-### `@each` {#each-directive}
-
-The `@each` rule has the form `@each $var in `.
-`$var` can be any variable name, like `$length` or `$name`,
-and `` is a SassScript expression that returns a list.
-
-The `@each` rule sets `$var` to each item in the list,
-then outputs the styles it contains using that value of `$var`.
-For example:
-
- @each $animal in puma, sea-slug, egret, salamander {
- .#{$animal}-icon {
- background-image: url('/images/#{$animal}.png');
- }
- }
-
-is compiled to:
-
- .puma-icon {
- background-image: url('/images/puma.png'); }
- .sea-slug-icon {
- background-image: url('/images/sea-slug.png'); }
- .egret-icon {
- background-image: url('/images/egret.png'); }
- .salamander-icon {
- background-image: url('/images/salamander.png'); }
-
-### `@while`
-
-The `@while` directive takes a SassScript expression
-and repeatedly outputs the nested styles
-until the statement evaluates to `false`.
-This can be used to achieve more complex looping
-than the `@for` statement is capable of,
-although this is rarely necessary.
-For example:
-
- $i: 6;
- @while $i > 0 {
- .item-#{$i} { width: 2em * $i; }
- $i: $i - 2;
- }
-
-is compiled to:
-
- .item-6 {
- width: 12em; }
-
- .item-4 {
- width: 8em; }
-
- .item-2 {
- width: 4em; }
-
-## Mixin Directives {#mixins}
-
-Mixins allow you to define styles
-that can be re-used throughout the stylesheet
-without needing to resort to non-semantic classes like `.float-left`.
-Mixins can also contain full CSS rules,
-and anything else allowed elsewhere in a Sass document.
-They can even take [arguments](#mixin-arguments)
-which allows you to produce a wide variety of styles
-with very few mixins.
-
-### Defining a Mixin: `@mixin` {#defining_a_mixin}
-
-Mixins are defined with the `@mixin` directive.
-It's followed by the name of the mixin
-and optionally the [arguments](#mixin-arguments),
-and a block containing the contents of the mixin.
-For example, the `large-text` mixin is defined as follows:
-
- @mixin large-text {
- font: {
- family: Arial;
- size: 20px;
- weight: bold;
- }
- color: #ff0000;
- }
-
-Mixins may also contain selectors,
-possibly mixed with properties.
-The selectors can even contain [parent references](#referencing_parent_selectors_).
-For example:
-
- @mixin clearfix {
- display: inline-block;
- &:after {
- content: ".";
- display: block;
- height: 0;
- clear: both;
- visibility: hidden;
- }
- * html & { height: 1px }
- }
-
-### Including a Mixin: `@include` {#including_a_mixin}
-
-Mixins are included in the document
-with the `@include` directive.
-This takes the name of a mixin
-and optionally [arguments to pass to it](#mixin-arguments),
-and includes the styles defined by that mixin
-into the current rule.
-For example:
-
- .page-title {
- @include large-text;
- padding: 4px;
- margin-top: 10px;
- }
-
-is compiled to:
-
- .page-title {
- font-family: Arial;
- font-size: 20px;
- font-weight: bold;
- color: #ff0000;
- padding: 4px;
- margin-top: 10px; }
-
-Mixins may also be included outside of any rule
-(that is, at the root of the document)
-as long as they don't directly define any properties
-or use any parent references.
-For example:
-
- @mixin silly-links {
- a {
- color: blue;
- background-color: red;
- }
- }
-
- @include silly-links;
-
-is compiled to:
-
- a {
- color: blue;
- background-color: red; }
-
-Mixin definitions can also include other mixins.
-For example:
-
- @mixin compound {
- @include highlighted-background;
- @include header-text;
- }
-
- @mixin highlighted-background { background-color: #fc0; }
- @mixin header-text { font-size: 20px; }
-
-Mixins that only define descendent selectors, can be safely mixed
-into the top most level of a document.
-
-### Arguments {#mixin-arguments}
-
-Mixins can take arguments SassScript values as arguments,
-which are given when the mixin is included
-and made available within the mixin as variables.
-
-When defining a mixin,
-the arguments are written as variable names separated by commas,
-all in parentheses after the name.
-Then when including the mixin,
-values can be passed in in the same manner.
-For example:
-
- @mixin sexy-border($color, $width) {
- border: {
- color: $color;
- width: $width;
- style: dashed;
- }
- }
-
- p { @include sexy-border(blue, 1in); }
-
-is compiled to:
-
- p {
- border-color: blue;
- border-width: 1in;
- border-style: dashed; }
-
-Mixins can also specify default values for their arguments
-using the normal variable-setting syntax.
-Then when the mixin is included,
-if it doesn't pass in that argument,
-the default value will be used instead.
-For example:
-
- @mixin sexy-border($color, $width: 1in) {
- border: {
- color: $color;
- width: $width;
- style: dashed;
- }
- }
- p { @include sexy-border(blue); }
- h1 { @include sexy-border(blue, 2in); }
-
-is compiled to:
-
- p {
- border-color: blue;
- border-width: 1in;
- border-style: dashed; }
-
- h1 {
- border-color: blue;
- border-width: 2in;
- border-style: dashed; }
-
-#### Keyword Arguments
-
-Mixins can also be included using explicit keyword arguments.
-For instance, we the above example could be written as:
-
- p { @include sexy-border($color: blue); }
- h1 { @include sexy-border($color: blue, $width: 2in); }
-
-While this is less concise, it can make the stylesheet easier to read.
-It also allows functions to present more flexible interfaces,
-providing many arguments without becoming difficult to call.
-
-Named arguments can be passed in any order, and arguments with default values can be omitted.
-Since the named arguments are variable names, underscores and dashes can be used interchangeably.
-
-## Function Directives {#functions}
-
-It is possible to define your own functions in sass and use them in any
-value or script context. For example:
-
- $grid-width: 40px;
- $gutter-width: 10px;
-
- @function grid-width($n) {
- @return $n * $grid-width + ($n - 1) * $gutter-width;
- }
-
- #sidebar { width: grid-width(5); }
-
-Becomes:
-
- #sidebar {
- width: 240px; }
-
-As you can see functions can access any globally defined variables as well as
-accept arguments just like a mixin. A function may have several statements
-contained within it, and you must call `@return` to set the return value of
-the function.
-
-As with mixins, you can call Sass-defined functions using keyword arguments.
-In the above example we could have called the function like this:
-
- #sidebar { width: grid-width($n: 5); }
-
-It is recommended that you prefix your functions to avoid naming conflicts
-and so that readers of your stylesheets know they are not part of Sass or CSS. For example, if you work for ACME Corp, you might have named the function above `-acme-grid-width`.
-
-## Output Style
-
-Although the default CSS style that Sass outputs is very nice
-and reflects the structure of the document,
-tastes and needs vary and so Sass supports several other styles.
-
-Sass allows you to choose between four different output styles
-by setting the [`:style` option](#style-option)
-or using the `--style` command-line flag.
-
-### `:nested`
-
-Nested style is the default Sass style,
-because it reflects the structure of the CSS styles
-and the HTML document they're styling.
-Each property has its own line,
-but the indentation isn't constant.
-Each rule is indented based on how deeply it's nested.
-For example:
-
- #main {
- color: #fff;
- background-color: #000; }
- #main p {
- width: 10em; }
-
- .huge {
- font-size: 10em;
- font-weight: bold;
- text-decoration: underline; }
-
-Nested style is very useful when looking at large CSS files:
-it allows you to easily grasp the structure of the file
-without actually reading anything.
-
-### `:expanded`
-
-Expanded is a more typical human-made CSS style,
-with each property and rule taking up one line.
-Properties are indented within the rules,
-but the rules aren't indented in any special way.
-For example:
-
- #main {
- color: #fff;
- background-color: #000;
- }
- #main p {
- width: 10em;
- }
-
- .huge {
- font-size: 10em;
- font-weight: bold;
- text-decoration: underline;
- }
-
-### `:compact`
-
-Compact style takes up less space than Nested or Expanded.
-It also draws the focus more to the selectors than to their properties.
-Each CSS rule takes up only one line,
-with every property defined on that line.
-Nested rules are placed next to each other with no newline,
-while separate groups of rules have newlines between them.
-For example:
-
- #main { color: #fff; background-color: #000; }
- #main p { width: 10em; }
-
- .huge { font-size: 10em; font-weight: bold; text-decoration: underline; }
-
-### `:compressed`
-
-Compressed style takes up the minimum amount of space possible,
-having no whitespace except that necessary to separate selectors
-and a newline at the end of the file.
-It also includes some other minor compressions,
-such as choosing the smallest representation for colors.
-It's not meant to be human-readable.
-For example:
-
- #main{color:#fff;background-color:#000}#main p{width:10em}.huge{font-size:10em;font-weight:bold;text-decoration:underline}
-
-## Extending Sass
-
-Sass provides a number of advanced customizations for users with unique requirements.
-Using these features requires a strong understanding of Ruby.
-
-### Defining Custom Sass Functions
-
-Users can define their own Sass functions using the Ruby API.
-For more information, see the [source documentation](Sass/Script/Functions.html#adding_custom_functions).
-
-### Cache Stores
-
-Sass caches parsed documents so that they can be reused without parsing them again
-unless they have changed. By default, Sass will write these cache files to a location
-on the filesystem indicated by [`:cache_location`](#cache_location-option). If you
-cannot write to the filesystem or need to share cache across ruby processes or machines,
-then you can define your own cache store and set the[`:cache_store`
-option](#cache_store-option). For details on creating your own cache store, please
-see the {Sass::CacheStores::Base source documentation}.
-
-### Custom Importers
-
-Sass importers are in charge of taking paths passed to `@import` and finding the
-appropriate Sass code for those paths. By default, this code is loaded from
-the {Sass::Importers::Filesystem filesystem}, but importers could be added to load
-from a database, over HTTP, or use a different file naming scheme than what Sass expects.
-
-Each importer is in charge of a single load path (or whatever the corresponding notion
-is for the backend). Importers can be placed in the {file:SASS_REFERENCE.md#load_paths-option
-`:load_paths` array} alongside normal filesystem paths.
-
-When resolving an `@import`, Sass will go through the load paths looking for an importer
-that successfully imports the path. Once one is found, the imported file is used.
-
-User-created importers must inherit from {Sass::Importers::Base}.
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/doc-src/SCSS_FOR_SASS_USERS.md b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/doc-src/SCSS_FOR_SASS_USERS.md
deleted file mode 100644
index 92ddbbe4cf..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/doc-src/SCSS_FOR_SASS_USERS.md
+++ /dev/null
@@ -1,155 +0,0 @@
-# Intro to SCSS for Sass Users
-
-Sass 3 introduces a new syntax known as SCSS
-which is fully compatible with the syntax of CSS3,
-while still supporting the full power of Sass.
-This means that every valid CSS3 stylesheet
-is a valid SCSS file with the same meaning.
-In addition, SCSS understands most CSS hacks
-and vendor-specific syntax, such as [IE's old `filter` syntax](http://msdn.microsoft.com/en-us/library/ms533754%28VS.85%29.aspx).
-
-Since SCSS is a CSS extension,
-everything that works in CSS works in SCSS.
-This means that for a Sass user to understand it,
-they need only understand how the Sass extensions work.
-Most of these, such as variables, parent references, and directives work the same;
-the only difference is that SCSS requires semicolons
-and brackets instead of newlines and indentation.
-For example, a simple rule in Sass:
-
- #sidebar
- width: 30%
- background-color: #faa
-
-could be converted to SCSS just by adding brackets and semicolons:
-
- #sidebar {
- width: 30%;
- background-color: #faa;
- }
-
-In addition, SCSS is completely whitespace-insensitive.
-That means the above could also be written as:
-
- #sidebar {width: 30%; background-color: #faa}
-
-There are some differences that are slightly more complicated.
-These are detailed below.
-Note, though, that SCSS uses all the
-{file:SASS_CHANGELOG.md#3-0-0-syntax-changes syntax changes in Sass 3},
-so make sure you understand those before going forward.
-
-## Nested Selectors
-
-To nest selectors, simply define a new ruleset
-inside an existing ruleset:
-
- #sidebar {
- a { text-decoration: none; }
- }
-
-Of course, white space is insignificant
-and the last trailing semicolon is optional
-so you can also do it like this:
-
- #sidebar { a { text-decoration: none } }
-
-## Nested Properties
-
-To nest properties,
-simply create a new property set
-after an existing property's colon:
-
- #footer {
- border: {
- width: 1px;
- color: #ccc;
- style: solid;
- }
- }
-
-This compiles to:
-
- #footer {
- border-width: 1px;
- border-color: #cccccc;
- border-style: solid; }
-
-## Mixins
-
-A mixin is declared with the `@mixin` directive:
-
- @mixin rounded($amount) {
- -moz-border-radius: $amount;
- -webkit-border-radius: $amount;
- border-radius: $amount;
- }
-
-A mixin is used with the `@include` directive:
-
- .box {
- border: 3px solid #777;
- @include rounded(0.5em);
- }
-
-This syntax is also available in the indented syntax,
-although the old `=` and `+` syntax still works.
-
-This is rather verbose compared to the `=` and `+` characters used in Sass syntax.
-This is because the SCSS format is designed for CSS compatibility rather than conciseness,
-and creating new syntax when the CSS directive syntax already exists
-adds new syntax needlessly and
-could create incompatibilities with future versions of CSS.
-
-## Comments
-
-Like Sass, SCSS supports both comments that are preserved in the CSS output
-and comments that aren't.
-However, SCSS's comments are significantly more flexible.
-It supports standard multiline CSS comments with `/* */`,
-which are preserved where possible in the output.
-These comments can have whatever formatting you like;
-Sass will do its best to format them nicely.
-
-SCSS also uses `//` for comments that are thrown away, like Sass.
-Unlike Sass, though, `//` comments in SCSS may appear anywhere
-and last only until the end of the line.
-
-For example:
-
- /* This comment is
- * several lines long.
- * since it uses the CSS comment syntax,
- * it will appear in the CSS output. */
- body { color: black; }
-
- // These comments are only one line long each.
- // They won't appear in the CSS output,
- // since they use the single-line comment syntax.
- a { color: green; }
-
-is compiled to:
-
- /* This comment is
- * several lines long.
- * since it uses the CSS comment syntax,
- * it will appear in the CSS output. */
- body {
- color: black; }
-
- a {
- color: green; }
-
-## `@import`
-
-The `@import` directive in SCSS functions just like that in Sass,
-except that it takes a quoted string to import.
-For example, this Sass:
-
- @import themes/dark
- @import font.sass
-
-would be this SCSS:
-
- @import "themes/dark";
- @import "font.sass";
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/ext/extconf.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/ext/extconf.rb
deleted file mode 100644
index 0ecd6b27fc..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/ext/extconf.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-root = File.expand_path("../..", __FILE__)
-File.open(File.expand_path("lib/sass/root.rb", root), "w") do |f|
- f << <<-RUBY
-module Sass
- ROOT_DIR = #{root.inspect}
-end
- RUBY
-end
-
-File.open('Makefile', 'w') { |f| f.puts("install:\n\t$(exit 0)") }
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/extra/update_watch.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/extra/update_watch.rb
deleted file mode 100644
index 73489a1785..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/extra/update_watch.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-require 'rubygems'
-require 'sinatra'
-require 'json'
-set :port, 3124
-set :environment, :production
-enable :lock
-Dir.chdir(File.dirname(__FILE__) + "/..")
-
-post "/" do
- puts "Recieved payload!"
- puts "Rev: #{`git name-rev HEAD`.strip}"
- system %{rake handle_update --trace REF=#{JSON.parse(params["payload"])["ref"].inspect}}
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/init.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/init.rb
deleted file mode 100644
index 5a3bceb4a4..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/init.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-begin
- require File.join(File.dirname(__FILE__), 'lib', 'sass') # From here
-rescue LoadError
- begin
- require 'sass' # From gem
- rescue LoadError => e
- # gems:install may be run to install Haml with the skeleton plugin
- # but not the gem itself installed.
- # Don't die if this is the case.
- raise e unless defined?(Rake) &&
- (Rake.application.top_level_tasks.include?('gems') ||
- Rake.application.top_level_tasks.include?('gems:install'))
- end
-end
-
-# Load Sass.
-# Sass may be undefined if we're running gems:install.
-require 'sass/plugin' if defined?(Sass)
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass.rb
deleted file mode 100644
index 2a868769af..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass.rb
+++ /dev/null
@@ -1,72 +0,0 @@
-dir = File.dirname(__FILE__)
-$LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
-
-# This is necessary to set so that the Haml code that tries to load Sass
-# knows that Sass is indeed loading,
-# even if there's some crazy autoload stuff going on.
-SASS_BEGUN_TO_LOAD = true unless defined?(SASS_BEGUN_TO_LOAD)
-
-require 'sass/version'
-
-# The module that contains everything Sass-related:
-#
-# * {Sass::Engine} is the class used to render Sass/SCSS within Ruby code.
-# * {Sass::Plugin} is interfaces with web frameworks (Rails and Merb in particular).
-# * {Sass::SyntaxError} is raised when Sass encounters an error.
-# * {Sass::CSS} handles conversion of CSS to Sass.
-#
-# Also see the {file:SASS_REFERENCE.md full Sass reference}.
-module Sass
- # Compile a Sass or SCSS string to CSS.
- # Defaults to SCSS.
- #
- # @param contents [String] The contents of the Sass file.
- # @param options [{Symbol => Object}] An options hash;
- # see {file:SASS_REFERENCE.md#sass_options the Sass options documentation}
- # @raise [Sass::SyntaxError] if there's an error in the document
- # @raise [Encoding::UndefinedConversionError] if the source encoding
- # cannot be converted to UTF-8
- # @raise [ArgumentError] if the document uses an unknown encoding with `@charset`
- def self.compile(contents, options = {})
- options[:syntax] ||= :scss
- Engine.new(contents, options).to_css
- end
-
- # Compile a file on disk to CSS.
- #
- # @param filename [String] The path to the Sass, SCSS, or CSS file on disk.
- # @param options [{Symbol => Object}] An options hash;
- # see {file:SASS_REFERENCE.md#sass_options the Sass options documentation}
- # @raise [Sass::SyntaxError] if there's an error in the document
- # @raise [Encoding::UndefinedConversionError] if the source encoding
- # cannot be converted to UTF-8
- # @raise [ArgumentError] if the document uses an unknown encoding with `@charset`
- #
- # @overload compile_file(filename, options = {})
- # Return the compiled CSS rather than writing it to a file.
- #
- # @return [String] The compiled CSS.
- #
- # @overload compile_file(filename, css_filename, options = {})
- # Write the compiled CSS to a file.
- #
- # @param css_filename [String] The location to which to write the compiled CSS.
- def self.compile_file(filename, *args)
- options = args.last.is_a?(Hash) ? args.pop : {}
- css_filename = args.shift
- result = Sass::Engine.for_file(filename, options).render
- if css_filename
- options[:css_filename] ||= css_filename
- open(css_filename,"w") {|css_file| css_file.write(result)}
- nil
- else
- result
- end
- end
-end
-
-require 'sass/util'
-
-require 'sass/engine'
-require 'sass/plugin' if defined?(Merb::Plugins)
-require 'sass/railtie'
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/cache_stores.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/cache_stores.rb
deleted file mode 100644
index 62259b3281..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/cache_stores.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-require 'stringio'
-
-module Sass
- # Sass cache stores are in charge of storing cached information,
- # especially parse trees for Sass documents.
- #
- # User-created importers must inherit from {CacheStores::Base}.
- module CacheStores
- end
-end
-
-require 'sass/cache_stores/base'
-require 'sass/cache_stores/filesystem'
-require 'sass/cache_stores/memory'
-require 'sass/cache_stores/chain'
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/cache_stores/base.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/cache_stores/base.rb
deleted file mode 100644
index 0d48f1455b..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/cache_stores/base.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-module Sass
- module CacheStores
- # An abstract base class for backends for the Sass cache.
- # Any key-value store can act as such a backend;
- # it just needs to implement the
- # \{#_store} and \{#_retrieve} methods.
- #
- # To use a cache store with Sass,
- # use the {file:SASS_REFERENCE.md#cache_store-option `:cache_store` option}.
- #
- # @abstract
- class Base
- # Store cached contents for later retrieval
- # Must be implemented by all CacheStore subclasses
- #
- # Note: cache contents contain binary data.
- #
- # @param key [String] The key to store the contents under
- # @param version [String] The current sass version.
- # Cached contents must not be retrieved across different versions of sass.
- # @param sha [String] The sha of the sass source.
- # Cached contents must not be retrieved if the sha has changed.
- # @param contents [String] The contents to store.
- def _store(key, version, sha, contents)
- raise "#{self.class} must implement #_store."
- end
-
- # Retrieved cached contents.
- # Must be implemented by all subclasses.
- #
- # Note: if the key exists but the sha or version have changed,
- # then the key may be deleted by the cache store, if it wants to do so.
- #
- # @param key [String] The key to retrieve
- # @param version [String] The current sass version.
- # Cached contents must not be retrieved across different versions of sass.
- # @param sha [String] The sha of the sass source.
- # Cached contents must not be retrieved if the sha has changed.
- # @return [String] The contents that were previously stored.
- # @return [NilClass] when the cache key is not found or the version or sha have changed.
- def _retrieve(key, version, sha)
- raise "#{self.class} must implement #_retrieve."
- end
-
- # Store a {Sass::Tree::RootNode}.
- #
- # @param key [String] The key to store it under.
- # @param sha [String] The checksum for the contents that are being stored.
- # @param obj [Object] The object to cache.
- def store(key, sha, root)
- _store(key, Sass::VERSION, sha, Marshal.dump(root))
- end
-
- # Retrieve a {Sass::Tree::RootNode}.
- #
- # @param key [String] The key the root element was stored under.
- # @param sha [String] The checksum of the root element's content.
- # @return [Object] The cached object.
- def retrieve(key, sha)
- contents = _retrieve(key, Sass::VERSION, sha)
- Marshal.load(contents) if contents
- rescue EOFError, TypeError, ArgumentError => e
- Sass::Util.sass_warn "Warning. Error encountered while reading cache #{path_to(key)}: #{e}"
- end
-
- # Return the key for the sass file.
- #
- # The `(sass_dirname, sass_basename)` pair
- # should uniquely identify the Sass document,
- # but otherwise there are no restrictions on their content.
- #
- # @param sass_dirname [String]
- # The fully-expanded location of the Sass file.
- # This corresponds to the directory name on a filesystem.
- # @param sass_basename [String] The name of the Sass file that is being referenced.
- # This corresponds to the basename on a filesystem.
- def key(sass_dirname, sass_basename)
- dir = Digest::SHA1.hexdigest(sass_dirname)
- filename = "#{sass_basename}c"
- "#{dir}/#{filename}"
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/cache_stores/chain.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/cache_stores/chain.rb
deleted file mode 100644
index 3d62635405..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/cache_stores/chain.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-module Sass
- module CacheStores
- # A meta-cache that chains multiple caches together.
- # Specifically:
- #
- # * All `#store`s are passed to all caches.
- # * `#retrieve`s are passed to each cache until one has a hit.
- # * When one cache has a hit, the value is `#store`d in all earlier caches.
- class Chain < Base
- # Create a new cache chaining the given caches.
- #
- # @param caches [Array] The caches to chain.
- def initialize(*caches)
- @caches = caches
- end
-
- # @see Base#store
- def store(key, sha, obj)
- @caches.each {|c| c.store(key, sha, obj)}
- end
-
- # @see Base#retrieve
- def retrieve(key, sha)
- @caches.each_with_index do |c, i|
- next unless obj = c.retrieve(key, sha)
- @caches[0...i].each {|c| c.store(key, sha, obj)}
- return obj
- end
- nil
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/cache_stores/filesystem.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/cache_stores/filesystem.rb
deleted file mode 100644
index b0fae9058a..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/cache_stores/filesystem.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-module Sass
- module CacheStores
- # A backend for the Sass cache using the filesystem.
- class Filesystem < Base
- # The directory where the cached files will be stored.
- #
- # @return [String]
- attr_accessor :cache_location
-
- # @param cache_location [String] see \{#cache\_location}
- def initialize(cache_location)
- @cache_location = cache_location
- end
-
- # @see Base#\_retrieve
- def _retrieve(key, version, sha)
- return unless File.readable?(path_to(key))
- contents = nil
- File.open(path_to(key), "rb") do |f|
- if f.readline("\n").strip == version && f.readline("\n").strip == sha
- return f.read
- end
- end
- File.unlink path_to(key)
- nil
- rescue EOFError, TypeError, ArgumentError => e
- Sass::Util.sass_warn "Warning. Error encountered while reading cache #{path_to(key)}: #{e}"
- end
-
- # @see Base#\_store
- def _store(key, version, sha, contents)
- # return unless File.writable?(File.dirname(@cache_location))
- # return if File.exists?(@cache_location) && !File.writable?(@cache_location)
- compiled_filename = path_to(key)
- # return if File.exists?(File.dirname(compiled_filename)) && !File.writable?(File.dirname(compiled_filename))
- # return if File.exists?(compiled_filename) && !File.writable?(compiled_filename)
- FileUtils.mkdir_p(File.dirname(compiled_filename))
- File.open(compiled_filename, "wb") do |f|
- f.puts(version)
- f.puts(sha)
- f.write(contents)
- end
- rescue Errno::EACCES
- #pass
- end
-
- private
-
- # Returns the path to a file for the given key.
- #
- # @param key [String]
- # @return [String] The path to the cache file.
- def path_to(key)
- File.join(cache_location, key)
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/cache_stores/memory.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/cache_stores/memory.rb
deleted file mode 100644
index 65dcf68c4f..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/cache_stores/memory.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-module Sass
- module CacheStores
- # A backend for the Sass cache using in-process memory.
- class Memory < Base
- # Since the {Memory} store is stored in the Sass tree's options hash,
- # when the options get serialized as part of serializing the tree,
- # you get crazy exponential growth in the size of the cached objects
- # unless you don't dump the cache.
- #
- # @private
- def _dump(depth)
- ""
- end
-
- # If we deserialize this class, just make a new empty one.
- #
- # @private
- def self._load(repr)
- Memory.new
- end
-
- # Create a new, empty cache store.
- def initialize
- @contents = {}
- end
-
- # @see Base#retrieve
- def retrieve(key, sha)
- if @contents.has_key?(key)
- return unless @contents[key][:sha] == sha
- obj = @contents[key][:obj]
- obj.respond_to?(:deep_copy) ? obj.deep_copy : obj.dup
- end
- end
-
- # @see Base#store
- def store(key, sha, obj)
- @contents[key] = {:sha => sha, :obj => obj}
- end
-
- # Destructively clear the cache.
- def reset!
- @contents = {}
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/cache_stores/null.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/cache_stores/null.rb
deleted file mode 100644
index 3bf56cab07..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/cache_stores/null.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-module Sass
- module CacheStores
- # Doesn't store anything, but records what things it should have stored.
- # This doesn't currently have any use except for testing and debugging.
- #
- # @private
- class Null < Base
- def initialize
- @keys = {}
- end
-
- def _retrieve(key, version, sha)
- nil
- end
-
- def _store(key, version, sha, contents)
- @keys[key] = true
- end
-
- def was_set?(key)
- @keys[key]
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/callbacks.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/callbacks.rb
deleted file mode 100644
index 70ea41def4..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/callbacks.rb
+++ /dev/null
@@ -1,66 +0,0 @@
-module Sass
- # A lightweight infrastructure for defining and running callbacks.
- # Callbacks are defined using \{#define\_callback\} at the class level,
- # and called using `run_#{name}` at the instance level.
- #
- # Clients can add callbacks by calling the generated `on_#{name}` method,
- # and passing in a block that's run when the callback is activated.
- #
- # @example Define a callback
- # class Munger
- # extend Sass::Callbacks
- # define_callback :string_munged
- #
- # def munge(str)
- # res = str.gsub(/[a-z]/, '\1\1')
- # run_string_munged str, res
- # res
- # end
- # end
- #
- # @example Use a callback
- # m = Munger.new
- # m.on_string_munged {|str, res| puts "#{str} was munged into #{res}!"}
- # m.munge "bar" #=> bar was munged into bbaarr!
- module Callbacks
- # Automatically includes {InstanceMethods}
- # when something extends this module.
- #
- # @param base [Module]
- def self.extended(base)
- base.send(:include, InstanceMethods)
- end
- protected
-
- module InstanceMethods
- # Removes all callbacks registered against this object.
- def clear_callbacks!
- @_sass_callbacks = {}
- end
- end
-
- # Define a callback with the given name.
- # This will define an `on_#{name}` method
- # that registers a block,
- # and a `run_#{name}` method that runs that block
- # (optionall with some arguments).
- #
- # @param name [Symbol] The name of the callback
- # @return [void]
- def define_callback(name)
- class_eval < "p\n color: blue"
- # Sass::CSS.new("p { color: blue }").render(:scss) #=> "p {\n color: blue; }"
- class CSS
- # @param template [String] The CSS stylesheet.
- # This stylesheet can be encoded using any encoding
- # that can be converted to Unicode.
- # If the stylesheet contains an `@charset` declaration,
- # that overrides the Ruby encoding
- # (see {file:SASS_REFERENCE.md#encodings the encoding documentation})
- # @option options :old [Boolean] (false)
- # Whether or not to output old property syntax
- # (`:color blue` as opposed to `color: blue`).
- # This is only meaningful when generating Sass code,
- # rather than SCSS.
- def initialize(template, options = {})
- if template.is_a? IO
- template = template.read
- end
-
- @options = options.dup
- # Backwards compatibility
- @options[:old] = true if @options[:alternate] == false
- @template = template
- end
-
- # Converts the CSS template into Sass or SCSS code.
- #
- # @param fmt [Symbol] `:sass` or `:scss`, designating the format to return.
- # @return [String] The resulting Sass or SCSS code
- # @raise [Sass::SyntaxError] if there's an error parsing the CSS template
- def render(fmt = :sass)
- check_encoding!
- build_tree.send("to_#{fmt}", @options).strip + "\n"
- rescue Sass::SyntaxError => err
- err.modify_backtrace(:filename => @options[:filename] || '(css)')
- raise err
- end
-
- # Returns the original encoding of the document,
- # or `nil` under Ruby 1.8.
- #
- # @return [Encoding, nil]
- # @raise [Encoding::UndefinedConversionError] if the source encoding
- # cannot be converted to UTF-8
- # @raise [ArgumentError] if the document uses an unknown encoding with `@charset`
- def source_encoding
- check_encoding!
- @original_encoding
- end
-
- private
-
- def check_encoding!
- return if @checked_encoding
- @checked_encoding = true
- @template, @original_encoding = Sass::Util.check_sass_encoding(@template) do |msg, line|
- raise Sass::SyntaxError.new(msg, :line => line)
- end
- end
-
- # Parses the CSS template and applies various transformations
- #
- # @return [Tree::Node] The root node of the parsed tree
- def build_tree
- root = Sass::SCSS::CssParser.new(@template).parse
- expand_commas root
- parent_ref_rules root
- remove_parent_refs root
- flatten_rules root
- fold_commas root
- root
- end
-
- # Transform
- #
- # foo, bar, baz
- # color: blue
- #
- # into
- #
- # foo
- # color: blue
- # bar
- # color: blue
- # baz
- # color: blue
- #
- # @param root [Tree::Node] The parent node
- def expand_commas(root)
- root.children.map! do |child|
- unless child.is_a?(Tree::RuleNode) && child.rule.first.include?(',')
- expand_commas(child) if child.is_a?(Tree::DirectiveNode)
- next child
- end
- child.rule.first.split(',').map do |rule|
- node = Tree::RuleNode.new([rule.strip])
- node.children = child.children
- node
- end
- end
- root.children.flatten!
- end
-
- # Make rules use parent refs so that
- #
- # foo
- # color: green
- # foo.bar
- # color: blue
- #
- # becomes
- #
- # foo
- # color: green
- # &.bar
- # color: blue
- #
- # This has the side effect of nesting rules,
- # so that
- #
- # foo
- # color: green
- # foo bar
- # color: red
- # foo baz
- # color: blue
- #
- # becomes
- #
- # foo
- # color: green
- # & bar
- # color: red
- # & baz
- # color: blue
- #
- # @param root [Tree::Node] The parent node
- def parent_ref_rules(root)
- current_rule = nil
- root.children.map! do |child|
- unless child.is_a?(Tree::RuleNode)
- parent_ref_rules(child) if child.is_a?(Tree::DirectiveNode)
- next child
- end
-
- first, rest = child.rule.first.scan(/\A(&?(?: .|[^ ])[^.#: \[]*)([.#: \[].*)?\Z/m).first
-
- if current_rule.nil? || current_rule.rule.first != first
- current_rule = Tree::RuleNode.new([first])
- end
-
- if rest
- child.rule = ["&" + rest]
- current_rule << child
- else
- current_rule.children += child.children
- end
-
- current_rule
- end
- root.children.compact!
- root.children.uniq!
-
- root.children.each { |v| parent_ref_rules(v) }
- end
-
- # Remove useless parent refs so that
- #
- # foo
- # & bar
- # color: blue
- #
- # becomes
- #
- # foo
- # bar
- # color: blue
- #
- # @param root [Tree::Node] The parent node
- def remove_parent_refs(root)
- root.children.each do |child|
- case child
- when Tree::RuleNode
- child.rule.first.gsub! /^& +/, ''
- remove_parent_refs child
- when Tree::DirectiveNode
- remove_parent_refs child
- end
- end
- end
-
- # Flatten rules so that
- #
- # foo
- # bar
- # color: red
- #
- # becomes
- #
- # foo bar
- # color: red
- #
- # and
- #
- # foo
- # &.bar
- # color: blue
- #
- # becomes
- #
- # foo.bar
- # color: blue
- #
- # @param root [Tree::Node] The parent node
- def flatten_rules(root)
- root.children.each do |child|
- case child
- when Tree::RuleNode
- flatten_rule(child)
- when Tree::DirectiveNode
- flatten_rules(child)
- end
- end
- end
-
- # Flattens a single rule
- #
- # @param rule [Tree::RuleNode] The candidate for flattening
- # @see #flatten_rules
- def flatten_rule(rule)
- while rule.children.size == 1 && rule.children.first.is_a?(Tree::RuleNode)
- child = rule.children.first
-
- if child.rule.first[0] == ?&
- rule.rule = [child.rule.first.gsub(/^&/, rule.rule.first)]
- else
- rule.rule = ["#{rule.rule.first} #{child.rule.first}"]
- end
-
- rule.children = child.children
- end
-
- flatten_rules(rule)
- end
-
- # Transform
- #
- # foo
- # bar
- # color: blue
- # baz
- # color: blue
- #
- # into
- #
- # foo
- # bar, baz
- # color: blue
- #
- # @param rule [Tree::RuleNode] The candidate for flattening
- def fold_commas(root)
- prev_rule = nil
- root.children.map! do |child|
- unless child.is_a?(Tree::RuleNode)
- fold_commas(child) if child.is_a?(Tree::DirectiveNode)
- next child
- end
-
- if prev_rule && prev_rule.children == child.children
- prev_rule.rule.first << ", #{child.rule.first}"
- next nil
- end
-
- fold_commas(child)
- prev_rule = child
- child
- end
- root.children.compact!
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/engine.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/engine.rb
deleted file mode 100644
index a54143ab67..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/engine.rb
+++ /dev/null
@@ -1,862 +0,0 @@
-require 'strscan'
-require 'set'
-require 'digest/sha1'
-require 'sass/cache_stores'
-require 'sass/tree/node'
-require 'sass/tree/root_node'
-require 'sass/tree/rule_node'
-require 'sass/tree/comment_node'
-require 'sass/tree/prop_node'
-require 'sass/tree/directive_node'
-require 'sass/tree/media_node'
-require 'sass/tree/variable_node'
-require 'sass/tree/mixin_def_node'
-require 'sass/tree/mixin_node'
-require 'sass/tree/function_node'
-require 'sass/tree/return_node'
-require 'sass/tree/extend_node'
-require 'sass/tree/if_node'
-require 'sass/tree/while_node'
-require 'sass/tree/for_node'
-require 'sass/tree/each_node'
-require 'sass/tree/debug_node'
-require 'sass/tree/warn_node'
-require 'sass/tree/import_node'
-require 'sass/tree/charset_node'
-require 'sass/tree/visitors/base'
-require 'sass/tree/visitors/perform'
-require 'sass/tree/visitors/cssize'
-require 'sass/tree/visitors/convert'
-require 'sass/tree/visitors/to_css'
-require 'sass/tree/visitors/check_nesting'
-require 'sass/selector'
-require 'sass/environment'
-require 'sass/script'
-require 'sass/scss'
-require 'sass/error'
-require 'sass/importers'
-require 'sass/shared'
-
-module Sass
-
- # A Sass mixin or function.
- #
- # `name`: `String`
- # : The name of the mixin/function.
- #
- # `args`: `Array<(String, Script::Node)>`
- # : The arguments for the mixin/function.
- # Each element is a tuple containing the name of the argument
- # and the parse tree for the default value of the argument.
- #
- # `environment`: {Sass::Environment}
- # : The environment in which the mixin/function was defined.
- # This is captured so that the mixin/function can have access
- # to local variables defined in its scope.
- #
- # `tree`: `Array`
- # : The parse tree for the mixin/function.
- Callable = Struct.new(:name, :args, :environment, :tree)
-
- # This class handles the parsing and compilation of the Sass template.
- # Example usage:
- #
- # template = File.load('stylesheets/sassy.sass')
- # sass_engine = Sass::Engine.new(template)
- # output = sass_engine.render
- # puts output
- class Engine
- include Sass::Util
-
- # A line of Sass code.
- #
- # `text`: `String`
- # : The text in the line, without any whitespace at the beginning or end.
- #
- # `tabs`: `Fixnum`
- # : The level of indentation of the line.
- #
- # `index`: `Fixnum`
- # : The line number in the original document.
- #
- # `offset`: `Fixnum`
- # : The number of bytes in on the line that the text begins.
- # This ends up being the number of bytes of leading whitespace.
- #
- # `filename`: `String`
- # : The name of the file in which this line appeared.
- #
- # `children`: `Array`
- # : The lines nested below this one.
- class Line < Struct.new(:text, :tabs, :index, :offset, :filename, :children)
- def comment?
- text[0] == COMMENT_CHAR && (text[1] == SASS_COMMENT_CHAR || text[1] == CSS_COMMENT_CHAR)
- end
- end
-
- # The character that begins a CSS property.
- PROPERTY_CHAR = ?:
-
- # The character that designates the beginning of a comment,
- # either Sass or CSS.
- COMMENT_CHAR = ?/
-
- # The character that follows the general COMMENT_CHAR and designates a Sass comment,
- # which is not output as a CSS comment.
- SASS_COMMENT_CHAR = ?/
-
- # The character that follows the general COMMENT_CHAR and designates a CSS comment,
- # which is embedded in the CSS document.
- CSS_COMMENT_CHAR = ?*
-
- # The character used to denote a compiler directive.
- DIRECTIVE_CHAR = ?@
-
- # Designates a non-parsed rule.
- ESCAPE_CHAR = ?\\
-
- # Designates block as mixin definition rather than CSS rules to output
- MIXIN_DEFINITION_CHAR = ?=
-
- # Includes named mixin declared using MIXIN_DEFINITION_CHAR
- MIXIN_INCLUDE_CHAR = ?+
-
- # The regex that matches and extracts data from
- # properties of the form `:name prop`.
- PROPERTY_OLD = /^:([^\s=:"]+)\s*(?:\s+|$)(.*)/
-
- # The default options for Sass::Engine.
- # @api public
- DEFAULT_OPTIONS = {
- :style => :nested,
- :load_paths => ['.'],
- :cache => true,
- :cache_location => './.sass-cache',
- :syntax => :sass,
- :filesystem_importer => Sass::Importers::Filesystem
- }.freeze
-
- # Converts a Sass options hash into a standard form, filling in
- # default values and resolving aliases.
- #
- # @param options [{Symbol => Object}] The options hash;
- # see {file:SASS_REFERENCE.md#sass_options the Sass options documentation}
- # @return [{Symbol => Object}] The normalized options hash.
- # @private
- def self.normalize_options(options)
- options = DEFAULT_OPTIONS.merge(options.reject {|k, v| v.nil?})
-
- # If the `:filename` option is passed in without an importer,
- # assume it's using the default filesystem importer.
- options[:importer] ||= options[:filesystem_importer].new(".") if options[:filename]
-
- # Tracks the original filename of the top-level Sass file
- options[:original_filename] ||= options[:filename]
-
- options[:cache_store] ||= Sass::CacheStores::Chain.new(
- Sass::CacheStores::Memory.new, Sass::CacheStores::Filesystem.new(options[:cache_location]))
- # Support both, because the docs said one and the other actually worked
- # for quite a long time.
- options[:line_comments] ||= options[:line_numbers]
-
- options[:load_paths] = options[:load_paths].map do |p|
- next p unless p.is_a?(String) || (defined?(Pathname) && p.is_a?(Pathname))
- options[:filesystem_importer].new(p.to_s)
- end
-
- # Backwards compatibility
- options[:property_syntax] ||= options[:attribute_syntax]
- case options[:property_syntax]
- when :alternate; options[:property_syntax] = :new
- when :normal; options[:property_syntax] = :old
- end
-
- options
- end
-
- # Returns the {Sass::Engine} for the given file.
- # This is preferable to Sass::Engine.new when reading from a file
- # because it properly sets up the Engine's metadata,
- # enables parse-tree caching,
- # and infers the syntax from the filename.
- #
- # @param filename [String] The path to the Sass or SCSS file
- # @param options [{Symbol => Object}] The options hash;
- # See {file:SASS_REFERENCE.md#sass_options the Sass options documentation}.
- # @return [Sass::Engine] The Engine for the given Sass or SCSS file.
- # @raise [Sass::SyntaxError] if there's an error in the document.
- def self.for_file(filename, options)
- had_syntax = options[:syntax]
-
- if had_syntax
- # Use what was explicitly specificed
- elsif filename =~ /\.scss$/
- options.merge!(:syntax => :scss)
- elsif filename =~ /\.sass$/
- options.merge!(:syntax => :sass)
- end
-
- Sass::Engine.new(File.read(filename), options.merge(:filename => filename))
- end
-
- # The options for the Sass engine.
- # See {file:SASS_REFERENCE.md#sass_options the Sass options documentation}.
- #
- # @return [{Symbol => Object}]
- attr_reader :options
-
- # Creates a new Engine. Note that Engine should only be used directly
- # when compiling in-memory Sass code.
- # If you're compiling a single Sass file from the filesystem,
- # use \{Sass::Engine.for\_file}.
- # If you're compiling multiple files from the filesystem,
- # use {Sass::Plugin.
- #
- # @param template [String] The Sass template.
- # This template can be encoded using any encoding
- # that can be converted to Unicode.
- # If the template contains an `@charset` declaration,
- # that overrides the Ruby encoding
- # (see {file:SASS_REFERENCE.md#encodings the encoding documentation})
- # @param options [{Symbol => Object}] An options hash.
- # See {file:SASS_REFERENCE.md#sass_options the Sass options documentation}.
- # @see {Sass::Engine.for_file}
- # @see {Sass::Plugin}
- def initialize(template, options={})
- @options = self.class.normalize_options(options)
- @template = template
- end
-
- # Render the template to CSS.
- #
- # @return [String] The CSS
- # @raise [Sass::SyntaxError] if there's an error in the document
- # @raise [Encoding::UndefinedConversionError] if the source encoding
- # cannot be converted to UTF-8
- # @raise [ArgumentError] if the document uses an unknown encoding with `@charset`
- def render
- return _render unless @options[:quiet]
- Sass::Util.silence_sass_warnings {_render}
- end
- alias_method :to_css, :render
-
- # Parses the document into its parse tree. Memoized.
- #
- # @return [Sass::Tree::Node] The root of the parse tree.
- # @raise [Sass::SyntaxError] if there's an error in the document
- def to_tree
- @tree ||= @options[:quiet] ?
- Sass::Util.silence_sass_warnings {_to_tree} :
- _to_tree
- end
-
- # Returns the original encoding of the document,
- # or `nil` under Ruby 1.8.
- #
- # @return [Encoding, nil]
- # @raise [Encoding::UndefinedConversionError] if the source encoding
- # cannot be converted to UTF-8
- # @raise [ArgumentError] if the document uses an unknown encoding with `@charset`
- def source_encoding
- check_encoding!
- @original_encoding
- end
-
- # Gets a set of all the documents
- # that are (transitive) dependencies of this document,
- # not including the document itself.
- #
- # @return [[Sass::Engine]] The dependency documents.
- def dependencies
- _dependencies(Set.new, engines = Set.new)
- engines - [self]
- end
-
- # Helper for \{#dependencies}.
- #
- # @private
- def _dependencies(seen, engines)
- return if seen.include?(key = [@options[:filename], @options[:importer]])
- seen << key
- engines << self
- to_tree.grep(Tree::ImportNode) do |n|
- next if n.css_import?
- n.imported_file._dependencies(seen, engines)
- end
- end
-
- private
-
- def _render
- rendered = _to_tree.render
- return rendered if ruby1_8?
- begin
- # Try to convert the result to the original encoding,
- # but if that doesn't work fall back on UTF-8
- rendered = rendered.encode(source_encoding)
- rescue EncodingError
- end
- rendered.gsub(Regexp.new('\A@charset "(.*?)"'.encode(source_encoding)),
- "@charset \"#{source_encoding.name}\"".encode(source_encoding))
- end
-
- def _to_tree
- if (@options[:cache] || @options[:read_cache]) &&
- @options[:filename] && @options[:importer]
- key = sassc_key
- sha = Digest::SHA1.hexdigest(@template)
-
- if root = @options[:cache_store].retrieve(key, sha)
- @options = root.options.merge(@options)
- root.options = @options
- return root
- end
- end
-
- check_encoding!
-
- if @options[:syntax] == :scss
- root = Sass::SCSS::Parser.new(@template).parse
- else
- root = Tree::RootNode.new(@template)
- append_children(root, tree(tabulate(@template)).first, true)
- end
-
- root.options = @options
- if @options[:cache] && key && sha
- begin
- old_options = root.options
- root.options = {:importer => root.options[:importer]}
- @options[:cache_store].store(key, sha, root)
- ensure
- root.options = old_options
- end
- end
- root
- rescue SyntaxError => e
- e.modify_backtrace(:filename => @options[:filename], :line => @line)
- e.sass_template = @template
- raise e
- end
-
- def sassc_key
- @options[:cache_store].key(*@options[:importer].key(@options[:filename], @options))
- end
-
- def check_encoding!
- return if @checked_encoding
- @checked_encoding = true
- @template, @original_encoding = check_sass_encoding(@template) do |msg, line|
- raise Sass::SyntaxError.new(msg, :line => line)
- end
- end
-
- def tabulate(string)
- tab_str = nil
- comment_tab_str = nil
- first = true
- lines = []
- string.gsub(/\r|\n|\r\n|\r\n/, "\n").scan(/^[^\n]*?$/).each_with_index do |line, index|
- index += (@options[:line] || 1)
- if line.strip.empty?
- lines.last.text << "\n" if lines.last && lines.last.comment?
- next
- end
-
- line_tab_str = line[/^\s*/]
- unless line_tab_str.empty?
- if tab_str.nil?
- comment_tab_str ||= line_tab_str
- next if try_comment(line, lines.last, "", comment_tab_str, index)
- comment_tab_str = nil
- end
-
- tab_str ||= line_tab_str
-
- raise SyntaxError.new("Indenting at the beginning of the document is illegal.",
- :line => index) if first
-
- raise SyntaxError.new("Indentation can't use both tabs and spaces.",
- :line => index) if tab_str.include?(?\s) && tab_str.include?(?\t)
- end
- first &&= !tab_str.nil?
- if tab_str.nil?
- lines << Line.new(line.strip, 0, index, 0, @options[:filename], [])
- next
- end
-
- comment_tab_str ||= line_tab_str
- if try_comment(line, lines.last, tab_str * lines.last.tabs, comment_tab_str, index)
- next
- else
- comment_tab_str = nil
- end
-
- line_tabs = line_tab_str.scan(tab_str).size
- if tab_str * line_tabs != line_tab_str
- message = < index)
- end
-
- lines << Line.new(line.strip, line_tabs, index, tab_str.size, @options[:filename], [])
- end
- lines
- end
-
- def try_comment(line, last, tab_str, comment_tab_str, index)
- return unless last && last.comment?
- # Nested comment stuff must be at least one whitespace char deeper
- # than the normal indentation
- return unless line =~ /^#{tab_str}\s/
- unless line =~ /^(?:#{comment_tab_str})(.*)$/
- raise SyntaxError.new(< index)
-Inconsistent indentation:
-previous line was indented by #{Sass::Shared.human_indentation comment_tab_str},
-but this line was indented by #{Sass::Shared.human_indentation line[/^\s*/]}.
-MSG
- end
-
- last.text << "\n" << $1
- true
- end
-
- def tree(arr, i = 0)
- return [], i if arr[i].nil?
-
- base = arr[i].tabs
- nodes = []
- while (line = arr[i]) && line.tabs >= base
- if line.tabs > base
- raise SyntaxError.new("The line was indented #{line.tabs - base} levels deeper than the previous line.",
- :line => line.index) if line.tabs > base + 1
-
- nodes.last.children, i = tree(arr, i)
- else
- nodes << line
- i += 1
- end
- end
- return nodes, i
- end
-
- def build_tree(parent, line, root = false)
- @line = line.index
- node_or_nodes = parse_line(parent, line, root)
-
- Array(node_or_nodes).each do |node|
- # Node is a symbol if it's non-outputting, like a variable assignment
- next unless node.is_a? Tree::Node
-
- node.line = line.index
- node.filename = line.filename
-
- append_children(node, line.children, false)
- end
-
- node_or_nodes
- end
-
- def append_children(parent, children, root)
- continued_rule = nil
- continued_comment = nil
- children.each do |line|
- child = build_tree(parent, line, root)
-
- if child.is_a?(Tree::RuleNode)
- if child.continued? && child.children.empty?
- if continued_rule
- continued_rule.add_rules child
- else
- continued_rule = child
- end
- next
- elsif continued_rule
- continued_rule.add_rules child
- continued_rule.children = child.children
- continued_rule, child = nil, continued_rule
- end
- elsif continued_rule
- continued_rule = nil
- end
-
- if child.is_a?(Tree::CommentNode) && child.silent
- if continued_comment &&
- child.line == continued_comment.line +
- continued_comment.value.count("\n") + 1
- continued_comment.value << "\n" << child.value
- next
- end
-
- continued_comment = child
- end
-
- check_for_no_children(child)
- validate_and_append_child(parent, child, line, root)
- end
-
- parent
- end
-
- def validate_and_append_child(parent, child, line, root)
- case child
- when Array
- child.each {|c| validate_and_append_child(parent, c, line, root)}
- when Tree::Node
- parent << child
- end
- end
-
- def check_for_no_children(node)
- return unless node.is_a?(Tree::RuleNode) && node.children.empty?
- Sass::Util.sass_warn(< @line) if name.nil? || value.nil?
- parse_property(name, parse_interp(name), value, :old, line)
- end
- when ?$
- parse_variable(line)
- when COMMENT_CHAR
- parse_comment(line.text)
- when DIRECTIVE_CHAR
- parse_directive(parent, line, root)
- when ESCAPE_CHAR
- Tree::RuleNode.new(parse_interp(line.text[1..-1]))
- when MIXIN_DEFINITION_CHAR
- parse_mixin_definition(line)
- when MIXIN_INCLUDE_CHAR
- if line.text[1].nil? || line.text[1] == ?\s
- Tree::RuleNode.new(parse_interp(line.text))
- else
- parse_mixin_include(line, root)
- end
- else
- parse_property_or_rule(line)
- end
- end
-
- def parse_property_or_rule(line)
- scanner = StringScanner.new(line.text)
- hack_char = scanner.scan(/[:\*\.]|\#(?!\{)/)
- parser = Sass::SCSS::SassParser.new(scanner, @line)
-
- unless res = parser.parse_interp_ident
- return Tree::RuleNode.new(parse_interp(line.text))
- end
- res.unshift(hack_char) if hack_char
- if comment = scanner.scan(Sass::SCSS::RX::COMMENT)
- res << comment
- end
-
- name = line.text[0...scanner.pos]
- if scanner.scan(/\s*:(?:\s|$)/)
- parse_property(name, res, scanner.rest, :new, line)
- else
- res.pop if comment
- Tree::RuleNode.new(res + parse_interp(scanner.rest))
- end
- end
-
- def parse_property(name, parsed_name, value, prop, line)
- if value.strip.empty?
- expr = Sass::Script::String.new("")
- else
- important = false
- if value =~ Sass::SCSS::RX::IMPORTANT
- important = true
- value = value.gsub(Sass::SCSS::RX::IMPORTANT,"")
- end
- expr = parse_script(value, :offset => line.offset + line.text.index(value))
-
- end
- Tree::PropNode.new(parse_interp(name), expr, important, prop)
- end
-
- def parse_variable(line)
- name, value, default = line.text.scan(Script::MATCH)[0]
- raise SyntaxError.new("Illegal nesting: Nothing may be nested beneath variable declarations.",
- :line => @line + 1) unless line.children.empty?
- raise SyntaxError.new("Invalid variable: \"#{line.text}\".",
- :line => @line) unless name && value
-
- expr = parse_script(value, :offset => line.offset + line.text.index(value))
-
- Tree::VariableNode.new(name, expr, default)
- end
-
- def parse_comment(line)
- if line[1] == CSS_COMMENT_CHAR || line[1] == SASS_COMMENT_CHAR
- silent = line[1] == SASS_COMMENT_CHAR
- Tree::CommentNode.new(
- format_comment_text(line[2..-1], silent),
- silent)
- else
- Tree::RuleNode.new(parse_interp(line))
- end
- end
-
- def parse_directive(parent, line, root)
- directive, whitespace, value = line.text[1..-1].split(/(\s+)/, 2)
- offset = directive.size + whitespace.size + 1 if whitespace
-
- # If value begins with url( or ",
- # it's a CSS @import rule and we don't want to touch it.
- if directive == "import"
- parse_import(line, value)
- elsif directive == "mixin"
- parse_mixin_definition(line)
- elsif directive == "include"
- parse_mixin_include(line, root)
- elsif directive == "function"
- parse_function(line, root)
- elsif directive == "for"
- parse_for(line, root, value)
- elsif directive == "each"
- parse_each(line, root, value)
- elsif directive == "else"
- parse_else(parent, line, value)
- elsif directive == "while"
- raise SyntaxError.new("Invalid while directive '@while': expected expression.") unless value
- Tree::WhileNode.new(parse_script(value, :offset => offset))
- elsif directive == "if"
- raise SyntaxError.new("Invalid if directive '@if': expected expression.") unless value
- Tree::IfNode.new(parse_script(value, :offset => offset))
- elsif directive == "debug"
- raise SyntaxError.new("Invalid debug directive '@debug': expected expression.") unless value
- raise SyntaxError.new("Illegal nesting: Nothing may be nested beneath debug directives.",
- :line => @line + 1) unless line.children.empty?
- offset = line.offset + line.text.index(value).to_i
- Tree::DebugNode.new(parse_script(value, :offset => offset))
- elsif directive == "extend"
- raise SyntaxError.new("Invalid extend directive '@extend': expected expression.") unless value
- raise SyntaxError.new("Illegal nesting: Nothing may be nested beneath extend directives.",
- :line => @line + 1) unless line.children.empty?
- offset = line.offset + line.text.index(value).to_i
- Tree::ExtendNode.new(parse_interp(value, offset))
- elsif directive == "warn"
- raise SyntaxError.new("Invalid warn directive '@warn': expected expression.") unless value
- raise SyntaxError.new("Illegal nesting: Nothing may be nested beneath warn directives.",
- :line => @line + 1) unless line.children.empty?
- offset = line.offset + line.text.index(value).to_i
- Tree::WarnNode.new(parse_script(value, :offset => offset))
- elsif directive == "return"
- raise SyntaxError.new("Invalid @return: expected expression.") unless value
- raise SyntaxError.new("Illegal nesting: Nothing may be nested beneath return directives.",
- :line => @line + 1) unless line.children.empty?
- offset = line.offset + line.text.index(value).to_i
- Tree::ReturnNode.new(parse_script(value, :offset => offset))
- elsif directive == "charset"
- name = value && value[/\A(["'])(.*)\1\Z/, 2] #"
- raise SyntaxError.new("Invalid charset directive '@charset': expected string.") unless name
- raise SyntaxError.new("Illegal nesting: Nothing may be nested beneath charset directives.",
- :line => @line + 1) unless line.children.empty?
- Tree::CharsetNode.new(name)
- elsif directive == "media"
- Tree::MediaNode.new(value)
- else
- Tree::DirectiveNode.new(line.text)
- end
- end
-
- def parse_for(line, root, text)
- var, from_expr, to_name, to_expr = text.scan(/^([^\s]+)\s+from\s+(.+)\s+(to|through)\s+(.+)$/).first
-
- if var.nil? # scan failed, try to figure out why for error message
- if text !~ /^[^\s]+/
- expected = "variable name"
- elsif text !~ /^[^\s]+\s+from\s+.+/
- expected = "'from '"
- else
- expected = "'to ' or 'through '"
- end
- raise SyntaxError.new("Invalid for directive '@for #{text}': expected #{expected}.")
- end
- raise SyntaxError.new("Invalid variable \"#{var}\".") unless var =~ Script::VALIDATE
-
- var = var[1..-1]
- parsed_from = parse_script(from_expr, :offset => line.offset + line.text.index(from_expr))
- parsed_to = parse_script(to_expr, :offset => line.offset + line.text.index(to_expr))
- Tree::ForNode.new(var, parsed_from, parsed_to, to_name == 'to')
- end
-
- def parse_each(line, root, text)
- var, list_expr = text.scan(/^([^\s]+)\s+in\s+(.+)$/).first
-
- if var.nil? # scan failed, try to figure out why for error message
- if text !~ /^[^\s]+/
- expected = "variable name"
- elsif text !~ /^[^\s]+\s+from\s+.+/
- expected = "'in '"
- end
- raise SyntaxError.new("Invalid for directive '@each #{text}': expected #{expected}.")
- end
- raise SyntaxError.new("Invalid variable \"#{var}\".") unless var =~ Script::VALIDATE
-
- var = var[1..-1]
- parsed_list = parse_script(list_expr, :offset => line.offset + line.text.index(list_expr))
- Tree::EachNode.new(var, parsed_list)
- end
-
- def parse_else(parent, line, text)
- previous = parent.children.last
- raise SyntaxError.new("@else must come after @if.") unless previous.is_a?(Tree::IfNode)
-
- if text
- if text !~ /^if\s+(.+)/
- raise SyntaxError.new("Invalid else directive '@else #{text}': expected 'if '.")
- end
- expr = parse_script($1, :offset => line.offset + line.text.index($1))
- end
-
- node = Tree::IfNode.new(expr)
- append_children(node, line.children, false)
- previous.add_else node
- nil
- end
-
- def parse_import(line, value)
- raise SyntaxError.new("Illegal nesting: Nothing may be nested beneath import directives.",
- :line => @line + 1) unless line.children.empty?
-
- scanner = StringScanner.new(value)
- values = []
-
- loop do
- unless node = parse_import_arg(scanner)
- raise SyntaxError.new("Invalid @import: expected file to import, was #{scanner.rest.inspect}",
- :line => @line)
- end
- values << node
- break unless scanner.scan(/,\s*/)
- end
-
- return values
- end
-
- def parse_import_arg(scanner)
- return if scanner.eos?
- unless (str = scanner.scan(Sass::SCSS::RX::STRING)) ||
- (uri = scanner.scan(Sass::SCSS::RX::URI))
- return Tree::ImportNode.new(scanner.scan(/[^,]+/))
- end
-
- val = scanner[1] || scanner[2]
- scanner.scan(/\s*/)
- if media = scanner.scan(/[^,].*/)
- Tree::DirectiveNode.new("@import #{str || uri} #{media}")
- elsif uri
- Tree::DirectiveNode.new("@import #{uri}")
- elsif val =~ /^http:\/\//
- Tree::DirectiveNode.new("@import url(#{val})")
- else
- Tree::ImportNode.new(val)
- end
- end
-
- MIXIN_DEF_RE = /^(?:=|@mixin)\s*(#{Sass::SCSS::RX::IDENT})(.*)$/
- def parse_mixin_definition(line)
- name, arg_string = line.text.scan(MIXIN_DEF_RE).first
- raise SyntaxError.new("Invalid mixin \"#{line.text[1..-1]}\".") if name.nil?
-
- offset = line.offset + line.text.size - arg_string.size
- args = Script::Parser.new(arg_string.strip, @line, offset, @options).
- parse_mixin_definition_arglist
- Tree::MixinDefNode.new(name, args)
- end
-
- MIXIN_INCLUDE_RE = /^(?:\+|@include)\s*(#{Sass::SCSS::RX::IDENT})(.*)$/
- def parse_mixin_include(line, root)
- name, arg_string = line.text.scan(MIXIN_INCLUDE_RE).first
- raise SyntaxError.new("Invalid mixin include \"#{line.text}\".") if name.nil?
-
- offset = line.offset + line.text.size - arg_string.size
- args, keywords = Script::Parser.new(arg_string.strip, @line, offset, @options).
- parse_mixin_include_arglist
- raise SyntaxError.new("Illegal nesting: Nothing may be nested beneath mixin directives.",
- :line => @line + 1) unless line.children.empty?
- Tree::MixinNode.new(name, args, keywords)
- end
-
- FUNCTION_RE = /^@function\s*(#{Sass::SCSS::RX::IDENT})(.*)$/
- def parse_function(line, root)
- name, arg_string = line.text.scan(FUNCTION_RE).first
- raise SyntaxError.new("Invalid function definition \"#{line.text}\".") if name.nil?
-
- offset = line.offset + line.text.size - arg_string.size
- args = Script::Parser.new(arg_string.strip, @line, offset, @options).
- parse_function_definition_arglist
- Tree::FunctionNode.new(name, args)
- end
-
- def parse_script(script, options = {})
- line = options[:line] || @line
- offset = options[:offset] || 0
- Script.parse(script, line, offset, @options)
- end
-
- def format_comment_text(text, silent)
- content = text.split("\n")
-
- if content.first && content.first.strip.empty?
- removed_first = true
- content.shift
- end
-
- return silent ? "//" : "/* */" if content.empty?
- content.last.gsub!(%r{ ?\*/ *$}, '')
- content.map! {|l| l.gsub!(/^\*( ?)/, '\1') || (l.empty? ? "" : " ") + l}
- content.first.gsub!(/^ /, '') unless removed_first
- if silent
- "//" + content.join("\n//")
- else
- # The #gsub fixes the case of a trailing */
- "/*" + content.join("\n *").gsub(/ \*\Z/, '') + " */"
- end
- end
-
- def parse_interp(text, offset = 0)
- self.class.parse_interp(text, @line, offset, :filename => @filename)
- end
-
- # It's important that this have strings (at least)
- # at the beginning, the end, and between each Script::Node.
- #
- # @private
- def self.parse_interp(text, line, offset, options)
- res = []
- rest = Sass::Shared.handle_interpolation text do |scan|
- escapes = scan[2].size
- res << scan.matched[0...-2 - escapes]
- if escapes % 2 == 1
- res << "\\" * (escapes - 1) << '#{'
- else
- res << "\\" * [0, escapes - 1].max
- res << Script::Parser.new(
- scan, line, offset + scan.pos - scan.matched_size, options).
- parse_interpolated
- end
- end
- res << rest
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/environment.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/environment.rb
deleted file mode 100644
index b57799fc64..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/environment.rb
+++ /dev/null
@@ -1,155 +0,0 @@
-require 'set'
-
-module Sass
- # The lexical environment for SassScript.
- # This keeps track of variable, mixin, and function definitions.
- #
- # A new environment is created for each level of Sass nesting.
- # This allows variables to be lexically scoped.
- # The new environment refers to the environment in the upper scope,
- # so it has access to variables defined in enclosing scopes,
- # but new variables are defined locally.
- #
- # Environment also keeps track of the {Engine} options
- # so that they can be made available to {Sass::Script::Functions}.
- class Environment
- # The enclosing environment,
- # or nil if this is the global environment.
- #
- # @return [Environment]
- attr_reader :parent
- attr_writer :options
-
- # @param parent [Environment] See \{#parent}
- def initialize(parent = nil)
- @parent = parent
- unless parent
- @stack = []
- @mixins_in_use = Set.new
- set_var("important", Script::String.new("!important"))
- end
- end
-
- # The options hash.
- # See {file:SASS_REFERENCE.md#sass_options the Sass options documentation}.
- #
- # @return [{Symbol => Object}]
- def options
- @options || parent_options || {}
- end
-
- # Push a new stack frame onto the mixin/include stack.
- #
- # @param frame_info [{Symbol => Object}]
- # Frame information has the following keys:
- #
- # `:filename`
- # : The name of the file in which the lexical scope changed.
- #
- # `:mixin`
- # : The name of the mixin in which the lexical scope changed,
- # or `nil` if it wasn't within in a mixin.
- #
- # `:line`
- # : The line of the file on which the lexical scope changed. Never nil.
- def push_frame(frame_info)
- top_of_stack = stack.last
- if top_of_stack && top_of_stack.delete(:prepared)
- top_of_stack.merge!(frame_info)
- else
- stack.push(top_of_stack = frame_info)
- end
- mixins_in_use << top_of_stack[:mixin] if top_of_stack[:mixin] && !top_of_stack[:prepared]
- end
-
- # Like \{#push\_frame}, but next time a stack frame is pushed,
- # it will be merged with this frame.
- #
- # @param frame_info [{Symbol => Object}] Same as for \{#push\_frame}.
- def prepare_frame(frame_info)
- push_frame(frame_info.merge(:prepared => true))
- end
-
- # Pop a stack frame from the mixin/include stack.
- def pop_frame
- stack.pop if stack.last && stack.last[:prepared]
- popped = stack.pop
- mixins_in_use.delete(popped[:mixin]) if popped && popped[:mixin]
- end
-
- # A list of stack frames in the mixin/include stack.
- # The last element in the list is the most deeply-nested frame.
- #
- # @return [Array<{Symbol => Object}>] The stack frames,
- # of the form passed to \{#push\_frame}.
- def stack
- @stack ||= @parent.stack
- end
-
- # A set of names of mixins currently present in the stack.
- #
- # @return [Set] The mixin names.
- def mixins_in_use
- @mixins_in_use ||= @parent.mixins_in_use
- end
-
- private
-
- def parent_options
- @parent_options ||= @parent && @parent.options
- end
-
- class << self
- private
- UNDERSCORE, DASH = '_', '-'
-
- # Note: when updating this,
- # update sass/yard/inherited_hash.rb as well.
- def inherited_hash(name)
- class_eval < Object>}]
- attr_accessor :sass_backtrace
-
- # The text of the template where this error was raised.
- #
- # @return [String]
- attr_accessor :sass_template
-
- # @param msg [String] The error message
- # @param attrs [{Symbol => Object}] The information in the backtrace entry.
- # See \{#sass\_backtrace}
- def initialize(msg, attrs = {})
- @message = msg
- @sass_backtrace = []
- add_backtrace(attrs)
- end
-
- # The name of the file in which the exception was raised.
- # This could be `nil` if no filename is available.
- #
- # @return [String, nil]
- def sass_filename
- sass_backtrace.first[:filename]
- end
-
- # The name of the mixin in which the error occurred.
- # This could be `nil` if the error occurred outside a mixin.
- #
- # @return [Fixnum]
- def sass_mixin
- sass_backtrace.first[:mixin]
- end
-
- # The line of the Sass template on which the error occurred.
- #
- # @return [Fixnum]
- def sass_line
- sass_backtrace.first[:line]
- end
-
- # Adds an entry to the exception's Sass backtrace.
- #
- # @param attrs [{Symbol => Object}] The information in the backtrace entry.
- # See \{#sass\_backtrace}
- def add_backtrace(attrs)
- sass_backtrace << attrs.reject {|k, v| v.nil?}
- end
-
- # Modify the top Sass backtrace entries
- # (that is, the most deeply nested ones)
- # to have the given attributes.
- #
- # Specifically, this goes through the backtrace entries
- # from most deeply nested to least,
- # setting the given attributes for each entry.
- # If an entry already has one of the given attributes set,
- # the pre-existing attribute takes precedence
- # and is not used for less deeply-nested entries
- # (even if they don't have that attribute set).
- #
- # @param attrs [{Symbol => Object}] The information to add to the backtrace entry.
- # See \{#sass\_backtrace}
- def modify_backtrace(attrs)
- attrs = attrs.reject {|k, v| v.nil?}
- # Move backwards through the backtrace
- (0...sass_backtrace.size).to_a.reverse.each do |i|
- entry = sass_backtrace[i]
- sass_backtrace[i] = attrs.merge(entry)
- attrs.reject! {|k, v| entry.include?(k)}
- break if attrs.empty?
- end
- end
-
- # @return [String] The error message
- def to_s
- @message
- end
-
- # Returns the standard exception backtrace,
- # including the Sass backtrace.
- #
- # @return [Array]
- def backtrace
- return nil if super.nil?
- return super if sass_backtrace.all? {|h| h.empty?}
- sass_backtrace.map do |h|
- "#{h[:filename] || "(sass)"}:#{h[:line]}" +
- (h[:mixin] ? ":in `#{h[:mixin]}'" : "")
- end + super
- end
-
- # Returns a string representation of the Sass backtrace.
- #
- # @param default_filename [String] The filename to use for unknown files
- # @see #sass_backtrace
- # @return [String]
- def sass_backtrace_str(default_filename = "an unknown file")
- lines = self.message.split("\n")
- msg = lines[0] + lines[1..-1].
- map {|l| "\n" + (" " * "Syntax error: ".size) + l}.join
- "Syntax error: #{msg}" +
- Sass::Util.enum_with_index(sass_backtrace).map do |entry, i|
- "\n #{i == 0 ? "on" : "from"} line #{entry[:line]}" +
- " of #{entry[:filename] || default_filename}" +
- (entry[:mixin] ? ", in `#{entry[:mixin]}'" : "")
- end.join
- end
-
- class << self
- # Returns an error report for an exception in CSS format.
- #
- # @param e [Exception]
- # @param options [{Symbol => Object}] The options passed to {Sass::Engine#initialize}
- # @return [String] The error report
- # @raise [Exception] `e`, if the
- # {file:SASS_REFERENCE.md#full_exception-option `:full_exception`} option
- # is set to false.
- def exception_to_css(e, options)
- raise e unless options[:full_exception]
-
- header = header_string(e, options)
-
- <] The command-line arguments
- def initialize(args)
- @args = args
- @options = {}
- end
-
- # Parses the command-line arguments and runs the executable.
- # Calls `Kernel#exit` at the end, so it never returns.
- #
- # @see #parse
- def parse!
- begin
- parse
- rescue Exception => e
- raise e if @options[:trace] || e.is_a?(SystemExit)
-
- $stderr.print "#{e.class}: " unless e.class == RuntimeError
- $stderr.puts "#{e.message}"
- $stderr.puts " Use --trace for backtrace."
- exit 1
- end
- exit 0
- end
-
- # Parses the command-line arguments and runs the executable.
- # This does not handle exceptions or exit the program.
- #
- # @see #parse!
- def parse
- @opts = OptionParser.new(&method(:set_opts))
- @opts.parse!(@args)
-
- process_result
-
- @options
- end
-
- # @return [String] A description of the executable
- def to_s
- @opts.to_s
- end
-
- protected
-
- # Finds the line of the source template
- # on which an exception was raised.
- #
- # @param exception [Exception] The exception
- # @return [String] The line number
- def get_line(exception)
- # SyntaxErrors have weird line reporting
- # when there's trailing whitespace
- return (exception.message.scan(/:(\d+)/).first || ["??"]).first if exception.is_a?(::SyntaxError)
- (exception.backtrace[0].scan(/:(\d+)/).first || ["??"]).first
- end
-
- # Tells optparse how to parse the arguments
- # available for all executables.
- #
- # This is meant to be overridden by subclasses
- # so they can add their own options.
- #
- # @param opts [OptionParser]
- def set_opts(opts)
- opts.on('-s', '--stdin', :NONE, 'Read input from standard input instead of an input file') do
- @options[:input] = $stdin
- end
-
- opts.on('--trace', :NONE, 'Show a full traceback on error') do
- @options[:trace] = true
- end
-
- opts.on('--unix-newlines', 'Use Unix-style newlines in written files.') do
- @options[:unix_newlines] = true if ::Sass::Util.windows?
- end
-
- opts.on_tail("-?", "-h", "--help", "Show this message") do
- puts opts
- exit
- end
-
- opts.on_tail("-v", "--version", "Print version") do
- puts("Sass #{::Sass.version[:string]}")
- exit
- end
- end
-
- # Processes the options set by the command-line arguments.
- # In particular, sets `@options[:input]` and `@options[:output]`
- # to appropriate IO streams.
- #
- # This is meant to be overridden by subclasses
- # so they can run their respective programs.
- def process_result
- input, output = @options[:input], @options[:output]
- args = @args.dup
- input ||=
- begin
- filename = args.shift
- @options[:filename] = filename
- open_file(filename) || $stdin
- end
- output ||= open_file(args.shift, 'w') || $stdout
-
- @options[:input], @options[:output] = input, output
- end
-
- COLORS = { :red => 31, :green => 32, :yellow => 33 }
-
- # Prints a status message about performing the given action,
- # colored using the given color (via terminal escapes) if possible.
- #
- # @param name [#to_s] A short name for the action being performed.
- # Shouldn't be longer than 11 characters.
- # @param color [Symbol] The name of the color to use for this action.
- # Can be `:red`, `:green`, or `:yellow`.
- def puts_action(name, color, arg)
- return if @options[:for_engine][:quiet]
- printf color(color, "%11s %s\n"), name, arg
- end
-
- # Same as \{Kernel.puts}, but doesn't print anything if the `--quiet` option is set.
- #
- # @param args [Array] Passed on to \{Kernel.puts}
- def puts(*args)
- return if @options[:for_engine][:quiet]
- Kernel.puts(*args)
- end
-
- # Wraps the given string in terminal escapes
- # causing it to have the given color.
- # If terminal esapes aren't supported on this platform,
- # just returns the string instead.
- #
- # @param color [Symbol] The name of the color to use.
- # Can be `:red`, `:green`, or `:yellow`.
- # @param str [String] The string to wrap in the given color.
- # @return [String] The wrapped string.
- def color(color, str)
- raise "[BUG] Unrecognized color #{color}" unless COLORS[color]
-
- # Almost any real Unix terminal will support color,
- # so we just filter for Windows terms (which don't set TERM)
- # and not-real terminals, which aren't ttys.
- return str if ENV["TERM"].nil? || ENV["TERM"].empty? || !STDOUT.tty?
- return "\e[#{COLORS[color]}m#{str}\e[0m"
- end
-
- private
-
- def open_file(filename, flag = 'r')
- return if filename.nil?
- flag = 'wb' if @options[:unix_newlines] && flag == 'w'
- File.open(filename, flag)
- end
-
- def handle_load_error(err)
- dep = err.message[/^no such file to load -- (.*)/, 1]
- raise err if @options[:trace] || dep.nil? || dep.empty?
- $stderr.puts <] The command-line arguments
- def initialize(args)
- super
- @options[:for_engine] = {
- :load_paths => ['.'] + (ENV['SASSPATH'] || '').split(File::PATH_SEPARATOR)
- }
- @default_syntax = :sass
- end
-
- protected
-
- # Tells optparse how to parse the arguments.
- #
- # @param opts [OptionParser]
- def set_opts(opts)
- super
-
- opts.banner = < e
- raise e if @options[:trace]
- raise e.sass_backtrace_str("standard input")
- end
- end
-
- private
-
- def load_compass
- begin
- require 'compass'
- rescue LoadError
- require 'rubygems'
- begin
- require 'compass'
- rescue LoadError
- puts "ERROR: Cannot load compass."
- exit 1
- end
- end
- Compass.add_project_configuration
- Compass.configuration.project_path ||= Dir.pwd
- @options[:for_engine][:load_paths] += Compass.configuration.sass_load_paths
- end
-
- def interactive
- require 'sass/repl'
- ::Sass::Repl.new(@options).run
- end
-
- def watch_or_update
- require 'sass/plugin'
- ::Sass::Plugin.options.merge! @options[:for_engine]
- ::Sass::Plugin.options[:unix_newlines] = @options[:unix_newlines]
-
- raise <>> Sass is watching for changes. Press Ctrl-C to stop."
-
- ::Sass::Plugin.on_template_modified {|template| puts ">>> Change detected to: #{template}"}
- ::Sass::Plugin.on_template_created {|template| puts ">>> New template detected: #{template}"}
- ::Sass::Plugin.on_template_deleted {|template| puts ">>> Deleted template detected: #{template}"}
-
- ::Sass::Plugin.watch(files)
- end
-
- def colon_path?(path)
- !split_colon_path(path)[1].nil?
- end
-
- def split_colon_path(path)
- one, two = path.split(':', 2)
- if one && two && ::Sass::Util.windows? &&
- one =~ /\A[A-Za-z]\Z/ && two =~ /\A[\/\\]/
- # If we're on Windows and we were passed a drive letter path,
- # don't split on that colon.
- one2, two = two.split(':', 2)
- one = one + ':' + one2
- end
- return one, two
- end
-
- # Whether path is likely to be meant as the destination
- # in a source:dest pair.
- def probably_dest_dir?(path)
- return false unless path
- return false if colon_path?(path)
- return Dir.glob(File.join(path, "*.s[ca]ss")).empty?
- end
- end
-
- class Scss < Sass
- # @param args [Array] The command-line arguments
- def initialize(args)
- super
- @default_syntax = :scss
- end
- end
-
- # The `sass-convert` executable.
- class SassConvert < Generic
- # @param args [Array] The command-line arguments
- def initialize(args)
- super
- require 'sass'
- @options[:for_tree] = {}
- @options[:for_engine] = {:cache => false, :read_cache => true}
- end
-
- # Tells optparse how to parse the arguments.
- #
- # @param opts [OptionParser]
- def set_opts(opts)
- opts.banner = < e
- raise e if @options[:trace]
- file = " of #{e.sass_filename}" if e.sass_filename
- raise "Error on line #{e.sass_line}#{file}: #{e.message}\n Use --trace for backtrace"
- rescue LoadError => err
- handle_load_error(err)
- end
-
- @@less_note_printed = false
- def try_less_note
- return if @@less_note_printed
- @@less_note_printed = true
- warn < Object}] Options for the Sass file
- # containing the `@import` that's currently being resolved.
- # @return [Sass::Engine, nil] An Engine containing the imported file,
- # or nil if it couldn't be found or was in the wrong format.
- def find_relative(uri, base, options)
- Sass::Util.abstract(self)
- end
-
- # Find a Sass file, if it exists.
- #
- # This is the primary entry point of the Importer.
- # It corresponds directly to an `@import` statement in Sass.
- # It should do three basic things:
- #
- # * Determine if the URI is in this importer's format.
- # If not, return nil.
- # * Determine if the file indicated by the URI actually exists and is readable.
- # If not, return nil.
- # * Read the file and place the contents in a {Sass::Engine}.
- # Return that engine.
- #
- # If this importer's format allows for file extensions,
- # it should treat them the same way as the default {Filesystem} importer.
- # If the URI explicitly has a `.sass` or `.scss` filename,
- # the importer should look for that exact file
- # and import it as the syntax indicated.
- # If it doesn't exist, the importer should return nil.
- #
- # If the URI doesn't have either of these extensions,
- # the importer should look for files with the extensions.
- # If no such files exist, it should return nil.
- #
- # The {Sass::Engine} to be returned should be passed `options`,
- # with a few modifications. `:filename` and `:syntax` should be set appropriately,
- # and `:importer` should be set to this importer.
- #
- # @param uri [String] The URI to import.
- # @param options [{Symbol => Object}] Options for the Sass file
- # containing the `@import` that's currently being resolved.
- # This is safe for subclasses to modify destructively.
- # Callers should only pass in a value they don't mind being destructively modified.
- # @return [Sass::Engine, nil] An Engine containing the imported file,
- # or nil if it couldn't be found or was in the wrong format.
- def find(uri, options)
- Sass::Util.abstract(self)
- end
-
- # Returns the time the given Sass file was last modified.
- #
- # If the given file has been deleted or the time can't be accessed
- # for some other reason, this should return nil.
- #
- # @param uri [String] The URI of the file to check.
- # Comes from a `:filename` option set on an engine returned by this importer.
- # @param options [{Symbol => Objet}] Options for the Sass file
- # containing the `@import` currently being checked.
- # @return [Time, nil]
- def mtime(uri, options)
- Sass::Util.abstract(self)
- end
-
- # Get the cache key pair for the given Sass URI.
- # The URI need not be checked for validity.
- #
- # The only strict requirement is that the returned pair of strings
- # uniquely identify the file at the given URI.
- # However, the first component generally corresponds roughly to the directory,
- # and the second to the basename, of the URI.
- #
- # Note that keys must be unique *across importers*.
- # Thus it's probably a good idea to include the importer name
- # at the beginning of the first component.
- #
- # @param uri [String] A URI known to be valid for this importer.
- # @param options [{Symbol => Object}] Options for the Sass file
- # containing the `@import` currently being checked.
- # @return [(String, String)] The key pair which uniquely identifies
- # the file at the given URI.
- def key(uri, options)
- Sass::Util.abstract(self)
- end
-
- # A string representation of the importer.
- # Should be overridden by subclasses.
- #
- # This is used to help debugging,
- # and should usually just show the load path encapsulated by this importer.
- #
- # @return [String]
- def to_s
- Sass::Util.abstract(self)
- end
- end
- end
-end
-
-
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/importers/filesystem.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/importers/filesystem.rb
deleted file mode 100644
index d78a275762..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/importers/filesystem.rb
+++ /dev/null
@@ -1,144 +0,0 @@
-require 'pathname'
-
-module Sass
- module Importers
- # The default importer, used for any strings found in the load path.
- # Simply loads Sass files from the filesystem using the default logic.
- class Filesystem < Base
-
- attr_accessor :root
-
- # Creates a new filesystem importer that imports files relative to a given path.
- #
- # @param root [String] The root path.
- # This importer will import files relative to this path.
- def initialize(root)
- @root = root
- end
-
- # @see Base#find_relative
- def find_relative(name, base, options)
- _find(File.dirname(base), name, options)
- end
-
- # @see Base#find
- def find(name, options)
- _find(@root, name, options)
- end
-
- # @see Base#mtime
- def mtime(name, options)
- file, s = find_real_file(@root, name)
- File.mtime(file) if file
- rescue Errno::ENOENT
- nil
- end
-
- # @see Base#key
- def key(name, options)
- [self.class.name + ":" + File.dirname(File.expand_path(name)),
- File.basename(name)]
- end
-
- # @see Base#to_s
- def to_s
- @root
- end
-
- protected
-
- # If a full uri is passed, this removes the root from it
- # otherwise returns the name unchanged
- def remove_root(name)
- root = @root.end_with?('/') ? @root : @root + '/'
- if name.index(root) == 0
- name[root.length..-1]
- else
- name
- end
- end
-
- # A hash from file extensions to the syntaxes for those extensions.
- # The syntaxes must be `:sass` or `:scss`.
- #
- # This can be overridden by subclasses that want normal filesystem importing
- # with unusual extensions.
- #
- # @return [{String => Symbol}]
- def extensions
- {'sass' => :sass, 'scss' => :scss}
- end
-
- # Given an `@import`ed path, returns an array of possible
- # on-disk filenames and their corresponding syntaxes for that path.
- #
- # @param name [String] The filename.
- # @return [Array(String, Symbol)] An array of pairs.
- # The first element of each pair is a filename to look for;
- # the second element is the syntax that file would be in (`:sass` or `:scss`).
- def possible_files(name)
- dirname, basename, extname = split(name)
- sorted_exts = extensions.sort
- syntax = extensions[extname]
-
- return [["#{dirname}/{_,}#{basename}.#{extensions.invert[syntax]}", syntax]] if syntax
- sorted_exts.map {|ext, syn| ["#{dirname}/{_,}#{basename}.#{ext}", syn]}
- end
-
-
- REDUNDANT_DIRECTORY = %r{#{Regexp.escape(File::SEPARATOR)}\.#{Regexp.escape(File::SEPARATOR)}}
- # Given a base directory and an `@import`ed name,
- # finds an existant file that matches the name.
- #
- # @param dir [String] The directory relative to which to search.
- # @param name [String] The filename to search for.
- # @return [(String, Symbol)] A filename-syntax pair.
- def find_real_file(dir, name)
- for (f,s) in possible_files(remove_root(name))
- path = (dir == ".") ? f : "#{dir}/#{f}"
- if full_path = Dir[path].first
- full_path.gsub!(REDUNDANT_DIRECTORY,File::SEPARATOR)
- return full_path, s
- end
- end
- nil
- end
-
- # Splits a filename into three parts, a directory part, a basename, and an extension
- # Only the known extensions returned from the extensions method will be recognized as such.
- def split(name)
- extension = nil
- dirname, basename = File.dirname(name), File.basename(name)
- if basename =~ /^(.*)\.(#{extensions.keys.map{|e| Regexp.escape(e)}.join('|')})$/
- basename = $1
- extension = $2
- end
- [dirname, basename, extension]
- end
-
- def hash
- @root.hash
- end
-
- def eql?(other)
- root.eql?(other.root)
- end
-
- private
-
- def _find(dir, name, options)
- full_filename, syntax = find_real_file(dir, name)
- return unless full_filename && File.readable?(full_filename)
-
- options[:syntax] = syntax
- options[:filename] = full_filename
- options[:importer] = self
- Sass::Engine.new(File.read(full_filename), options)
- end
-
- def join(base, path)
- Pathname.new(base).join(path).to_s
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/less.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/less.rb
deleted file mode 100755
index 71d63389bb..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/less.rb
+++ /dev/null
@@ -1,382 +0,0 @@
-#!/usr/bin/env ruby
-
-require 'less'
-
-module Less
- # This is the class that Treetop defines for parsing Less files.
- # Since not everything gets parsed into the AST but is instead resolved at parse-time,
- # we need to override some of it so that it can be converted into Sass.
- module StyleSheet
- # Selector mixins that don't have arguments.
- # This depends only on the syntax at the call site;
- # if it doesn't use parens, it hits this production,
- # regardless of whether the mixin being called has arguments or not.
- module Mixin4
- def build_with_sass(env)
- selectors.build(env, :mixin).each do |path|
- el = path.inject(env.root) do |current, node|
- current.descend(node.selector, node) or raise MixinNameError, "#{selectors.text_value} in #{env}"
- end
- if el.is_a?(Node::Mixin::Def)
- # Calling a mixin with arguments, which gets compiled to a Sass mixin
- env << Node::Mixin::Call.new(el, [], env)
- else
- # Calling a mixin without arguments, which gets compiled to @extend
- sel = selector_str(path)
- base = selector_str(selector_base(path))
- if base == sel
- env << Node::SassNode.new(Sass::Tree::ExtendNode.new([sel]))
- else
- Sass::Util.sass_warn < e
- raise Sass::SyntaxError.new("File to import #{url.text_value} not found or unreadable", :line => line)
- end
- alias_method :build_without_sass, :build
- alias_method :build, :build_with_sass
- end
-
- # The IE-specific `alpha(opacity=@var)`.
- # Less manually resolves the variable here at parse-time.
- # We want to keep the variable around,
- # so we compile this to a function.
- # Less doesn't actually have an `=` operator,
- # but that's okay since it's just getting compiled to Sass anyway.
- module Entity::Alpha1
- def build(env)
- Node::Function.new("alpha",
- [Node::Expression.new([
- Node::Keyword.new("opacity"),
- Node::Operator.new("="),
- variable.build])])
- end
- end
- end
-
- # The Less AST classes for the document,
- # including both stylesheet-level nodes and expression-level nodes.
- # The main purpose of overriding these is to add `#to_sass_tree` functions
- # for converting to Sass.
- module Node
- module Entity
- attr_accessor :hide_in_sass
- attr_accessor :src_line
- end
-
- class Element
- attr_accessor :group
-
- def top(env)
- return self if parent.equal?(env)
- return parent.top(env)
- end
-
- def to_sass_tree
- if root?
- root = Sass::Tree::RootNode.new("")
- rules.each {|r| root << r.to_sass_tree}
- return root
- end
- return if hide_in_sass
- return if !self.equal?(group.first)
-
- last_el = nil
- sel = group.map do |el|
- comma_sel = []
- loop do
- comma_sel << el.sass_selector_str
- break unless el.rules.size == 1 && el.rules.first.is_a?(Element)
- el = el.rules.first
- end
- last_el = el
- comma_sel = comma_sel.join(' ').gsub(' :', ':')
- comma_sel.gsub!(/^:/, '&:') unless parent.root?
- comma_sel
- end.join(', ')
-
- rule = Sass::Tree::RuleNode.new([sel])
- last_el.rules.each {|r| rule << r.to_sass_tree}
- return rule
- end
-
- def sass_selector_str
- case @selector
- when /[+>~]/; "#{@selector} #{@name}"
- else @selector + @name
- end
- end
- end
-
- module Mixin
- class Call
- def to_sass_tree
- return if hide_in_sass
- Sass::Tree::MixinNode.new(@mixin.name.gsub(/^\./, ''), @params.map {|v| v.to_sass_tree}, {})
- end
- end
-
- class Def
- def to_sass_tree
- return if hide_in_sass
- mixin = Sass::Tree::MixinDefNode.new(name, @params.map do |v|
- v.value.flatten!
- [Sass::Script::Variable.new(v), v.value.to_sass_tree]
- end)
- rules.each {|r| mixin << r.to_sass_tree}
- mixin
- end
- end
- end
-
- class SassNode
- include Entity
-
- def initialize(node)
- @node = node
- end
-
- def to_sass_tree
- return if hide_in_sass
- @node
- end
- end
-
- class Property
- def to_sass_tree
- return if hide_in_sass
- Sass::Tree::PropNode.new([self], @value.to_sass_tree, false, :new)
- end
- end
-
- class Expression
- def to_sass_tree
- if first.is_a?(Array)
- val = map {|e| _to_sass_tree(e)}.inject(nil) do |e, i|
- next i unless e
- Sass::Script::Operation.new(e, i, :comma)
- end
- else
- val = _to_sass_tree(self)
- end
- val.options = {}
- val
- end
-
- private
-
- LESS_TO_SASS_OPERATORS = {"-" => :minus, "+" => :plus, "*" => :times, "/" => :div, "=" => :single_eq}
-
- def _to_sass_tree(arr)
- e, rest = _to_sass_tree_plus_minus_eq(arr)
- until rest.empty?
- e2, rest = _to_sass_tree_plus_minus_eq(rest)
- e = Sass::Script::Operation.new(e, e2, :space)
- end
- return e
- end
-
- def _to_sass_tree_plus_minus_eq(arr)
- e, rest = _to_sass_tree_times_div(arr)
- while rest[0] && rest[0].is_a?(Operator) && %w[+ - =].include?(rest[0])
- op = LESS_TO_SASS_OPERATORS[rest[0]]
- e2, rest = _to_sass_tree_times_div(rest[1..-1])
- e = Sass::Script::Operation.new(e, e2, op)
- end
- return e, rest
- end
-
- def _to_sass_tree_times_div(arr)
- e, rest = _to_sass_tree_unary(arr)
- while rest[0] && rest[0].is_a?(Operator) && %w[* /].include?(rest[0])
- op = LESS_TO_SASS_OPERATORS[rest[0]]
- e2, rest = _to_sass_tree_unary(rest[1..-1])
- e = Sass::Script::Operation.new(e, e2, op)
- end
- return e, rest
- end
-
- def _to_sass_tree_unary(arr)
- if arr[0] == "-"
- first, rest = _sass_split(arr[1..-1])
- return Sass::Script::UnaryOperation.new(first, :minus), rest
- else
- return _sass_split(arr[0..-1])
- end
- end
-
- def _sass_split(arr)
- return arr[0].to_sass_tree, arr[1..-1] unless arr[0] == "("
- parens = 1
- i = arr[1..-1].each_with_index do |e, i|
- parens += 1 if e == "("
- parens -= 1 if e == ")"
- break i if parens == 0
- end
-
- return _to_sass_tree(arr[1...i+1]), arr[i+2..-1]
- end
- end
-
- class Color
- def to_sass_tree
- Sass::Script::Color.new(:red => r, :green => g, :blue => b, :alpha => a)
- end
- end
-
- class Number
- def to_sass_tree
- Sass::Script::Number.new(self, [self.unit])
- end
- end
-
- class Variable
- def to_sass_tree
- if @declaration
- return if hide_in_sass
- node = Sass::Tree::VariableNode.new(self, @value.to_sass_tree, false)
- node.line = self.src_line
- node
- else
- Sass::Script::Variable.new(self)
- end
- end
- end
-
- class Function
- def to_sass_tree
- Sass::Script::Funcall.new(self, @args.map {|a| a.to_sass_tree}, {})
- end
- end
-
- class Keyword
- def to_sass_tree
- Sass::Script::String.new(self)
- end
- end
-
- class Anonymous
- def to_sass_tree
- Sass::Script::String.new(self)
- end
- end
-
- class Quoted
- def to_sass_tree
- Sass::Script::String.new(self, true)
- end
- end
-
- class FontFamily
- def to_sass_tree
- @family.map {|f| f.to_sass_tree}.inject(nil) do |e, f|
- next f unless e
- Sass::Script::Operation.new(e, f, :comma)
- end
- end
- end
- end
-
- # The entry point to Less.
- # By default Less doesn't preserve the filename of the file being parsed,
- # which is unpleasant for error reporting.
- # Our monkeypatch keeps it around.
- class Engine
- def initialize_with_sass(obj, opts = {})
- initialize_without_sass(obj, opts)
- @filename = obj.path if obj.is_a?(File)
- end
- alias_method :initialize_without_sass, :initialize
- alias_method :initialize, :initialize_with_sass
-
- def parse_with_sass
- parse_without_sass
- rescue Sass::SyntaxError => e
- e.modify_backtrace(:filename => @filename)
- raise e
- end
- alias_method :parse_without_sass, :parse
- alias_method :parse, :parse_with_sass
- alias_method :to_tree, :parse
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin.rb
deleted file mode 100644
index 85b1ffb9a1..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin.rb
+++ /dev/null
@@ -1,136 +0,0 @@
-require 'fileutils'
-
-require 'sass'
-require 'sass/plugin/compiler'
-
-module Sass
- # This module provides a single interface to the compilation of Sass/SCSS files
- # for an application. It provides global options and checks whether CSS files
- # need to be updated.
- #
- # This module is used as the primary interface with Sass
- # when it's used as a plugin for various frameworks.
- # All Rack-enabled frameworks are supported out of the box.
- # The plugin is {file:SASS_REFERENCE.md#rails_merb_plugin automatically activated for Rails and Merb}.
- # Other frameworks must enable it explicitly; see {Sass::Plugin::Rack}.
- #
- # This module has a large set of callbacks available
- # to allow users to run code (such as logging) when certain things happen.
- # All callback methods are of the form `on_#{name}`,
- # and they all take a block that's called when the given action occurs.
- #
- # Note that this class proxies almost all methods to its {Sass::Plugin::Compiler} instance.
- # See \{#compiler}.
- #
- # @example Using a callback
- # Sass::Plugin.on_updating_stylesheet do |template, css|
- # puts "Compiling #{template} to #{css}"
- # end
- # Sass::Plugin.update_stylesheets
- # #=> Compiling app/sass/screen.scss to public/stylesheets/screen.css
- # #=> Compiling app/sass/print.scss to public/stylesheets/print.css
- # #=> Compiling app/sass/ie.scss to public/stylesheets/ie.css
- # @see Sass::Plugin::Compiler
- module Plugin
- include Sass::Util
- extend self
-
- @checked_for_updates = false
-
- # Whether or not Sass has **ever** checked if the stylesheets need to be updated
- # (in this Ruby instance).
- #
- # @return [Boolean]
- attr_accessor :checked_for_updates
-
- # Same as \{#update\_stylesheets}, but respects \{#checked\_for\_updates}
- # and the {file:SASS_REFERENCE.md#always_update-option `:always_update`}
- # and {file:SASS_REFERENCE.md#always_check-option `:always_check`} options.
- #
- # @see #update_stylesheets
- def check_for_updates
- return unless !Sass::Plugin.checked_for_updates ||
- Sass::Plugin.options[:always_update] || Sass::Plugin.options[:always_check]
- update_stylesheets
- end
-
- # Returns the singleton compiler instance.
- # This compiler has been pre-configured according
- # to the plugin configuration.
- #
- # @return [Sass::Plugin::Compiler]
- def compiler
- @compiler ||= Compiler.new
- end
-
- # Updates out-of-date stylesheets.
- #
- # Checks each Sass/SCSS file in {file:SASS_REFERENCE.md#template_location-option `:template_location`}
- # to see if it's been modified more recently than the corresponding CSS file
- # in {file:SASS_REFERENCE.md#css_location-option `:css_location`}.
- # If it has, it updates the CSS file.
- #
- # @param individual_files [Array<(String, String)>]
- # A list of files to check for updates
- # **in addition to those specified by the
- # {file:SASS_REFERENCE.md#template_location-option `:template_location` option}.**
- # The first string in each pair is the location of the Sass/SCSS file,
- # the second is the location of the CSS file that it should be compiled to.
- def update_stylesheets(individual_files = [])
- return if options[:never_update]
- compiler.update_stylesheets(individual_files)
- end
-
- # Updates all stylesheets, even those that aren't out-of-date.
- # Ignores the cache.
- #
- # @param individual_files [Array<(String, String)>]
- # A list of files to check for updates
- # **in addition to those specified by the
- # {file:SASS_REFERENCE.md#template_location-option `:template_location` option}.**
- # The first string in each pair is the location of the Sass/SCSS file,
- # the second is the location of the CSS file that it should be compiled to.
- # @see #update_stylesheets
- def force_update_stylesheets(individual_files = [])
- old_options = options
- self.options = options.dup
- options[:never_update] = false
- options[:always_update] = true
- options[:cache] = false
- update_stylesheets(individual_files)
- ensure
- self.options = old_options
- end
-
- # All other method invocations are proxied to the \{#compiler}.
- #
- # @see #compiler
- # @see Sass::Plugin::Compiler
- def method_missing(method, *args, &block)
- if compiler.respond_to?(method)
- compiler.send(method, *args, &block)
- else
- super
- end
- end
-
- # For parity with method_missing
- def respond_to?(method)
- super || compiler.respond_to?(method)
- end
-
- # There's a small speedup by not using method missing for frequently delegated methods.
- def options
- compiler.options
- end
-
- end
-end
-
-if defined?(ActionController)
- require 'sass/plugin/rails'
-elsif defined?(Merb::Plugins)
- require 'sass/plugin/merb'
-else
- require 'sass/plugin/generic'
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin/compiler.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin/compiler.rb
deleted file mode 100644
index f7b511a747..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin/compiler.rb
+++ /dev/null
@@ -1,358 +0,0 @@
-require 'fileutils'
-
-require 'sass'
-# XXX CE: is this still necessary now that we have the compiler class?
-require 'sass/callbacks'
-require 'sass/plugin/configuration'
-require 'sass/plugin/staleness_checker'
-
-module Sass::Plugin
-
- # The Compiler class handles compilation of multiple files and/or directories,
- # including checking which CSS files are out-of-date and need to be updated
- # and calling Sass to perform the compilation on those files.
- #
- # {Sass::Plugin} uses this class to update stylesheets for a single application.
- # Unlike {Sass::Plugin}, though, the Compiler class has no global state,
- # and so multiple instances may be created and used independently.
- #
- # If you need to compile a Sass string into CSS,
- # please see the {Sass::Engine} class.
- #
- # Unlike {Sass::Plugin}, this class doesn't keep track of
- # whether or how many times a stylesheet should be updated.
- # Therefore, the following `Sass::Plugin` options are ignored by the Compiler:
- #
- # * `:never_update`
- # * `:always_check`
- class Compiler
- include Sass::Util
- include Configuration
- extend Sass::Callbacks
-
- # Creates a new compiler.
- #
- # @param options [{Symbol => Object}]
- # See {file:SASS_REFERENCE.md#sass_options the Sass options documentation}.
- def initialize(options = {})
- self.options.merge!(options)
- end
-
- # Register a callback to be run before stylesheets are mass-updated.
- # This is run whenever \{#update\_stylesheets} is called,
- # unless the \{file:SASS_REFERENCE.md#never_update-option `:never_update` option}
- # is enabled.
- #
- # @yield [individual_files]
- # @yieldparam individual_files [<(String, String)>]
- # Individual files to be updated, in addition to the directories
- # specified in the options.
- # The first element of each pair is the source file,
- # the second is the target CSS file.
- define_callback :updating_stylesheets
-
- # Register a callback to be run before a single stylesheet is updated.
- # The callback is only run if the stylesheet is guaranteed to be updated;
- # if the CSS file is fresh, this won't be run.
- #
- # Even if the \{file:SASS_REFERENCE.md#full_exception-option `:full_exception` option}
- # is enabled, this callback won't be run
- # when an exception CSS file is being written.
- # To run an action for those files, use \{#on\_compilation\_error}.
- #
- # @yield [template, css]
- # @yieldparam template [String]
- # The location of the Sass/SCSS file being updated.
- # @yieldparam css [String]
- # The location of the CSS file being generated.
- define_callback :updating_stylesheet
-
- # Register a callback to be run when Sass decides not to update a stylesheet.
- # In particular, the callback is run when Sass finds that
- # the template file and none of its dependencies
- # have been modified since the last compilation.
- #
- # Note that this is **not** run when the
- # \{file:SASS_REFERENCE.md#never-update_option `:never_update` option} is set,
- # nor when Sass decides not to compile a partial.
- #
- # @yield [template, css]
- # @yieldparam template [String]
- # The location of the Sass/SCSS file not being updated.
- # @yieldparam css [String]
- # The location of the CSS file not being generated.
- define_callback :not_updating_stylesheet
-
- # Register a callback to be run when there's an error
- # compiling a Sass file.
- # This could include not only errors in the Sass document,
- # but also errors accessing the file at all.
- #
- # @yield [error, template, css]
- # @yieldparam error [Exception] The exception that was raised.
- # @yieldparam template [String]
- # The location of the Sass/SCSS file being updated.
- # @yieldparam css [String]
- # The location of the CSS file being generated.
- define_callback :compilation_error
-
- # Register a callback to be run when Sass creates a directory
- # into which to put CSS files.
- #
- # Note that even if multiple levels of directories need to be created,
- # the callback may only be run once.
- # For example, if "foo/" exists and "foo/bar/baz/" needs to be created,
- # this may only be run for "foo/bar/baz/".
- # This is not a guarantee, however;
- # it may also be run for "foo/bar/".
- #
- # @yield [dirname]
- # @yieldparam dirname [String]
- # The location of the directory that was created.
- define_callback :creating_directory
-
- # Register a callback to be run when Sass detects
- # that a template has been modified.
- # This is only run when using \{#watch}.
- #
- # @yield [template]
- # @yieldparam template [String]
- # The location of the template that was modified.
- define_callback :template_modified
-
- # Register a callback to be run when Sass detects
- # that a new template has been created.
- # This is only run when using \{#watch}.
- #
- # @yield [template]
- # @yieldparam template [String]
- # The location of the template that was created.
- define_callback :template_created
-
- # Register a callback to be run when Sass detects
- # that a template has been deleted.
- # This is only run when using \{#watch}.
- #
- # @yield [template]
- # @yieldparam template [String]
- # The location of the template that was deleted.
- define_callback :template_deleted
-
- # Register a callback to be run when Sass deletes a CSS file.
- # This happens when the corresponding Sass/SCSS file has been deleted.
- #
- # @yield [filename]
- # @yieldparam filename [String]
- # The location of the CSS file that was deleted.
- define_callback :deleting_css
-
- # Updates out-of-date stylesheets.
- #
- # Checks each Sass/SCSS file in {file:SASS_REFERENCE.md#template_location-option `:template_location`}
- # to see if it's been modified more recently than the corresponding CSS file
- # in {file:SASS_REFERENCE.md#css_location-option `:css_location`}.
- # If it has, it updates the CSS file.
- #
- # @param individual_files [Array<(String, String)>]
- # A list of files to check for updates
- # **in addition to those specified by the
- # {file:SASS_REFERENCE.md#template_location-option `:template_location` option}.**
- # The first string in each pair is the location of the Sass/SCSS file,
- # the second is the location of the CSS file that it should be compiled to.
- def update_stylesheets(individual_files = [])
- run_updating_stylesheets individual_files
- Sass::Plugin.checked_for_updates = true
- staleness_checker = StalenessChecker.new(engine_options)
-
- individual_files.each do |t, c|
- if options[:always_update] || staleness_checker.stylesheet_needs_update?(c, t)
- update_stylesheet(t, c)
- end
- end
-
- template_location_array.each do |template_location, css_location|
-
- Dir.glob(File.join(template_location, "**", "[^_]*.s[ca]ss")).sort.each do |file|
- # Get the relative path to the file
- name = file.sub(template_location.to_s.sub(/\/*$/, '/'), "")
- css = css_filename(name, css_location)
-
- if options[:always_update] || staleness_checker.stylesheet_needs_update?(css, file)
- update_stylesheet file, css
- else
- run_not_updating_stylesheet file, css
- end
- end
- end
- end
-
- # Watches the template directory (or directories)
- # and updates the CSS files whenever the related Sass/SCSS files change.
- # `watch` never returns.
- #
- # Whenever a change is detected to a Sass/SCSS file in
- # {file:SASS_REFERENCE.md#template_location-option `:template_location`},
- # the corresponding CSS file in {file:SASS_REFERENCE.md#css_location-option `:css_location`}
- # will be recompiled.
- # The CSS files of any Sass/SCSS files that import the changed file will also be recompiled.
- #
- # Before the watching starts in earnest, `watch` calls \{#update\_stylesheets}.
- #
- # Note that `watch` uses the [FSSM](http://github.com/ttilley/fssm) library
- # to monitor the filesystem for changes.
- # FSSM isn't loaded until `watch` is run.
- # The version of FSSM distributed with Sass is loaded by default,
- # but if another version has already been loaded that will be used instead.
- #
- # @param individual_files [Array<(String, String)>]
- # A list of files to watch for updates
- # **in addition to those specified by the
- # {file:SASS_REFERENCE.md#template_location-option `:template_location` option}.**
- # The first string in each pair is the location of the Sass/SCSS file,
- # the second is the location of the CSS file that it should be compiled to.
- def watch(individual_files = [])
- update_stylesheets(individual_files)
-
- begin
- require 'fssm'
- rescue LoadError => e
- dir = Sass::Util.scope("vendor/fssm/lib")
- if $LOAD_PATH.include?(dir)
- e.message << "\n" <<
- if File.exists?(scope(".git"))
- 'Run "git submodule update --init" to get the recommended version.'
- else
- 'Run "gem install fssm" to get it.'
- end
- raise e
- else
- $LOAD_PATH.unshift dir
- retry
- end
- end
-
- unless individual_files.empty? && FSSM::Backends::Default.name == "FSSM::Backends::FSEvents"
- # As of FSSM 0.1.4, it doesn't support FSevents on individual files,
- # but it also isn't smart enough to switch to polling itself.
- require 'fssm/backends/polling'
- Sass::Util.silence_warnings do
- FSSM::Backends.const_set(:Default, FSSM::Backends::Polling)
- end
- end
-
- # TODO: Keep better track of what depends on what
- # so we don't have to run a global update every time anything changes.
- FSSM.monitor do |mon|
- template_location_array.each do |template_location, css_location|
- mon.path template_location do |path|
- path.glob '**/*.s[ac]ss'
-
- path.update do |base, relative|
- run_template_modified File.join(base, relative)
- update_stylesheets(individual_files)
- end
-
- path.create do |base, relative|
- run_template_created File.join(base, relative)
- update_stylesheets(individual_files)
- end
-
- path.delete do |base, relative|
- run_template_deleted File.join(base, relative)
- css = File.join(css_location, relative.gsub(/\.s[ac]ss$/, '.css'))
- try_delete_css css
- update_stylesheets(individual_files)
- end
- end
- end
-
- individual_files.each do |template, css|
- mon.file template do |path|
- path.update do
- run_template_modified template
- update_stylesheets(individual_files)
- end
-
- path.create do
- run_template_created template
- update_stylesheets(individual_files)
- end
-
- path.delete do
- run_template_deleted template
- try_delete_css css
- update_stylesheets(individual_files)
- end
- end
- end
- end
- end
-
- # Non-destructively modifies \{#options} so that default values are properly set,
- # and returns the result.
- #
- # @param additional_options [{Symbol => Object}] An options hash with which to merge \{#options}
- # @return [{Symbol => Object}] The modified options hash
- def engine_options(additional_options = {})
- opts = options.merge(additional_options)
- opts[:load_paths] = load_paths(opts)
- opts
- end
-
- # Compass expects this to exist
- def stylesheet_needs_update?(css_file, template_file)
- StalenessChecker.stylesheet_needs_update?(css_file, template_file)
- end
-
- private
-
- def update_stylesheet(filename, css)
- dir = File.dirname(css)
- unless File.exists?(dir)
- run_creating_directory dir
- FileUtils.mkdir_p dir
- end
-
- begin
- File.read(filename) unless File.readable?(filename) # triggers an error for handling
- engine_opts = engine_options(:css_filename => css, :filename => filename)
- result = Sass::Engine.for_file(filename, engine_opts).render
- rescue Exception => e
- run_compilation_error e, filename, css
- result = Sass::SyntaxError.exception_to_css(e, options)
- else
- run_updating_stylesheet filename, css
- end
-
- # Finally, write the file
- flag = 'w'
- flag = 'wb' if Sass::Util.windows? && options[:unix_newlines]
- File.open(css, flag) do |file|
- file.set_encoding(result.encoding) unless Sass::Util.ruby1_8?
- file.print(result)
- end
- end
-
- def try_delete_css(css)
- return unless File.exists?(css)
- run_deleting_css css
- File.delete css
- end
-
- def load_paths(opts = options)
- (opts[:load_paths] || []) + template_locations
- end
-
- def template_locations
- template_location_array.to_a.map {|l| l.first}
- end
-
- def css_locations
- template_location_array.to_a.map {|l| l.last}
- end
-
- def css_filename(name, path)
- "#{path}/#{name}".gsub(/\.s[ac]ss$/, '.css')
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin/configuration.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin/configuration.rb
deleted file mode 100644
index e26fba2045..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin/configuration.rb
+++ /dev/null
@@ -1,125 +0,0 @@
-# We keep configuration in its own self-contained file
-# so that we can load it independently in Rails 3,
-# where the full plugin stuff is lazy-loaded.
-
-module Sass
- module Plugin
- module Configuration
-
- # Returns the default options for a {Sass::Plugin::Compiler}.
- #
- # @return [{Symbol => Object}]
- def default_options
- @default_options ||= {
- :css_location => './public/stylesheets',
- :always_update => false,
- :always_check => true,
- :full_exception => true,
- :cache_location => ".sass-cache"
- }.freeze
- end
-
- # Resets the options and {Sass::Callbacks::InstanceMethods#clear_callbacks! clears all callbacks}.
- def reset!
- @options = nil
- clear_callbacks!
- end
-
- # An options hash.
- # See {file:SASS_REFERENCE.md#sass_options the Sass options documentation}.
- #
- # @return [{Symbol => Object}]
- def options
- @options ||= default_options.dup
- @options[:cache_store] ||= Sass::CacheStores::Filesystem.new(@options[:cache_location])
- @options
- end
-
- # Sets the options hash.
- # See {file:SASS_REFERENCE.md#sass_options the Sass options documentation}.
- # See {Sass::Plugin::Configuration#reset!}
- # @deprecated Instead, modify the options hash in-place.
- # @param value [{Symbol => Object}] The options hash
- def options=(value)
- Sass::Util.sass_warn("Setting Sass::Plugin.options is deprecated " +
- "and will be removed in a future release.")
- options.merge!(value)
- end
-
- # Adds a new template-location/css-location mapping.
- # This means that Sass/SCSS files in `template_location`
- # will be compiled to CSS files in `css_location`.
- #
- # This is preferred over manually manipulating the {file:SASS_REFERENCE.md#template_location-option `:template_location` option}
- # since the option can be in multiple formats.
- #
- # Note that this method will change `options[:template_location]`
- # to be in the Array format.
- # This means that even if `options[:template_location]`
- # had previously been a Hash or a String,
- # it will now be an Array.
- #
- # @param template_location [String] The location where Sass/SCSS files will be.
- # @param css_location [String] The location where compiled CSS files will go.
- def add_template_location(template_location, css_location = options[:css_location])
- normalize_template_location!
- template_location_array << [template_location, css_location]
- end
-
- # Removes a template-location/css-location mapping.
- # This means that Sass/SCSS files in `template_location`
- # will no longer be compiled to CSS files in `css_location`.
- #
- # This is preferred over manually manipulating the {file:SASS_REFERENCE.md#template_location-option `:template_location` option}
- # since the option can be in multiple formats.
- #
- # Note that this method will change `options[:template_location]`
- # to be in the Array format.
- # This means that even if `options[:template_location]`
- # had previously been a Hash or a String,
- # it will now be an Array.
- #
- # @param template_location [String]
- # The location where Sass/SCSS files were,
- # which is now going to be ignored.
- # @param css_location [String]
- # The location where compiled CSS files went, but will no longer go.
- # @return [Boolean]
- # Non-`nil` if the given mapping already existed and was removed,
- # or `nil` if nothing was changed.
- def remove_template_location(template_location, css_location = options[:css_location])
- normalize_template_location!
- template_location_array.delete([template_location, css_location])
- end
-
- # Returns the template locations configured for Sass
- # as an array of `[template_location, css_location]` pairs.
- # See the {file:SASS_REFERENCE.md#template_location-option `:template_location` option}
- # for details.
- #
- # @return [Array<(String, String)>]
- # An array of `[template_location, css_location]` pairs.
- def template_location_array
- old_template_location = options[:template_location]
- normalize_template_location!
- options[:template_location]
- ensure
- options[:template_location] = old_template_location
- end
-
- private
-
- def normalize_template_location!
- return if options[:template_location].is_a?(Array)
- options[:template_location] =
- case options[:template_location]
- when nil
- options[:css_location] ?
- [[File.join(options[:css_location], 'sass'), options[:css_location]]] : []
- when String; [[options[:template_location], options[:css_location]]]
- else; options[:template_location].to_a
- end
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin/generic.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin/generic.rb
deleted file mode 100644
index 3e82d2d0e4..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin/generic.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# The reason some options are declared here rather than in sass/plugin/configuration.rb
-# is that otherwise they'd clobber the Rails-specific options.
-# Since Rails' options are lazy-loaded in Rails 3,
-# they're reverse-merged with the default options
-# so that user configuration is preserved.
-# This means that defaults that differ from Rails'
-# must be declared here.
-
-unless defined?(Sass::GENERIC_LOADED)
- Sass::GENERIC_LOADED = true
-
- Sass::Plugin.options.merge!(:css_location => './public/stylesheets',
- :always_update => false,
- :always_check => true)
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin/merb.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin/merb.rb
deleted file mode 100644
index f2b0a03f2e..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin/merb.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-unless defined?(Sass::MERB_LOADED)
- Sass::MERB_LOADED = true
-
- module Sass::Plugin::Configuration
- # Different default options in a m envirionment.
- def default_options
- @default_options ||= begin
- version = Merb::VERSION.split('.').map { |n| n.to_i }
- if version[0] <= 0 && version[1] < 5
- root = MERB_ROOT
- env = MERB_ENV
- else
- root = Merb.root.to_s
- env = Merb.environment
- end
-
- {
- :always_update => false,
- :template_location => root + '/public/stylesheets/sass',
- :css_location => root + '/public/stylesheets',
- :cache_location => root + '/tmp/sass-cache',
- :always_check => env != "production",
- :quiet => env != "production",
- :full_exception => env != "production"
- }.freeze
- end
- end
- end
-
- config = Merb::Plugins.config[:sass] || Merb::Plugins.config["sass"] || {}
-
- if defined? config.symbolize_keys!
- config.symbolize_keys!
- end
-
- Sass::Plugin.options.merge!(config)
-
- require 'sass/plugin/rack'
- class Sass::Plugin::MerbBootLoader < Merb::BootLoader
- after Merb::BootLoader::RackUpApplication
-
- def self.run
- # Apparently there's no better way than this to add Sass
- # to Merb's Rack stack.
- Merb::Config[:app] = Sass::Plugin::Rack.new(Merb::Config[:app])
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin/rack.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin/rack.rb
deleted file mode 100644
index 1a93265533..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin/rack.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-module Sass
- module Plugin
- # Rack middleware for compiling Sass code.
- #
- # ## Activate
- #
- # require 'sass/plugin/rack'
- # use Sass::Plugin::Rack
- #
- # ## Customize
- #
- # Sass::Plugin.options.merge(
- # :cache_location => './tmp/sass-cache',
- # :never_update => environment != :production,
- # :full_exception => environment != :production)
- #
- # {file:SASS_REFERENCE.md#options See the Reference for more options}.
- #
- # ## Use
- #
- # Put your Sass files in `public/stylesheets/sass`.
- # Your CSS will be generated in `public/stylesheets`,
- # and regenerated every request if necessary.
- # The locations and frequency {file:SASS_REFERENCE.md#options can be customized}.
- # That's all there is to it!
- class Rack
- # The delay, in seconds, between update checks.
- # Useful when many resources are requested for a single page.
- # `nil` means no delay at all.
- #
- # @return [Float]
- attr_accessor :dwell
-
- # Initialize the middleware.
- #
- # @param app [#call] The Rack application
- # @param dwell [Float] See \{#dwell}
- def initialize(app, dwell = 1.0)
- @app = app
- @dwell = dwell
- @check_after = Time.now.to_f
- end
-
- # Process a request, checking the Sass stylesheets for changes
- # and updating them if necessary.
- #
- # @param env The Rack request environment
- # @return [(#to_i, {String => String}, Object)] The Rack response
- def call(env)
- if @dwell.nil? || Time.now.to_f > @check_after
- Sass::Plugin.check_for_updates
- @check_after = Time.now.to_f + @dwell if @dwell
- end
- @app.call(env)
- end
- end
- end
-end
-
-require 'sass/plugin'
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin/rails.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin/rails.rb
deleted file mode 100644
index 2ced021927..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin/rails.rb
+++ /dev/null
@@ -1,47 +0,0 @@
-unless defined?(Sass::RAILS_LOADED)
- Sass::RAILS_LOADED = true
-
- module Sass::Plugin::Configuration
- # Different default options in a rails envirionment.
- def default_options
- return @default_options if @default_options
- opts = {
- :quiet => Sass::Util.rails_env != "production",
- :full_exception => Sass::Util.rails_env != "production",
- :cache_location => Sass::Util.rails_root + '/tmp/sass-cache'
- }
-
- opts.merge!(
- :always_update => false,
- :template_location => Sass::Util.rails_root + '/public/stylesheets/sass',
- :css_location => Sass::Util.rails_root + '/public/stylesheets',
- :always_check => Sass::Util.rails_env == "development")
-
- @default_options = opts.freeze
- end
- end
-
- Sass::Plugin.options.reverse_merge!(Sass::Plugin.default_options)
-
- # Rails 3.1 loads and handles Sass all on its own
- if defined?(ActionController::Metal)
- # 3.1 > Rails >= 3.0
- require 'sass/plugin/rack'
- Rails.configuration.middleware.use(Sass::Plugin::Rack)
- elsif defined?(ActionController::Dispatcher) &&
- defined?(ActionController::Dispatcher.middleware)
- # Rails >= 2.3
- require 'sass/plugin/rack'
- ActionController::Dispatcher.middleware.use(Sass::Plugin::Rack)
- else
- module ActionController
- class Base
- alias_method :sass_old_process, :process
- def process(*args)
- Sass::Plugin.check_for_updates
- sass_old_process(*args)
- end
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin/staleness_checker.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin/staleness_checker.rb
deleted file mode 100644
index c87d7bf8ad..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/plugin/staleness_checker.rb
+++ /dev/null
@@ -1,173 +0,0 @@
-module Sass
- module Plugin
- # The class handles `.s[ca]ss` file staleness checks via their mtime timestamps.
- #
- # To speed things up two level of caches are employed:
- #
- # * A class-level dependency cache which stores @import paths for each file.
- # This is a long-lived cache that is reused by every StalenessChecker instance.
- # * Three short-lived instance-level caches, one for file mtimes,
- # one for whether a file is stale during this particular run.
- # and one for the parse tree for a file.
- # These are only used by a single StalenessChecker instance.
- #
- # Usage:
- #
- # * For a one-off staleness check of a single `.s[ca]ss` file,
- # the class-level {stylesheet_needs_update?} method
- # should be used.
- # * For a series of staleness checks (e.g. checking all files for staleness)
- # a StalenessChecker instance should be created,
- # and the instance-level \{#stylesheet\_needs\_update?} method should be used.
- # the caches should make the whole process significantly faster.
- # *WARNING*: It is important not to retain the instance for too long,
- # as its instance-level caches are never explicitly expired.
- class StalenessChecker
- @dependencies_cache = {}
-
- class << self
- # TODO: attach this to a compiler instance.
- # @private
- attr_accessor :dependencies_cache
- end
-
- # Creates a new StalenessChecker
- # for checking the staleness of several stylesheets at once.
- #
- # @param options [{Symbol => Object}]
- # See {file:SASS_REFERENCE.md#sass_options the Sass options documentation}.
- def initialize(options)
- @dependencies = self.class.dependencies_cache
-
- # Entries in the following instance-level caches are never explicitly expired.
- # Instead they are supposed to automaticaly go out of scope when a series of staleness checks
- # (this instance of StalenessChecker was created for) is finished.
- @mtimes, @dependencies_stale, @parse_trees = {}, {}, {}
- @options = Sass::Engine.normalize_options(options)
- end
-
- # Returns whether or not a given CSS file is out of date
- # and needs to be regenerated.
- #
- # @param css_file [String] The location of the CSS file to check.
- # @param template_file [String] The location of the Sass or SCSS template
- # that is compiled to `css_file`.
- # @return [Boolean] Whether the stylesheet needs to be updated.
- def stylesheet_needs_update?(css_file, template_file, importer = nil)
- template_file = File.expand_path(template_file)
- begin
- css_mtime = File.mtime(css_file)
- rescue Errno::ENOENT
- return true
- end
- stylesheet_modified_since?(template_file, css_mtime, importer)
- end
-
- # Returns whether a Sass or SCSS stylesheet has been modified since a given time.
- #
- # @param template_file [String] The location of the Sass or SCSS template.
- # @param mtime [Fixnum] The modification time to check against.
- # @param importer [Sass::Importers::Base] The importer used to locate the stylesheet.
- # Defaults to the filesystem importer.
- # @return [Boolean] Whether the stylesheet has been modified.
- def stylesheet_modified_since?(template_file, mtime, importer = nil)
- importer ||= @options[:filesystem_importer].new(".")
- dependency_updated?(mtime).call(template_file, importer)
- end
-
- # Returns whether or not a given CSS file is out of date
- # and needs to be regenerated.
- #
- # The distinction between this method and the instance-level \{#stylesheet\_needs\_update?}
- # is that the instance method preserves mtime and stale-dependency caches,
- # so it's better to use when checking multiple stylesheets at once.
- #
- # @param css_file [String] The location of the CSS file to check.
- # @param template_file [String] The location of the Sass or SCSS template
- # that is compiled to `css_file`.
- # @return [Boolean] Whether the stylesheet needs to be updated.
- def self.stylesheet_needs_update?(css_file, template_file, importer = nil)
- new(Plugin.engine_options).stylesheet_needs_update?(css_file, template_file, importer)
- end
-
- # Returns whether a Sass or SCSS stylesheet has been modified since a given time.
- #
- # The distinction between this method and the instance-level \{#stylesheet\_modified\_since?}
- # is that the instance method preserves mtime and stale-dependency caches,
- # so it's better to use when checking multiple stylesheets at once.
- #
- # @param template_file [String] The location of the Sass or SCSS template.
- # @param mtime [Fixnum] The modification time to check against.
- # @param importer [Sass::Importers::Base] The importer used to locate the stylesheet.
- # Defaults to the filesystem importer.
- # @return [Boolean] Whether the stylesheet has been modified.
- def self.stylesheet_modified_since?(template_file, mtime, importer = nil)
- new(Plugin.engine_options).stylesheet_modified_since?(template_file, mtime, importer)
- end
-
- private
-
- def dependencies_stale?(uri, importer, css_mtime)
- timestamps = @dependencies_stale[[uri, importer]] ||= {}
- timestamps.each_pair do |checked_css_mtime, is_stale|
- if checked_css_mtime <= css_mtime && !is_stale
- return false
- elsif checked_css_mtime > css_mtime && is_stale
- return true
- end
- end
- timestamps[css_mtime] = dependencies(uri, importer).any?(&dependency_updated?(css_mtime))
- rescue Sass::SyntaxError
- # If there's an error finding dependencies, default to recompiling.
- true
- end
-
- def mtime(uri, importer)
- @mtimes[[uri, importer]] ||=
- begin
- mtime = importer.mtime(uri, @options)
- if mtime.nil?
- @dependencies.delete([uri, importer])
- nil
- else
- mtime
- end
- end
- end
-
- def dependencies(uri, importer)
- stored_mtime, dependencies = @dependencies[[uri, importer]]
-
- if !stored_mtime || stored_mtime < mtime(uri, importer)
- dependencies = compute_dependencies(uri, importer)
- @dependencies[[uri, importer]] = [mtime(uri, importer), dependencies]
- end
-
- dependencies
- end
-
- def dependency_updated?(css_mtime)
- Proc.new do |uri, importer|
- sass_mtime = mtime(uri, importer)
- !sass_mtime ||
- sass_mtime > css_mtime ||
- dependencies_stale?(uri, importer, css_mtime)
- end
- end
-
- def compute_dependencies(uri, importer)
- tree(uri, importer).grep(Tree::ImportNode) do |n|
- next if n.css_import?
- file = n.imported_file
- key = [file.options[:filename], file.options[:importer]]
- @parse_trees[key] = file.to_tree
- key
- end.compact
- end
-
- def tree(uri, importer)
- @parse_trees[[uri, importer]] ||= importer.find(uri, @options).to_tree
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/railtie.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/railtie.rb
deleted file mode 100644
index fbad4f37d7..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/railtie.rb
+++ /dev/null
@@ -1,9 +0,0 @@
-# Rails 3.0.0.beta.2+, < 3.1
-if defined?(ActiveSupport) && Sass::Util.has?(:public_method, ActiveSupport, :on_load) &&
- !Sass::Util.ap_geq?('3.1.0.beta')
- require 'sass/plugin/configuration'
- ActiveSupport.on_load(:before_initialize) do
- require 'sass'
- require 'sass/plugin'
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/repl.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/repl.rb
deleted file mode 100644
index 7db447f0b5..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/repl.rb
+++ /dev/null
@@ -1,58 +0,0 @@
-require 'readline'
-
-module Sass
- # Runs a SassScript read-eval-print loop.
- # It presents a prompt on the terminal,
- # reads in SassScript expressions,
- # evaluates them,
- # and prints the result.
- class Repl
- # @param options [{Symbol => Object}] An options hash.
- def initialize(options = {})
- @options = options
- end
-
- # Starts the read-eval-print loop.
- def run
- environment = Environment.new
- environment.set_var('important', Script::String.new('!important'))
- @line = 0
- loop do
- @line += 1
- unless text = Readline.readline('>> ')
- puts
- return
- end
-
- Readline::HISTORY << text
- parse_input(environment, text)
- end
- end
-
- private
-
- def parse_input(environment, text)
- case text
- when Script::MATCH
- name = $1
- guarded = $3 == '||=' || $4
- val = Script::Parser.parse($3, @line, text.size - $3.size)
-
- unless guarded && environment.var(name)
- environment.set_var(name, val.perform(environment))
- end
-
- p environment.var(name)
- else
- p Script::Parser.parse(text, @line, 0).perform(environment)
- end
- rescue Sass::SyntaxError => e
- puts "SyntaxError: #{e.message}"
- if @options[:trace]
- e.backtrace.each do |e|
- puts "\tfrom #{e}"
- end
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/root.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/root.rb
deleted file mode 100644
index 31e19c5065..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/root.rb
+++ /dev/null
@@ -1,7 +0,0 @@
-module Sass
- # The root directory of the Sass source tree.
- # This may be overridden by the package manager
- # if the lib directory is separated from the main source tree.
- # @api public
- ROOT_DIR = File.expand_path(File.join(__FILE__, "../../.."))
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script.rb
deleted file mode 100644
index 78ca2a8c5f..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-require 'strscan'
-require 'sass/script/node'
-require 'sass/script/variable'
-require 'sass/script/funcall'
-require 'sass/script/operation'
-require 'sass/script/literal'
-require 'sass/script/parser'
-
-module Sass
- # SassScript is code that's embedded in Sass documents
- # to allow for property values to be computed from variables.
- #
- # This module contains code that handles the parsing and evaluation of SassScript.
- module Script
- # The regular expression used to parse variables.
- MATCH = /^\$(#{Sass::SCSS::RX::IDENT})\s*:\s*(.+?)(!(?i:default))?$/
-
- # The regular expression used to validate variables without matching.
- VALIDATE = /^\$#{Sass::SCSS::RX::IDENT}$/
-
- # Parses a string of SassScript
- #
- # @param value [String] The SassScript
- # @param line [Fixnum] The number of the line on which the SassScript appeared.
- # Used for error reporting
- # @param offset [Fixnum] The number of characters in on `line` that the SassScript started.
- # Used for error reporting
- # @param options [{Symbol => Object}] An options hash;
- # see {file:SASS_REFERENCE.md#sass_options the Sass options documentation}
- # @return [Script::Node] The root node of the parse tree
- def self.parse(value, line, offset, options = {})
- Parser.parse(value, line, offset, options)
- rescue Sass::SyntaxError => e
- e.message << ": #{value.inspect}." if e.message == "SassScript error"
- e.modify_backtrace(:line => line, :filename => options[:filename])
- raise e
- end
-
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/bool.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/bool.rb
deleted file mode 100644
index 90fa39ac5c..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/bool.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-require 'sass/script/literal'
-
-module Sass::Script
- # A SassScript object representing a boolean (true or false) value.
- class Bool < Literal
- # The Ruby value of the boolean.
- #
- # @return [Boolean]
- attr_reader :value
- alias_method :to_bool, :value
-
- # @return [String] "true" or "false"
- def to_s(opts = {})
- @value.to_s
- end
- alias_method :to_sass, :to_s
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/color.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/color.rb
deleted file mode 100644
index 8c4d2748c7..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/color.rb
+++ /dev/null
@@ -1,480 +0,0 @@
-require 'sass/script/literal'
-
-module Sass::Script
- # A SassScript object representing a CSS color.
- #
- # A color may be represented internally as RGBA, HSLA, or both.
- # It's originally represented as whatever its input is;
- # if it's created with RGB values, it's represented as RGBA,
- # and if it's created with HSL values, it's represented as HSLA.
- # Once a property is accessed that requires the other representation --
- # for example, \{#red} for an HSL color --
- # that component is calculated and cached.
- #
- # The alpha channel of a color is independent of its RGB or HSL representation.
- # It's always stored, as 1 if nothing else is specified.
- # If only the alpha channel is modified using \{#with},
- # the cached RGB and HSL values are retained.
- class Color < Literal
- class << self; include Sass::Util; end
-
- # A hash from color names to `[red, green, blue]` value arrays.
- HTML4_COLORS = map_vals({
- 'black' => 0x000000,
- 'silver' => 0xc0c0c0,
- 'gray' => 0x808080,
- 'white' => 0xffffff,
- 'maroon' => 0x800000,
- 'red' => 0xff0000,
- 'purple' => 0x800080,
- 'fuchsia' => 0xff00ff,
- 'green' => 0x008000,
- 'lime' => 0x00ff00,
- 'olive' => 0x808000,
- 'yellow' => 0xffff00,
- 'navy' => 0x000080,
- 'blue' => 0x0000ff,
- 'teal' => 0x008080,
- 'aqua' => 0x00ffff
- }) {|color| (0..2).map {|n| color >> (n << 3) & 0xff}.reverse}
- # A hash from `[red, green, blue]` value arrays to color names.
- HTML4_COLORS_REVERSE = map_hash(HTML4_COLORS) {|k, v| [v, k]}
-
- # Constructs an RGB or HSL color object,
- # optionally with an alpha channel.
- #
- # The RGB values must be between 0 and 255.
- # The saturation and lightness values must be between 0 and 100.
- # The alpha value must be between 0 and 1.
- #
- # @raise [Sass::SyntaxError] if any color value isn't in the specified range
- #
- # @overload initialize(attrs)
- # The attributes are specified as a hash.
- # This hash must contain either `:hue`, `:saturation`, and `:value` keys,
- # or `:red`, `:green`, and `:blue` keys.
- # It cannot contain both HSL and RGB keys.
- # It may also optionally contain an `:alpha` key.
- #
- # @param attrs [{Symbol => Numeric}] A hash of color attributes to values
- # @raise [ArgumentError] if not enough attributes are specified,
- # or both RGB and HSL attributes are specified
- #
- # @overload initialize(rgba)
- # The attributes are specified as an array.
- # This overload only supports RGB or RGBA colors.
- #
- # @param rgba [Array] A three- or four-element array
- # of the red, green, blue, and optionally alpha values (respectively)
- # of the color
- # @raise [ArgumentError] if not enough attributes are specified
- def initialize(attrs, allow_both_rgb_and_hsl = false)
- super(nil)
-
- if attrs.is_a?(Array)
- unless (3..4).include?(attrs.size)
- raise ArgumentError.new("Color.new(array) expects a three- or four-element array")
- end
-
- red, green, blue = attrs[0...3].map {|c| c.to_i}
- @attrs = {:red => red, :green => green, :blue => blue}
- @attrs[:alpha] = attrs[3] ? attrs[3].to_f : 1
- else
- attrs = attrs.reject {|k, v| v.nil?}
- hsl = [:hue, :saturation, :lightness] & attrs.keys
- rgb = [:red, :green, :blue] & attrs.keys
- if !allow_both_rgb_and_hsl && !hsl.empty? && !rgb.empty?
- raise ArgumentError.new("Color.new(hash) may not have both HSL and RGB keys specified")
- elsif hsl.empty? && rgb.empty?
- raise ArgumentError.new("Color.new(hash) must have either HSL or RGB keys specified")
- elsif !hsl.empty? && hsl.size != 3
- raise ArgumentError.new("Color.new(hash) must have all three HSL values specified")
- elsif !rgb.empty? && rgb.size != 3
- raise ArgumentError.new("Color.new(hash) must have all three RGB values specified")
- end
-
- @attrs = attrs
- @attrs[:hue] %= 360 if @attrs[:hue]
- @attrs[:alpha] ||= 1
- end
-
- [:red, :green, :blue].each do |k|
- next if @attrs[k].nil?
- @attrs[k] = @attrs[k].to_i
- next if (0..255).include?(@attrs[k])
- raise ArgumentError.new("#{k.to_s.capitalize} value must be between 0 and 255")
- end
-
- [:saturation, :lightness].each do |k|
- next if @attrs[k].nil?
- @attrs[k] = 0 if @attrs[k] < 0.00001 && @attrs[k] > -0.00001
- @attrs[k] = 100 if @attrs[k] - 100 < 0.00001 && @attrs[k] - 100 > -0.00001
- next if (0..100).include?(@attrs[k])
- raise ArgumentError.new("#{k.to_s.capitalize} must be between 0 and 100")
- end
-
- unless (0..1).include?(@attrs[:alpha])
- raise ArgumentError.new("Alpha channel must be between 0 and 1")
- end
- end
-
- # The red component of the color.
- #
- # @return [Fixnum]
- def red
- hsl_to_rgb!
- @attrs[:red]
- end
-
- # The green component of the color.
- #
- # @return [Fixnum]
- def green
- hsl_to_rgb!
- @attrs[:green]
- end
-
- # The blue component of the color.
- #
- # @return [Fixnum]
- def blue
- hsl_to_rgb!
- @attrs[:blue]
- end
-
- # The hue component of the color.
- #
- # @return [Numeric]
- def hue
- rgb_to_hsl!
- @attrs[:hue]
- end
-
- # The saturation component of the color.
- #
- # @return [Numeric]
- def saturation
- rgb_to_hsl!
- @attrs[:saturation]
- end
-
- # The lightness component of the color.
- #
- # @return [Numeric]
- def lightness
- rgb_to_hsl!
- @attrs[:lightness]
- end
-
- # The alpha channel (opacity) of the color.
- # This is 1 unless otherwise defined.
- #
- # @return [Fixnum]
- def alpha
- @attrs[:alpha]
- end
-
- # Returns whether this color object is translucent;
- # that is, whether the alpha channel is non-1.
- #
- # @return [Boolean]
- def alpha?
- alpha < 1
- end
-
- # Returns the red, green, and blue components of the color.
- #
- # @return [Array] A frozen three-element array of the red, green, and blue
- # values (respectively) of the color
- def rgb
- [red, green, blue].freeze
- end
-
- # Returns the hue, saturation, and lightness components of the color.
- #
- # @return [Array] A frozen three-element array of the
- # hue, saturation, and lightness values (respectively) of the color
- def hsl
- [hue, saturation, lightness].freeze
- end
-
- # The SassScript `==` operation.
- # **Note that this returns a {Sass::Script::Bool} object,
- # not a Ruby boolean**.
- #
- # @param other [Literal] The right-hand side of the operator
- # @return [Bool] True if this literal is the same as the other,
- # false otherwise
- def eq(other)
- Sass::Script::Bool.new(
- other.is_a?(Color) && rgb == other.rgb && alpha == other.alpha)
- end
-
- # Returns a copy of this color with one or more channels changed.
- # RGB or HSL colors may be changed, but not both at once.
- #
- # For example:
- #
- # Color.new([10, 20, 30]).with(:blue => 40)
- # #=> rgb(10, 40, 30)
- # Color.new([126, 126, 126]).with(:red => 0, :green => 255)
- # #=> rgb(0, 255, 126)
- # Color.new([255, 0, 127]).with(:saturation => 60)
- # #=> rgb(204, 51, 127)
- # Color.new([1, 2, 3]).with(:alpha => 0.4)
- # #=> rgba(1, 2, 3, 0.4)
- #
- # @param attrs [{Symbol => Numeric}]
- # A map of channel names (`:red`, `:green`, `:blue`,
- # `:hue`, `:saturation`, `:lightness`, or `:alpha`) to values
- # @return [Color] The new Color object
- # @raise [ArgumentError] if both RGB and HSL keys are specified
- def with(attrs)
- attrs = attrs.reject {|k, v| v.nil?}
- hsl = !([:hue, :saturation, :lightness] & attrs.keys).empty?
- rgb = !([:red, :green, :blue] & attrs.keys).empty?
- if hsl && rgb
- raise ArgumentError.new("Cannot specify HSL and RGB values for a color at the same time")
- end
-
- if hsl
- [:hue, :saturation, :lightness].each {|k| attrs[k] ||= send(k)}
- elsif rgb
- [:red, :green, :blue].each {|k| attrs[k] ||= send(k)}
- else
- # If we're just changing the alpha channel,
- # keep all the HSL/RGB stuff we've calculated
- attrs = @attrs.merge(attrs)
- end
- attrs[:alpha] ||= alpha
-
- Color.new(attrs, :allow_both_rgb_and_hsl)
- end
-
- # The SassScript `+` operation.
- # Its functionality depends on the type of its argument:
- #
- # {Number}
- # : Adds the number to each of the RGB color channels.
- #
- # {Color}
- # : Adds each of the RGB color channels together.
- #
- # {Literal}
- # : See {Literal#plus}.
- #
- # @param other [Literal] The right-hand side of the operator
- # @return [Color] The resulting color
- # @raise [Sass::SyntaxError] if `other` is a number with units
- def plus(other)
- if other.is_a?(Sass::Script::Number) || other.is_a?(Sass::Script::Color)
- piecewise(other, :+)
- else
- super
- end
- end
-
- # The SassScript `-` operation.
- # Its functionality depends on the type of its argument:
- #
- # {Number}
- # : Subtracts the number from each of the RGB color channels.
- #
- # {Color}
- # : Subtracts each of the other color's RGB color channels from this color's.
- #
- # {Literal}
- # : See {Literal#minus}.
- #
- # @param other [Literal] The right-hand side of the operator
- # @return [Color] The resulting color
- # @raise [Sass::SyntaxError] if `other` is a number with units
- def minus(other)
- if other.is_a?(Sass::Script::Number) || other.is_a?(Sass::Script::Color)
- piecewise(other, :-)
- else
- super
- end
- end
-
- # The SassScript `*` operation.
- # Its functionality depends on the type of its argument:
- #
- # {Number}
- # : Multiplies the number by each of the RGB color channels.
- #
- # {Color}
- # : Multiplies each of the RGB color channels together.
- #
- # @param other [Number, Color] The right-hand side of the operator
- # @return [Color] The resulting color
- # @raise [Sass::SyntaxError] if `other` is a number with units
- def times(other)
- if other.is_a?(Sass::Script::Number) || other.is_a?(Sass::Script::Color)
- piecewise(other, :*)
- else
- raise NoMethodError.new(nil, :times)
- end
- end
-
- # The SassScript `/` operation.
- # Its functionality depends on the type of its argument:
- #
- # {Number}
- # : Divides each of the RGB color channels by the number.
- #
- # {Color}
- # : Divides each of this color's RGB color channels by the other color's.
- #
- # {Literal}
- # : See {Literal#div}.
- #
- # @param other [Literal] The right-hand side of the operator
- # @return [Color] The resulting color
- # @raise [Sass::SyntaxError] if `other` is a number with units
- def div(other)
- if other.is_a?(Sass::Script::Number) || other.is_a?(Sass::Script::Color)
- piecewise(other, :/)
- else
- super
- end
- end
-
- # The SassScript `%` operation.
- # Its functionality depends on the type of its argument:
- #
- # {Number}
- # : Takes each of the RGB color channels module the number.
- #
- # {Color}
- # : Takes each of this color's RGB color channels modulo the other color's.
- #
- # @param other [Number, Color] The right-hand side of the operator
- # @return [Color] The resulting color
- # @raise [Sass::SyntaxError] if `other` is a number with units
- def mod(other)
- if other.is_a?(Sass::Script::Number) || other.is_a?(Sass::Script::Color)
- piecewise(other, :%)
- else
- raise NoMethodError.new(nil, :mod)
- end
- end
-
- # Returns a string representation of the color.
- # This is usually the color's hex value,
- # but if the color has a name that's used instead.
- #
- # @return [String] The string representation
- def to_s(opts = {})
- return rgba_str if alpha?
- return smallest if options[:style] == :compressed
- return HTML4_COLORS_REVERSE[rgb] if HTML4_COLORS_REVERSE[rgb]
- hex_str
- end
- alias_method :to_sass, :to_s
-
- # Returns a string representation of the color.
- #
- # @return [String] The hex value
- def inspect
- alpha? ? rgba_str : hex_str
- end
-
- private
-
- def smallest
- small_hex_str = hex_str.gsub(/^#(.)\1(.)\2(.)\3$/, '#\1\2\3')
- return small_hex_str unless (color = HTML4_COLORS_REVERSE[rgb]) &&
- color.size <= small_hex_str.size
- return color
- end
-
- def rgba_str
- split = options[:style] == :compressed ? ',' : ', '
- "rgba(#{rgb.join(split)}#{split}#{Number.round(alpha)})"
- end
-
- def hex_str
- red, green, blue = rgb.map { |num| num.to_s(16).rjust(2, '0') }
- "##{red}#{green}#{blue}"
- end
-
- def piecewise(other, operation)
- other_num = other.is_a? Number
- if other_num && !other.unitless?
- raise Sass::SyntaxError.new("Cannot add a number with units (#{other}) to a color (#{self}).")
- end
-
- result = []
- for i in (0...3)
- res = rgb[i].send(operation, other_num ? other.value : other.rgb[i])
- result[i] = [ [res, 255].min, 0 ].max
- end
-
- if !other_num && other.alpha != alpha
- raise Sass::SyntaxError.new("Alpha channels must be equal: #{self} #{operation} #{other}")
- end
-
- with(:red => result[0], :green => result[1], :blue => result[2])
- end
-
- def hsl_to_rgb!
- return if @attrs[:red] && @attrs[:blue] && @attrs[:green]
-
- h = @attrs[:hue] / 360.0
- s = @attrs[:saturation] / 100.0
- l = @attrs[:lightness] / 100.0
-
- # Algorithm from the CSS3 spec: http://www.w3.org/TR/css3-color/#hsl-color.
- m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s
- m1 = l * 2 - m2
- @attrs[:red], @attrs[:green], @attrs[:blue] = [
- hue_to_rgb(m1, m2, h + 1.0/3),
- hue_to_rgb(m1, m2, h),
- hue_to_rgb(m1, m2, h - 1.0/3)
- ].map {|c| (c * 0xff).round}
- end
-
- def hue_to_rgb(m1, m2, h)
- h += 1 if h < 0
- h -= 1 if h > 1
- return m1 + (m2 - m1) * h * 6 if h * 6 < 1
- return m2 if h * 2 < 1
- return m1 + (m2 - m1) * (2.0/3 - h) * 6 if h * 3 < 2
- return m1
- end
-
- def rgb_to_hsl!
- return if @attrs[:hue] && @attrs[:saturation] && @attrs[:lightness]
- r, g, b = [:red, :green, :blue].map {|k| @attrs[k] / 255.0}
-
- # Algorithm from http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV
- max = [r, g, b].max
- min = [r, g, b].min
- d = max - min
-
- h =
- case max
- when min; 0
- when r; 60 * (g-b)/d
- when g; 60 * (b-r)/d + 120
- when b; 60 * (r-g)/d + 240
- end
-
- l = (max + min)/2.0
-
- s =
- if max == min
- 0
- elsif l < 0.5
- d/(2*l)
- else
- d/(2 - 2*l)
- end
-
- @attrs[:hue] = h % 360
- @attrs[:saturation] = s * 100
- @attrs[:lightness] = l * 100
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/css_lexer.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/css_lexer.rb
deleted file mode 100644
index 464fcf4c90..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/css_lexer.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-module Sass
- module Script
- # This is a subclass of {Lexer} for use in parsing plain CSS properties.
- #
- # @see Sass::SCSS::CssParser
- class CssLexer < Lexer
- private
-
- def token
- important || super
- end
-
- def string(re, *args)
- if re == :uri
- return unless uri = scan(URI)
- return [:string, Script::String.new(uri)]
- end
-
- return unless scan(STRING)
- [:string, Script::String.new((@scanner[1] || @scanner[2]).gsub(/\\(['"])/, '\1'), :string)]
- end
-
- def important
- return unless s = scan(IMPORTANT)
- [:raw, s]
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/css_parser.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/css_parser.rb
deleted file mode 100644
index 968b94bd41..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/css_parser.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-require 'sass/script'
-require 'sass/script/css_lexer'
-
-module Sass
- module Script
- # This is a subclass of {Parser} for use in parsing plain CSS properties.
- #
- # @see Sass::SCSS::CssParser
- class CssParser < Parser
- private
-
- # @private
- def lexer_class; CssLexer; end
-
- # We need a production that only does /,
- # since * and % aren't allowed in plain CSS
- production :div, :unary_plus, :div
-
- def string
- return number unless tok = try_tok(:string)
- return tok.value unless @lexer.peek && @lexer.peek.type == :begin_interpolation
- end
-
- # Short-circuit all the SassScript-only productions
- alias_method :interpolation, :space
- alias_method :or_expr, :div
- alias_method :unary_div, :ident
- alias_method :paren, :string
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/funcall.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/funcall.rb
deleted file mode 100644
index 7b9266d7c9..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/funcall.rb
+++ /dev/null
@@ -1,162 +0,0 @@
-require 'sass/script/functions'
-
-module Sass
- module Script
- # A SassScript parse node representing a function call.
- #
- # A function call either calls one of the functions in {Script::Functions},
- # or if no function with the given name exists
- # it returns a string representation of the function call.
- class Funcall < Node
- # The name of the function.
- #
- # @return [String]
- attr_reader :name
-
- # The arguments to the function.
- #
- # @return [Array]
- attr_reader :args
-
- # The keyword arguments to the function.
- #
- # @return [{String => Script::Node}]
- attr_reader :keywords
-
- # @param name [String] See \{#name}
- # @param args [Array] See \{#args}
- # @param keywords [{String => Script::Node}] See \{#keywords}
- def initialize(name, args, keywords)
- @name = name
- @args = args
- @keywords = keywords
- super()
- end
-
- # @return [String] A string representation of the function call
- def inspect
- args = @args.map {|a| a.inspect}.join(', ')
- keywords = @keywords.sort_by {|k, v| k}.
- map {|k, v| "$#{k}: #{v.inspect}"}.join(', ')
- "#{name}(#{args}#{', ' unless args.empty? || keywords.empty?}#{keywords})"
- end
-
- # @see Node#to_sass
- def to_sass(opts = {})
- args = @args.map {|a| a.to_sass(opts)}.join(', ')
- keywords = @keywords.sort_by {|k, v| k}.
- map {|k, v| "$#{dasherize(k, opts)}: #{v.to_sass(opts)}"}.join(', ')
- "#{dasherize(name, opts)}(#{args}#{', ' unless args.empty? || keywords.empty?}#{keywords})"
- end
-
- # Returns the arguments to the function.
- #
- # @return [Array]
- # @see Node#children
- def children
- @args + @keywords.values
- end
-
- protected
-
- # Evaluates the function call.
- #
- # @param environment [Sass::Environment] The environment in which to evaluate the SassScript
- # @return [Literal] The SassScript object that is the value of the function call
- # @raise [Sass::SyntaxError] if the function call raises an ArgumentError
- def _perform(environment)
- args = @args.map {|a| a.perform(environment)}
- if fn = environment.function(@name)
- keywords = Sass::Util.map_hash(@keywords) {|k, v| [k, v.perform(environment)]}
- return perform_sass_fn(fn, args, keywords)
- end
-
- ruby_name = @name.tr('-', '_')
- args = construct_ruby_args(ruby_name, args, environment)
-
- unless Functions.callable?(ruby_name)
- opts(to_literal(args))
- else
- opts(Functions::EvaluationContext.new(environment.options).send(ruby_name, *args))
- end
- rescue ArgumentError => e
- raise e unless e.backtrace.any? {|t| t =~ /:in `(block in )?(#{name}|perform)'$/}
- raise Sass::SyntaxError.new("#{e.message} for `#{name}'")
- end
-
- # This method is factored out from `_perform` so that compass can override
- # it with a cross-browser implementation for functions that require vendor prefixes
- # in the generated css.
- def to_literal(args)
- Script::String.new("#{name}(#{args.join(', ')})")
- end
-
- private
-
- def construct_ruby_args(name, args, environment)
- unless signature = Functions.signature(name.to_sym, args.size, @keywords.size)
- return args if keywords.empty?
- raise Sass::SyntaxError.new("Function #{name} doesn't support keyword arguments")
- end
- keywords = Sass::Util.map_hash(@keywords) {|k, v| [k, v.perform(environment)]}
-
- # If the user passes more non-keyword args than the function expects,
- # but it does expect keyword args, Ruby's arg handling won't raise an error.
- # Since we don't want to make functions think about this,
- # we'll handle it for them here.
- if signature.var_kwargs && !signature.var_args && args.size > signature.args.size
- raise Sass::SyntaxError.new(
- "#{args[signature.args.size].inspect} is not a keyword argument for `#{name}'")
- elsif keywords.empty?
- return args
- end
-
- args = args + signature.args[args.size..-1].map do |argname|
- if keywords.has_key?(argname)
- keywords.delete(argname)
- else
- raise Sass::SyntaxError.new("Function #{name} requires an argument named $#{argname}")
- end
- end
-
- if keywords.size > 0
- if signature.var_kwargs
- args << keywords
- else
- raise Sass::SyntaxError.new("Function #{name} doesn't take an argument named $#{keywords.keys.sort.first}")
- end
- end
-
- args
- end
-
- def perform_sass_fn(function, args, keywords)
- # TODO: merge with mixin arg evaluation?
- keywords.each do |name, value|
- # TODO: Make this fast
- unless function.args.find {|(var, default)| var.underscored_name == name}
- raise Sass::SyntaxError.new("Function #{@name} doesn't have an argument named $#{name}")
- end
- end
-
- if args.size > function.args.size
- raise ArgumentError.new("Wrong number of arguments (#{args.size} for #{function.args.size})")
- end
-
- environment = function.args.zip(args).
- inject(Sass::Environment.new(function.environment)) do |env, ((var, default), value)|
- env.set_local_var(var.name,
- value || keywords[var.underscored_name] || (default && default.perform(env)))
- raise Sass::SyntaxError.new("Function #{@name} is missing parameter #{var.inspect}.") unless env.var(var.name)
- env
- end
-
- val = catch :_sass_return do
- function.tree.each {|c| Sass::Tree::Visitors::Perform.visit(c, environment)}
- raise Sass::SyntaxError.new("Function #{@name} finished without @return")
- end
- val
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/functions.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/functions.rb
deleted file mode 100644
index 2f1eaed598..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/functions.rb
+++ /dev/null
@@ -1,1343 +0,0 @@
-module Sass::Script
- # Methods in this module are accessible from the SassScript context.
- # For example, you can write
- #
- # $color = hsl(120deg, 100%, 50%)
- #
- # and it will call {Sass::Script::Functions#hsl}.
- #
- # The following functions are provided:
- #
- # *Note: These functions are described in more detail below.*
- #
- # ## RGB Functions
- #
- # \{#rgb rgb($red, $green, $blue)}
- # : Converts an `rgb(red, green, blue)` triplet into a color.
- #
- # \{#rgba rgba($red, $green, $blue, $alpha)}
- # : Converts an `rgba(red, green, blue, alpha)` quadruplet into a color.
- #
- # \{#rgba rgba($color, $alpha)}
- # : Adds an alpha layer to any color value.
- #
- # \{#red red($color)}
- # : Gets the red component of a color.
- #
- # \{#green green($color)}
- # : Gets the green component of a color.
- #
- # \{#blue blue($color)}
- # : Gets the blue component of a color.
- #
- # \{#mix mix($color-1, $color-2, \[$weight\])}
- # : Mixes two colors together.
- #
- # ## HSL Functions
- #
- # \{#hsl hsl($hue, $saturation, $lightness)}
- # : Converts an `hsl(hue, saturation, lightness)` triplet into a color.
- #
- # \{#hsla hsla($hue, $saturation, $lightness, $alpha)}
- # : Converts an `hsla(hue, saturation, lightness, alpha)` quadruplet into a color.
- #
- # \{#hue hue($color)}
- # : Gets the hue component of a color.
- #
- # \{#saturation saturation($color)}
- # : Gets the saturation component of a color.
- #
- # \{#lightness lightness($color)}
- # : Gets the lightness component of a color.
- #
- # \{#adjust_hue adjust-hue($color, $degrees)}
- # : Changes the hue of a color.
- #
- # \{#lighten lighten($color, $amount)}
- # : Makes a color lighter.
- #
- # \{#darken darken($color, $amount)}
- # : Makes a color darker.
- #
- # \{#saturate saturate($color, $amount)}
- # : Makes a color more saturated.
- #
- # \{#desaturate desaturate($color, $amount)}
- # : Makes a color less saturated.
- #
- # \{#grayscale grayscale($color)}
- # : Converts a color to grayscale.
- #
- # \{#complement complement($color)}
- # : Returns the complement of a color.
- #
- # \{#invert invert($color)}
- # : Returns the inverse of a color.
- #
- # ## Opacity Functions
- #
- # \{#alpha alpha($color)} / \{#opacity opacity($color)}
- # : Gets the alpha component (opacity) of a color.
- #
- # \{#rgba rgba($color, $alpha)}
- # : Add or change an alpha layer for any color value.
- #
- # \{#opacify opacify($color, $amount)} / \{#fade_in fade-in($color, $amount)}
- # : Makes a color more opaque.
- #
- # \{#transparentize transparentize($color, $amount)} / \{#fade_out fade-out($color, $amount)}
- # : Makes a color more transparent.
- #
- # ## Other Color Functions
- #
- # \{#adjust_color adjust-color($color, \[$red\], \[$green\], \[$blue\], \[$hue\], \[$saturation\], \[$lightness\], \[$alpha\]}
- # : Increase or decrease any of the components of a color.
- #
- # \{#scale_color scale-color($color, \[$red\], \[$green\], \[$blue\], \[$hue\], \[$saturation\], \[$lightness\], \[$alpha\]}
- # : Fluidly scale one or more components of a color.
- #
- # \{#change_color change-color($color, \[$red\], \[$green\], \[$blue\], \[$hue\], \[$saturation\], \[$lightness\], \[$alpha\]}
- # : Changes one or more properties of a color.
- #
- # ## String Functions
- #
- # \{#unquote unquote($string)}
- # : Removes the quotes from a string.
- #
- # \{#quote quote($string)}
- # : Adds quotes to a string.
- #
- # ## Number Functions
- #
- # \{#percentage percentage($value)}
- # : Converts a unitless number to a percentage.
- #
- # \{#round round($value)}
- # : Rounds a number to the nearest whole number.
- #
- # \{#ceil ceil($value)}
- # : Rounds a number up to the nearest whole number.
- #
- # \{#floor floor($value)}
- # : Rounds a number down to the nearest whole number.
- #
- # \{#abs abs($value)}
- # : Returns the absolute value of a number.
- #
- # ## List Functions {#list-functions}
- #
- # \{#length length($list)}
- # : Returns the length of a list.
- #
- # \{#nth nth($list, $n)}
- # : Returns a specific item in a list.
- #
- # \{#join join($list1, $list2, \[$separator\])}
- # : Joins together two lists into one.
- #
- # ## Introspection Functions
- #
- # \{#type_of type-of($value)}
- # : Returns the type of a value.
- #
- # \{#unit unit($number)}
- # : Returns the units associated with a number.
- #
- # \{#unitless unitless($number)}
- # : Returns whether a number has units or not.
- #
- # \{#comparable comparable($number-1, $number-2)}
- # : Returns whether two numbers can be added or compared.
- #
- # ## Miscellaneous Functions
- #
- # \{#if if($condition, $if-true, $if-false)}
- # : Returns one of two values, depending on whether or not a condition is true.
- #
- # ## Adding Custom Functions
- #
- # New Sass functions can be added by adding Ruby methods to this module.
- # For example:
- #
- # module Sass::Script::Functions
- # def reverse(string)
- # assert_type string, :String
- # Sass::Script::String.new(string.value.reverse)
- # end
- # declare :reverse, :args => [:string]
- # end
- #
- # Calling {declare} tells Sass the argument names for your function.
- # If omitted, the function will still work, but will not be able to accept keyword arguments.
- # {declare} can also allow your function to take arbitrary keyword arguments.
- #
- # There are a few things to keep in mind when modifying this module.
- # First of all, the arguments passed are {Sass::Script::Literal} objects.
- # Literal objects are also expected to be returned.
- # This means that Ruby values must be unwrapped and wrapped.
- #
- # Most Literal objects support the {Sass::Script::Literal#value value} accessor
- # for getting their Ruby values.
- # Color objects, though, must be accessed using {Sass::Script::Color#rgb rgb},
- # {Sass::Script::Color#red red}, {Sass::Script::Color#blue green}, or {Sass::Script::Color#blue blue}.
- #
- # Second, making Ruby functions accessible from Sass introduces the temptation
- # to do things like database access within stylesheets.
- # This is generally a bad idea;
- # since Sass files are by default only compiled once,
- # dynamic code is not a great fit.
- #
- # If you really, really need to compile Sass on each request,
- # first make sure you have adequate caching set up.
- # Then you can use {Sass::Engine} to render the code,
- # using the {file:SASS_REFERENCE.md#custom-option `options` parameter}
- # to pass in data that {EvaluationContext#options can be accessed}
- # from your Sass functions.
- #
- # Within one of the functions in this module,
- # methods of {EvaluationContext} can be used.
- #
- # ### Caveats
- #
- # When creating new {Literal} objects within functions,
- # be aware that it's not safe to call {Literal#to_s #to_s}
- # (or other methods that use the string representation)
- # on those objects without first setting {Node#options= the #options attribute}.
- module Functions
- @signatures = {}
-
- # A class representing a Sass function signature.
- #
- # @attr args [Array] The names of the arguments to the function.
- # @attr var_args [Boolean] Whether the function takes a variable number of arguments.
- # @attr var_kwargs [Boolean] Whether the function takes an arbitrary set of keyword arguments.
- Signature = Struct.new(:args, :var_args, :var_kwargs)
-
- # Declare a Sass signature for a Ruby-defined function.
- # This includes the names of the arguments,
- # whether the function takes a variable number of arguments,
- # and whether the function takes an arbitrary set of keyword arguments.
- #
- # It's not necessary to declare a signature for a function.
- # However, without a signature it won't support keyword arguments.
- #
- # A single function can have multiple signatures declared
- # as long as each one takes a different number of arguments.
- # It's also possible to declare multiple signatures
- # that all take the same number of arguments,
- # but none of them but the first will be used
- # unless the user uses keyword arguments.
- #
- # @param method_name [Symbol] The name of the method
- # whose signature is being declared.
- # @param args [Array] The names of the arguments for the function signature.
- # @option options :var_args [Boolean] (false)
- # Whether the function accepts a variable number of (unnamed) arguments
- # in addition to the named arguments.
- # @option options :var_kwargs [Boolean] (false)
- # Whether the function accepts other keyword arguments
- # in addition to those in `:args`.
- # If this is true, the Ruby function will be passed a hash from strings
- # to {Sass::Script::Literal}s as the last argument.
- # In addition, if this is true and `:var_args` is not,
- # Sass will ensure that the last argument passed is a hash.
- #
- # @example
- # declare :rgba, [:hex, :alpha]
- # declare :rgba, [:red, :green, :blue, :alpha]
- # declare :accepts_anything, [], :var_args => true, :var_kwargs => true
- # declare :some_func, [:foo, :bar, :baz], :var_kwargs => true
- def self.declare(method_name, args, options = {})
- @signatures[method_name] ||= []
- @signatures[method_name] << Signature.new(
- args.map {|s| s.to_s},
- options[:var_args],
- options[:var_kwargs])
- end
-
- # Determine the correct signature for the number of arguments
- # passed in for a given function.
- # If no signatures match, the first signature is returned for error messaging.
- #
- # @param method_name [Symbol] The name of the Ruby function to be called.
- # @param arg_arity [Number] The number of unnamed arguments the function was passed.
- # @param kwarg_arity [Number] The number of keyword arguments the function was passed.
- #
- # @return [{Symbol => Object}, nil]
- # The signature options for the matching signature,
- # or nil if no signatures are declared for this function. See {declare}.
- def self.signature(method_name, arg_arity, kwarg_arity)
- return unless @signatures[method_name]
- @signatures[method_name].each do |signature|
- return signature if signature.args.size == arg_arity + kwarg_arity
- next unless signature.args.size < arg_arity + kwarg_arity
-
- # We have enough args.
- # Now we need to figure out which args are varargs
- # and if the signature allows them.
- t_arg_arity, t_kwarg_arity = arg_arity, kwarg_arity
- if signature.args.size > t_arg_arity
- # we transfer some kwargs arity to args arity
- # if it does not have enough args -- assuming the names will work out.
- t_kwarg_arity -= (signature.args.size - t_arg_arity)
- t_arg_arity = signature.args.size
- end
-
- if ( t_arg_arity == signature.args.size || t_arg_arity > signature.args.size && signature.var_args ) &&
- (t_kwarg_arity == 0 || t_kwarg_arity > 0 && signature.var_kwargs)
- return signature
- end
- end
- @signatures[method_name].first
- end
-
- # The context in which methods in {Script::Functions} are evaluated.
- # That means that all instance methods of {EvaluationContext}
- # are available to use in functions.
- class EvaluationContext
- include Functions
-
- # The options hash for the {Sass::Engine} that is processing the function call
- #
- # @return [{Symbol => Object}]
- attr_reader :options
-
- # @param options [{Symbol => Object}] See \{#options}
- def initialize(options)
- @options = options
- end
-
- # Asserts that the type of a given SassScript value
- # is the expected type (designated by a symbol).
- #
- # Valid types are `:Bool`, `:Color`, `:Number`, and `:String`.
- # Note that `:String` will match both double-quoted strings
- # and unquoted identifiers.
- #
- # @example
- # assert_type value, :String
- # assert_type value, :Number
- # @param value [Sass::Script::Literal] A SassScript value
- # @param type [Symbol] The name of the type the value is expected to be
- # @param name [String, nil] The name of the argument.
- def assert_type(value, type, name = nil)
- return if value.is_a?(Sass::Script.const_get(type))
- err = "#{value.inspect} is not a #{type.to_s.downcase}"
- err = "$#{name}: " + err if name
- raise ArgumentError.new(err)
- end
- end
-
- class << self
- # Returns whether user function with a given name exists.
- #
- # @param function_name [String]
- # @return [Boolean]
- alias_method :callable?, :public_method_defined?
-
- private
- def include(*args)
- r = super
- # We have to re-include ourselves into EvaluationContext to work around
- # an icky Ruby restriction.
- EvaluationContext.send :include, self
- r
- end
- end
-
- # Creates a {Color} object from red, green, and blue values.
- #
- # @param red [Number]
- # A number between 0 and 255 inclusive,
- # or between 0% and 100% inclusive
- # @param green [Number]
- # A number between 0 and 255 inclusive,
- # or between 0% and 100% inclusive
- # @param blue [Number]
- # A number between 0 and 255 inclusive,
- # or between 0% and 100% inclusive
- # @see #rgba
- # @return [Color]
- def rgb(red, green, blue)
- assert_type red, :Number
- assert_type green, :Number
- assert_type blue, :Number
-
- Color.new([red, green, blue].map do |c|
- v = c.value
- if c.numerator_units == ["%"] && c.denominator_units.empty?
- next v * 255 / 100.0 if (0..100).include?(v)
- raise ArgumentError.new("Color value #{c} must be between 0% and 100% inclusive")
- else
- next v if (0..255).include?(v)
- raise ArgumentError.new("Color value #{v} must be between 0 and 255 inclusive")
- end
- end)
- end
- declare :rgb, [:red, :green, :blue]
-
- # @see #rgb
- # @overload rgba(red, green, blue, alpha)
- # Creates a {Color} object from red, green, and blue values,
- # as well as an alpha channel indicating opacity.
- #
- # @param red [Number]
- # A number between 0 and 255 inclusive
- # @param green [Number]
- # A number between 0 and 255 inclusive
- # @param blue [Number]
- # A number between 0 and 255 inclusive
- # @param alpha [Number]
- # A number between 0 and 1
- # @return [Color]
- #
- # @overload rgba(color, alpha)
- # Sets the opacity of a color.
- #
- # @example
- # rgba(#102030, 0.5) => rgba(16, 32, 48, 0.5)
- # rgba(blue, 0.2) => rgba(0, 0, 255, 0.2)
- #
- # @param color [Color]
- # @param alpha [Number]
- # A number between 0 and 1
- # @return [Color]
- def rgba(*args)
- case args.size
- when 2
- color, alpha = args
-
- assert_type color, :Color
- assert_type alpha, :Number
-
- unless (0..1).include?(alpha.value)
- raise ArgumentError.new("Alpha channel #{alpha.value} must be between 0 and 1 inclusive")
- end
-
- color.with(:alpha => alpha.value)
- when 4
- red, green, blue, alpha = args
- rgba(rgb(red, green, blue), alpha)
- else
- raise ArgumentError.new("wrong number of arguments (#{args.size} for 4)")
- end
- end
- declare :rgba, [:red, :green, :blue, :alpha]
- declare :rgba, [:color, :alpha]
-
- # Creates a {Color} object from hue, saturation, and lightness.
- # Uses the algorithm from the [CSS3 spec](http://www.w3.org/TR/css3-color/#hsl-color).
- #
- # @param hue [Number] The hue of the color.
- # Should be between 0 and 360 degrees, inclusive
- # @param saturation [Number] The saturation of the color.
- # Must be between `0%` and `100%`, inclusive
- # @param lightness [Number] The lightness of the color.
- # Must be between `0%` and `100%`, inclusive
- # @return [Color] The resulting color
- # @see #hsla
- # @raise [ArgumentError] if `saturation` or `lightness` are out of bounds
- def hsl(hue, saturation, lightness)
- hsla(hue, saturation, lightness, Number.new(1))
- end
- declare :hsl, [:hue, :saturation, :lightness]
-
- # Creates a {Color} object from hue, saturation, and lightness,
- # as well as an alpha channel indicating opacity.
- # Uses the algorithm from the [CSS3 spec](http://www.w3.org/TR/css3-color/#hsl-color).
- #
- # @param hue [Number] The hue of the color.
- # Should be between 0 and 360 degrees, inclusive
- # @param saturation [Number] The saturation of the color.
- # Must be between `0%` and `100%`, inclusive
- # @param lightness [Number] The lightness of the color.
- # Must be between `0%` and `100%`, inclusive
- # @param alpha [Number] The opacity of the color.
- # Must be between 0 and 1, inclusive
- # @return [Color] The resulting color
- # @see #hsl
- # @raise [ArgumentError] if `saturation`, `lightness`, or `alpha` are out of bounds
- def hsla(hue, saturation, lightness, alpha)
- assert_type hue, :Number
- assert_type saturation, :Number
- assert_type lightness, :Number
- assert_type alpha, :Number
-
- unless (0..1).include?(alpha.value)
- raise ArgumentError.new("Alpha channel #{alpha.value} must be between 0 and 1")
- end
-
- original_s = saturation
- original_l = lightness
- # This algorithm is from http://www.w3.org/TR/css3-color#hsl-color
- h, s, l = [hue, saturation, lightness].map { |a| a.value }
- raise ArgumentError.new("Saturation #{s} must be between 0% and 100%") unless (0..100).include?(s)
- raise ArgumentError.new("Lightness #{l} must be between 0% and 100%") unless (0..100).include?(l)
-
- Color.new(:hue => h, :saturation => s, :lightness => l, :alpha => alpha.value)
- end
- declare :hsla, [:hue, :saturation, :lightness, :alpha]
-
- # Returns the red component of a color.
- #
- # @param color [Color]
- # @return [Number]
- # @raise [ArgumentError] If `color` isn't a color
- def red(color)
- assert_type color, :Color
- Sass::Script::Number.new(color.red)
- end
- declare :red, [:color]
-
- # Returns the green component of a color.
- #
- # @param color [Color]
- # @return [Number]
- # @raise [ArgumentError] If `color` isn't a color
- def green(color)
- assert_type color, :Color
- Sass::Script::Number.new(color.green)
- end
- declare :green, [:color]
-
- # Returns the blue component of a color.
- #
- # @param color [Color]
- # @return [Number]
- # @raise [ArgumentError] If `color` isn't a color
- def blue(color)
- assert_type color, :Color
- Sass::Script::Number.new(color.blue)
- end
- declare :blue, [:color]
-
- # Returns the hue component of a color.
- #
- # See [the CSS3 HSL specification](http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV).
- #
- # Calculated from RGB where necessary via [this algorithm](http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV).
- #
- # @param color [Color]
- # @return [Number] between 0deg and 360deg
- # @see #adjust_hue
- # @raise [ArgumentError] if `color` isn't a color
- def hue(color)
- assert_type color, :Color
- Sass::Script::Number.new(color.hue, ["deg"])
- end
- declare :hue, [:color]
-
- # Returns the saturation component of a color.
- #
- # See [the CSS3 HSL specification](http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV).
- #
- # Calculated from RGB where necessary via [this algorithm](http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV).
- #
- # @param color [Color]
- # @return [Number] between 0% and 100%
- # @see #saturate
- # @see #desaturate
- # @raise [ArgumentError] if `color` isn't a color
- def saturation(color)
- assert_type color, :Color
- Sass::Script::Number.new(color.saturation, ["%"])
- end
- declare :saturation, [:color]
-
- # Returns the hue component of a color.
- #
- # See [the CSS3 HSL specification](http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV).
- #
- # Calculated from RGB where necessary via [this algorithm](http://en.wikipedia.org/wiki/HSL_and_HSV#Conversion_from_RGB_to_HSL_or_HSV).
- #
- # @param color [Color]
- # @return [Number] between 0% and 100%
- # @see #lighten
- # @see #darken
- # @raise [ArgumentError] if `color` isn't a color
- def lightness(color)
- assert_type color, :Color
- Sass::Script::Number.new(color.lightness, ["%"])
- end
- declare :lightness, [:color]
-
- # Returns the alpha component (opacity) of a color.
- # This is 1 unless otherwise specified.
- #
- # This function also supports the proprietary Microsoft
- # `alpha(opacity=20)` syntax.
- #
- # @overload def alpha(color)
- # @param color [Color]
- # @return [Number]
- # @see #opacify
- # @see #transparentize
- # @raise [ArgumentError] If `color` isn't a color
- def alpha(*args)
- if args.all? do |a|
- a.is_a?(Sass::Script::String) && a.type == :identifier &&
- a.value =~ /^[a-zA-Z]+\s*=/
- end
- # Support the proprietary MS alpha() function
- return Sass::Script::String.new("alpha(#{args.map {|a| a.to_s}.join(", ")})")
- end
-
- opacity(*args)
- end
- declare :alpha, [:color]
-
- # Returns the alpha component (opacity) of a color.
- # This is 1 unless otherwise specified.
- #
- # @param color [Color]
- # @return [Number]
- # @see #opacify
- # @see #transparentize
- # @raise [ArgumentError] If `color` isn't a color
- def opacity(color)
- assert_type color, :Color
- Sass::Script::Number.new(color.alpha)
- end
- declare :opacity, [:color]
-
- # Makes a color more opaque.
- # Takes a color and an amount between 0 and 1,
- # and returns a color with the opacity increased by that value.
- #
- # @example
- # opacify(rgba(0, 0, 0, 0.5), 0.1) => rgba(0, 0, 0, 0.6)
- # opacify(rgba(0, 0, 17, 0.8), 0.2) => #001
- # @param color [Color]
- # @param amount [Number]
- # @return [Color]
- # @see #transparentize
- # @raise [ArgumentError] If `color` isn't a color,
- # or `number` isn't a number between 0 and 1
- def opacify(color, amount)
- _adjust(color, amount, :alpha, 0..1, :+)
- end
- declare :opacify, [:color, :amount]
-
- alias_method :fade_in, :opacify
- declare :fade_in, [:color, :amount]
-
- # Makes a color more transparent.
- # Takes a color and an amount between 0 and 1,
- # and returns a color with the opacity decreased by that value.
- #
- # @example
- # transparentize(rgba(0, 0, 0, 0.5), 0.1) => rgba(0, 0, 0, 0.4)
- # transparentize(rgba(0, 0, 0, 0.8), 0.2) => rgba(0, 0, 0, 0.6)
- # @param color [Color]
- # @param amount [Number]
- # @return [Color]
- # @see #opacify
- # @raise [ArgumentError] If `color` isn't a color,
- # or `number` isn't a number between 0 and 1
- def transparentize(color, amount)
- _adjust(color, amount, :alpha, 0..1, :-)
- end
- declare :transparentize, [:color, :amount]
-
- alias_method :fade_out, :transparentize
- declare :fade_out, [:color, :amount]
-
- # Makes a color lighter.
- # Takes a color and an amount between 0% and 100%,
- # and returns a color with the lightness increased by that value.
- #
- # @example
- # lighten(hsl(0, 0%, 0%), 30%) => hsl(0, 0, 30)
- # lighten(#800, 20%) => #e00
- # @param color [Color]
- # @param amount [Number]
- # @return [Color]
- # @see #darken
- # @raise [ArgumentError] If `color` isn't a color,
- # or `number` isn't a number between 0% and 100%
- def lighten(color, amount)
- _adjust(color, amount, :lightness, 0..100, :+, "%")
- end
- declare :lighten, [:color, :amount]
-
- # Makes a color darker.
- # Takes a color and an amount between 0% and 100%,
- # and returns a color with the lightness decreased by that value.
- #
- # @example
- # darken(hsl(25, 100%, 80%), 30%) => hsl(25, 100%, 50%)
- # darken(#800, 20%) => #200
- # @param color [Color]
- # @param amount [Number]
- # @return [Color]
- # @see #lighten
- # @raise [ArgumentError] If `color` isn't a color,
- # or `number` isn't a number between 0% and 100%
- def darken(color, amount)
- _adjust(color, amount, :lightness, 0..100, :-, "%")
- end
- declare :darken, [:color, :amount]
-
- # Makes a color more saturated.
- # Takes a color and an amount between 0% and 100%,
- # and returns a color with the saturation increased by that value.
- #
- # @example
- # saturate(hsl(120, 30%, 90%), 20%) => hsl(120, 50%, 90%)
- # saturate(#855, 20%) => #9e3f3f
- # @param color [Color]
- # @param amount [Number]
- # @return [Color]
- # @see #desaturate
- # @raise [ArgumentError] If `color` isn't a color,
- # or `number` isn't a number between 0% and 100%
- def saturate(color, amount)
- _adjust(color, amount, :saturation, 0..100, :+, "%")
- end
- declare :saturate, [:color, :amount]
-
- # Makes a color less saturated.
- # Takes a color and an amount between 0% and 100%,
- # and returns a color with the saturation decreased by that value.
- #
- # @example
- # desaturate(hsl(120, 30%, 90%), 20%) => hsl(120, 10%, 90%)
- # desaturate(#855, 20%) => #726b6b
- # @param color [Color]
- # @param amount [Number]
- # @return [Color]
- # @see #saturate
- # @raise [ArgumentError] If `color` isn't a color,
- # or `number` isn't a number between 0% and 100%
- def desaturate(color, amount)
- _adjust(color, amount, :saturation, 0..100, :-, "%")
- end
- declare :desaturate, [:color, :amount]
-
- # Changes the hue of a color while retaining the lightness and saturation.
- # Takes a color and a number of degrees (usually between -360deg and 360deg),
- # and returns a color with the hue rotated by that value.
- #
- # @example
- # adjust-hue(hsl(120, 30%, 90%), 60deg) => hsl(180, 30%, 90%)
- # adjust-hue(hsl(120, 30%, 90%), 060deg) => hsl(60, 30%, 90%)
- # adjust-hue(#811, 45deg) => #886a11
- # @param color [Color]
- # @param amount [Number]
- # @return [Color]
- # @raise [ArgumentError] If `color` isn't a color, or `number` isn't a number
- def adjust_hue(color, degrees)
- assert_type color, :Color
- assert_type degrees, :Number
- color.with(:hue => color.hue + degrees.value)
- end
- declare :adjust_hue, [:color, :degrees]
-
- # Adjusts one or more properties of a color.
- # This can change the red, green, blue, hue, saturation, value, and alpha properties.
- # The properties are specified as keyword arguments,
- # and are added to or subtracted from the color's current value for that property.
- #
- # `$red`, `$green`, and `$blue` properties should be between 0 and 255.
- # `$saturation` and `$lightness` should be between 0% and 100%.
- # `$alpha` should be between 0 and 1.
- #
- # All properties are optional.
- # You can't specify both RGB properties (`$red`, `$green`, `$blue`)
- # and HSL properties (`$hue`, `$saturation`, `$value`) at the same time.
- #
- # @example
- # adjust-color(#102030, $blue: 5) => #102035
- # adjust-color(#102030, $red: -5, $blue: 5) => #0b2035
- # adjust-color(hsl(25, 100%, 80%), $lightness: -30%, $alpha: -0.4) => hsla(25, 100%, 50%, 0.6)
- # @param color [Color]
- # @param red [Number]
- # @param green [Number]
- # @param blue [Number]
- # @param hue [Number]
- # @param saturation [Number]
- # @param lightness [Number]
- # @param alpha [Number]
- # @return [Color]
- # @raise [ArgumentError] if `color` is not a color,
- # if any keyword argument is not a number,
- # if any keyword argument is not in the legal range,
- # if an unexpected keyword argument is given,
- # or if both HSL and RGB properties are given.
- def adjust_color(color, kwargs)
- assert_type color, :Color
- with = Sass::Util.map_hash({
- "red" => [-255..255, ""],
- "green" => [-255..255, ""],
- "blue" => [-255..255, ""],
- "hue" => nil,
- "saturation" => [-100..100, "%"],
- "lightness" => [-100..100, "%"],
- "alpha" => [-1..1, ""]
- }) do |name, (range, units)|
-
- next unless val = kwargs.delete(name)
- assert_type val, :Number, name
- if range && !range.include?(val.value)
- raise ArgumentError.new("$#{name}: Amount #{val} must be between #{range.first}#{units} and #{range.last}#{units}")
- end
- adjusted = color.send(name) + val.value
- adjusted = [0, Sass::Util.restrict(adjusted, range)].max if range
- [name.to_sym, adjusted]
- end
-
- unless kwargs.empty?
- name, val = kwargs.to_a.first
- raise ArgumentError.new("Unknown argument $#{name} (#{val})")
- end
-
- color.with(with)
- end
- declare :adjust_color, [:color], :var_kwargs => true
-
- # Scales one or more properties of a color by a percentage value.
- # Unlike \{#adjust_color adjust-color}, which changes a color's properties by fixed amounts,
- # \{#scale_color scale-color} fluidly changes them based on how high or low they already are.
- # That means that lightening an already-light color with \{#scale_color scale-color}
- # won't change the lightness much,
- # but lightening a dark color by the same amount will change it more dramatically.
- # This has the benefit of making `scale-color($color, ...)` have a similar effect
- # regardless of what `$color` is.
- #
- # For example, the lightness of a color can be anywhere between 0 and 100.
- # If `scale-color($color, $lightness: 40%)` is called, the resulting color's lightness
- # will be 40% of the way between its original lightness and 100.
- # If `scale-color($color, $lightness: -40%)` is called instead,
- # the lightness will be 40% of the way between the original and 0.
- #
- # This can change the red, green, blue, saturation, value, and alpha properties.
- # The properties are specified as keyword arguments.
- # All arguments should be percentages between 0% and 100%.
- #
- # All properties are optional.
- # You can't specify both RGB properties (`$red`, `$green`, `$blue`)
- # and HSL properties (`$saturation`, `$value`) at the same time.
- #
- # @example
- # scale-color(hsl(120, 70, 80), $lightness: 50%) => hsl(120, 70, 90)
- # scale-color(rgb(200, 150, 170), $green: -40%, $blue: 70%) => rgb(200, 90, 229)
- # scale-color(hsl(200, 70, 80), $saturation: -90%, $alpha: -30%) => hsla(200, 7, 80, 0.7)
- # @param color [Color]
- # @param red [Number]
- # @param green [Number]
- # @param blue [Number]
- # @param saturation [Number]
- # @param lightness [Number]
- # @param alpha [Number]
- # @return [Color]
- # @raise [ArgumentError] if `color` is not a color,
- # if any keyword argument is not a percentage between 0% and 100%,
- # if an unexpected keyword argument is given,
- # or if both HSL and RGB properties are given.
- def scale_color(color, kwargs)
- assert_type color, :Color
- with = Sass::Util.map_hash({
- "red" => 255,
- "green" => 255,
- "blue" => 255,
- "saturation" => 100,
- "lightness" => 100,
- "alpha" => 1
- }) do |name, max|
-
- next unless val = kwargs.delete(name)
- assert_type val, :Number, name
- if !(val.numerator_units == ['%'] && val.denominator_units.empty?)
- raise ArgumentError.new("$#{name}: Amount #{val} must be a % (e.g. #{val.value}%)")
- elsif !(-100..100).include?(val.value)
- raise ArgumentError.new("$#{name}: Amount #{val} must be between -100% and 100%")
- end
-
- current = color.send(name)
- scale = val.value/100.0
- diff = scale > 0 ? max - current : current
- [name.to_sym, current + diff*scale]
- end
-
- unless kwargs.empty?
- name, val = kwargs.to_a.first
- raise ArgumentError.new("Unknown argument $#{name} (#{val})")
- end
-
- color.with(with)
- end
- declare :scale_color, [:color], :var_kwargs => true
-
- # Changes one or more properties of a color.
- # This can change the red, green, blue, hue, saturation, value, and alpha properties.
- # The properties are specified as keyword arguments,
- # and replace the color's current value for that property.
- #
- # `$red`, `$green`, and `$blue` properties should be between 0 and 255.
- # `$saturation` and `$lightness` should be between 0% and 100%.
- # `$alpha` should be between 0 and 1.
- #
- # All properties are optional.
- # You can't specify both RGB properties (`$red`, `$green`, `$blue`)
- # and HSL properties (`$hue`, `$saturation`, `$value`) at the same time.
- #
- # @example
- # change-color(#102030, $blue: 5) => #102005
- # change-color(#102030, $red: 120, $blue: 5) => #782005
- # change-color(hsl(25, 100%, 80%), $lightness: 40%, $alpha: 0.8) => hsla(25, 100%, 40%, 0.8)
- # @param color [Color]
- # @param red [Number]
- # @param green [Number]
- # @param blue [Number]
- # @param hue [Number]
- # @param saturation [Number]
- # @param lightness [Number]
- # @param alpha [Number]
- # @return [Color]
- # @raise [ArgumentError] if `color` is not a color,
- # if any keyword argument is not a number,
- # if any keyword argument is not in the legal range,
- # if an unexpected keyword argument is given,
- # or if both HSL and RGB properties are given.
- def change_color(color, kwargs)
- assert_type color, :Color
- with = Sass::Util.map_hash(%w[red green blue hue saturation lightness alpha]) do |name, max|
- next unless val = kwargs.delete(name)
- assert_type val, :Number, name
- [name.to_sym, val.value]
- end
-
- unless kwargs.empty?
- name, val = kwargs.to_a.first
- raise ArgumentError.new("Unknown argument $#{name} (#{val})")
- end
-
- color.with(with)
- end
- declare :change_color, [:color], :var_kwargs => true
-
- # Mixes together two colors.
- # Specifically, takes the average of each of the RGB components,
- # optionally weighted by the given percentage.
- # The opacity of the colors is also considered when weighting the components.
- #
- # The weight specifies the amount of the first color that should be included
- # in the returned color.
- # The default, 50%, means that half the first color
- # and half the second color should be used.
- # 25% means that a quarter of the first color
- # and three quarters of the second color should be used.
- #
- # @example
- # mix(#f00, #00f) => #7f007f
- # mix(#f00, #00f, 25%) => #3f00bf
- # mix(rgba(255, 0, 0, 0.5), #00f) => rgba(63, 0, 191, 0.75)
- # @overload mix(color1, color2, weight: 50%)
- # @param color1 [Color]
- # @param color2 [Color]
- # @param weight [Number] between 0% and 100%
- # @return [Color]
- # @raise [ArgumentError] if `color1` or `color2` aren't colors,
- # or `weight` isn't a number between 0% and 100%
- def mix(color1, color2, weight = Number.new(50))
- assert_type color1, :Color
- assert_type color2, :Color
- assert_type weight, :Number
-
- unless (0..100).include?(weight.value)
- raise ArgumentError.new("Weight #{weight} must be between 0% and 100%")
- end
-
- # This algorithm factors in both the user-provided weight
- # and the difference between the alpha values of the two colors
- # to decide how to perform the weighted average of the two RGB values.
- #
- # It works by first normalizing both parameters to be within [-1, 1],
- # where 1 indicates "only use color1", -1 indicates "only use color 0",
- # and all values in between indicated a proportionately weighted average.
- #
- # Once we have the normalized variables w and a,
- # we apply the formula (w + a)/(1 + w*a)
- # to get the combined weight (in [-1, 1]) of color1.
- # This formula has two especially nice properties:
- #
- # * When either w or a are -1 or 1, the combined weight is also that number
- # (cases where w * a == -1 are undefined, and handled as a special case).
- #
- # * When a is 0, the combined weight is w, and vice versa
- #
- # Finally, the weight of color1 is renormalized to be within [0, 1]
- # and the weight of color2 is given by 1 minus the weight of color1.
- p = weight.value/100.0
- w = p*2 - 1
- a = color1.alpha - color2.alpha
-
- w1 = (((w * a == -1) ? w : (w + a)/(1 + w*a)) + 1)/2.0
- w2 = 1 - w1
-
- rgb = color1.rgb.zip(color2.rgb).map {|v1, v2| v1*w1 + v2*w2}
- alpha = color1.alpha*p + color2.alpha*(1-p)
- Color.new(rgb + [alpha])
- end
- declare :mix, [:color_1, :color_2]
- declare :mix, [:color_1, :color_2, :weight]
-
- # Converts a color to grayscale.
- # This is identical to `desaturate(color, 100%)`.
- #
- # @param color [Color]
- # @return [Color]
- # @raise [ArgumentError] if `color` isn't a color
- # @see #desaturate
- def grayscale(color)
- desaturate color, Number.new(100)
- end
- declare :grayscale, [:color]
-
- # Returns the complement of a color.
- # This is identical to `adjust-hue(color, 180deg)`.
- #
- # @param color [Color]
- # @return [Color]
- # @raise [ArgumentError] if `color` isn't a color
- # @see #adjust_hue #adjust-hue
- def complement(color)
- adjust_hue color, Number.new(180)
- end
- declare :complement, [:color]
-
- # Returns the inverse (negative) of a color.
- # The red, green, and blue values are inverted, while the opacity is left alone.
- #
- # @param color [Color]
- # @return [Color]
- # @raise [ArgumentError] if `color` isn't a color
- def invert(color)
- assert_type color, :Color
- color.with(
- :red => (255 - color.red),
- :green => (255 - color.green),
- :blue => (255 - color.blue))
- end
-
- # Removes quotes from a string if the string is quoted,
- # or returns the same string if it's not.
- #
- # @param string [String]
- # @return [String]
- # @raise [ArgumentError] if `string` isn't a string
- # @see #quote
- # @example
- # unquote("foo") => foo
- # unquote(foo) => foo
- def unquote(string)
- if string.is_a?(Sass::Script::String)
- Sass::Script::String.new(string.value, :identifier)
- else
- string
- end
- end
- declare :unquote, [:string]
-
- # Add quotes to a string if the string isn't quoted,
- # or returns the same string if it is.
- #
- # @param string [String]
- # @return [String]
- # @raise [ArgumentError] if `string` isn't a string
- # @see #unquote
- # @example
- # quote("foo") => "foo"
- # quote(foo) => "foo"
- def quote(string)
- assert_type string, :String
- Sass::Script::String.new(string.value, :string)
- end
- declare :quote, [:string]
-
- # Inspects the type of the argument, returning it as an unquoted string.
- #
- # @example
- # type-of(100px) => number
- # type-of(asdf) => string
- # type-of("asdf") => string
- # type-of(true) => bool
- # type-of(#fff) => color
- # type-of(blue) => color
- # @param value [Literal] The object to inspect
- # @return [String] The unquoted string name of the literal's type
- def type_of(value)
- Sass::Script::String.new(value.class.name.gsub(/Sass::Script::/,'').downcase)
- end
- declare :type_of, [:value]
-
- # Inspects the unit of the number, returning it as a quoted string.
- # Complex units are sorted in alphabetical order by numerator and denominator.
- #
- # @example
- # unit(100) => ""
- # unit(100px) => "px"
- # unit(3em) => "em"
- # unit(10px * 5em) => "em*px"
- # unit(10px * 5em / 30cm / 1rem) => "em*px/cm*rem"
- # @param number [Literal] The number to inspect
- # @return [String] The unit(s) of the number
- # @raise [ArgumentError] if `number` isn't a number
- def unit(number)
- assert_type number, :Number
- Sass::Script::String.new(number.unit_str, :string)
- end
- declare :unit, [:number]
-
- # Inspects the unit of the number, returning a boolean indicating if it is unitless.
- #
- # @example
- # unitless(100) => true
- # unitless(100px) => false
- # @param number [Literal] The number to inspect
- # @return [Bool] Whether or not the number is unitless
- # @raise [ArgumentError] if `number` isn't a number
- def unitless(number)
- assert_type number, :Number
- Sass::Script::Bool.new(number.unitless?)
- end
- declare :unitless, [:number]
-
- # Returns true if two numbers are similar enough to be added, subtracted, or compared.
- #
- # @example
- # comparable(2px, 1px) => true
- # comparable(100px, 3em) => false
- # comparable(10cm, 3mm) => true
- # @param number_1 [Number]
- # @param number_2 [Number]
- # @return [Bool] indicating if the numbers can be compared.
- # @raise [ArgumentError] if `number_1` or `number_2` aren't numbers
- def comparable(number_1, number_2)
- assert_type number_1, :Number
- assert_type number_2, :Number
- Sass::Script::Bool.new(number_1.comparable_to?(number_2))
- end
- declare :comparable, [:number_1, :number_2]
-
- # Converts a decimal number to a percentage.
- #
- # @example
- # percentage(100px / 50px) => 200%
- # @param value [Number] The decimal number to convert to a percentage
- # @return [Number] The percentage
- # @raise [ArgumentError] If `value` isn't a unitless number
- def percentage(value)
- unless value.is_a?(Sass::Script::Number) && value.unitless?
- raise ArgumentError.new("#{value.inspect} is not a unitless number")
- end
- Sass::Script::Number.new(value.value * 100, ['%'])
- end
- declare :percentage, [:value]
-
- # Rounds a number to the nearest whole number.
- #
- # @example
- # round(10.4px) => 10px
- # round(10.6px) => 11px
- # @param value [Number] The number
- # @return [Number] The rounded number
- # @raise [ArgumentError] if `value` isn't a number
- def round(value)
- numeric_transformation(value) {|n| n.round}
- end
- declare :round, [:value]
-
- # Rounds a number up to the nearest whole number.
- #
- # @example
- # ciel(10.4px) => 11px
- # ciel(10.6px) => 11px
- # @param value [Number] The number
- # @return [Number] The rounded number
- # @raise [ArgumentError] if `value` isn't a number
- def ceil(value)
- numeric_transformation(value) {|n| n.ceil}
- end
- declare :ceil, [:value]
-
- # Rounds down to the nearest whole number.
- #
- # @example
- # floor(10.4px) => 10px
- # floor(10.6px) => 10px
- # @param value [Number] The number
- # @return [Number] The rounded number
- # @raise [ArgumentError] if `value` isn't a number
- def floor(value)
- numeric_transformation(value) {|n| n.floor}
- end
- declare :floor, [:value]
-
- # Finds the absolute value of a number.
- #
- # @example
- # abs(10px) => 10px
- # abs(-10px) => 10px
- # @param value [Number] The number
- # @return [Number] The absolute value
- # @raise [ArgumentError] if `value` isn't a number
- def abs(value)
- numeric_transformation(value) {|n| n.abs}
- end
- declare :abs, [:value]
-
- # Return the length of a list.
- #
- # @example
- # length(10px) => 1
- # length(10px 20px 30px) => 3
- # @param list [Literal] The list
- # @return [Number] The length
- def length(list)
- Sass::Script::Number.new(list.to_a.size)
- end
- declare :length, [:list]
-
- # Gets the nth item in a list.
- #
- # Note that unlike some languages, the first item in a Sass list is number 1,
- # the second number 2, and so forth.
- #
- # @example
- # nth(10px 20px 30px, 1) => 10px
- # nth((Helvetica, Arial, sans-serif), 3) => sans-serif
- # @param list [Literal] The list
- # @param n [Number] The index into the list
- # @return [Literal] The nth item in the list
- # @raise [ArgumentError] If `n` isn't an integer between 1 and the list's length.
- def nth(list, n)
- assert_type n, :Number
- if !n.int?
- raise ArgumentError.new("List index #{n} must be an integer")
- elsif n.to_i < 1
- raise ArgumentError.new("List index #{n} must be greater than or equal to 1")
- elsif list.to_a.size == 0
- raise ArgumentError.new("List index is #{n} but list has no items")
- elsif n.to_i > (size = list.to_a.size)
- raise ArgumentError.new("List index is #{n} but list is only #{size} item#{'s' if size != 1} long")
- end
-
- list.to_a[n.to_i - 1]
- end
- declare :nth, [:list, :n]
-
- # Joins together two lists into a new list.
- #
- # Unless the `$separator` argument is passed,
- # if one list is comma-separated and one is space-separated,
- # the first parameter's separator is used for the resulting list.
- # If the lists have only one item each, spaces are used for the resulting list.
- #
- # @example
- # join(10px 20px, 30px 40px) => 10px 20px 30px 40px
- # join((blue, red), (#abc, #def)) => blue, red, #abc, #def
- # join(10px, 20px) => 10px 20px
- # join(10px, 20px, comma) => 10px, 20px
- # join((blue, red), (#abc, #def), space) => blue red #abc #def
- # @overload join(list1, list2, separator: auto)
- # @param list1 [Literal] The first list to join
- # @param list2 [Literal] The second list to join
- # @param separator [String] How the list separator (comma or space) should be determined.
- # If this is `comma` or `space`, that is always the separator;
- # if this is `auto` (the default), the separator is determined as explained above.
- def join(list1, list2, separator = Sass::Script::String.new("auto"))
- assert_type separator, :String
- unless %w[auto space comma].include?(separator.value)
- raise ArgumentError.new("Separator name must be space, comma, or auto")
- end
- sep1 = list1.separator if list1.is_a?(Sass::Script::List) && !list1.value.empty?
- sep2 = list2.separator if list2.is_a?(Sass::Script::List) && !list2.value.empty?
- Sass::Script::List.new(
- list1.to_a + list2.to_a,
- if separator.value == 'auto'
- sep1 || sep2 || :space
- else
- separator.value.to_sym
- end)
- end
- declare :join, [:list1, :list2]
- declare :join, [:list1, :list2, :separator]
-
- # Appends a single value onto the end of a list.
- #
- # Unless the `$separator` argument is passed,
- # if the list has only one item,
- # the resulting list will be space-separated.
- #
- # @example
- # append(10px 20px, 30px) => 10px 20px 30px
- # append((blue, red), green) => blue, red, green
- # append(10px 20px, 30px 40px) => 10px 20px (30px 40px)
- # join(10px, 20px, comma) => 10px, 20px
- # join((blue, red), green, space) => blue red green
- # @overload join(list, val, separator: auto)
- # @param list1 [Literal] The first list to join
- # @param list2 [Literal] The second list to join
- # @param separator [String] How the list separator (comma or space) should be determined.
- # If this is `comma` or `space`, that is always the separator;
- # if this is `auto` (the default), the separator is determined as explained above.
- def append(list, val, separator = Sass::Script::String.new("auto"))
- assert_type separator, :String
- unless %w[auto space comma].include?(separator.value)
- raise ArgumentError.new("Separator name must be space, comma, or auto")
- end
- sep = list.separator if list.is_a?(Sass::Script::List)
- Sass::Script::List.new(
- list.to_a + [val],
- if separator.value == 'auto'
- sep || :space
- else
- separator.value.to_sym
- end)
- end
- declare :append, [:list, :val]
- declare :append, [:list, :val, :separator]
-
- # Returns one of two values based on the truth value of the first argument.
- #
- # @example
- # if(true, 1px, 2px) => 1px
- # if(false, 1px, 2px) => 2px
- # @param condition [Bool] Whether the first or second value will be returned.
- # @param if_true [Literal] The value that will be returned if `$condition` is true.
- # @param if_false [Literal] The value that will be returned if `$condition` is false.
- def if(condition, if_true, if_false)
- if condition.to_bool
- if_true
- else
- if_false
- end
- end
- declare :if, [:condition, :if_true, :if_false]
-
- private
-
- # This method implements the pattern of transforming a numeric value into
- # another numeric value with the same units.
- # It yields a number to a block to perform the operation and return a number
- def numeric_transformation(value)
- assert_type value, :Number
- Sass::Script::Number.new(yield(value.value), value.numerator_units, value.denominator_units)
- end
-
- def _adjust(color, amount, attr, range, op, units = "")
- assert_type color, :Color
- assert_type amount, :Number
- unless range.include?(amount.value)
- raise ArgumentError.new("Amount #{amount} must be between #{range.first}#{units} and #{range.last}#{units}")
- end
-
- # TODO: is it worth restricting here,
- # or should we do so in the Color constructor itself,
- # and allow clipping in rgb() et al?
- color.with(attr => Sass::Util.restrict(
- color.send(attr).send(op, amount.value), range))
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/interpolation.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/interpolation.rb
deleted file mode 100644
index e4a2a207b4..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/interpolation.rb
+++ /dev/null
@@ -1,70 +0,0 @@
-module Sass::Script
- # A SassScript object representing `#{}` interpolation outside a string.
- #
- # @see StringInterpolation
- class Interpolation < Node
- # Interpolation in a property is of the form `before #{mid} after`.
- #
- # @param before [Node] The SassScript before the interpolation
- # @param mid [Node] The SassScript within the interpolation
- # @param after [Node] The SassScript after the interpolation
- # @param wb [Boolean] Whether there was whitespace between `before` and `#{`
- # @param wa [Boolean] Whether there was whitespace between `}` and `after`
- # @param originally_text [Boolean]
- # Whether the original format of the interpolation was plain text,
- # not an interpolation.
- # This is used when converting back to SassScript.
- def initialize(before, mid, after, wb, wa, originally_text = false)
- @before = before
- @mid = mid
- @after = after
- @whitespace_before = wb
- @whitespace_after = wa
- @originally_text = originally_text
- end
-
- # @return [String] A human-readable s-expression representation of the interpolation
- def inspect
- "(interpolation #{@before.inspect} #{@mid.inspect} #{@after.inspect})"
- end
-
- # @see Node#to_sass
- def to_sass(opts = {})
- res = ""
- res << @before.to_sass(opts) if @before
- res << ' ' if @before && @whitespace_before
- res << '#{' unless @originally_text
- res << @mid.to_sass(opts)
- res << '}' unless @originally_text
- res << ' ' if @after && @whitespace_after
- res << @after.to_sass(opts) if @after
- res
- end
-
- # Returns the three components of the interpolation, `before`, `mid`, and `after`.
- #
- # @return [Array]
- # @see #initialize
- # @see Node#children
- def children
- [@before, @mid, @after].compact
- end
-
- protected
-
- # Evaluates the interpolation.
- #
- # @param environment [Sass::Environment] The environment in which to evaluate the SassScript
- # @return [Sass::Script::String] The SassScript string that is the value of the interpolation
- def _perform(environment)
- res = ""
- res << @before.perform(environment).to_s if @before
- res << " " if @before && @whitespace_before
- val = @mid.perform(environment)
- res << (val.is_a?(Sass::Script::String) ? val.value : val.to_s)
- res << " " if @after && @whitespace_after
- res << @after.perform(environment).to_s if @after
- opts(Sass::Script::String.new(res))
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/lexer.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/lexer.rb
deleted file mode 100644
index 1641f845e2..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/lexer.rb
+++ /dev/null
@@ -1,334 +0,0 @@
-require 'sass/scss/rx'
-
-require 'strscan'
-
-module Sass
- module Script
- # The lexical analyzer for SassScript.
- # It takes a raw string and converts it to individual tokens
- # that are easier to parse.
- class Lexer
- include Sass::SCSS::RX
-
- # A struct containing information about an individual token.
- #
- # `type`: \[`Symbol`\]
- # : The type of token.
- #
- # `value`: \[`Object`\]
- # : The Ruby object corresponding to the value of the token.
- #
- # `line`: \[`Fixnum`\]
- # : The line of the source file on which the token appears.
- #
- # `offset`: \[`Fixnum`\]
- # : The number of bytes into the line the SassScript token appeared.
- #
- # `pos`: \[`Fixnum`\]
- # : The scanner position at which the SassScript token appeared.
- Token = Struct.new(:type, :value, :line, :offset, :pos)
-
- # The line number of the lexer's current position.
- #
- # @return [Fixnum]
- attr_reader :line
-
- # The number of bytes into the current line
- # of the lexer's current position.
- #
- # @return [Fixnum]
- attr_reader :offset
-
- # A hash from operator strings to the corresponding token types.
- OPERATORS = {
- '+' => :plus,
- '-' => :minus,
- '*' => :times,
- '/' => :div,
- '%' => :mod,
- '=' => :single_eq,
- ':' => :colon,
- '(' => :lparen,
- ')' => :rparen,
- ',' => :comma,
- 'and' => :and,
- 'or' => :or,
- 'not' => :not,
- '==' => :eq,
- '!=' => :neq,
- '>=' => :gte,
- '<=' => :lte,
- '>' => :gt,
- '<' => :lt,
- '#{' => :begin_interpolation,
- '}' => :end_interpolation,
- ';' => :semicolon,
- '{' => :lcurly,
- }
-
- OPERATORS_REVERSE = Sass::Util.map_hash(OPERATORS) {|k, v| [v, k]}
-
- TOKEN_NAMES = Sass::Util.map_hash(OPERATORS_REVERSE) {|k, v| [k, v.inspect]}.merge({
- :const => "variable (e.g. $foo)",
- :ident => "identifier (e.g. middle)",
- :bool => "boolean (e.g. true, false)",
- })
-
- # A list of operator strings ordered with longer names first
- # so that `>` and `<` don't clobber `>=` and `<=`.
- OP_NAMES = OPERATORS.keys.sort_by {|o| -o.size}
-
- # A sub-list of {OP_NAMES} that only includes operators
- # with identifier names.
- IDENT_OP_NAMES = OP_NAMES.select {|k, v| k =~ /^\w+/}
-
- # A hash of regular expressions that are used for tokenizing.
- REGULAR_EXPRESSIONS = {
- :whitespace => /\s+/,
- :comment => COMMENT,
- :single_line_comment => SINGLE_LINE_COMMENT,
- :variable => /(\$)(#{IDENT})/,
- :ident => /(#{IDENT})(\()?/,
- :number => /(-)?(?:(\d*\.\d+)|(\d+))([a-zA-Z%]+)?/,
- :color => HEXCOLOR,
- :bool => /(true|false)\b/,
- :ident_op => %r{(#{Regexp.union(*IDENT_OP_NAMES.map{|s| Regexp.new(Regexp.escape(s) + "(?!#{NMCHAR}|\Z)")})})},
- :op => %r{(#{Regexp.union(*OP_NAMES)})},
- }
-
- class << self
- private
- def string_re(open, close)
- /#{open}((?:\\.|\#(?!\{)|[^#{close}\\#])*)(#{close}|#\{)/
- end
- end
-
- # A hash of regular expressions that are used for tokenizing strings.
- #
- # The key is a `[Symbol, Boolean]` pair.
- # The symbol represents which style of quotation to use,
- # while the boolean represents whether or not the string
- # is following an interpolated segment.
- STRING_REGULAR_EXPRESSIONS = {
- [:double, false] => string_re('"', '"'),
- [:single, false] => string_re("'", "'"),
- [:double, true] => string_re('', '"'),
- [:single, true] => string_re('', "'"),
- [:uri, false] => /url\(#{W}(#{URLCHAR}*?)(#{W}\)|#\{)/,
- [:uri, true] => /(#{URLCHAR}*?)(#{W}\)|#\{)/,
- }
-
- # @param str [String, StringScanner] The source text to lex
- # @param line [Fixnum] The line on which the SassScript appears.
- # Used for error reporting
- # @param offset [Fixnum] The number of characters in on which the SassScript appears.
- # Used for error reporting
- # @param options [{Symbol => Object}] An options hash;
- # see {file:SASS_REFERENCE.md#sass_options the Sass options documentation}
- def initialize(str, line, offset, options)
- @scanner = str.is_a?(StringScanner) ? str : StringScanner.new(str)
- @line = line
- @offset = offset
- @options = options
- @interpolation_stack = []
- @prev = nil
- end
-
- # Moves the lexer forward one token.
- #
- # @return [Token] The token that was moved past
- def next
- @tok ||= read_token
- @tok, tok = nil, @tok
- @prev = tok
- return tok
- end
-
- # Returns whether or not there's whitespace before the next token.
- #
- # @return [Boolean]
- def whitespace?(tok = @tok)
- if tok
- @scanner.string[0...tok.pos] =~ /\s\Z/
- else
- @scanner.string[@scanner.pos, 1] =~ /^\s/ ||
- @scanner.string[@scanner.pos - 1, 1] =~ /\s\Z/
- end
- end
-
- # Returns the next token without moving the lexer forward.
- #
- # @return [Token] The next token
- def peek
- @tok ||= read_token
- end
-
- # Rewinds the underlying StringScanner
- # to before the token returned by \{#peek}.
- def unpeek!
- @scanner.pos = @tok.pos if @tok
- end
-
- # @return [Boolean] Whether or not there's more source text to lex.
- def done?
- whitespace unless after_interpolation? && @interpolation_stack.last
- @scanner.eos? && @tok.nil?
- end
-
- # @return [Boolean] Whether or not the last token lexed was `:end_interpolation`.
- def after_interpolation?
- @prev && @prev.type == :end_interpolation
- end
-
- # Raise an error to the effect that `name` was expected in the input stream
- # and wasn't found.
- #
- # This calls \{#unpeek!} to rewind the scanner to immediately after
- # the last returned token.
- #
- # @param name [String] The name of the entity that was expected but not found
- # @raise [Sass::SyntaxError]
- def expected!(name)
- unpeek!
- Sass::SCSS::Parser.expected(@scanner, name, @line)
- end
-
- # Records all non-comment text the lexer consumes within the block
- # and returns it as a string.
- #
- # @yield A block in which text is recorded
- # @return [String]
- def str
- old_pos = @tok ? @tok.pos : @scanner.pos
- yield
- new_pos = @tok ? @tok.pos : @scanner.pos
- @scanner.string[old_pos...new_pos]
- end
-
- private
-
- def read_token
- return if done?
- return unless value = token
- type, val, size = value
- size ||= @scanner.matched_size
-
- val.line = @line if val.is_a?(Script::Node)
- Token.new(type, val, @line,
- current_position - size, @scanner.pos - size)
- end
-
- def whitespace
- nil while scan(REGULAR_EXPRESSIONS[:whitespace]) ||
- scan(REGULAR_EXPRESSIONS[:comment]) ||
- scan(REGULAR_EXPRESSIONS[:single_line_comment])
- end
-
- def token
- if after_interpolation? && (interp_type = @interpolation_stack.pop)
- return string(interp_type, true)
- end
-
- variable || string(:double, false) || string(:single, false) || number ||
- color || bool || string(:uri, false) || raw(UNICODERANGE) ||
- special_fun || ident_op || ident || op
- end
-
- def variable
- _variable(REGULAR_EXPRESSIONS[:variable])
- end
-
- def _variable(rx)
- line = @line
- offset = @offset
- return unless scan(rx)
-
- [:const, @scanner[2]]
- end
-
- def ident
- return unless scan(REGULAR_EXPRESSIONS[:ident])
- [@scanner[2] ? :funcall : :ident, @scanner[1]]
- end
-
- def string(re, open)
- return unless scan(STRING_REGULAR_EXPRESSIONS[[re, open]])
- if @scanner[2] == '#{' #'
- @scanner.pos -= 2 # Don't actually consume the #{
- @interpolation_stack << re
- end
- str =
- if re == :uri
- Script::String.new("#{'url(' unless open}#{@scanner[1]}#{')' unless @scanner[2] == '#{'}")
- else
- Script::String.new(@scanner[1].gsub(/\\(['"]|\#\{)/, '\1'), :string)
- end
- [:string, str]
- end
-
- def number
- return unless scan(REGULAR_EXPRESSIONS[:number])
- value = @scanner[2] ? @scanner[2].to_f : @scanner[3].to_i
- value = -value if @scanner[1]
- [:number, Script::Number.new(value, Array(@scanner[4]))]
- end
-
- def color
- return unless s = scan(REGULAR_EXPRESSIONS[:color])
- raise Sass::SyntaxError.new(<]
- attr_reader :value
- alias_method :children, :value
- alias_method :to_a, :value
-
- # The operator separating the values of the list.
- # Either `:comma` or `:space`.
- #
- # @return [Symbol]
- attr_reader :separator
-
- # Creates a new list.
- #
- # @param value [Array] See \{#value}
- # @param separator [String] See \{#separator}
- def initialize(value, separator)
- super(value)
- @separator = separator
- end
-
- # @see Node#eq
- def eq(other)
- Sass::Script::Bool.new(
- self.class == other.class && self.value == other.value &&
- self.separator == other.separator)
- end
-
- # @see Node#to_s
- def to_s(opts = {})
- raise Sass::SyntaxError.new("() isn't a valid CSS value.") if value.empty?
- return value.reject {|e| e.is_a?(List) && e.value.empty?}.map {|e| e.to_s(opts)}.join(sep_str)
- end
-
- # @see Node#to_sass
- def to_sass(opts = {})
- precedence = Sass::Script::Parser.precedence_of(separator)
- value.map do |v|
- if v.is_a?(List) && Sass::Script::Parser.precedence_of(v.separator) <= precedence
- "(#{v.to_sass(opts)})"
- else
- v.to_sass(opts)
- end
- end.join(sep_str(nil))
- end
-
- # @see Node#inspect
- def inspect
- "(#{to_sass})"
- end
-
- protected
-
- # @see Node#_perform
- def _perform(environment)
- list = Sass::Script::List.new(
- value.map {|e| e.perform(environment)},
- separator)
- list.options = self.options
- list
- end
-
- private
-
- def sep_str(opts = self.options)
- return ' ' if separator == :space
- return ',' if opts && opts[:style] == :compressed
- return ', '
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/literal.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/literal.rb
deleted file mode 100644
index 90d31f23f9..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/literal.rb
+++ /dev/null
@@ -1,245 +0,0 @@
-module Sass::Script
- # The abstract superclass for SassScript objects.
- #
- # Many of these methods, especially the ones that correspond to SassScript operations,
- # are designed to be overridden by subclasses which may change the semantics somewhat.
- # The operations listed here are just the defaults.
- class Literal < Node
- require 'sass/script/string'
- require 'sass/script/number'
- require 'sass/script/color'
- require 'sass/script/bool'
- require 'sass/script/list'
-
- # Returns the Ruby value of the literal.
- # The type of this value varies based on the subclass.
- #
- # @return [Object]
- attr_reader :value
-
- # Creates a new literal.
- #
- # @param value [Object] The object for \{#value}
- def initialize(value = nil)
- @value = value
- super()
- end
-
- # Returns an empty array.
- #
- # @return [Array] empty
- # @see Node#children
- def children
- []
- end
-
- # Returns the options hash for this node.
- #
- # @return [{Symbol => Object}]
- # @raise [Sass::SyntaxError] if the options hash hasn't been set.
- # This should only happen when the literal was created
- # outside of the parser and \{#to\_s} was called on it
- def options
- opts = super
- return opts if opts
- raise Sass::SyntaxError.new(<] The of this literal as a list
- def to_a
- [self]
- end
-
- # Returns the string representation of this literal
- # as it would be output to the CSS document.
- #
- # @return [String]
- def to_s(opts = {})
- raise Sass::SyntaxError.new("[BUG] All subclasses of Sass::Literal must implement #to_s.")
- end
- alias_method :to_sass, :to_s
-
- protected
-
- # Evaluates the literal.
- #
- # @param environment [Sass::Environment] The environment in which to evaluate the SassScript
- # @return [Literal] This literal
- def _perform(environment)
- self
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/node.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/node.rb
deleted file mode 100644
index 337d7d0cc4..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/node.rb
+++ /dev/null
@@ -1,91 +0,0 @@
-module Sass::Script
- # The abstract superclass for SassScript parse tree nodes.
- #
- # Use \{#perform} to evaluate a parse tree.
- class Node
- # The options hash for this node.
- #
- # @return [{Symbol => Object}]
- attr_reader :options
-
- # The line of the document on which this node appeared.
- #
- # @return [Fixnum]
- attr_accessor :line
-
- # Sets the options hash for this node,
- # as well as for all child nodes.
- # See {file:SASS_REFERENCE.md#sass_options the Sass options documentation}.
- #
- # @param options [{Symbol => Object}] The options
- def options=(options)
- @options = options
- children.each do |c|
- if c.is_a? Hash
- c.values.each {|v| v.options = options }
- else
- c.options = options
- end
- end
- end
-
- # Evaluates the node.
- #
- # \{#perform} shouldn't be overridden directly;
- # instead, override \{#\_perform}.
- #
- # @param environment [Sass::Environment] The environment in which to evaluate the SassScript
- # @return [Literal] The SassScript object that is the value of the SassScript
- def perform(environment)
- _perform(environment)
- rescue Sass::SyntaxError => e
- e.modify_backtrace(:line => line)
- raise e
- end
-
- # Returns all child nodes of this node.
- #
- # @return [Array]
- def children
- Sass::Util.abstract(self)
- end
-
- # Returns the text of this SassScript expression.
- #
- # @return [String]
- def to_sass(opts = {})
- Sass::Util.abstract(self)
- end
-
- protected
-
- # Converts underscores to dashes if the :dasherize option is set.
- def dasherize(s, opts)
- if opts[:dasherize]
- s.gsub(/_/,'-')
- else
- s
- end
- end
-
- # Evaluates this node.
- # Note that all {Literal} objects created within this method
- # should have their \{#options} attribute set, probably via \{#opts}.
- #
- # @param environment [Sass::Environment] The environment in which to evaluate the SassScript
- # @return [Literal] The SassScript object that is the value of the SassScript
- # @see #perform
- def _perform(environment)
- Sass::Util.abstract(self)
- end
-
- # Sets the \{#options} field on the given literal and returns it
- #
- # @param literal [Literal]
- # @return [Literal]
- def opts(literal)
- literal.options = options
- literal
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/number.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/number.rb
deleted file mode 100644
index ae27cb92ce..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/number.rb
+++ /dev/null
@@ -1,429 +0,0 @@
-require 'sass/script/literal'
-
-module Sass::Script
- # A SassScript object representing a number.
- # SassScript numbers can have decimal values,
- # and can also have units.
- # For example, `12`, `1px`, and `10.45em`
- # are all valid values.
- #
- # Numbers can also have more complex units, such as `1px*em/in`.
- # These cannot be inputted directly in Sass code at the moment.
- class Number < Literal
- # The Ruby value of the number.
- #
- # @return [Numeric]
- attr_reader :value
-
- # A list of units in the numerator of the number.
- # For example, `1px*em/in*cm` would return `["px", "em"]`
- # @return [Array]
- attr_reader :numerator_units
-
- # A list of units in the denominator of the number.
- # For example, `1px*em/in*cm` would return `["in", "cm"]`
- # @return [Array]
- attr_reader :denominator_units
-
- # The original representation of this number.
- # For example, although the result of `1px/2px` is `0.5`,
- # the value of `#original` is `"1px/2px"`.
- #
- # This is only non-nil when the original value should be used as the CSS value,
- # as in `font: 1px/2px`.
- #
- # @return [Boolean, nil]
- attr_accessor :original
-
- # The precision with which numbers will be printed to CSS files.
- # For example, if this is `1000.0`,
- # `3.1415926` will be printed as `3.142`.
- # @api public
- PRECISION = 1000.0
-
- # Used so we don't allocate two new arrays for each new number.
- NO_UNITS = []
-
- # @param value [Numeric] The value of the number
- # @param numerator_units [Array] See \{#numerator\_units}
- # @param denominator_units [Array] See \{#denominator\_units}
- def initialize(value, numerator_units = NO_UNITS, denominator_units = NO_UNITS)
- super(value)
- @numerator_units = numerator_units
- @denominator_units = denominator_units
- normalize!
- end
-
- # The SassScript `+` operation.
- # Its functionality depends on the type of its argument:
- #
- # {Number}
- # : Adds the two numbers together, converting units if possible.
- #
- # {Color}
- # : Adds this number to each of the RGB color channels.
- #
- # {Literal}
- # : See {Literal#plus}.
- #
- # @param other [Literal] The right-hand side of the operator
- # @return [Literal] The result of the operation
- # @raise [Sass::UnitConversionError] if `other` is a number with incompatible units
- def plus(other)
- if other.is_a? Number
- operate(other, :+)
- elsif other.is_a?(Color)
- other.plus(self)
- else
- super
- end
- end
-
- # The SassScript binary `-` operation (e.g. `$a - $b`).
- # Its functionality depends on the type of its argument:
- #
- # {Number}
- # : Subtracts this number from the other, converting units if possible.
- #
- # {Literal}
- # : See {Literal#minus}.
- #
- # @param other [Literal] The right-hand side of the operator
- # @return [Literal] The result of the operation
- # @raise [Sass::UnitConversionError] if `other` is a number with incompatible units
- def minus(other)
- if other.is_a? Number
- operate(other, :-)
- else
- super
- end
- end
-
- # The SassScript unary `+` operation (e.g. `+$a`).
- #
- # @return [Number] The value of this number
- def unary_plus
- self
- end
-
- # The SassScript unary `-` operation (e.g. `-$a`).
- #
- # @return [Number] The negative value of this number
- def unary_minus
- Number.new(-value, @numerator_units, @denominator_units)
- end
-
- # The SassScript `*` operation.
- # Its functionality depends on the type of its argument:
- #
- # {Number}
- # : Multiplies the two numbers together, converting units appropriately.
- #
- # {Color}
- # : Multiplies each of the RGB color channels by this number.
- #
- # @param other [Number, Color] The right-hand side of the operator
- # @return [Number, Color] The result of the operation
- # @raise [NoMethodError] if `other` is an invalid type
- def times(other)
- if other.is_a? Number
- operate(other, :*)
- elsif other.is_a? Color
- other.times(self)
- else
- raise NoMethodError.new(nil, :times)
- end
- end
-
- # The SassScript `/` operation.
- # Its functionality depends on the type of its argument:
- #
- # {Number}
- # : Divides this number by the other, converting units appropriately.
- #
- # {Literal}
- # : See {Literal#div}.
- #
- # @param other [Literal] The right-hand side of the operator
- # @return [Literal] The result of the operation
- def div(other)
- if other.is_a? Number
- res = operate(other, :/)
- if self.original && other.original
- res.original = "#{self.original}/#{other.original}"
- end
- res
- else
- super
- end
- end
-
- # The SassScript `%` operation.
- #
- # @param other [Number] The right-hand side of the operator
- # @return [Number] This number modulo the other
- # @raise [NoMethodError] if `other` is an invalid type
- # @raise [Sass::UnitConversionError] if `other` has any units
- def mod(other)
- if other.is_a?(Number)
- unless other.unitless?
- raise Sass::UnitConversionError.new("Cannot modulo by a number with units: #{other.inspect}.")
- end
- operate(other, :%)
- else
- raise NoMethodError.new(nil, :mod)
- end
- end
-
- # The SassScript `==` operation.
- #
- # @param other [Literal] The right-hand side of the operator
- # @return [Boolean] Whether this number is equal to the other object
- def eq(other)
- return Sass::Script::Bool.new(false) unless other.is_a?(Sass::Script::Number)
- this = self
- begin
- if unitless?
- this = this.coerce(other.numerator_units, other.denominator_units)
- else
- other = other.coerce(@numerator_units, @denominator_units)
- end
- rescue Sass::UnitConversionError
- return Sass::Script::Bool.new(false)
- end
-
- Sass::Script::Bool.new(this.value == other.value)
- end
-
- # The SassScript `>` operation.
- #
- # @param other [Number] The right-hand side of the operator
- # @return [Boolean] Whether this number is greater than the other
- # @raise [NoMethodError] if `other` is an invalid type
- def gt(other)
- raise NoMethodError.new(nil, :gt) unless other.is_a?(Number)
- operate(other, :>)
- end
-
- # The SassScript `>=` operation.
- #
- # @param other [Number] The right-hand side of the operator
- # @return [Boolean] Whether this number is greater than or equal to the other
- # @raise [NoMethodError] if `other` is an invalid type
- def gte(other)
- raise NoMethodError.new(nil, :gte) unless other.is_a?(Number)
- operate(other, :>=)
- end
-
- # The SassScript `<` operation.
- #
- # @param other [Number] The right-hand side of the operator
- # @return [Boolean] Whether this number is less than the other
- # @raise [NoMethodError] if `other` is an invalid type
- def lt(other)
- raise NoMethodError.new(nil, :lt) unless other.is_a?(Number)
- operate(other, :<)
- end
-
- # The SassScript `<=` operation.
- #
- # @param other [Number] The right-hand side of the operator
- # @return [Boolean] Whether this number is less than or equal to the other
- # @raise [NoMethodError] if `other` is an invalid type
- def lte(other)
- raise NoMethodError.new(nil, :lte) unless other.is_a?(Number)
- operate(other, :<=)
- end
-
- # @return [String] The CSS representation of this number
- # @raise [Sass::SyntaxError] if this number has units that can't be used in CSS
- # (e.g. `px*in`)
- def to_s(opts = {})
- return original if original
- raise Sass::SyntaxError.new("#{inspect} isn't a valid CSS value.") unless legal_units?
- inspect
- end
-
- # Returns a readable representation of this number.
- #
- # This representation is valid CSS (and valid SassScript)
- # as long as there is only one unit.
- #
- # @return [String] The representation
- def inspect(opts = {})
- value = self.class.round(self.value)
- unitless? ? value.to_s : "#{value}#{unit_str}"
- end
- alias_method :to_sass, :inspect
-
- # @return [Fixnum] The integer value of the number
- # @raise [Sass::SyntaxError] if the number isn't an integer
- def to_i
- super unless int?
- return value
- end
-
- # @return [Boolean] Whether or not this number is an integer.
- def int?
- value % 1 == 0.0
- end
-
- # @return [Boolean] Whether or not this number has no units.
- def unitless?
- @numerator_units.empty? && @denominator_units.empty?
- end
-
- # @return [Boolean] Whether or not this number has units that can be represented in CSS
- # (that is, zero or one \{#numerator\_units}).
- def legal_units?
- (@numerator_units.empty? || @numerator_units.size == 1) && @denominator_units.empty?
- end
-
- # Returns this number converted to other units.
- # The conversion takes into account the relationship between e.g. mm and cm,
- # as well as between e.g. in and cm.
- #
- # If this number has no units, it will simply return itself
- # with the given units.
- #
- # An incompatible coercion, e.g. between px and cm, will raise an error.
- #
- # @param num_units [Array] The numerator units to coerce this number into.
- # See {\#numerator\_units}
- # @param den_units [Array] The denominator units to coerce this number into.
- # See {\#denominator\_units}
- # @return [Number] The number with the new units
- # @raise [Sass::UnitConversionError] if the given units are incompatible with the number's
- # current units
- def coerce(num_units, den_units)
- Number.new(if unitless?
- self.value
- else
- self.value * coercion_factor(@numerator_units, num_units) /
- coercion_factor(@denominator_units, den_units)
- end, num_units, den_units)
- end
-
- # @param other [Number] A number to decide if it can be compared with this number.
- # @return [Boolean] Whether or not this number can be compared with the other.
- def comparable_to?(other)
- begin
- operate(other, :+)
- true
- rescue Sass::UnitConversionError
- false
- end
- end
-
- # Returns a human readable representation of the units in this number.
- # For complex units this takes the form of:
- # numerator_unit1 * numerator_unit2 / denominator_unit1 * denominator_unit2
- # @return [String] a string that represents the units in this number
- def unit_str
- rv = @numerator_units.sort.join("*")
- if @denominator_units.any?
- rv << "/"
- rv << @denominator_units.sort.join("*")
- end
- rv
- end
-
- private
-
- # @private
- def self.round(num)
- if num.is_a?(Float) && (num.infinite? || num.nan?)
- num
- elsif num % 1 == 0.0
- num.to_i
- else
- (num * PRECISION).round / PRECISION
- end
- end
-
- OPERATIONS = [:+, :-, :<=, :<, :>, :>=]
-
- def operate(other, operation)
- this = self
- if OPERATIONS.include?(operation)
- if unitless?
- this = this.coerce(other.numerator_units, other.denominator_units)
- else
- other = other.coerce(@numerator_units, @denominator_units)
- end
- end
- # avoid integer division
- value = (:/ == operation) ? this.value.to_f : this.value
- result = value.send(operation, other.value)
-
- if result.is_a?(Numeric)
- Number.new(result, *compute_units(this, other, operation))
- else # Boolean op
- Bool.new(result)
- end
- end
-
- def coercion_factor(from_units, to_units)
- # get a list of unmatched units
- from_units, to_units = sans_common_units(from_units, to_units)
-
- if from_units.size != to_units.size || !convertable?(from_units | to_units)
- raise Sass::UnitConversionError.new("Incompatible units: '#{from_units.join('*')}' and '#{to_units.join('*')}'.")
- end
-
- from_units.zip(to_units).inject(1) {|m,p| m * conversion_factor(p[0], p[1]) }
- end
-
- def compute_units(this, other, operation)
- case operation
- when :*
- [this.numerator_units + other.numerator_units, this.denominator_units + other.denominator_units]
- when :/
- [this.numerator_units + other.denominator_units, this.denominator_units + other.numerator_units]
- else
- [this.numerator_units, this.denominator_units]
- end
- end
-
- def normalize!
- return if unitless?
- @numerator_units, @denominator_units = sans_common_units(@numerator_units, @denominator_units)
-
- @denominator_units.each_with_index do |d, i|
- if convertable?(d) && (u = @numerator_units.detect(&method(:convertable?)))
- @value /= conversion_factor(d, u)
- @denominator_units.delete_at(i)
- @numerator_units.delete_at(@numerator_units.index(u))
- end
- end
- end
-
- # A hash of unit names to their index in the conversion table
- CONVERTABLE_UNITS = {"in" => 0, "cm" => 1, "pc" => 2, "mm" => 3, "pt" => 4}
- CONVERSION_TABLE = [[ 1, 2.54, 6, 25.4, 72 ], # in
- [ nil, 1, 2.36220473, 10, 28.3464567], # cm
- [ nil, nil, 1, 4.23333333, 12 ], # pc
- [ nil, nil, nil, 1, 2.83464567], # mm
- [ nil, nil, nil, nil, 1 ]] # pt
-
- def conversion_factor(from_unit, to_unit)
- res = CONVERSION_TABLE[CONVERTABLE_UNITS[from_unit]][CONVERTABLE_UNITS[to_unit]]
- return 1.0 / conversion_factor(to_unit, from_unit) if res.nil?
- res
- end
-
- def convertable?(units)
- Array(units).all? {|u| CONVERTABLE_UNITS.include?(u)}
- end
-
- def sans_common_units(units1, units2)
- units2 = units2.dup
- # Can't just use -, because we want px*px to coerce properly to px*mm
- return units1.map do |u|
- next u unless j = units2.index(u)
- units2.delete_at(j)
- nil
- end.compact, units2
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/operation.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/operation.rb
deleted file mode 100644
index 35af57f5c7..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/operation.rb
+++ /dev/null
@@ -1,91 +0,0 @@
-require 'set'
-require 'sass/script/string'
-require 'sass/script/number'
-require 'sass/script/color'
-require 'sass/script/functions'
-require 'sass/script/unary_operation'
-require 'sass/script/interpolation'
-require 'sass/script/string_interpolation'
-
-module Sass::Script
- # A SassScript parse node representing a binary operation,
- # such as `$a + $b` or `"foo" + 1`.
- class Operation < Node
- attr_reader :operand1
- attr_reader :operand2
- attr_reader :operator
-
- # @param operand1 [Script::Node] The parse-tree node
- # for the right-hand side of the operator
- # @param operand2 [Script::Node] The parse-tree node
- # for the left-hand side of the operator
- # @param operator [Symbol] The operator to perform.
- # This should be one of the binary operator names in {Lexer::OPERATORS}
- def initialize(operand1, operand2, operator)
- @operand1 = operand1
- @operand2 = operand2
- @operator = operator
- super()
- end
-
- # @return [String] A human-readable s-expression representation of the operation
- def inspect
- "(#{@operator.inspect} #{@operand1.inspect} #{@operand2.inspect})"
- end
-
- # @see Node#to_sass
- def to_sass(opts = {})
- pred = Sass::Script::Parser.precedence_of(@operator)
- o1 = operand_to_sass @operand1, :left, opts
- o2 = operand_to_sass @operand2, :right, opts
- sep =
- case @operator
- when :comma; ", "
- when :space; " "
- else; " #{Lexer::OPERATORS_REVERSE[@operator]} "
- end
- "#{o1}#{sep}#{o2}"
- end
-
- # Returns the operands for this operation.
- #
- # @return [Array]
- # @see Node#children
- def children
- [@operand1, @operand2]
- end
-
- protected
-
- # Evaluates the operation.
- #
- # @param environment [Sass::Environment] The environment in which to evaluate the SassScript
- # @return [Literal] The SassScript object that is the value of the operation
- # @raise [Sass::SyntaxError] if the operation is undefined for the operands
- def _perform(environment)
- literal1 = @operand1.perform(environment)
- literal2 = @operand2.perform(environment)
-
- begin
- opts(literal1.send(@operator, literal2))
- rescue NoMethodError => e
- raise e unless e.name.to_s == @operator.to_s
- raise Sass::SyntaxError.new("Undefined operation: \"#{literal1} #{@operator} #{literal2}\".")
- end
- end
-
- private
-
- def operand_to_sass(op, side, opts)
- return "(#{op.to_sass(opts)})" if op.is_a?(List)
- return op.to_sass(opts) unless op.is_a?(Operation)
-
- pred = Sass::Script::Parser.precedence_of(@operator)
- sub_pred = Sass::Script::Parser.precedence_of(op.operator)
- assoc = Sass::Script::Parser.associative?(@operator)
- return "(#{op.to_sass(opts)})" if sub_pred < pred ||
- (side == :right && sub_pred == pred && !assoc)
- op.to_sass(opts)
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/parser.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/parser.rb
deleted file mode 100644
index e38e5b6f92..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/parser.rb
+++ /dev/null
@@ -1,467 +0,0 @@
-require 'sass/script/lexer'
-
-module Sass
- module Script
- # The parser for SassScript.
- # It parses a string of code into a tree of {Script::Node}s.
- class Parser
- # The line number of the parser's current position.
- #
- # @return [Fixnum]
- def line
- @lexer.line
- end
-
- # @param str [String, StringScanner] The source text to parse
- # @param line [Fixnum] The line on which the SassScript appears.
- # Used for error reporting
- # @param offset [Fixnum] The number of characters in on which the SassScript appears.
- # Used for error reporting
- # @param options [{Symbol => Object}] An options hash;
- # see {file:SASS_REFERENCE.md#sass_options the Sass options documentation}
- def initialize(str, line, offset, options = {})
- @options = options
- @lexer = lexer_class.new(str, line, offset, options)
- end
-
- # Parses a SassScript expression within an interpolated segment (`#{}`).
- # This means that it stops when it comes across an unmatched `}`,
- # which signals the end of an interpolated segment,
- # it returns rather than throwing an error.
- #
- # @return [Script::Node] The root node of the parse tree
- # @raise [Sass::SyntaxError] if the expression isn't valid SassScript
- def parse_interpolated
- expr = assert_expr :expr
- assert_tok :end_interpolation
- expr.options = @options
- expr
- rescue Sass::SyntaxError => e
- e.modify_backtrace :line => @lexer.line, :filename => @options[:filename]
- raise e
- end
-
- # Parses a SassScript expression.
- #
- # @return [Script::Node] The root node of the parse tree
- # @raise [Sass::SyntaxError] if the expression isn't valid SassScript
- def parse
- expr = assert_expr :expr
- assert_done
- expr.options = @options
- expr
- rescue Sass::SyntaxError => e
- e.modify_backtrace :line => @lexer.line, :filename => @options[:filename]
- raise e
- end
-
- # Parses a SassScript expression,
- # ending it when it encounters one of the given identifier tokens.
- #
- # @param [#include?(String)] A set of strings that delimit the expression.
- # @return [Script::Node] The root node of the parse tree
- # @raise [Sass::SyntaxError] if the expression isn't valid SassScript
- def parse_until(tokens)
- @stop_at = tokens
- expr = assert_expr :expr
- assert_done
- expr.options = @options
- expr
- rescue Sass::SyntaxError => e
- e.modify_backtrace :line => @lexer.line, :filename => @options[:filename]
- raise e
- end
-
- # Parses the argument list for a mixin include.
- #
- # @return [(Array, {String => Script::Note})]
- # The root nodes of the arguments.
- # Keyword arguments are in a hash from names to values.
- # @raise [Sass::SyntaxError] if the argument list isn't valid SassScript
- def parse_mixin_include_arglist
- args, keywords = [], {}
- if try_tok(:lparen)
- args, keywords = mixin_arglist || [[], {}]
- assert_tok(:rparen)
- end
- assert_done
-
- args.each {|a| a.options = @options}
- keywords.each {|k, v| v.options = @options}
- return args, keywords
- rescue Sass::SyntaxError => e
- e.modify_backtrace :line => @lexer.line, :filename => @options[:filename]
- raise e
- end
-
- # Parses the argument list for a mixin definition.
- #
- # @return [Array] The root nodes of the arguments.
- # @raise [Sass::SyntaxError] if the argument list isn't valid SassScript
- def parse_mixin_definition_arglist
- args = defn_arglist!(false)
- assert_done
-
- args.each do |k, v|
- k.options = @options
- v.options = @options if v
- end
- args
- rescue Sass::SyntaxError => e
- e.modify_backtrace :line => @lexer.line, :filename => @options[:filename]
- raise e
- end
-
- # Parses the argument list for a function definition.
- #
- # @return [Array] The root nodes of the arguments.
- # @raise [Sass::SyntaxError] if the argument list isn't valid SassScript
- def parse_function_definition_arglist
- args = defn_arglist!(true)
- assert_done
-
- args.each do |k, v|
- k.options = @options
- v.options = @options if v
- end
- args
- rescue Sass::SyntaxError => e
- e.modify_backtrace :line => @lexer.line, :filename => @options[:filename]
- raise e
- end
-
- # Parses a SassScript expression.
- #
- # @overload parse(str, line, offset, filename = nil)
- # @return [Script::Node] The root node of the parse tree
- # @see Parser#initialize
- # @see Parser#parse
- def self.parse(*args)
- new(*args).parse
- end
-
- PRECEDENCE = [
- :comma, :single_eq, :space, :or, :and,
- [:eq, :neq],
- [:gt, :gte, :lt, :lte],
- [:plus, :minus],
- [:times, :div, :mod],
- ]
-
- ASSOCIATIVE = [:plus, :times]
-
- class << self
- # Returns an integer representing the precedence
- # of the given operator.
- # A lower integer indicates a looser binding.
- #
- # @private
- def precedence_of(op)
- PRECEDENCE.each_with_index do |e, i|
- return i if Array(e).include?(op)
- end
- raise "[BUG] Unknown operator #{op}"
- end
-
- # Returns whether or not the given operation is associative.
- #
- # @private
- def associative?(op)
- ASSOCIATIVE.include?(op)
- end
-
- private
-
- # Defines a simple left-associative production.
- # name is the name of the production,
- # sub is the name of the production beneath it,
- # and ops is a list of operators for this precedence level
- def production(name, sub, *ops)
- class_eval < assert_expr(subexpr, EXPR_NAMES[type])}
- end
-
- unless try_tok(:comma)
- return [], keywords if keywords
- return [e], {}
- end
-
- other_args, other_keywords = assert_expr(type)
- if keywords
- if other_keywords[name.underscored_name]
- raise SyntaxError.new("Keyword argument \"#{name.to_sass}\" passed more than once")
- end
- return other_args, keywords.merge(other_keywords)
- else
- return [e, *other_args], other_keywords
- end
- end
-
- def keyword_arglist
- return unless var = try_tok(:const)
- unless try_tok(:colon)
- return_tok!
- return
- end
- name = var[1]
- value = interpolation
- return {name => value} unless try_tok(:comma)
- {name => value}.merge(assert_expr(:keyword_arglist))
- end
-
- def raw
- return special_fun unless tok = try_tok(:raw)
- node(Script::String.new(tok.value))
- end
-
- def special_fun
- return paren unless tok = try_tok(:special_fun)
- first = node(Script::String.new(tok.value.first))
- Sass::Util.enum_slice(tok.value[1..-1], 2).inject(first) do |l, (i, r)|
- Script::Interpolation.new(
- l, i, r && node(Script::String.new(r)),
- false, false)
- end
- end
-
- def paren
- return variable unless try_tok(:lparen)
- was_in_parens = @in_parens
- @in_parens = true
- line = @lexer.line
- e = expr
- assert_tok(:rparen)
- return e || node(List.new([], :space), line)
- ensure
- @in_parens = was_in_parens
- end
-
- def variable
- return string unless c = try_tok(:const)
- node(Variable.new(*c.value))
- end
-
- def string
- return number unless first = try_tok(:string)
- return first.value unless try_tok(:begin_interpolation)
- line = @lexer.line
- mid = parse_interpolated
- last = assert_expr(:string)
- interp = StringInterpolation.new(first.value, mid, last)
- interp.line = line
- interp
- end
-
- def number
- return literal unless tok = try_tok(:number)
- num = tok.value
- num.original = num.to_s unless @in_parens
- num
- end
-
- def literal
- (t = try_tok(:color, :bool)) && (return t.value)
- end
-
- # It would be possible to have unified #assert and #try methods,
- # but detecting the method/token difference turns out to be quite expensive.
-
- EXPR_NAMES = {
- :string => "string",
- :default => "expression (e.g. 1px, bold)",
- :mixin_arglist => "mixin argument",
- :fn_arglist => "function argument",
- }
-
- def assert_expr(name, expected = nil)
- (e = send(name)) && (return e)
- @lexer.expected!(expected || EXPR_NAMES[name] || EXPR_NAMES[:default])
- end
-
- def assert_tok(*names)
- (t = try_tok(*names)) && (return t)
- @lexer.expected!(names.map {|tok| Lexer::TOKEN_NAMES[tok] || tok}.join(" or "))
- end
-
- def try_tok(*names)
- peeked = @lexer.peek
- peeked && names.include?(peeked.type) && @lexer.next
- end
-
- def assert_done
- return if @lexer.done?
- @lexer.expected!(EXPR_NAMES[:default])
- end
-
- def node(node, line = @lexer.line)
- node.line = line
- node
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/string.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/string.rb
deleted file mode 100644
index e2007b2472..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/string.rb
+++ /dev/null
@@ -1,51 +0,0 @@
-require 'sass/script/literal'
-
-module Sass::Script
- # A SassScript object representing a CSS string *or* a CSS identifier.
- class String < Literal
- # The Ruby value of the string.
- #
- # @return [String]
- attr_reader :value
-
- # Whether this is a CSS string or a CSS identifier.
- # The difference is that strings are written with double-quotes,
- # while identifiers aren't.
- #
- # @return [Symbol] `:string` or `:identifier`
- attr_reader :type
-
- # Creates a new string.
- #
- # @param value [String] See \{#value}
- # @param type [Symbol] See \{#type}
- def initialize(value, type = :identifier)
- super(value)
- @type = type
- end
-
- # @see Literal#plus
- def plus(other)
- other_str = other.is_a?(Sass::Script::String) ? other.value : other.to_s
- Sass::Script::String.new(self.value + other_str, self.type)
- end
-
- # @see Node#to_s
- def to_s(opts = {})
- if @type == :identifier
- return @value.tr("\n", " ")
- end
-
- return "\"#{value.gsub('"', "\\\"")}\"" if opts[:quote] == %q{"}
- return "'#{value.gsub("'", "\\'")}'" if opts[:quote] == %q{'}
- return "\"#{value}\"" unless value.include?('"')
- return "'#{value}'" unless value.include?("'")
- "\"#{value.gsub('"', "\\\"")}\"" #'
- end
-
- # @see Node#to_sass
- def to_sass(opts = {})
- to_s
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/string_interpolation.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/string_interpolation.rb
deleted file mode 100644
index 6706f809a5..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/string_interpolation.rb
+++ /dev/null
@@ -1,94 +0,0 @@
-module Sass::Script
- # A SassScript object representing `#{}` interpolation within a string.
- #
- # @see Interpolation
- class StringInterpolation < Node
- # Interpolation in a string is of the form `"before #{mid} after"`,
- # where `before` and `after` may include more interpolation.
- #
- # @param before [Node] The string before the interpolation
- # @param mid [Node] The SassScript within the interpolation
- # @param after [Node] The string after the interpolation
- def initialize(before, mid, after)
- @before = before
- @mid = mid
- @after = after
- end
-
- # @return [String] A human-readable s-expression representation of the interpolation
- def inspect
- "(string_interpolation #{@before.inspect} #{@mid.inspect} #{@after.inspect})"
- end
-
- # @see Node#to_sass
- def to_sass(opts = {})
- # We can get rid of all of this when we remove the deprecated :equals context
- # XXX CE: It's gone now but I'm not sure what can be removed now.
- before_unquote, before_quote_char, before_str = parse_str(@before.to_sass(opts))
- after_unquote, after_quote_char, after_str = parse_str(@after.to_sass(opts))
- unquote = before_unquote || after_unquote ||
- (before_quote_char && !after_quote_char && !after_str.empty?) ||
- (!before_quote_char && after_quote_char && !before_str.empty?)
- quote_char =
- if before_quote_char && after_quote_char && before_quote_char != after_quote_char
- before_str.gsub!("\\'", "'")
- before_str.gsub!('"', "\\\"")
- after_str.gsub!("\\'", "'")
- after_str.gsub!('"', "\\\"")
- '"'
- else
- before_quote_char || after_quote_char
- end
-
- res = ""
- res << 'unquote(' if unquote
- res << quote_char if quote_char
- res << before_str
- res << '#{' << @mid.to_sass(opts) << '}'
- res << after_str
- res << quote_char if quote_char
- res << ')' if unquote
- res
- end
-
- # Returns the three components of the interpolation, `before`, `mid`, and `after`.
- #
- # @return [Array]
- # @see #initialize
- # @see Node#children
- def children
- [@before, @mid, @after].compact
- end
-
- protected
-
- # Evaluates the interpolation.
- #
- # @param environment [Sass::Environment] The environment in which to evaluate the SassScript
- # @return [Sass::Script::String] The SassScript string that is the value of the interpolation
- def _perform(environment)
- res = ""
- before = @before.perform(environment)
- res << before.value
- mid = @mid.perform(environment)
- res << (mid.is_a?(Sass::Script::String) ? mid.value : mid.to_s)
- res << @after.perform(environment).value
- opts(Sass::Script::String.new(res, before.type))
- end
-
- private
-
- def parse_str(str)
- case str
- when /^unquote\((["'])(.*)\1\)$/
- return true, $1, $2
- when '""'
- return false, nil, ""
- when /^(["'])(.*)\1$/
- return false, $1, $2
- else
- return false, nil, str
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/unary_operation.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/unary_operation.rb
deleted file mode 100644
index 1ccceb3b6a..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/unary_operation.rb
+++ /dev/null
@@ -1,57 +0,0 @@
-module Sass::Script
- # A SassScript parse node representing a unary operation,
- # such as `-$b` or `not true`.
- #
- # Currently only `-`, `/`, and `not` are unary operators.
- class UnaryOperation < Node
- # @param operand [Script::Node] The parse-tree node
- # for the object of the operator
- # @param operator [Symbol] The operator to perform
- def initialize(operand, operator)
- @operand = operand
- @operator = operator
- super()
- end
-
- # @return [String] A human-readable s-expression representation of the operation
- def inspect
- "(#{@operator.inspect} #{@operand.inspect})"
- end
-
- # @see Node#to_sass
- def to_sass(opts = {})
- operand = @operand.to_sass(opts)
- if @operand.is_a?(Operation) ||
- (@operator == :minus &&
- (operand =~ Sass::SCSS::RX::IDENT) == 0)
- operand = "(#{@operand.to_sass(opts)})"
- end
- op = Lexer::OPERATORS_REVERSE[@operator]
- op + (op =~ /[a-z]/ ? " " : "") + operand
- end
-
- # Returns the operand of the operation.
- #
- # @return [Array]
- # @see Node#children
- def children
- [@operand]
- end
-
- protected
-
- # Evaluates the operation.
- #
- # @param environment [Sass::Environment] The environment in which to evaluate the SassScript
- # @return [Literal] The SassScript object that is the value of the operation
- # @raise [Sass::SyntaxError] if the operation is undefined for the operand
- def _perform(environment)
- operator = "unary_#{@operator}"
- literal = @operand.perform(environment)
- literal.send(operator)
- rescue NoMethodError => e
- raise e unless e.name.to_s == operator.to_s
- raise Sass::SyntaxError.new("Undefined unary operation: \"#{@operator} #{literal}\".")
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/variable.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/variable.rb
deleted file mode 100644
index 0633b10a5f..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/script/variable.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-module Sass
- module Script
- # A SassScript parse node representing a variable.
- class Variable < Node
- # The name of the variable.
- #
- # @return [String]
- attr_reader :name
-
- # The underscored name of the variable.
- #
- # @return [String]
- attr_reader :underscored_name
-
- # @param name [String] See \{#name}
- def initialize(name)
- @name = name
- @underscored_name = name.gsub(/-/,"_")
- super()
- end
-
- # @return [String] A string representation of the variable
- def inspect(opts = {})
- return "!important" if name == "important"
- "$#{dasherize(name, opts)}"
- end
- alias_method :to_sass, :inspect
-
- # Returns an empty array.
- #
- # @return [Array] empty
- # @see Node#children
- def children
- []
- end
-
- protected
-
- # Evaluates the variable.
- #
- # @param environment [Sass::Environment] The environment in which to evaluate the SassScript
- # @return [Literal] The SassScript object that is the value of the variable
- # @raise [Sass::SyntaxError] if the variable is undefined
- def _perform(environment)
- raise SyntaxError.new("Undefined variable: \"$#{name}\".") unless val = environment.var(name)
- if val.is_a?(Number)
- val = val.dup
- val.original = nil
- end
- return val
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss.rb
deleted file mode 100644
index 8aaf0f6393..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-require 'sass/scss/rx'
-require 'sass/scss/script_lexer'
-require 'sass/scss/script_parser'
-require 'sass/scss/parser'
-require 'sass/scss/sass_parser'
-require 'sass/scss/static_parser'
-require 'sass/scss/css_parser'
-
-module Sass
- # SCSS is the CSS syntax for Sass.
- # It parses into the same syntax tree as Sass,
- # and generates the same sort of output CSS.
- #
- # This module contains code for the parsing of SCSS.
- # The evaluation is handled by the broader {Sass} module.
- module SCSS; end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss/css_parser.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss/css_parser.rb
deleted file mode 100644
index 8964ced17a..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss/css_parser.rb
+++ /dev/null
@@ -1,46 +0,0 @@
-require 'sass/script/css_parser'
-
-module Sass
- module SCSS
- # This is a subclass of {Parser} which only parses plain CSS.
- # It doesn't support any Sass extensions, such as interpolation,
- # parent references, nested selectors, and so forth.
- # It does support all the same CSS hacks as the SCSS parser, though.
- class CssParser < StaticParser
- # Parse a selector, and return its value as a string.
- #
- # @return [String, nil] The parsed selector, or nil if no selector was parsed
- # @raise [Sass::SyntaxError] if there's a syntax error in the selector
- def parse_selector_string
- init_scanner!
- str {return unless selector}
- end
-
- private
-
- def parent_selector; nil; end
- def interpolation; nil; end
- def interp_string; tok(STRING); end
- def interp_ident(ident = IDENT); tok(ident); end
- def use_css_import?; true; end
-
- def block_child(context)
- case context
- when :ruleset
- declaration
- when :stylesheet
- directive || ruleset
- when :directive
- directive || declaration_or_ruleset
- end
- end
-
- def nested_properties!(node, space)
- expected('expression (e.g. 1px, bold)');
- end
-
- @sass_script_parser = Class.new(Sass::Script::CssParser)
- @sass_script_parser.send(:include, ScriptParser)
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss/parser.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss/parser.rb
deleted file mode 100644
index 6c9d059049..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss/parser.rb
+++ /dev/null
@@ -1,920 +0,0 @@
-require 'strscan'
-require 'set'
-
-module Sass
- module SCSS
- # The parser for SCSS.
- # It parses a string of code into a tree of {Sass::Tree::Node}s.
- class Parser
- # @param str [String, StringScanner] The source document to parse.
- # Note that `Parser` *won't* raise a nice error message if this isn't properly parsed;
- # for that, you should use the higher-level {Sass::Engine} or {Sass::CSS}.
- # @param line [Fixnum] The line on which the source string appeared,
- # if it's part of another document
- def initialize(str, line = 1)
- @template = str
- @line = line
- @strs = []
- end
-
- # Parses an SCSS document.
- #
- # @return [Sass::Tree::RootNode] The root node of the document tree
- # @raise [Sass::SyntaxError] if there's a syntax error in the document
- def parse
- init_scanner!
- root = stylesheet
- expected("selector or at-rule") unless @scanner.eos?
- root
- end
-
- # Parses an identifier with interpolation.
- # Note that this won't assert that the identifier takes up the entire input string;
- # it's meant to be used with `StringScanner`s as part of other parsers.
- #
- # @return [Array, nil]
- # The interpolated identifier, or nil if none could be parsed
- def parse_interp_ident
- init_scanner!
- interp_ident
- end
-
- private
-
- include Sass::SCSS::RX
-
- def init_scanner!
- @scanner =
- if @template.is_a?(StringScanner)
- @template
- else
- StringScanner.new(@template.gsub("\r", ""))
- end
- end
-
- def stylesheet
- node = node(Sass::Tree::RootNode.new(@scanner.string))
- block_contents(node, :stylesheet) {s(node)}
- end
-
- def s(node)
- while tok(S) || tok(CDC) || tok(CDO) || (c = tok(SINGLE_LINE_COMMENT)) || (c = tok(COMMENT))
- next unless c
- process_comment c, node
- c = nil
- end
- true
- end
-
- def ss
- nil while tok(S) || tok(SINGLE_LINE_COMMENT) || tok(COMMENT)
- true
- end
-
- def ss_comments(node)
- while tok(S) || (c = tok(SINGLE_LINE_COMMENT)) || (c = tok(COMMENT))
- next unless c
- process_comment c, node
- c = nil
- end
-
- true
- end
-
- def whitespace
- return unless tok(S) || tok(SINGLE_LINE_COMMENT) || tok(COMMENT)
- ss
- end
-
- def process_comment(text, node)
- single_line = text =~ /^\/\//
- pre_str = single_line ? "" : @scanner.
- string[0...@scanner.pos].
- reverse[/.*?\*\/(.*?)($|\Z)/, 1].
- reverse.gsub(/[^\s]/, ' ')
- text = text.sub(/^\s*\/\//, '/*').gsub(/^\s*\/\//, ' *') + ' */' if single_line
- comment = Sass::Tree::CommentNode.new(pre_str + text, single_line)
- comment.line = @line - text.count("\n")
- node << comment
- end
-
- DIRECTIVES = Set[:mixin, :include, :function, :return, :debug, :warn, :for,
- :each, :while, :if, :else, :extend, :import, :media, :charset]
-
- def directive
- return unless tok(/@/)
- name = tok!(IDENT)
- ss
-
- if dir = special_directive(name)
- return dir
- end
-
- # Most at-rules take expressions (e.g. @import),
- # but some (e.g. @page) take selector-like arguments
- val = str {break unless expr}
- val ||= CssParser.new(@scanner, @line).parse_selector_string
- node = node(Sass::Tree::DirectiveNode.new("@#{name} #{val}".strip))
-
- if tok(/\{/)
- node.has_children = true
- block_contents(node, :directive)
- tok!(/\}/)
- end
-
- node
- end
-
- def special_directive(name)
- sym = name.gsub('-', '_').to_sym
- DIRECTIVES.include?(sym) && send("#{sym}_directive")
- end
-
- def mixin_directive
- name = tok! IDENT
- args = sass_script(:parse_mixin_definition_arglist)
- ss
- block(node(Sass::Tree::MixinDefNode.new(name, args)), :directive)
- end
-
- def include_directive
- name = tok! IDENT
- args, keywords = sass_script(:parse_mixin_include_arglist)
- ss
- node(Sass::Tree::MixinNode.new(name, args, keywords))
- end
-
- def function_directive
- name = tok! IDENT
- args = sass_script(:parse_function_definition_arglist)
- ss
- block(node(Sass::Tree::FunctionNode.new(name, args)), :function)
- end
-
- def return_directive
- node(Sass::Tree::ReturnNode.new(sass_script(:parse)))
- end
-
- def debug_directive
- node(Sass::Tree::DebugNode.new(sass_script(:parse)))
- end
-
- def warn_directive
- node(Sass::Tree::WarnNode.new(sass_script(:parse)))
- end
-
- def for_directive
- tok!(/\$/)
- var = tok! IDENT
- ss
-
- tok!(/from/)
- from = sass_script(:parse_until, Set["to", "through"])
- ss
-
- @expected = '"to" or "through"'
- exclusive = (tok(/to/) || tok!(/through/)) == 'to'
- to = sass_script(:parse)
- ss
-
- block(node(Sass::Tree::ForNode.new(var, from, to, exclusive)), :directive)
- end
-
- def each_directive
- tok!(/\$/)
- var = tok! IDENT
- ss
-
- tok!(/in/)
- list = sass_script(:parse)
- ss
-
- block(node(Sass::Tree::EachNode.new(var, list)), :directive)
- end
-
- def while_directive
- expr = sass_script(:parse)
- ss
- block(node(Sass::Tree::WhileNode.new(expr)), :directive)
- end
-
- def if_directive
- expr = sass_script(:parse)
- ss
- node = block(node(Sass::Tree::IfNode.new(expr)), :directive)
- pos = @scanner.pos
- line = @line
- ss
-
- else_block(node) ||
- begin
- # Backtrack in case there are any comments we want to parse
- @scanner.pos = pos
- @line = line
- node
- end
- end
-
- def else_block(node)
- return unless tok(/@else/)
- ss
- else_node = block(
- Sass::Tree::IfNode.new((sass_script(:parse) if tok(/if/))),
- :directive)
- node.add_else(else_node)
- pos = @scanner.pos
- line = @line
- ss
-
- else_block(node) ||
- begin
- # Backtrack in case there are any comments we want to parse
- @scanner.pos = pos
- @line = line
- node
- end
- end
-
- def else_directive
- err("Invalid CSS: @else must come after @if")
- end
-
- def extend_directive
- node(Sass::Tree::ExtendNode.new(expr!(:selector)))
- end
-
- def import_directive
- values = []
-
- loop do
- values << expr!(:import_arg)
- break if use_css_import? || !tok(/,\s*/)
- end
-
- return values
- end
-
- def import_arg
- return unless arg = tok(STRING) || (uri = tok!(URI))
- path = @scanner[1] || @scanner[2] || @scanner[3]
- ss
-
- media = str {media_query_list}.strip
-
- if uri || path =~ /^http:\/\// || !media.strip.empty? || use_css_import?
- return node(Sass::Tree::DirectiveNode.new("@import #{arg} #{media}".strip))
- end
-
- node(Sass::Tree::ImportNode.new(path.strip))
- end
-
- def use_css_import?; false; end
-
- def media_directive
- val = str {media_query_list}.strip
- block(node(Sass::Tree::MediaNode.new(val)), :directive)
- end
-
- # http://www.w3.org/TR/css3-mediaqueries/#syntax
- def media_query_list
- return unless media_query
-
- ss
- while tok(/,/)
- ss; expr!(:media_query); ss
- end
-
- true
- end
-
- def media_query
- if tok(/only|not/i)
- ss
- @expected = "media type (e.g. print, screen)"
- tok!(IDENT)
- ss
- elsif !tok(IDENT) && !media_expr
- return
- end
-
- ss
- while tok(/and/i)
- ss; expr!(:media_expr); ss
- end
-
- true
- end
-
- def media_expr
- return unless tok(/\(/)
- ss
- @expected = "media feature (e.g. min-device-width, color)"
- tok!(IDENT)
- ss
-
- if tok(/:/)
- ss; expr!(:expr)
- end
- tok!(/\)/)
- ss
-
- true
- end
-
- def charset_directive
- tok! STRING
- name = @scanner[1] || @scanner[2]
- ss
- node(Sass::Tree::CharsetNode.new(name))
- end
-
- def variable
- return unless tok(/\$/)
- name = tok!(IDENT)
- ss; tok!(/:/); ss
-
- expr = sass_script(:parse)
- guarded = tok(DEFAULT)
- node(Sass::Tree::VariableNode.new(name, expr, guarded))
- end
-
- def operator
- # Many of these operators (all except / and ,)
- # are disallowed by the CSS spec,
- # but they're included here for compatibility
- # with some proprietary MS properties
- str {ss if tok(/[\/,:.=]/)}
- end
-
- def unary_operator
- tok(/[+-]/)
- end
-
- def ruleset
- return unless rules = selector_sequence
- block(node(Sass::Tree::RuleNode.new(rules.flatten.compact)), :ruleset)
- end
-
- def block(node, context)
- node.has_children = true
- tok!(/\{/)
- block_contents(node, context)
- tok!(/\}/)
- node
- end
-
- # A block may contain declarations and/or rulesets
- def block_contents(node, context)
- block_given? ? yield : ss_comments(node)
- node << (child = block_child(context))
- while tok(/;/) || has_children?(child)
- block_given? ? yield : ss_comments(node)
- node << (child = block_child(context))
- end
- node
- end
-
- def block_child(context)
- return variable || directive if context == :function
- return variable || directive || ruleset if context == :stylesheet
- variable || directive || declaration_or_ruleset
- end
-
- def has_children?(child_or_array)
- return false unless child_or_array
- return child_or_array.last.has_children if child_or_array.is_a?(Array)
- return child_or_array.has_children
- end
-
- # This is a nasty hack, and the only place in the parser
- # that requires backtracking.
- # The reason is that we can't figure out if certain strings
- # are declarations or rulesets with fixed finite lookahead.
- # For example, "foo:bar baz baz baz..." could be either a property
- # or a selector.
- #
- # To handle this, we simply check if it works as a property
- # (which is the most common case)
- # and, if it doesn't, try it as a ruleset.
- #
- # We could eke some more efficiency out of this
- # by handling some easy cases (first token isn't an identifier,
- # no colon after the identifier, whitespace after the colon),
- # but I'm not sure the gains would be worth the added complexity.
- def declaration_or_ruleset
- old_use_property_exception, @use_property_exception =
- @use_property_exception, false
- decl_err = catch_error do
- decl = declaration
- unless decl && decl.has_children
- # We want an exception if it's not there,
- # but we don't want to consume if it is
- tok!(/[;}]/) unless tok?(/[;}]/)
- end
- return decl
- end
-
- ruleset_err = catch_error {return ruleset}
- rethrow(@use_property_exception ? decl_err : ruleset_err)
- ensure
- @use_property_exception = old_use_property_exception
- end
-
- def selector_sequence
- if sel = tok(STATIC_SELECTOR)
- return [sel]
- end
-
- rules = []
- return unless v = selector
- rules.concat v
-
- ws = ''
- while tok(/,/)
- ws << str {ss}
- if v = selector
- rules << ',' << ws
- rules.concat v
- ws = ''
- end
- end
- rules
- end
-
- def selector
- return unless sel = _selector
- sel.to_a
- end
-
- def selector_comma_sequence
- return unless sel = _selector
- selectors = [sel]
- ws = ''
- while tok(/,/)
- ws << str{ss}
- if sel = _selector
- selectors << sel
- selectors[-1] = Selector::Sequence.new(["\n"] + selectors.last.members) if ws.include?("\n")
- ws = ''
- end
- end
- Selector::CommaSequence.new(selectors)
- end
-
- def _selector
- # The combinator here allows the "> E" hack
- return unless val = combinator || simple_selector_sequence
- nl = str{ss}.include?("\n")
- res = []
- res << val
- res << "\n" if nl
-
- while val = combinator || simple_selector_sequence
- res << val
- res << "\n" if str{ss}.include?("\n")
- end
- Selector::Sequence.new(res.compact)
- end
-
- def combinator
- tok(PLUS) || tok(GREATER) || tok(TILDE)
- end
-
- def simple_selector_sequence
- # This allows for stuff like http://www.w3.org/TR/css3-animations/#keyframes-
- return expr unless e = element_name || id_selector || class_selector ||
- attrib || negation || pseudo || parent_selector || interpolation_selector
- res = [e]
-
- # The tok(/\*/) allows the "E*" hack
- while v = element_name || id_selector || class_selector ||
- attrib || negation || pseudo || interpolation_selector ||
- (tok(/\*/) && Selector::Universal.new(nil))
- res << v
- end
-
- if tok?(/&/)
- begin
- expected('"{"')
- rescue Sass::SyntaxError => e
- e.message << "\n\n" << < e
- throw(:_sass_parser_error, true) if @throw_error
- raise e
- end
-
- def merge(arr)
- arr && Sass::Util.merge_adjacent_strings([arr].flatten)
- end
-
- EXPR_NAMES = {
- :media_query => "media query (e.g. print, screen, print and screen)",
- :media_expr => "media expression (e.g. (min-device-width: 800px)))",
- :pseudo_expr => "expression (e.g. fr, 2n+1)",
- :interp_ident => "identifier",
- :interp_name => "identifier",
- :expr => "expression (e.g. 1px, bold)",
- :_selector => "selector",
- :selector_comma_sequence => "selector",
- :simple_selector_sequence => "selector",
- :import_arg => "file to import (string or url())",
- }
-
- TOK_NAMES = Sass::Util.to_hash(
- Sass::SCSS::RX.constants.map {|c| [Sass::SCSS::RX.const_get(c), c.downcase]}).
- merge(IDENT => "identifier", /[;}]/ => '";"')
-
- def tok?(rx)
- @scanner.match?(rx)
- end
-
- def expr!(name)
- (e = send(name)) && (return e)
- expected(EXPR_NAMES[name] || name.to_s)
- end
-
- def tok!(rx)
- (t = tok(rx)) && (return t)
- name = TOK_NAMES[rx]
-
- unless name
- # Display basic regexps as plain old strings
- string = rx.source.gsub(/\\(.)/, '\1')
- name = rx.source == Regexp.escape(string) ? string.inspect : rx.inspect
- end
-
- expected(name)
- end
-
- def expected(name)
- throw(:_sass_parser_error, true) if @throw_error
- self.class.expected(@scanner, @expected || name, @line)
- end
-
- def err(msg)
- throw(:_sass_parser_error, true) if @throw_error
- raise Sass::SyntaxError.new(msg, :line => @line)
- end
-
- def catch_error(&block)
- old_throw_error, @throw_error = @throw_error, true
- pos = @scanner.pos
- line = @line
- expected = @expected
- if catch(:_sass_parser_error, &block)
- @scanner.pos = pos
- @line = line
- @expected = expected
- {:pos => pos, :line => line, :expected => @expected, :block => block}
- end
- ensure
- @throw_error = old_throw_error
- end
-
- def rethrow(err)
- if @throw_err
- throw :_sass_parser_error, err
- else
- @scanner = StringScanner.new(@scanner.string)
- @scanner.pos = err[:pos]
- @line = err[:line]
- @expected = err[:expected]
- err[:block].call
- end
- end
-
- # @private
- def self.expected(scanner, expected, line)
- pos = scanner.pos
-
- after = scanner.string[0...pos]
- # Get rid of whitespace between pos and the last token,
- # but only if there's a newline in there
- after.gsub!(/\s*\n\s*$/, '')
- # Also get rid of stuff before the last newline
- after.gsub!(/.*\n/, '')
- after = "..." + after[-15..-1] if after.size > 18
-
- was = scanner.rest.dup
- # Get rid of whitespace between pos and the next token,
- # but only if there's a newline in there
- was.gsub!(/^\s*\n\s*/, '')
- # Also get rid of stuff after the next newline
- was.gsub!(/\n.*/, '')
- was = was[0...15] + "..." if was.size > 18
-
- raise Sass::SyntaxError.new(
- "Invalid CSS after \"#{after}\": expected #{expected}, was \"#{was}\"",
- :line => line)
- end
-
- # Avoid allocating lots of new strings for `#tok`.
- # This is important because `#tok` is called all the time.
- NEWLINE = "\n"
-
- def tok(rx)
- res = @scanner.scan(rx)
- if res
- @line += res.count(NEWLINE)
- @expected = nil
- if !@strs.empty? && rx != COMMENT && rx != SINGLE_LINE_COMMENT
- @strs.each {|s| s << res}
- end
- res
- end
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss/rx.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss/rx.rb
deleted file mode 100644
index 82f8367304..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss/rx.rb
+++ /dev/null
@@ -1,127 +0,0 @@
-module Sass
- module SCSS
- # A module containing regular expressions used
- # for lexing tokens in an SCSS document.
- # Most of these are taken from [the CSS3 spec](http://www.w3.org/TR/css3-syntax/#lexical),
- # although some have been modified for various reasons.
- module RX
- # Takes a string and returns a CSS identifier
- # that will have the value of the given string.
- #
- # @param str [String] The string to escape
- # @return [String] The escaped string
- def self.escape_ident(str)
- return "" if str.empty?
- return "\\#{str}" if str == '-' || str == '_'
- out = ""
- value = str.dup
- out << value.slice!(0...1) if value =~ /^[-_]/
- if value[0...1] =~ NMSTART
- out << value.slice!(0...1)
- else
- out << escape_char(value.slice!(0...1))
- end
- out << value.gsub(/[^a-zA-Z0-9_-]/) {|c| escape_char c}
- return out
- end
-
- # Escapes a single character for a CSS identifier.
- #
- # @param c [String] The character to escape. Should have length 1
- # @return [String] The escaped character
- # @private
- def self.escape_char(c)
- return "\\%06x" % Sass::Util.ord(c) unless c =~ /[ -\/:-~]/
- return "\\#{c}"
- end
-
- # Creates a Regexp from a plain text string,
- # escaping all significant characters.
- #
- # @param str [String] The text of the regexp
- # @param flags [Fixnum] Flags for the created regular expression
- # @return [Regexp]
- # @private
- def self.quote(str, flags = 0)
- Regexp.new(Regexp.quote(str), flags)
- end
-
- H = /[0-9a-fA-F]/
- NL = /\n|\r\n|\r|\f/
- UNICODE = /\\#{H}{1,6}[ \t\r\n\f]?/
- s = if Sass::Util.ruby1_8?
- '\200-\377'
- else
- '\u{80}-\u{D7FF}\u{E000}-\u{FFFD}\u{10000}-\u{10FFFF}'
- end
- NONASCII = /[#{s}]/
- ESCAPE = /#{UNICODE}|\\[ -~#{s}]/
- NMSTART = /[_a-zA-Z]|#{NONASCII}|#{ESCAPE}/
- NMCHAR = /[a-zA-Z0-9_-]|#{NONASCII}|#{ESCAPE}/
- STRING1 = /\"((?:[^\n\r\f\\"]|\\#{NL}|#{ESCAPE})*)\"/
- STRING2 = /\'((?:[^\n\r\f\\']|\\#{NL}|#{ESCAPE})*)\'/
-
- IDENT = /-?#{NMSTART}#{NMCHAR}*/
- NAME = /#{NMCHAR}+/
- NUM = /[0-9]+|[0-9]*\.[0-9]+/
- STRING = /#{STRING1}|#{STRING2}/
- URLCHAR = /[#%&*-~]|#{NONASCII}|#{ESCAPE}/
- URL = /(#{URLCHAR}*)/
- W = /[ \t\r\n\f]*/
- VARIABLE = /(\$)(#{Sass::SCSS::RX::IDENT})/
-
- # This is more liberal than the spec's definition,
- # but that definition didn't work well with the greediness rules
- RANGE = /(?:#{H}|\?){1,6}/
-
- ##
-
- S = /[ \t\r\n\f]+/
-
- COMMENT = /\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\//
- SINGLE_LINE_COMMENT = /\/\/.*(\n[ \t]*\/\/.*)*/
-
- CDO = quote("")
- INCLUDES = quote("~=")
- DASHMATCH = quote("|=")
- PREFIXMATCH = quote("^=")
- SUFFIXMATCH = quote("$=")
- SUBSTRINGMATCH = quote("*=")
-
- HASH = /##{NAME}/
-
- IMPORTANT = /!#{W}important/i
- DEFAULT = /!#{W}default/i
-
- NUMBER = /#{NUM}(?:#{IDENT}|%)?/
-
- URI = /url\(#{W}(?:#{STRING}|#{URL})#{W}\)/i
- FUNCTION = /#{IDENT}\(/
-
- UNICODERANGE = /u\+(?:#{H}{1,6}-#{H}{1,6}|#{RANGE})/i
-
- # Defined in http://www.w3.org/TR/css3-selectors/#lex
- PLUS = /#{W}\+/
- GREATER = /#{W}>/
- TILDE = /#{W}~/
- NOT = quote(":not(", Regexp::IGNORECASE)
-
- # Custom
- HEXCOLOR = /\#[0-9a-fA-F]+/
- INTERP_START = /#\{/
- MOZ_ANY = quote(":-moz-any(", Regexp::IGNORECASE)
-
- STRING1_NOINTERP = /\"((?:[^\n\r\f\\"#]|#(?!\{)|\\#{NL}|#{ESCAPE})*)\"/
- STRING2_NOINTERP = /\'((?:[^\n\r\f\\'#]|#(?!\{)|\\#{NL}|#{ESCAPE})*)\'/
- STRING_NOINTERP = /#{STRING1_NOINTERP}|#{STRING2_NOINTERP}/
- # Can't use IDENT here, because it seems to take exponential time on 1.8.
- # We could use it for 1.9 only, but I don't want to introduce a cross-version
- # behavior difference.
- # In any case, almost all CSS idents will be matched by this.
- STATIC_VALUE = /(-?#{NMSTART}|#{STRING_NOINTERP}|\s(?!%)|#[a-f0-9]|[,%]|#{NUM})+(?=[;}])/i
-
- STATIC_SELECTOR = /(#{NMCHAR}|\s|[,>+*]|[:#.]#{NMSTART})+(?=[{])/i
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss/sass_parser.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss/sass_parser.rb
deleted file mode 100644
index e0bd609142..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss/sass_parser.rb
+++ /dev/null
@@ -1,11 +0,0 @@
-module Sass
- module SCSS
- # A subclass of {Parser} that parses code in Sass documents
- # using some SCSS constructs.
- # This is necessary because SassScript in Sass supports `!`-style variables,
- # whereas in SCSS it doesn't.
- class SassParser < Parser
- @sass_script_parser = Sass::Script::Parser
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss/script_lexer.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss/script_lexer.rb
deleted file mode 100644
index 777485fbe7..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss/script_lexer.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-module Sass
- module SCSS
- # A mixin for subclasses of {Sass::Script::Lexer}
- # that makes them usable by {SCSS::Parser} to parse SassScript.
- # In particular, the lexer doesn't support `!` for a variable prefix.
- module ScriptLexer
- private
-
- def variable
- return [:raw, "!important"] if scan(Sass::SCSS::RX::IMPORTANT)
- _variable(Sass::SCSS::RX::VARIABLE)
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss/script_parser.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss/script_parser.rb
deleted file mode 100644
index e5f64b2a5b..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss/script_parser.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-module Sass
- module SCSS
- # A mixin for subclasses of {Sass::Script::Parser}
- # that makes them usable by {SCSS::Parser} to parse SassScript.
- # In particular, the parser won't raise an error
- # when there's more content in the lexer once lexing is done.
- # In addition, the parser doesn't support `!` for a variable prefix.
- module ScriptParser
- private
-
- # @private
- def lexer_class
- klass = Class.new(super)
- klass.send(:include, ScriptLexer)
- klass
- end
-
- # Instead of raising an error when the parser is done,
- # rewind the StringScanner so that it hasn't consumed the final token.
- def assert_done
- @lexer.unpeek!
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss/static_parser.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss/static_parser.rb
deleted file mode 100644
index 5074b7168b..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/scss/static_parser.rb
+++ /dev/null
@@ -1,40 +0,0 @@
-module Sass
- module SCSS
- # A parser for a static SCSS tree.
- # Parses with SCSS extensions, like nested rules and parent selectors,
- # but without dynamic SassScript.
- # This is useful for e.g. \{#parse\_selector parsing selectors}
- # after resolving the interpolation.
- class StaticParser < Parser
- # Parses the text as a selector.
- #
- # @param filename [String, nil] The file in which the selector appears,
- # or nil if there is no such file.
- # Used for error reporting.
- # @return [Selector::CommaSequence] The parsed selector
- # @raise [Sass::SyntaxError] if there's a syntax error in the selector
- def parse_selector(filename)
- init_scanner!
- seq = expr!(:selector_comma_sequence)
- expected("selector") unless @scanner.eos?
- seq.line = @line
- seq.filename = filename
- seq
- end
-
- private
-
- def variable; nil; end
- def script_value; nil; end
- def interpolation; nil; end
- def interp_string; s = tok(STRING) and [s]; end
- def interp_ident(ident = IDENT); s = tok(ident) and [s]; end
- def use_css_import?; true; end
-
- def special_directive(name)
- return unless %w[media import charset].include?(name)
- super
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/selector.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/selector.rb
deleted file mode 100644
index 855180365b..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/selector.rb
+++ /dev/null
@@ -1,361 +0,0 @@
-require 'sass/selector/simple'
-require 'sass/selector/abstract_sequence'
-require 'sass/selector/comma_sequence'
-require 'sass/selector/sequence'
-require 'sass/selector/simple_sequence'
-
-module Sass
- # A namespace for nodes in the parse tree for selectors.
- #
- # {CommaSequence} is the toplevel seelctor,
- # representing a comma-separated sequence of {Sequence}s,
- # such as `foo bar, baz bang`.
- # {Sequence} is the next level,
- # representing {SimpleSequence}s separated by combinators (e.g. descendant or child),
- # such as `foo bar` or `foo > bar baz`.
- # {SimpleSequence} is a sequence of selectors that all apply to a single element,
- # such as `foo.bar[attr=val]`.
- # Finally, {Simple} is the superclass of the simplest selectors,
- # such as `.foo` or `#bar`.
- module Selector
- # A parent-referencing selector (`&` in Sass).
- # The function of this is to be replaced by the parent selector
- # in the nested hierarchy.
- class Parent < Simple
- # @see Selector#to_a
- def to_a
- ["&"]
- end
-
- # Always raises an exception.
- #
- # @raise [Sass::SyntaxError] Parent selectors should be resolved before unification
- # @see Selector#unify
- def unify(sels)
- raise Sass::SyntaxError.new("[BUG] Cannot unify parent selectors.")
- end
- end
-
- # A class selector (e.g. `.foo`).
- class Class < Simple
- # The class name.
- #
- # @return [Array]
- attr_reader :name
-
- # @param name [Array] The class name
- def initialize(name)
- @name = name
- end
-
- # @see Selector#to_a
- def to_a
- [".", *@name]
- end
- end
-
- # An id selector (e.g. `#foo`).
- class Id < Simple
- # The id name.
- #
- # @return [Array]
- attr_reader :name
-
- # @param name [Array] The id name
- def initialize(name)
- @name = name
- end
-
- # @see Selector#to_a
- def to_a
- ["#", *@name]
- end
-
- # Returns `nil` if `sels` contains an {Id} selector
- # with a different name than this one.
- #
- # @see Selector#unify
- def unify(sels)
- return if sels.any? {|sel2| sel2.is_a?(Id) && self.name != sel2.name}
- super
- end
- end
-
- # A universal selector (`*` in CSS).
- class Universal < Simple
- # The selector namespace.
- # `nil` means the default namespace,
- # `[""]` means no namespace,
- # `["*"]` means any namespace.
- #
- # @return [Array, nil]
- attr_reader :namespace
-
- # @param namespace [Array, nil] See \{#namespace}
- def initialize(namespace)
- @namespace = namespace
- end
-
- # @see Selector#to_a
- def to_a
- @namespace ? @namespace + ["|*"] : ["*"]
- end
-
- # Unification of a universal selector is somewhat complicated,
- # especially when a namespace is specified.
- # If there is no namespace specified
- # or any namespace is specified (namespace `"*"`),
- # then `sel` is returned without change
- # (unless it's empty, in which case `"*"` is required).
- #
- # If a namespace is specified
- # but `sel` does not specify a namespace,
- # then the given namespace is applied to `sel`,
- # either by adding this {Universal} selector
- # or applying this namespace to an existing {Element} selector.
- #
- # If both this selector *and* `sel` specify namespaces,
- # those namespaces are unified via {Simple#unify_namespaces}
- # and the unified namespace is used, if possible.
- #
- # @todo There are lots of cases that this documentation specifies;
- # make sure we thoroughly test **all of them**.
- # @todo Keep track of whether a default namespace has been declared
- # and handle namespace-unspecified selectors accordingly.
- # @todo If any branch of a CommaSequence ends up being just `"*"`,
- # then all other branches should be eliminated
- #
- # @see Selector#unify
- def unify(sels)
- name =
- case sels.first
- when Universal; :universal
- when Element; sels.first.name
- else
- return [self] + sels unless namespace.nil? || namespace == ['*']
- return sels unless sels.empty?
- return [self]
- end
-
- ns, accept = unify_namespaces(namespace, sels.first.namespace)
- return unless accept
- [name == :universal ? Universal.new(ns) : Element.new(name, ns)] + sels[1..-1]
- end
- end
-
- # An element selector (e.g. `h1`).
- class Element < Simple
- # The element name.
- #
- # @return [Array]
- attr_reader :name
-
- # The selector namespace.
- # `nil` means the default namespace,
- # `[""]` means no namespace,
- # `["*"]` means any namespace.
- #
- # @return [Array, nil]
- attr_reader :namespace
-
- # @param name [Array] The element name
- # @param namespace [Array, nil] See \{#namespace}
- def initialize(name, namespace)
- @name = name
- @namespace = namespace
- end
-
- # @see Selector#to_a
- def to_a
- @namespace ? @namespace + ["|"] + @name : @name
- end
-
- # Unification of an element selector is somewhat complicated,
- # especially when a namespace is specified.
- # First, if `sel` contains another {Element} with a different \{#name},
- # then the selectors can't be unified and `nil` is returned.
- #
- # Otherwise, if `sel` doesn't specify a namespace,
- # or it specifies any namespace (via `"*"`),
- # then it's returned with this element selector
- # (e.g. `.foo` becomes `a.foo` or `svg|a.foo`).
- # Similarly, if this selector doesn't specify a namespace,
- # the namespace from `sel` is used.
- #
- # If both this selector *and* `sel` specify namespaces,
- # those namespaces are unified via {Simple#unify_namespaces}
- # and the unified namespace is used, if possible.
- #
- # @todo There are lots of cases that this documentation specifies;
- # make sure we thoroughly test **all of them**.
- # @todo Keep track of whether a default namespace has been declared
- # and handle namespace-unspecified selectors accordingly.
- #
- # @see Selector#unify
- def unify(sels)
- case sels.first
- when Universal;
- when Element; return unless name == sels.first.name
- else return [self] + sels
- end
-
- ns, accept = unify_namespaces(namespace, sels.first.namespace)
- return unless accept
- [Element.new(name, ns)] + sels[1..-1]
- end
- end
-
- # Selector interpolation (`#{}` in Sass).
- class Interpolation < Simple
- # The script to run.
- #
- # @return [Sass::Script::Node]
- attr_reader :script
-
- # @param script [Sass::Script::Node] The script to run
- def initialize(script)
- @script = script
- end
-
- # @see Selector#to_a
- def to_a
- [@script]
- end
-
- # Always raises an exception.
- #
- # @raise [Sass::SyntaxError] Interpolation selectors should be resolved before unification
- # @see Selector#unify
- def unify(sels)
- raise Sass::SyntaxError.new("[BUG] Cannot unify interpolation selectors.")
- end
- end
-
- # An attribute selector (e.g. `[href^="http://"]`).
- class Attribute < Simple
- # The attribute name.
- #
- # @return [Array]
- attr_reader :name
-
- # The attribute namespace.
- # `nil` means the default namespace,
- # `[""]` means no namespace,
- # `["*"]` means any namespace.
- #
- # @return [Array, nil]
- attr_reader :namespace
-
- # The matching operator, e.g. `"="` or `"^="`.
- #
- # @return [String]
- attr_reader :operator
-
- # The right-hand side of the operator.
- #
- # @return [Array]
- attr_reader :value
-
- # @param name [Array] The attribute name
- # @param namespace [Array, nil] See \{#namespace}
- # @param operator [String] The matching operator, e.g. `"="` or `"^="`
- # @param value [Array] See \{#value}
- def initialize(name, namespace, operator, value)
- @name = name
- @namespace = namespace
- @operator = operator
- @value = value
- end
-
- # @see Selector#to_a
- def to_a
- res = ["["]
- res.concat(@namespace) << "|" if @namespace
- res.concat @name
- (res << @operator).concat @value if @value
- res << "]"
- end
- end
-
- # A pseudoclass (e.g. `:visited`) or pseudoelement (e.g. `::first-line`) selector.
- # It can have arguments (e.g. `:nth-child(2n+1)`).
- class Pseudo < Simple
- # The type of the selector.
- # `:class` if this is a pseudoclass selector,
- # `:element` if it's a pseudoelement.
- #
- # @return [Symbol]
- attr_reader :type
-
- # The name of the selector.
- #
- # @return [Array]
- attr_reader :name
-
- # The argument to the selector,
- # or `nil` if no argument was given.
- #
- # This may include SassScript nodes that will be run during resolution.
- # Note that this should not include SassScript nodes
- # after resolution has taken place.
- #
- # @return [Array, nil]
- attr_reader :arg
-
- # @param type [Symbol] See \{#type}
- # @param name [Array] The name of the selector
- # @param arg [nil, Array] The argument to the selector,
- # or nil if no argument was given
- def initialize(type, name, arg)
- @type = type
- @name = name
- @arg = arg
- end
-
- # @see Selector#to_a
- def to_a
- res = [@type == :class ? ":" : "::"] + @name
- (res << "(").concat(Sass::Util.strip_string_array(@arg)) << ")" if @arg
- res
- end
-
- # Returns `nil` if this is a pseudoclass selector
- # and `sels` contains a pseudoclass selector different than this one.
- #
- # @see Selector#unify
- def unify(sels)
- return if type == :element && sels.any? do |sel|
- sel.is_a?(Pseudo) && sel.type == :element &&
- (sel.name != self.name || sel.arg != self.arg)
- end
- super
- end
- end
-
- # A pseudoclass selector whose argument is itself a selector
- # (e.g. `:not(.foo)` or `:-moz-all(.foo, .bar)`).
- class SelectorPseudoClass < Simple
- # The name of the pseudoclass.
- #
- # @return [String]
- attr_reader :name
-
- # The selector argument.
- #
- # @return [Selector::Sequence]
- attr_reader :selector
-
- # @param [String] The name of the pseudoclass
- # @param [Selector::Sequence] The selector argument
- def initialize(name, selector)
- @name = name
- @selector = selector
- end
-
- # @see Selector#to_a
- def to_a
- [":", @name, "("] + @selector.to_a + [")"]
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/selector/abstract_sequence.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/selector/abstract_sequence.rb
deleted file mode 100644
index 77be86cbdc..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/selector/abstract_sequence.rb
+++ /dev/null
@@ -1,62 +0,0 @@
-module Sass
- module Selector
- # The abstract parent class of the various selector sequence classes.
- #
- # All subclasses should implement a `members` method
- # that returns an array of object that respond to `#line=` and `#filename=`.
- class AbstractSequence
- # The line of the Sass template on which this selector was declared.
- #
- # @return [Fixnum]
- attr_reader :line
-
- # The name of the file in which this selector was declared.
- #
- # @return [String, nil]
- attr_reader :filename
-
- # Sets the line of the Sass template on which this selector was declared.
- # This also sets the line for all child selectors.
- #
- # @param line [Fixnum]
- # @return [Fixnum]
- def line=(line)
- members.each {|m| m.line = line}
- @line = line
- end
-
- # Sets the name of the file in which this selector was declared,
- # or `nil` if it was not declared in a file (e.g. on stdin).
- # This also sets the filename for all child selectors.
- #
- # @param filename [String, nil]
- # @return [String, nil]
- def filename=(filename)
- members.each {|m| m.filename = filename}
- @filename = filename
- end
-
- # Returns a hash code for this sequence.
- #
- # Subclasses should define `#_hash` rather than overriding this method,
- # which automatically handles memoizing the result.
- #
- # @return [Fixnum]
- def hash
- @_hash ||= _hash
- end
-
- # Checks equality between this and another object.
- #
- # Subclasses should define `#_eql?` rather than overriding this method,
- # which handles checking class equality and hash equality.
- #
- # @param other [Object] The object to test equality against
- # @return [Boolean] Whether or not this is equal to `other`
- def eql?(other)
- other.class == self.class && other.hash == self.hash && _eql?(other)
- end
- alias_method :==, :eql?
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/selector/comma_sequence.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/selector/comma_sequence.rb
deleted file mode 100644
index c7153f3533..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/selector/comma_sequence.rb
+++ /dev/null
@@ -1,81 +0,0 @@
-module Sass
- module Selector
- # A comma-separated sequence of selectors.
- class CommaSequence < AbstractSequence
- # The comma-separated selector sequences
- # represented by this class.
- #
- # @return [Array]
- attr_reader :members
-
- # @param seqs [Array] See \{#members}
- def initialize(seqs)
- @members = seqs
- end
-
- # Resolves the {Parent} selectors within this selector
- # by replacing them with the given parent selector,
- # handling commas appropriately.
- #
- # @param super_cseq [CommaSequence] The parent selector
- # @return [CommaSequence] This selector, with parent references resolved
- # @raise [Sass::SyntaxError] If a parent selector is invalid
- def resolve_parent_refs(super_cseq)
- if super_cseq.nil?
- if @members.any? do |sel|
- sel.members.any? do |sel_or_op|
- sel_or_op.is_a?(SimpleSequence) && sel_or_op.members.any? {|ssel| ssel.is_a?(Parent)}
- end
- end
- raise Sass::SyntaxError.new("Base-level rules cannot contain the parent-selector-referencing character '&'.")
- end
- return self
- end
-
- CommaSequence.new(
- super_cseq.members.map do |super_seq|
- @members.map {|seq| seq.resolve_parent_refs(super_seq)}
- end.flatten)
- end
-
- # Non-destrucively extends this selector with the extensions specified in a hash
- # (which should come from {Sass::Tree::Visitors::Cssize}).
- #
- # @todo Link this to the reference documentation on `@extend`
- # when such a thing exists.
- #
- # @param extends [Sass::Util::SubsetMap{Selector::Simple => Selector::Sequence}]
- # The extensions to perform on this selector
- # @return [CommaSequence] A copy of this selector,
- # with extensions made according to `extends`
- def do_extend(extends)
- CommaSequence.new(members.map {|seq| seq.do_extend(extends)}.flatten)
- end
-
- # Returns a string representation of the sequence.
- # This is basically the selector string.
- #
- # @return [String]
- def inspect
- members.map {|m| m.inspect}.join(", ")
- end
-
- # @see Simple#to_a
- def to_a
- arr = Sass::Util.intersperse(@members.map {|m| m.to_a}, ", ").flatten
- arr.delete("\n")
- arr
- end
-
- private
-
- def _hash
- members.hash
- end
-
- def _eql?(other)
- other.class == self.class && other.members.eql?(self.members)
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/selector/sequence.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/selector/sequence.rb
deleted file mode 100644
index fef8a93591..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/selector/sequence.rb
+++ /dev/null
@@ -1,233 +0,0 @@
-module Sass
- module Selector
- # An operator-separated sequence of
- # {SimpleSequence simple selector sequences}.
- class Sequence < AbstractSequence
- # Sets the line of the Sass template on which this selector was declared.
- # This also sets the line for all child selectors.
- #
- # @param line [Fixnum]
- # @return [Fixnum]
- def line=(line)
- members.each {|m| m.line = line if m.is_a?(SimpleSequence)}
- line
- end
-
- # Sets the name of the file in which this selector was declared,
- # or `nil` if it was not declared in a file (e.g. on stdin).
- # This also sets the filename for all child selectors.
- #
- # @param filename [String, nil]
- # @return [String, nil]
- def filename=(filename)
- members.each {|m| m.filename = filename if m.is_a?(SimpleSequence)}
- filename
- end
-
- # The array of {SimpleSequence simple selector sequences}, operators, and newlines.
- # The operators are strings such as `"+"` and `">"`
- # representing the corresponding CSS operators.
- # Newlines are also newline strings;
- # these aren't semantically relevant,
- # but they do affect formatting.
- #
- # @return [Array]
- attr_reader :members
-
- # @param seqs_and_ops [Array] See \{#members}
- def initialize(seqs_and_ops)
- @members = seqs_and_ops
- end
-
- # Resolves the {Parent} selectors within this selector
- # by replacing them with the given parent selector,
- # handling commas appropriately.
- #
- # @param super_seq [Sequence] The parent selector sequence
- # @return [Sequence] This selector, with parent references resolved
- # @raise [Sass::SyntaxError] If a parent selector is invalid
- def resolve_parent_refs(super_seq)
- members = @members
- nl = (members.first == "\n" && members.shift)
- unless members.any? do |seq_or_op|
- seq_or_op.is_a?(SimpleSequence) && seq_or_op.members.first.is_a?(Parent)
- end
- members = []
- members << nl if nl
- members << SimpleSequence.new([Parent.new])
- members += @members
- end
-
- Sequence.new(
- members.map do |seq_or_op|
- next seq_or_op unless seq_or_op.is_a?(SimpleSequence)
- seq_or_op.resolve_parent_refs(super_seq)
- end.flatten)
- end
-
- # Non-destructively extends this selector with the extensions specified in a hash
- # (which should come from {Sass::Tree::Visitors::Cssize}).
- #
- # @overload def do_extend(extends)
- # @param extends [Sass::Util::SubsetMap{Selector::Simple => Selector::Sequence}]
- # The extensions to perform on this selector
- # @return [Array] A list of selectors generated
- # by extending this selector with `extends`.
- # These correspond to a {CommaSequence}'s {CommaSequence#members members array}.
- # @see CommaSequence#do_extend
- def do_extend(extends, seen = Set.new)
- paths = Sass::Util.paths(members.map do |sseq_or_op|
- next [[sseq_or_op]] unless sseq_or_op.is_a?(SimpleSequence)
- extended = sseq_or_op.do_extend(extends, seen)
- choices = extended.map {|seq| seq.members}
- choices.unshift([sseq_or_op]) unless extended.any? {|seq| seq.superselector?(sseq_or_op)}
- choices
- end)
- Sass::Util.flatten(paths.map {|path| weave(path)}, 1).map {|p| Sequence.new(p)}
- end
-
- # Returns whether or not this selector matches all elements
- # that the given selector matches (as well as possibly more).
- #
- # @example
- # (.foo).superselector?(.foo.bar) #=> true
- # (.foo).superselector?(.bar) #=> false
- # (.bar .foo).superselector?(.foo) #=> false
- # @param sseq [SimpleSequence]
- # @return [Boolean]
- def superselector?(sseq)
- return false unless members.size == 1
- members.last.superselector?(sseq)
- end
-
- # @see Simple#to_a
- def to_a
- ary = @members.map {|seq_or_op| seq_or_op.is_a?(SimpleSequence) ? seq_or_op.to_a : seq_or_op}
- Sass::Util.intersperse(ary, " ").flatten.compact
- end
-
- # Returns a string representation of the sequence.
- # This is basically the selector string.
- #
- # @return [String]
- def inspect
- members.map {|m| m.inspect}.join(" ")
- end
-
- private
-
- # Conceptually, this expands "parenthesized selectors".
- # That is, if we have `.A .B {@extend .C}` and `.D .C {...}`,
- # this conceptually expands into `.D .C, .D (.A .B)`,
- # and this function translates `.D (.A .B)` into `.D .A .B, .A.D .B, .D .A .B`.
- #
- # @param path [Array>] A list of parenthesized selector groups.
- # @return [Array>] A list of fully-expanded selectors.
- def weave(path)
- befores = [[]]
- afters = path.dup
-
- until afters.empty?
- current = afters.shift.dup
- last_current = [current.pop]
- while !current.empty? && last_current.first.is_a?(String) || current.last.is_a?(String)
- last_current.unshift(current.pop)
- end
- befores = Sass::Util.flatten(befores.map do |before|
- subweave(before, current).map {|seqs| seqs + last_current}
- end, 1)
- return befores if afters.empty?
- end
- end
-
- # This interweaves two lists of selectors,
- # returning all possible orderings of them (including using unification)
- # that maintain the relative ordering of the input arrays.
- #
- # For example, given `.foo .bar` and `.baz .bang`,
- # this would return `.foo .bar .baz .bang`, `.foo .bar.baz .bang`,
- # `.foo .baz .bar .bang`, `.foo .baz .bar.bang`, `.foo .baz .bang .bar`,
- # and so on until `.baz .bang .foo .bar`.
- #
- # @overload def subweave(seq1, seq2)
- # @param seq1 [Array]
- # @param seq2 [Array]
- # @return [Array>]
- def subweave(seq1, seq2, cache = {})
- return [seq2] if seq1.empty?
- return [seq1] if seq2.empty?
-
- seq1 = group_selectors(seq1)
- seq2 = group_selectors(seq2)
- lcs = Sass::Util.lcs(seq2, seq1) do |s1, s2|
- next s1 if s1 == s2
- next unless s1.first.is_a?(SimpleSequence) && s2.first.is_a?(SimpleSequence)
- next s2 if subweave_superselector?(s1, s2)
- next s1 if subweave_superselector?(s2, s1)
- end
-
- diff = []
- until lcs.empty?
- diff << chunks(seq1, seq2) {|s| subweave_superselector?(s.first, lcs.first)} << [lcs.shift]
- seq1.shift
- seq2.shift
- end
- diff << chunks(seq1, seq2) {|s| s.empty?}
- diff.reject! {|c| c.empty?}
-
- Sass::Util.paths(diff).map {|p| p.flatten}
- end
-
- def chunks(seq1, seq2)
- chunk1 = []
- chunk1 << seq1.shift until yield seq1
- chunk2 = []
- chunk2 << seq2.shift until yield seq2
- return [] if chunk1.empty? && chunk2.empty?
- return [chunk2] if chunk1.empty?
- return [chunk1] if chunk2.empty?
- [chunk1 + chunk2, chunk2 + chunk1]
- end
-
- def group_selectors(seq)
- newseq = []
- tail = seq.dup
- until tail.empty?
- head = []
- begin
- head << tail.shift
- end while !tail.empty? && head.last.is_a?(String) || tail.first.is_a?(String)
- newseq << head
- end
- return newseq
- end
-
- def subweave_superselector?(sseq1, sseq2)
- if sseq1.size > 1
- # More complex selectors are never superselectors of less complex ones
- return unless sseq2.size > 1
- # .foo ~ .bar is a superselector of .foo + .bar
- return unless sseq1[1] == "~" ? sseq2[1] != ">" : sseq2[1] == sseq1[1]
- return unless sseq1.first.superselector?(sseq2.first)
- return true if sseq1.size == 2
- return false if sseq2.size == 2
- return subweave_superselector?(sseq1[2..-1], sseq2[2..-1])
- elsif sseq2.size > 1
- return true if sseq2[1] == ">" && sseq1.first.superselector?(sseq2.first)
- return false if sseq2.size == 2
- return subweave_superselector?(sseq1, sseq2[2..-1])
- else
- sseq1.first.superselector?(sseq2.first)
- end
- end
-
- def _hash
- members.reject {|m| m == "\n"}.hash
- end
-
- def _eql?(other)
- other.members.reject {|m| m == "\n"}.eql?(self.members.reject {|m| m == "\n"})
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/selector/simple.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/selector/simple.rb
deleted file mode 100644
index 4ca0c9f09d..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/selector/simple.rb
+++ /dev/null
@@ -1,113 +0,0 @@
-module Sass
- module Selector
- # The abstract superclass for simple selectors
- # (that is, those that don't compose multiple selectors).
- class Simple
- # The line of the Sass template on which this selector was declared.
- #
- # @return [Fixnum]
- attr_accessor :line
-
- # The name of the file in which this selector was declared,
- # or `nil` if it was not declared in a file (e.g. on stdin).
- #
- # @return [String, nil]
- attr_accessor :filename
-
- # Returns a representation of the node
- # as an array of strings and potentially {Sass::Script::Node}s
- # (if there's interpolation in the selector).
- # When the interpolation is resolved and the strings are joined together,
- # this will be the string representation of this node.
- #
- # @return [Array]
- def to_a
- Sass::Util.abstract(self)
- end
-
- # Returns a string representation of the node.
- # This is basically the selector string.
- #
- # @return [String]
- def inspect
- to_a.map {|e| e.is_a?(Sass::Script::Node) ? "\#{#{e.to_sass}}" : e}.join
- end
-
- # Returns a hash code for this selector object.
- #
- # By default, this is based on the value of \{#to\_a},
- # so if that contains information irrelevant to the identity of the selector,
- # this should be overridden.
- #
- # @return [Fixnum]
- def hash
- @_hash ||= to_a.hash
- end
-
- # Checks equality between this and another object.
- #
- # By default, this is based on the value of \{#to\_a},
- # so if that contains information irrelevant to the identity of the selector,
- # this should be overridden.
- #
- # @param other [Object] The object to test equality against
- # @return [Boolean] Whether or not this is equal to `other`
- def eql?(other)
- other.class == self.class && other.hash == self.hash && other.to_a.eql?(to_a)
- end
- alias_method :==, :eql?
-
- # Unifies this selector with a {SimpleSequence}'s {SimpleSequence#members members array},
- # returning another `SimpleSequence` members array
- # that matches both this selector and the input selector.
- #
- # By default, this just appends this selector to the end of the array
- # (or returns the original array if this selector already exists in it).
- #
- # @param sels [Array] A {SimpleSequence}'s {SimpleSequence#members members array}
- # @return [Array, nil] A {SimpleSequence} {SimpleSequence#members members array}
- # matching both `sels` and this selector,
- # or `nil` if this is impossible (e.g. unifying `#foo` and `#bar`)
- # @raise [Sass::SyntaxError] If this selector cannot be unified.
- # This will only ever occur when a dynamic selector,
- # such as {Parent} or {Interpolation}, is used in unification.
- # Since these selectors should be resolved
- # by the time extension and unification happen,
- # this exception will only ever be raised as a result of programmer error
- def unify(sels)
- return sels if sels.any? {|sel2| eql?(sel2)}
- sels_with_ix = Sass::Util.enum_with_index(sels)
- _, i =
- if self.is_a?(Pseudo) || self.is_a?(SelectorPseudoClass)
- sels_with_ix.find {|sel, _| sel.is_a?(Pseudo) && sels.last.type == :element}
- else
- sels_with_ix.find {|sel, _| sel.is_a?(Pseudo) || sel.is_a?(SelectorPseudoClass)}
- end
- return sels + [self] unless i
- return sels[0...i] + [self] + sels[i..-1]
- end
-
- protected
-
- # Unifies two namespaces,
- # returning a namespace that works for both of them if possible.
- #
- # @param ns1 [String, nil] The first namespace.
- # `nil` means none specified, e.g. `foo`.
- # The empty string means no namespace specified, e.g. `|foo`.
- # `"*"` means any namespace is allowed, e.g. `*|foo`.
- # @param ns2 [String, nil] The second namespace. See `ns1`.
- # @return [Array(String or nil, Boolean)]
- # The first value is the unified namespace, or `nil` for no namespace.
- # The second value is whether or not a namespace that works for both inputs
- # could be found at all.
- # If the second value is `false`, the first should be ignored.
- def unify_namespaces(ns1, ns2)
- return nil, false unless ns1 == ns2 || ns1.nil? || ns1 == ['*'] || ns2.nil? || ns2 == ['*']
- return ns2, true if ns1 == ['*']
- return ns1, true if ns2 == ['*']
- return ns1 || ns2, true
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/selector/simple_sequence.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/selector/simple_sequence.rb
deleted file mode 100644
index ce88982867..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/selector/simple_sequence.rb
+++ /dev/null
@@ -1,134 +0,0 @@
-module Sass
- module Selector
- # A unseparated sequence of selectors
- # that all apply to a single element.
- # For example, `.foo#bar[attr=baz]` is a simple sequence
- # of the selectors `.foo`, `#bar`, and `[attr=baz]`.
- class SimpleSequence < AbstractSequence
- # The array of individual selectors.
- #
- # @return [Array]
- attr_reader :members
-
- # Returns the element or universal selector in this sequence,
- # if it exists.
- #
- # @return [Element, Universal, nil]
- def base
- @base ||= (members.first if members.first.is_a?(Element) || members.first.is_a?(Universal))
- end
-
- # Returns the non-base selectors in this sequence.
- #
- # @return [Set]
- def rest
- @rest ||= Set.new(base ? members[1..-1] : members)
- end
-
- # @param selectors [Array] See \{#members}
- def initialize(selectors)
- @members = selectors
- end
-
- # Resolves the {Parent} selectors within this selector
- # by replacing them with the given parent selector,
- # handling commas appropriately.
- #
- # @param super_seq [Sequence] The parent selector sequence
- # @return [Array] This selector, with parent references resolved.
- # This is an array because the parent selector is itself a {Sequence}
- # @raise [Sass::SyntaxError] If a parent selector is invalid
- def resolve_parent_refs(super_seq)
- # Parent selector only appears as the first selector in the sequence
- return [self] unless @members.first.is_a?(Parent)
-
- return super_seq.members if @members.size == 1
- unless super_seq.members.last.is_a?(SimpleSequence)
- raise Sass::SyntaxError.new("Invalid parent selector: " + super_seq.to_a.join)
- end
-
- super_seq.members[0...-1] +
- [SimpleSequence.new(super_seq.members.last.members + @members[1..-1])]
- end
-
- # Non-destrucively extends this selector with the extensions specified in a hash
- # (which should come from {Sass::Tree::Visitors::Cssize}).
- #
- # @overload def do_extend(extends)
- # @param extends [{Selector::Simple => Selector::Sequence}]
- # The extensions to perform on this selector
- # @return [Array] A list of selectors generated
- # by extending this selector with `extends`.
- # @see CommaSequence#do_extend
- def do_extend(extends, seen = Set.new)
- extends.get(members.to_set).map do |seq, sels|
- # If A {@extend B} and C {...},
- # seq is A, sels is B, and self is C
-
- self_without_sel = self.members - sels
- next unless unified = seq.members.last.unify(self_without_sel)
- [sels, seq.members[0...-1] + [unified]]
- end.compact.map do |sels, seq|
- seq = Sequence.new(seq)
- seen.include?(sels) ? [] : seq.do_extend(extends, seen + [sels])
- end.flatten.uniq
- end
-
- # Unifies this selector with another {SimpleSequence}'s {SimpleSequence#members members array},
- # returning another `SimpleSequence`
- # that matches both this selector and the input selector.
- #
- # @param sels [Array] A {SimpleSequence}'s {SimpleSequence#members members array}
- # @return [SimpleSequence, nil] A {SimpleSequence} matching both `sels` and this selector,
- # or `nil` if this is impossible (e.g. unifying `#foo` and `#bar`)
- # @raise [Sass::SyntaxError] If this selector cannot be unified.
- # This will only ever occur when a dynamic selector,
- # such as {Parent} or {Interpolation}, is used in unification.
- # Since these selectors should be resolved
- # by the time extension and unification happen,
- # this exception will only ever be raised as a result of programmer error
- def unify(sels)
- return unless sseq = members.inject(sels) do |sseq, sel|
- return unless sseq
- sel.unify(sseq)
- end
- SimpleSequence.new(sseq)
- end
-
- # Returns whether or not this selector matches all elements
- # that the given selector matches (as well as possibly more).
- #
- # @example
- # (.foo).superselector?(.foo.bar) #=> true
- # (.foo).superselector?(.bar) #=> false
- # @param sseq [SimpleSequence]
- # @return [Boolean]
- def superselector?(sseq)
- (base.nil? || base.eql?(sseq.base)) && rest.subset?(sseq.rest)
- end
-
- # @see Simple#to_a
- def to_a
- @members.map {|sel| sel.to_a}.flatten
- end
-
- # Returns a string representation of the sequence.
- # This is basically the selector string.
- #
- # @return [String]
- def inspect
- members.map {|m| m.inspect}.join
- end
-
- private
-
- def _hash
- [base, Sass::Util.set_hash(rest)].hash
- end
-
- def _eql?(other)
- other.base.eql?(self.base) && Sass::Util.set_eql?(other.rest, self.rest)
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/shared.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/shared.rb
deleted file mode 100644
index f53c7c6fbe..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/shared.rb
+++ /dev/null
@@ -1,78 +0,0 @@
-require 'strscan'
-
-module Sass
- # This module contains functionality that's shared between Haml and Sass.
- module Shared
- extend self
-
- # Scans through a string looking for the interoplation-opening `#{`
- # and, when it's found, yields the scanner to the calling code
- # so it can handle it properly.
- #
- # The scanner will have any backslashes immediately in front of the `#{`
- # as the second capture group (`scan[2]`),
- # and the text prior to that as the first (`scan[1]`).
- #
- # @yieldparam scan [StringScanner] The scanner scanning through the string
- # @return [String] The text remaining in the scanner after all `#{`s have been processed
- def handle_interpolation(str)
- scan = StringScanner.new(str)
- yield scan while scan.scan(/(.*?)(\\*)\#\{/)
- scan.rest
- end
-
- # Moves a scanner through a balanced pair of characters.
- # For example:
- #
- # Foo (Bar (Baz bang) bop) (Bang (bop bip))
- # ^ ^
- # from to
- #
- # @param scanner [StringScanner] The string scanner to move
- # @param start [Character] The character opening the balanced pair.
- # A `Fixnum` in 1.8, a `String` in 1.9
- # @param finish [Character] The character closing the balanced pair.
- # A `Fixnum` in 1.8, a `String` in 1.9
- # @param count [Fixnum] The number of opening characters matched
- # before calling this method
- # @return [(String, String)] The string matched within the balanced pair
- # and the rest of the string.
- # `["Foo (Bar (Baz bang) bop)", " (Bang (bop bip))"]` in the example above.
- def balance(scanner, start, finish, count = 0)
- str = ''
- scanner = StringScanner.new(scanner) unless scanner.is_a? StringScanner
- regexp = Regexp.new("(.*?)[\\#{start.chr}\\#{finish.chr}]", Regexp::MULTILINE)
- while scanner.scan(regexp)
- str << scanner.matched
- count += 1 if scanner.matched[-1] == start
- count -= 1 if scanner.matched[-1] == finish
- return [str.strip, scanner.rest] if count == 0
- end
- end
-
- # Formats a string for use in error messages about indentation.
- #
- # @param indentation [String] The string used for indentation
- # @param was [Boolean] Whether or not to add `"was"` or `"were"`
- # (depending on how many characters were in `indentation`)
- # @return [String] The name of the indentation (e.g. `"12 spaces"`, `"1 tab"`)
- def human_indentation(indentation, was = false)
- if !indentation.include?(?\t)
- noun = 'space'
- elsif !indentation.include?(?\s)
- noun = 'tab'
- else
- return indentation.inspect + (was ? ' was' : '')
- end
-
- singular = indentation.length == 1
- if was
- was = singular ? ' was' : ' were'
- else
- was = ''
- end
-
- "#{indentation.length} #{noun}#{'s' unless singular}#{was}"
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/charset_node.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/charset_node.rb
deleted file mode 100644
index 65b6306325..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/charset_node.rb
+++ /dev/null
@@ -1,22 +0,0 @@
-module Sass::Tree
- # A static node representing an unproccessed Sass `@charset` directive.
- #
- # @see Sass::Tree
- class CharsetNode < Node
- # The name of the charset.
- #
- # @return [String]
- attr_accessor :name
-
- # @param name [String] see \{#name}
- def initialize(name)
- @name = name
- super()
- end
-
- # @see Node#invisible?
- def invisible?
- !Sass::Util.ruby1_8?
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/comment_node.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/comment_node.rb
deleted file mode 100644
index a58bb8f65d..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/comment_node.rb
+++ /dev/null
@@ -1,77 +0,0 @@
-require 'sass/tree/node'
-
-module Sass::Tree
- # A static node representing a Sass comment (silent or loud).
- #
- # @see Sass::Tree
- class CommentNode < Node
- # The text of the comment, not including `/*` and `*/`.
- #
- # @return [String]
- attr_accessor :value
-
- # Whether the comment is loud.
- #
- # Loud comments start with ! and force the comment to be generated
- # irrespective of compilation settings or the comment syntax used.
- #
- # @return [Boolean]
- attr_accessor :loud
-
- # Whether or not the comment is silent (that is, doesn't output to CSS).
- #
- # @return [Boolean]
- attr_accessor :silent
-
- # @param value [String] See \{#value}
- # @param silent [Boolean] See \{#silent}
- def initialize(value, silent)
- @lines = []
- @silent = silent
- @value = normalize_indentation value
- @loud = @value =~ %r{^(/[\/\*])?!}
- @value.sub!("#{$1}!", $1.to_s) if @loud
- super()
- end
-
- # Compares the contents of two comments.
- #
- # @param other [Object] The object to compare with
- # @return [Boolean] Whether or not this node and the other object
- # are the same
- def ==(other)
- self.class == other.class && value == other.value && silent == other.silent
- end
-
- # Returns `true` if this is a silent comment
- # or the current style doesn't render comments.
- #
- # Comments starting with ! are never invisible (and the ! is removed from the output.)
- #
- # @return [Boolean]
- def invisible?
- if @loud
- return false
- else
- @silent || (style == :compressed)
- end
- end
-
- # Returns whether this comment should be interpolated for dynamic comment generation.
- def evaluated?
- @loud
- end
-
- private
-
- def normalize_indentation(str)
- pre = str.split("\n").inject(str[/^[ \t]*/].split("")) do |pre, line|
- line[/^[ \t]*/].split("").zip(pre).inject([]) do |arr, (a, b)|
- break arr if a != b
- arr + [a]
- end
- end.join
- str.gsub(/^#{pre}/, '')
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/debug_node.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/debug_node.rb
deleted file mode 100644
index b10af5197a..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/debug_node.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-module Sass
- module Tree
- # A dynamic node representing a Sass `@debug` statement.
- #
- # @see Sass::Tree
- class DebugNode < Node
- # The expression to print.
- # @return [Script::Node]
- attr_reader :expr
-
- # @param expr [Script::Node] The expression to print
- def initialize(expr)
- @expr = expr
- super()
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/directive_node.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/directive_node.rb
deleted file mode 100644
index 91263febb4..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/directive_node.rb
+++ /dev/null
@@ -1,23 +0,0 @@
-module Sass::Tree
- # A static node representing an unproccessed Sass `@`-directive.
- # Directives known to Sass, like `@for` and `@debug`,
- # are handled by their own nodes;
- # only CSS directives like `@media` and `@font-face` become {DirectiveNode}s.
- #
- # `@import` and `@charset` are special cases;
- # they become {ImportNode}s and {CharsetNode}s, respectively.
- #
- # @see Sass::Tree
- class DirectiveNode < Node
- # The text of the directive, `@` and all.
- #
- # @return [String]
- attr_accessor :value
-
- # @param value [String] See \{#value}
- def initialize(value)
- @value = value
- super()
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/each_node.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/each_node.rb
deleted file mode 100644
index 2529463c97..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/each_node.rb
+++ /dev/null
@@ -1,24 +0,0 @@
-require 'sass/tree/node'
-
-module Sass::Tree
- # A dynamic node representing a Sass `@each` loop.
- #
- # @see Sass::Tree
- class EachNode < Node
- # The name of the loop variable.
- # @return [String]
- attr_reader :var
-
- # The parse tree for the list.
- # @param [Script::Node]
- attr_reader :list
-
- # @param var [String] The name of the loop variable
- # @param list [Script::Node] The parse tree for the list
- def initialize(var, list)
- @var = var
- @list = list
- super()
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/extend_node.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/extend_node.rb
deleted file mode 100644
index de48023eb7..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/extend_node.rb
+++ /dev/null
@@ -1,29 +0,0 @@
-require 'sass/tree/node'
-
-module Sass::Tree
- # A static node reprenting an `@extend` directive.
- #
- # @see Sass::Tree
- class ExtendNode < Node
- # The parsed selector after interpolation has been resolved.
- # Only set once {Tree::Visitors::Perform} has been run.
- #
- # @return [Selector::CommaSequence]
- attr_accessor :resolved_selector
-
- # The CSS selector to extend, interspersed with {Sass::Script::Node}s
- # representing `#{}`-interpolation.
- #
- # @return [Array]
- attr_reader :selector
-
- # @param selector [Array]
- # The CSS selector to extend,
- # interspersed with {Sass::Script::Node}s
- # representing `#{}`-interpolation.
- def initialize(selector)
- @selector = selector
- super()
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/for_node.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/for_node.rb
deleted file mode 100644
index 3aea835718..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/for_node.rb
+++ /dev/null
@@ -1,36 +0,0 @@
-require 'sass/tree/node'
-
-module Sass::Tree
- # A dynamic node representing a Sass `@for` loop.
- #
- # @see Sass::Tree
- class ForNode < Node
- # The name of the loop variable.
- # @return [String]
- attr_reader :var
-
- # The parse tree for the initial expression.
- # @return [Script::Node]
- attr_reader :from
-
- # The parse tree for the final expression.
- # @return [Script::Node]
- attr_reader :to
-
- # Whether to include `to` in the loop or stop just before.
- # @return [Boolean]
- attr_reader :exclusive
-
- # @param var [String] See \{#var}
- # @param from [Script::Node] See \{#from}
- # @param to [Script::Node] See \{#to}
- # @param exclusive [Boolean] See \{#exclusive}
- def initialize(var, from, to, exclusive)
- @var = var
- @from = from
- @to = to
- @exclusive = exclusive
- super()
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/function_node.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/function_node.rb
deleted file mode 100644
index dfea8db30c..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/function_node.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-module Sass
- module Tree
- # A dynamic node representing a function definition.
- #
- # @see Sass::Tree
- class FunctionNode < Node
- # The name of the function.
- # @return [String]
- attr_reader :name
-
- # The arguments to the function. Each element is a tuple
- # containing the variable for argument and the parse tree for
- # the default value of the argument
- #
- # @return [Array]
- attr_reader :args
-
- # @param name [String] The function name
- # @param args [Array<(Script::Node, Script::Node)>] The arguments for the function.
- def initialize(name, args)
- @name = name
- @args = args
- super()
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/if_node.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/if_node.rb
deleted file mode 100644
index d6f18cfa0f..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/if_node.rb
+++ /dev/null
@@ -1,65 +0,0 @@
-require 'sass/tree/node'
-
-module Sass::Tree
- # A dynamic node representing a Sass `@if` statement.
- #
- # {IfNode}s are a little odd, in that they also represent `@else` and `@else if`s.
- # This is done as a linked list:
- # each {IfNode} has a link (\{#else}) to the next {IfNode}.
- #
- # @see Sass::Tree
- class IfNode < Node
- # The conditional expression.
- # If this is nil, this is an `@else` node, not an `@else if`.
- #
- # @return [Script::Expr]
- attr_reader :expr
-
- # The next {IfNode} in the if-else list, or `nil`.
- #
- # @return [IfNode]
- attr_accessor :else
-
- # @param expr [Script::Expr] See \{#expr}
- def initialize(expr)
- @expr = expr
- @last_else = self
- super()
- end
-
- # Append an `@else` node to the end of the list.
- #
- # @param node [IfNode] The `@else` node to append
- def add_else(node)
- @last_else.else = node
- @last_else = node
- end
-
- # @see Node#options=
- def options=(options)
- super
- self.else.options = options if self.else
- end
-
- def _dump(f)
- Marshal.dump([self.expr, self.else, self.children])
- end
-
- def self._load(data)
- expr, else_, children = Marshal.load(data)
- node = IfNode.new(expr)
- node.else = else_
- node.children = children
- node.instance_variable_set('@last_else',
- node.else ? node.else.instance_variable_get('@last_else') : node)
- node
- end
-
- # @see Node#deep_copy
- def deep_copy
- node = super
- node.else = self.else.deep_copy if self.else
- node
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/import_node.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/import_node.rb
deleted file mode 100644
index 98bcfe1c79..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/import_node.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-module Sass
- module Tree
- # A static node that wraps the {Sass::Tree} for an `@import`ed file.
- # It doesn't have a functional purpose other than to add the `@import`ed file
- # to the backtrace if an error occurs.
- class ImportNode < RootNode
- # The name of the imported file as it appears in the Sass document.
- #
- # @return [String]
- attr_reader :imported_filename
-
- # @param imported_filename [String] The name of the imported file
- def initialize(imported_filename)
- @imported_filename = imported_filename
- super(nil)
- end
-
- def invisible?; to_s.empty?; end
-
- # Returns the imported file.
- #
- # @return [Sass::Engine]
- # @raise [Sass::SyntaxError] If no file could be found to import.
- def imported_file
- @imported_file ||= import
- end
-
- # Returns whether or not this import should emit a CSS @import declaration
- #
- # @return [Boolean] Whether or not this is a simple CSS @import declaration.
- def css_import?
- if @imported_filename =~ /\.css$/
- @imported_filename
- elsif imported_file.is_a?(String) && imported_file =~ /\.css$/
- imported_file
- end
- end
-
- private
-
- def import
- paths = @options[:load_paths]
-
- if @options[:importer]
- f = @options[:importer].find_relative(
- @imported_filename, @options[:filename], @options.dup)
- return f if f
- end
-
- paths.each do |p|
- if f = p.find(@imported_filename, @options.dup)
- return f
- end
- end
-
- message = "File to import not found or unreadable: #{@imported_filename}.\n"
- if paths.size == 1
- message << "Load path: #{paths.first}"
- else
- message << "Load paths:\n " << paths.join("\n ")
- end
- raise SyntaxError.new(message)
- rescue SyntaxError => e
- raise SyntaxError.new(e.message, :line => self.line, :filename => @filename)
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/media_node.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/media_node.rb
deleted file mode 100644
index 6149379ee9..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/media_node.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-module Sass::Tree
- # A static node representing a `@media` rule.
- # `@media` rules behave differently from other directives
- # in that when they're nested within rules,
- # they bubble up to top-level.
- #
- # @see Sass::Tree
- class MediaNode < DirectiveNode
- # The media query (e.g. `print` or `screen`).
- #
- # @return [String]
- attr_accessor :query
-
- # @see RuleNode#tabs
- attr_accessor :tabs
-
- # @see RuleNode#group_end
- attr_accessor :group_end
-
- # @param query [String] See \{#query}
- def initialize(query)
- @query = query
- @tabs = 0
- super('')
- end
-
- # @see DirectiveNode#value
- def value
- "@media #{query}"
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/mixin_def_node.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/mixin_def_node.rb
deleted file mode 100644
index 1d08fb063d..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/mixin_def_node.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-module Sass
- module Tree
- # A dynamic node representing a mixin definition.
- #
- # @see Sass::Tree
- class MixinDefNode < Node
- # The mixin name.
- # @return [String]
- attr_reader :name
-
- # The arguments for the mixin.
- # Each element is a tuple containing the variable for argument
- # and the parse tree for the default value of the argument.
- #
- # @return [Array<(Script::Node, Script::Node)>]
- attr_reader :args
-
- # @param name [String] The mixin name
- # @param args [Array<(Script::Node, Script::Node)>] See \{#args}
- def initialize(name, args)
- @name = name
- @args = args
- super()
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/mixin_node.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/mixin_node.rb
deleted file mode 100644
index 6612ec68ad..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/mixin_node.rb
+++ /dev/null
@@ -1,32 +0,0 @@
-require 'sass/tree/node'
-
-module Sass::Tree
- # A static node representing a mixin include.
- # When in a static tree, the sole purpose is to wrap exceptions
- # to add the mixin to the backtrace.
- #
- # @see Sass::Tree
- class MixinNode < Node
- # The name of the mixin.
- # @return [String]
- attr_reader :name
-
- # The arguments to the mixin.
- # @return [Array]
- attr_reader :args
-
- # A hash from keyword argument names to values.
- # @return [{String => Script::Node}]
- attr_reader :keywords
-
- # @param name [String] The name of the mixin
- # @param args [Array] See \{#args}
- # @param keywords [{String => Script::Node}] See \{#keywords}
- def initialize(name, args, keywords)
- @name = name
- @args = args
- @keywords = keywords
- super()
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/node.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/node.rb
deleted file mode 100644
index 63b4a48157..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/node.rb
+++ /dev/null
@@ -1,204 +0,0 @@
-module Sass
- # A namespace for nodes in the Sass parse tree.
- #
- # The Sass parse tree has three states: dynamic, static Sass, and static CSS.
- #
- # When it's first parsed, a Sass document is in the dynamic state.
- # It has nodes for mixin definitions and `@for` loops and so forth,
- # in addition to nodes for CSS rules and properties.
- # Nodes that only appear in this state are called **dynamic nodes**.
- #
- # {Tree::Visitors::Perform} creates a static Sass tree, which is different.
- # It still has nodes for CSS rules and properties
- # but it doesn't have any dynamic-generation-related nodes.
- # The nodes in this state are in the same structure as the Sass document:
- # rules and properties are nested beneath one another.
- # Nodes that can be in this state or in the dynamic state
- # are called **static nodes**.
- #
- # {Tree::Visitors::Cssize} is then used to create a static CSS tree.
- # This is like a static Sass tree,
- # but the structure exactly mirrors that of the generated CSS.
- # Rules and properties can't be nested beneath one another in this state.
- #
- # Finally, {Tree::Visitors::ToCss} can be called on a static CSS tree
- # to get the actual CSS code as a string.
- module Tree
- # The abstract superclass of all parse-tree nodes.
- class Node
- include Enumerable
-
- # The child nodes of this node.
- #
- # @return [Array]
- attr_accessor :children
-
- # Whether or not this node has child nodes.
- # This may be true even when \{#children} is empty,
- # in which case this node has an empty block (e.g. `{}`).
- #
- # @return [Boolean]
- attr_accessor :has_children
-
- # The line of the document on which this node appeared.
- #
- # @return [Fixnum]
- attr_accessor :line
-
- # The name of the document on which this node appeared.
- #
- # @return [String]
- attr_writer :filename
-
- # The options hash for the node.
- # See {file:SASS_REFERENCE.md#sass_options the Sass options documentation}.
- #
- # @return [{Symbol => Object}]
- attr_reader :options
-
- def initialize
- @children = []
- end
-
- # Sets the options hash for the node and all its children.
- #
- # @param options [{Symbol => Object}] The options
- # @see #options
- def options=(options)
- children.each {|c| c.options = options}
- @options = options
- end
-
- # @private
- def children=(children)
- self.has_children ||= !children.empty?
- @children = children
- end
-
- # The name of the document on which this node appeared.
- #
- # @return [String]
- def filename
- @filename || (@options && @options[:filename])
- end
-
- # Appends a child to the node.
- #
- # @param child [Tree::Node, Array] The child node or nodes
- # @raise [Sass::SyntaxError] if `child` is invalid
- def <<(child)
- return if child.nil?
- if child.is_a?(Array)
- child.each {|c| self << c}
- else
- self.has_children = true
- @children << child
- end
- end
-
- # Compares this node and another object (only other {Tree::Node}s will be equal).
- # This does a structural comparison;
- # if the contents of the nodes and all the child nodes are equivalent,
- # then the nodes are as well.
- #
- # Only static nodes need to override this.
- #
- # @param other [Object] The object to compare with
- # @return [Boolean] Whether or not this node and the other object
- # are the same
- # @see Sass::Tree
- def ==(other)
- self.class == other.class && other.children == children
- end
-
- # True if \{#to\_s} will return `nil`;
- # that is, if the node shouldn't be rendered.
- # Should only be called in a static tree.
- #
- # @return [Boolean]
- def invisible?; false; end
-
- # The output style. See {file:SASS_REFERENCE.md#sass_options the Sass options documentation}.
- #
- # @return [Symbol]
- def style
- @options[:style]
- end
-
- # Computes the CSS corresponding to this static CSS tree.
- #
- # @return [String, nil] The resulting CSS
- # @see Sass::Tree
- def to_s
- Sass::Tree::Visitors::ToCss.visit(self)
- end
-
- # Converts a static CSS tree (e.g. the output of \{Tree::Visitors::Cssize})
- # into another static CSS tree,
- # with the given extensions applied to all relevant {RuleNode}s.
- #
- # @todo Link this to the reference documentation on `@extend`
- # when such a thing exists.
- #
- # @param extends [Sass::Util::SubsetMap{Selector::Simple => Selector::Sequence}]
- # The extensions to perform on this tree
- # @return [Tree::Node] The resulting tree of static CSS nodes.
- # @raise [Sass::SyntaxError] Only if there's a programmer error
- # and this is not a static CSS tree
- def do_extend(extends)
- node = dup
- node.children = children.map {|c| c.do_extend(extends)}
- node
- rescue Sass::SyntaxError => e
- e.modify_backtrace(:filename => filename, :line => line)
- raise e
- end
-
- # Iterates through each node in the tree rooted at this node
- # in a pre-order walk.
- #
- # @yield node
- # @yieldparam node [Node] a node in the tree
- def each(&block)
- yield self
- children.each {|c| c.each(&block)}
- end
-
- # Converts a node to Sass code that will generate it.
- #
- # @param options [{Symbol => Object}] An options hash (see {Sass::CSS#initialize})
- # @return [String] The Sass code corresponding to the node
- def to_sass(options = {})
- Sass::Tree::Visitors::Convert.visit(self, options, :sass)
- end
-
- # Converts a node to SCSS code that will generate it.
- #
- # @param options [{Symbol => Object}] An options hash (see {Sass::CSS#initialize})
- # @return [String] The Sass code corresponding to the node
- def to_scss(options = {})
- Sass::Tree::Visitors::Convert.visit(self, options, :scss)
- end
-
- # Return a deep clone of this node.
- # The child nodes are cloned, but options are not.
- #
- # @return [Node]
- def deep_copy
- node = dup
- node.children = children.map {|c| c.deep_copy}
- node
- end
-
- protected
-
- # @see Sass::Shared.balance
- # @raise [Sass::SyntaxError] if the brackets aren't balanced
- def balance(*args)
- res = Sass::Shared.balance(*args)
- return res if res
- raise Sass::SyntaxError.new("Unbalanced brackets.", :line => line)
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/prop_node.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/prop_node.rb
deleted file mode 100644
index 53797f1f4b..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/prop_node.rb
+++ /dev/null
@@ -1,155 +0,0 @@
-module Sass::Tree
- # A static node reprenting a CSS property.
- #
- # @see Sass::Tree
- class PropNode < Node
- # The name of the property,
- # interspersed with {Sass::Script::Node}s
- # representing `#{}`-interpolation.
- # Any adjacent strings will be merged together.
- #
- # @return [Array]
- attr_accessor :name
-
- # The name of the property
- # after any interpolated SassScript has been resolved.
- # Only set once \{Tree::Visitors::Perform} has been run.
- #
- # @return [String]
- attr_accessor :resolved_name
-
- # The value of the property.
- #
- # @return [Sass::Script::Node]
- attr_accessor :value
-
- # Whether the property was marked as !important.
- #
- # @return [Boolean]
- attr_accessor :important
-
- # The value of the property
- # after any interpolated SassScript has been resolved.
- # Only set once \{Tree::Visitors::Perform} has been run.
- #
- # @return [String]
- attr_accessor :resolved_value
-
- # How deep this property is indented
- # relative to a normal property.
- # This is only greater than 0 in the case that:
- #
- # * This node is in a CSS tree
- # * The style is :nested
- # * This is a child property of another property
- # * The parent property has a value, and thus will be rendered
- #
- # @return [Fixnum]
- attr_accessor :tabs
-
- # @param name [Array] See \{#name}
- # @param value [Sass::Script::Node] See \{#value}
- # @param important [Boolean] whether this is an !important property
- # @param prop_syntax [Symbol] `:new` if this property uses `a: b`-style syntax,
- # `:old` if it uses `:a b`-style syntax
- def initialize(name, value, important, prop_syntax)
- @name = Sass::Util.strip_string_array(
- Sass::Util.merge_adjacent_strings(name))
- @value = value
- @tabs = 0
- @prop_syntax = prop_syntax
- @important = important
- super()
- end
-
- # Compares the names and values of two properties.
- #
- # @param other [Object] The object to compare with
- # @return [Boolean] Whether or not this node and the other object
- # are the same
- def ==(other)
- self.class == other.class && name == other.name && value == other.value && super
- end
-
- # Returns a appropriate message indicating how to escape pseudo-class selectors.
- # This only applies for old-style properties with no value,
- # so returns the empty string if this is new-style.
- #
- # @return [String] The message
- def pseudo_class_selector_message
- return "" if @prop_syntax == :new || !value.is_a?(Sass::Script::String) || !value.value.empty?
- "\nIf #{declaration.dump} should be a selector, use \"\\#{declaration}\" instead."
- end
-
- # Computes the Sass or SCSS code for the variable declaration.
- # This is like \{#to\_scss} or \{#to\_sass},
- # except it doesn't print any child properties or a trailing semicolon.
- #
- # @param opts [{Symbol => Object}] The options hash for the tree.
- # @param fmt [Symbol] `:scss` or `:sass`.
- def declaration(opts = {:old => @prop_syntax == :old}, fmt = :sass)
- name = self.name.map {|n| n.is_a?(String) ? n : "\#{#{n.to_sass(opts)}}"}.join
- if name[0] == ?:
- raise Sass::SyntaxError.new("The \"#{name}: #{self.class.val_to_sass(value, opts)}\" hack is not allowed in the Sass indented syntax")
- end
-
- old = opts[:old] && fmt == :sass
- initial = old ? ':' : ''
- mid = old ? '' : ':'
- "#{initial}#{name}#{mid} #{self.class.val_to_sass(value, opts)}#{' !important' if important}".rstrip
- end
-
- private
-
- def check!
- if @options[:property_syntax] && @options[:property_syntax] != @prop_syntax
- raise Sass::SyntaxError.new(
- "Illegal property syntax: can't use #{@prop_syntax} syntax when :property_syntax => #{@options[:property_syntax].inspect} is set.")
- elsif resolved_value.empty?
- raise Sass::SyntaxError.new("Invalid property: #{declaration.dump} (no value)." +
- pseudo_class_selector_message)
- end
- end
-
- class << self
- # @private
- def val_to_sass(value, opts)
- val_to_sass_comma(value, opts).to_sass(opts)
- end
-
- private
-
- def val_to_sass_comma(node, opts)
- return node unless node.is_a?(Sass::Script::Operation)
- return val_to_sass_concat(node, opts) unless node.operator == :comma
-
- Sass::Script::Operation.new(
- val_to_sass_concat(node.operand1, opts),
- val_to_sass_comma(node.operand2, opts),
- node.operator)
- end
-
- def val_to_sass_concat(node, opts)
- return node unless node.is_a?(Sass::Script::Operation)
- return val_to_sass_div(node, opts) unless node.operator == :space
-
- Sass::Script::Operation.new(
- val_to_sass_div(node.operand1, opts),
- val_to_sass_concat(node.operand2, opts),
- node.operator)
- end
-
- def val_to_sass_div(node, opts)
- unless node.is_a?(Sass::Script::Operation) && node.operator == :div &&
- node.operand1.is_a?(Sass::Script::Number) &&
- node.operand2.is_a?(Sass::Script::Number) &&
- (!node.operand1.original || !node.operand2.original)
- return node
- end
-
- Sass::Script::String.new("(#{node.to_sass(opts)})")
- end
-
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/return_node.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/return_node.rb
deleted file mode 100644
index 2d4244974f..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/return_node.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-module Sass
- module Tree
- # A dynamic node representing returning from a function.
- #
- # @see Sass::Tree
- class ReturnNode < Node
- # The expression to return.
- # @type [Script::Node]
- attr_reader :expr
-
- # @param expr [Script::Node] The expression to return
- def initialize(expr)
- @expr = expr
- super()
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/root_node.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/root_node.rb
deleted file mode 100644
index f50fd1b42f..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/root_node.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-module Sass
- module Tree
- # A static node that is the root node of the Sass document.
- class RootNode < Node
- # The Sass template from which this node was created
- #
- # @param template [String]
- attr_reader :template
-
- # @param template [String] The Sass template from which this node was created
- def initialize(template)
- super()
- @template = template
- end
-
- # Runs the dynamic Sass code *and* computes the CSS for the tree.
- # @see #to_s
- def render
- Visitors::CheckNesting.visit(self)
- result = Visitors::Perform.visit(self)
- Visitors::CheckNesting.visit(result) # Check again to validate mixins
- result, extends = Visitors::Cssize.visit(result)
- result = result.do_extend(extends) unless extends.empty?
- result.to_s
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/rule_node.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/rule_node.rb
deleted file mode 100644
index 338c6ba0e2..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/rule_node.rb
+++ /dev/null
@@ -1,129 +0,0 @@
-require 'pathname'
-require 'uri'
-
-module Sass::Tree
- # A static node reprenting a CSS rule.
- #
- # @see Sass::Tree
- class RuleNode < Node
- # The character used to include the parent selector
- PARENT = '&'
-
- # The CSS selector for this rule,
- # interspersed with {Sass::Script::Node}s
- # representing `#{}`-interpolation.
- # Any adjacent strings will be merged together.
- #
- # @return [Array]
- attr_accessor :rule
-
- # The CSS selector for this rule,
- # without any unresolved interpolation
- # but with parent references still intact.
- # It's only set once {Tree::Node#perform} has been called.
- #
- # @return [Selector::CommaSequence]
- attr_accessor :parsed_rules
-
- # The CSS selector for this rule,
- # without any unresolved interpolation or parent references.
- # It's only set once {Tree::Visitors::Cssize} has been run.
- #
- # @return [Selector::CommaSequence]
- attr_accessor :resolved_rules
-
- # How deep this rule is indented
- # relative to a base-level rule.
- # This is only greater than 0 in the case that:
- #
- # * This node is in a CSS tree
- # * The style is :nested
- # * This is a child rule of another rule
- # * The parent rule has properties, and thus will be rendered
- #
- # @return [Fixnum]
- attr_accessor :tabs
-
- # Whether or not this rule is the last rule in a nested group.
- # This is only set in a CSS tree.
- #
- # @return [Boolean]
- attr_accessor :group_end
-
- # @param rule [Array]
- # The CSS rule. See \{#rule}
- def initialize(rule)
- merged = Sass::Util.merge_adjacent_strings(rule)
- @rule = Sass::Util.strip_string_array(merged)
- @tabs = 0
- try_to_parse_non_interpolated_rules
- super()
- end
-
- # If we've precached the parsed selector, set the line on it, too.
- def line=(line)
- @parsed_rules.line = line if @parsed_rules
- super
- end
-
- # If we've precached the parsed selector, set the filename on it, too.
- def filename=(filename)
- @parsed_rules.filename = filename if @parsed_rules
- super
- end
-
- # Compares the contents of two rules.
- #
- # @param other [Object] The object to compare with
- # @return [Boolean] Whether or not this node and the other object
- # are the same
- def ==(other)
- self.class == other.class && rule == other.rule && super
- end
-
- # Adds another {RuleNode}'s rules to this one's.
- #
- # @param node [RuleNode] The other node
- def add_rules(node)
- @rule = Sass::Util.strip_string_array(
- Sass::Util.merge_adjacent_strings(@rule + ["\n"] + node.rule))
- try_to_parse_non_interpolated_rules
- end
-
- # @return [Boolean] Whether or not this rule is continued on the next line
- def continued?
- last = @rule.last
- last.is_a?(String) && last[-1] == ?,
- end
-
- # Extends this Rule's selector with the given `extends`.
- #
- # @see Node#do_extend
- def do_extend(extends)
- node = dup
- node.resolved_rules = resolved_rules.do_extend(extends)
- node
- end
-
- # A hash that will be associated with this rule in the CSS document
- # if the {file:SASS_REFERENCE.md#debug_info-option `:debug_info` option} is enabled.
- # This data is used by e.g. [the FireSass Firebug extension](https://addons.mozilla.org/en-US/firefox/addon/103988).
- #
- # @return [{#to_s => #to_s}]
- def debug_info
- {:filename => filename && ("file://" + URI.escape(File.expand_path(filename))),
- :line => self.line}
- end
-
- private
-
- def try_to_parse_non_interpolated_rules
- if @rule.all? {|t| t.kind_of?(String)}
- # We don't use real filename/line info because we don't have it yet.
- # When we get it, we'll set it on the parsed rules if possible.
- parser = Sass::SCSS::StaticParser.new(@rule.join.strip, 1)
- @parsed_rules = parser.parse_selector('') rescue nil
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/variable_node.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/variable_node.rb
deleted file mode 100644
index e0ae6a055e..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/variable_node.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-module Sass
- module Tree
- # A dynamic node representing a variable definition.
- #
- # @see Sass::Tree
- class VariableNode < Node
- # The name of the variable.
- # @return [String]
- attr_reader :name
-
- # The parse tree for the variable value.
- # @return [Script::Node]
- attr_reader :expr
-
- # Whether this is a guarded variable assignment (`!default`).
- # @return [Boolean]
- attr_reader :guarded
-
- # @param name [String] The name of the variable
- # @param expr [Script::Node] See \{#expr}
- # @param guarded [Boolean] See \{#guarded}
- def initialize(name, expr, guarded)
- @name = name
- @expr = expr
- @guarded = guarded
- super()
- end
- end
- end
-end
diff --git a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/visitors/base.rb b/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/visitors/base.rb
deleted file mode 100644
index ebbf5fd8ed..0000000000
--- a/jruby/src/main/resources/gem/gems/haml-3.1.1/vendor/sass/lib/sass/tree/visitors/base.rb
+++ /dev/null
@@ -1,75 +0,0 @@
-# Visitors are used to traverse the Sass parse tree.
-# Visitors should extend {Visitors::Base},
-# which provides a small amount of scaffolding for traversal.
-module Sass::Tree::Visitors
- # The abstract base class for Sass visitors.
- # Visitors should extend this class,
- # then implement `visit_*` methods for each node they care about
- # (e.g. `visit_rule` for {RuleNode} or `visit_for` for {ForNode}).
- # These methods take the node in question as argument.
- # They may `yield` to visit the child nodes of the current node.
- #
- # *Note*: due to the unusual nature of {Sass::Tree::IfNode},
- # special care must be taken to ensure that it is properly handled.
- # In particular, there is no built-in scaffolding
- # for dealing with the return value of `@else` nodes.
- #
- # @abstract
- class Base
- # Runs the visitor on a tree.
- #
- # @param root [Tree::Node] The root node of the Sass tree.
- # @return [Object] The return value of \{#visit} for the root node.
- def self.visit(root)
- new.send(:visit, root)
- end
-
- protected
-
- # Runs the visitor on the given node.
- # This can be overridden by subclasses that need to do something for each node.
- #
- # @param node [Tree::Node] The node to visit.
- # @return [Object] The return value of the `visit_*` method for this node.
- def visit(node)
- method = "visit_#{node_name node}"
- if self.respond_to?(method)
- self.send(method, node) {visit_children(node)}
- else
- visit_children(node)
- end
- end
-
- # Visit the child nodes for a given node.
- # This can be overridden by subclasses that need to do something
- # with the child nodes' return values.
- #
- # This method is run when `visit_*` methods `yield`,
- # and its return value is returned from the `yield`.
- #
- # @param parent [Tree::Node] The parent node of the children to visit.
- # @return [Array