xp 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/xp +18 -0
- metadata +59 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3816f96fa2151f29ab394b520e8808a88b0d3faa
|
4
|
+
data.tar.gz: c4d1cd91d8bf6e9f3a0ce051a4ab0bb22bc9e80f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 303beb7aff81b98ccca19bcf564c7a0f2d15bd52e10c2824fb3fbae530472d7b3d68daaa7e056f062abbf8d36a762096931921d578c7841069cd19abb22cc622
|
7
|
+
data.tar.gz: 57d532ab197bc5fe6cc0929799aadfbcee5cf14fbf4a16a67dd87fb1db043ba187f344c1d7e291f27df5bffb5e9c97e103c6de3274862492f14b291be5f2d445
|
data/bin/xp
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# $LOAD_PATH.unshift(File.expand_path("../../lib", "__FILE__"))
|
4
|
+
|
5
|
+
require 'nokogiri'
|
6
|
+
|
7
|
+
n = Nokogiri::HTML::parse STDIN.read
|
8
|
+
|
9
|
+
query = ARGV.select{ |o| o =~ /^\// }
|
10
|
+
options = ARGV - query
|
11
|
+
|
12
|
+
n.css(query.first).each do |element|
|
13
|
+
if options.any?{|o| ["-t", "--text"].include?(o) }
|
14
|
+
puts element.text
|
15
|
+
else
|
16
|
+
puts element
|
17
|
+
end
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: xp
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Jikku Jose
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-09-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: nokogiri
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: A 10 line xpath parser using Nokogiri to be used in commandline.
|
28
|
+
email:
|
29
|
+
executables:
|
30
|
+
- xp
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- bin/xp
|
35
|
+
homepage:
|
36
|
+
licenses:
|
37
|
+
- MIT
|
38
|
+
metadata: {}
|
39
|
+
post_install_message:
|
40
|
+
rdoc_options: []
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - '>='
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
requirements: []
|
54
|
+
rubyforge_project:
|
55
|
+
rubygems_version: 2.2.2
|
56
|
+
signing_key:
|
57
|
+
specification_version: 4
|
58
|
+
summary: A very simple commandline xpath parser.
|
59
|
+
test_files: []
|