diff --git a/README.md b/README.md index 56b7820..5655c50 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,15 @@ $ cat robots.html | pup ':contains("History")' ``` +```bash +$ cat robots.html | pup ':parent-of([action="edit"])' + + + Edit links + + +``` + For a complete list, view the [implemented selectors](#Implemented Selectors) section. @@ -167,29 +176,31 @@ For further examples of these selectors head over to [MDN]( https://developer.mozilla.org/en-US/docs/Web/CSS/Reference). ```bash -cat index.html | pup '.class' -cat index.html | pup '#id' -cat index.html | pup 'element' -cat index.html | pup 'selector + selector' -cat index.html | pup 'selector > selector' -cat index.html | pup '[attribute]' -cat index.html | pup '[attribute="value"]' -cat index.html | pup '[attribute*="value"]' -cat index.html | pup '[attribute~="value"]' -cat index.html | pup '[attribute^="value"]' -cat index.html | pup '[attribute$="value"]' -cat index.html | pup ':empty' -cat index.html | pup ':first-child' -cat index.html | pup ':first-of-type' -cat index.html | pup ':last-child' -cat index.html | pup ':last-of-type' -cat index.html | pup ':only-child' -cat index.html | pup ':only-of-type' -cat index.html | pup ':contains("text")' -cat index.html | pup ':nth-child(n)' -cat index.html | pup ':nth-of-type(n)' -cat index.html | pup ':nth-last-child(n)' -cat index.html | pup ':nth-last-of-type(n)' +pup '.class' +pup '#id' +pup 'element' +pup 'selector + selector' +pup 'selector > selector' +pup '[attribute]' +pup '[attribute="value"]' +pup '[attribute*="value"]' +pup '[attribute~="value"]' +pup '[attribute^="value"]' +pup '[attribute$="value"]' +pup ':empty' +pup ':first-child' +pup ':first-of-type' +pup ':last-child' +pup ':last-of-type' +pup ':only-child' +pup ':only-of-type' +pup ':contains("text")' +pup ':nth-child(n)' +pup ':nth-of-type(n)' +pup ':nth-last-child(n)' +pup ':nth-last-of-type(n)' +pup ':not(selector)' +pup ':parent-of(selector)' ``` You can mix and match selectors as you wish. diff --git a/pup.go b/pup.go index 2ffd8ee..1590eb3 100644 --- a/pup.go +++ b/pup.go @@ -17,7 +17,7 @@ import ( // |/ \_( # |" // C/ ,--___/ -var VERSION string = "0.3.3" +var VERSION string = "0.3.4" func main() { // process flags and arguments diff --git a/pup.rb b/pup.rb index 0d6f587..1dc8b5f 100644 --- a/pup.rb +++ b/pup.rb @@ -2,14 +2,14 @@ require 'formula' class Pup < Formula homepage 'https://github.com/EricChiang/pup' - version '0.3.3' + version '0.3.4' if Hardware.is_64_bit? - url 'https://github.com/EricChiang/pup/releases/download/v0.3.3/pup_darwin_amd64.zip' - sha1 'e5a74c032abd8bc81e4a12b06d0c071343811949' + url 'https://github.com/EricChiang/pup/releases/download/v0.3.4/pup_darwin_amd64.zip' + sha1 '5fec62701a49bfd5eaa4b9c980e9c06dcece78c6' else - url 'https://github.com/EricChiang/pup/releases/download/v0.3.3/pup_darwin_386.zip' - sha1 'cd7d18cae7d8bf6af8bdb04c963156a1b217dfcb' + url 'https://github.com/EricChiang/pup/releases/download/v0.3.4/pup_darwin_386.zip' + sha1 '1eb129c662d7e323c9b1e8f8ed3b8e28ce521434' end def install diff --git a/release.sh b/release.sh index 13c1da1..b782004 100755 --- a/release.sh +++ b/release.sh @@ -2,6 +2,8 @@ set -e +rm -f dist/* + gox -output "dist/{{.Dir}}_{{.OS}}_{{.Arch}}" cd dist