Skip to content

Commit f680c1d

Browse files
author
Richard Wallace
committed
adding distributionManagement and scm sections, updating a few deps
1 parent 54a6deb commit f680c1d

File tree

5 files changed

+46
-27
lines changed

5 files changed

+46
-27
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target

pom.xml

+39-21
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
<project>
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
23
<modelVersion>4.0.0</modelVersion>
3-
<groupId>com.threelevers.css</groupId>
4-
<artifactId>3levers-css</artifactId>
5-
<version>1-SNAPSHOT</version>
4+
<groupId>com.3levers.cssselectors</groupId>
5+
<artifactId>cssselectors</artifactId>
6+
<version>1.0-SNAPSHOT</version>
67
<name>CSS Selectors</name>
78
<build>
89
<plugins>
@@ -28,6 +29,13 @@
2829
</executions>
2930
</plugin>
3031
</plugins>
32+
<extensions>
33+
<extension>
34+
<groupId>org.jvnet.wagon-svn</groupId>
35+
<artifactId>wagon-svn</artifactId>
36+
<version>1.8</version>
37+
</extension>
38+
</extensions>
3139
</build>
3240
<dependencies>
3341
<dependency>
@@ -36,32 +44,26 @@
3644
<version>3.0.1</version>
3745
</dependency>
3846
<dependency>
39-
<groupId>com.google.code.google-collections</groupId>
40-
<artifactId>google-collect</artifactId>
41-
<version>snapshot-20080530</version>
47+
<groupId>com.google.collections</groupId>
48+
<artifactId>google-collections</artifactId>
49+
<version>1.0-rc2</version>
4250
</dependency>
4351
<dependency>
4452
<groupId>junit</groupId>
4553
<artifactId>junit-dep</artifactId>
4654
<version>4.5</version>
4755
<scope>test</scope>
56+
<exclusions>
57+
<exclusion>
58+
<groupId>org.hamcrest</groupId>
59+
<artifactId>hamcrest-core</artifactId>
60+
</exclusion>
61+
</exclusions>
4862
</dependency>
4963
<dependency>
5064
<groupId>org.hamcrest</groupId>
51-
<artifactId>hamcrest-core</artifactId>
52-
<version>1.2RC3</version>
53-
<scope>test</scope>
54-
</dependency>
55-
<dependency>
56-
<groupId>org.hamcrest</groupId>
57-
<artifactId>hamcrest-library</artifactId>
58-
<version>1.2RC3</version>
59-
<scope>test</scope>
60-
</dependency>
61-
<dependency>
62-
<groupId>org.hamcrest</groupId>
63-
<artifactId>hamcrest-integration</artifactId>
64-
<version>1.2RC3</version>
65+
<artifactId>hamcrest-all</artifactId>
66+
<version>1.2</version>
6567
<scope>test</scope>
6668
</dependency>
6769
<dependency>
@@ -71,4 +73,20 @@
7173
<scope>test</scope>
7274
</dependency>
7375
</dependencies>
76+
<distributionManagement>
77+
<repository>
78+
<uniqueVersion>false</uniqueVersion>
79+
<id>3levers-googlecode-releases</id>
80+
<url>svn:https://3levers.googlecode.com/svn/maven2/releases</url>
81+
</repository>
82+
<snapshotRepository>
83+
<uniqueVersion>true</uniqueVersion>
84+
<id>3levers-googlecode-snapshots</id>
85+
<url>svn:https://3levers.googlecode.com/svn/maven2/snapshots</url>
86+
</snapshotRepository>
87+
</distributionManagement>
88+
<scm>
89+
<connection>scm:git:git://github.com/rwallace/cssselectors.git</connection>
90+
<url>scm:git:git://github.com/rwallace/cssselectors.git</url>
91+
</scm>
7492
</project>

src/main/java/com/threelevers/css/Nodes.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import org.w3c.dom.NodeList;
77

88
import com.google.common.base.Predicate;
9-
import com.google.common.collect.AbstractIterable;
109
import com.google.common.collect.AbstractIterator;
1110

1211
public final class Nodes {
@@ -17,7 +16,7 @@ static boolean isElement(Node node) {
1716
}
1817

1918
static Iterable<Node> asIterable(final NodeList nodes) {
20-
return new AbstractIterable<Node>() {
19+
return new Iterable<Node>() {
2120
public Iterator<Node> iterator() {
2221
return new AbstractIterator<Node>() {
2322
int index = -1;

src/main/java/com/threelevers/css/Selector.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.threelevers.css;
22

33
import static com.google.common.collect.Iterables.concat;
4-
import static com.google.common.collect.Iterables.emptyIterable;
54
import static com.threelevers.css.CssSelectors.selectors;
65
import static com.threelevers.css.Nodes.isElement;
76

@@ -11,6 +10,8 @@
1110
import org.w3c.dom.Element;
1211
import org.w3c.dom.NodeList;
1312

13+
import com.google.common.collect.ImmutableSet;
14+
1415
public final class Selector {
1516
private final Element element;
1617

@@ -31,7 +32,7 @@ public Iterable<Element> select(String selector) {
3132
}
3233

3334
static Iterable<Element> select(Element element, CssSelector matcher) {
34-
Iterable<Element> matches = emptyIterable();
35+
Iterable<Element> matches = ImmutableSet.of();
3536
if (matcher.matches(element)) {
3637
matches = concat(matches, Collections.singletonList(element));
3738
}

src/test/java/com/threelevers/css/SelectorTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.threelevers.css;
22

3-
import static com.google.common.collect.Iterables.newArray;
3+
import static com.google.common.collect.Iterables.toArray;
44
import static com.threelevers.css.DocumentBuilder.doc;
55
import static com.threelevers.css.Matchers.elements;
66
import static com.threelevers.css.Selector.from;
@@ -338,6 +338,6 @@ public void assertThatElementsCanBeSelectedWithSelected() {
338338
}
339339

340340
static Element[] elementsSelectedWith(String selector) {
341-
return newArray(from(doc).select(selector), Element.class);
341+
return toArray(from(doc).select(selector), Element.class);
342342
}
343343
}

0 commit comments

Comments
 (0)