patu 0.1.0.pre → 0.1.1.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CODE_OF_CONDUCT.md +3 -1
- data/LICENSE.txt +1 -1
- data/lib/patu.rb +14 -0
- data/lib/patu/version.rb +1 -1
- data/patu-0.1.0.pre.gem +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a2ec85c2b9cc58f60ef06b7fedc1d759ce781d8
|
4
|
+
data.tar.gz: dd751a45b6d3e5c52c6796aa4276146cebd44a24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b548b42858b60afb3a004ca97e7472e249530fc0ca692287a9773e84298f128d2d78601374c8bb7b007ad32c88eb8e3bd4772f145ddf75209b415d74a99ad19f
|
7
|
+
data.tar.gz: 3a8b685b5c927310bc6858910fc9a2a0908a558eb89a38a3127f13659d9037bb3e2fe229a9df0c0ea9e8c8f3d1f98da3c4aeeae2a9fb5c364f4b398b343a6154
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Contributor Code of Conduct
|
2
2
|
|
3
|
+
Just be nice.
|
4
|
+
|
3
5
|
As contributors and maintainers of this project, and in the interest of
|
4
6
|
fostering an open and welcoming community, we pledge to respect all people who
|
5
7
|
contribute through reporting issues, posting feature requests, updating
|
@@ -46,4 +48,4 @@ version 1.3.0, available at
|
|
46
48
|
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
49
|
|
48
50
|
[homepage]: http://contributor-covenant.org
|
49
|
-
[version]: http://contributor-covenant.org/version/1/3/0/
|
51
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/LICENSE.txt
CHANGED
data/lib/patu.rb
CHANGED
@@ -11,6 +11,12 @@ module Patu
|
|
11
11
|
package_name 'patu'
|
12
12
|
default_task :print
|
13
13
|
|
14
|
+
desc :test, 'patu test will print out result on terminal'
|
15
|
+
def test url, pattern
|
16
|
+
test_process_argv(url, pattern)
|
17
|
+
end
|
18
|
+
|
19
|
+
|
14
20
|
desc :scrap, 'patu scrap <url> <pattern>'
|
15
21
|
def scrap url, pattern
|
16
22
|
process_argv(url, pattern)
|
@@ -47,6 +53,14 @@ module Patu
|
|
47
53
|
|
48
54
|
|
49
55
|
private
|
56
|
+
|
57
|
+
def test_process_argv(url, pattern)
|
58
|
+
web_page = Nokogiri::HTML(open(url))
|
59
|
+
scraped_result = web_page.css(pattern)
|
60
|
+
# print_csv(scraped_result, scraped_result.count)
|
61
|
+
puts "#{scraped_result} \n=======\nfound #{scraped_result.count} for pattern #{pattern}"
|
62
|
+
end
|
63
|
+
|
50
64
|
def process_argv(url, pattern)
|
51
65
|
web_page = Nokogiri::HTML(open(url))
|
52
66
|
scraped_result = web_page.css(pattern)
|
data/lib/patu/version.rb
CHANGED
data/patu-0.1.0.pre.gem
ADDED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: patu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Lim
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -75,6 +75,7 @@ files:
|
|
75
75
|
- lib/patu/dependencies.rb
|
76
76
|
- lib/patu/post_message.rb
|
77
77
|
- lib/patu/version.rb
|
78
|
+
- patu-0.1.0.pre.gem
|
78
79
|
- patu.gemspec
|
79
80
|
homepage: http://github.com/ytbryan/patu
|
80
81
|
licenses:
|