publish2cloud 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,8 +5,20 @@ require 'uri'
5
5
  require 'base64'
6
6
  require 'right_aws'
7
7
 
8
+ require 'open-uri'
9
+ require 'nokogiri'
10
+
8
11
  module Publish2Cloud
9
12
 
13
+ class Analyzer
14
+ def run url
15
+ doc = Nokogiri::HTML(open(url))
16
+ doc.css('a').each { |node|
17
+ puts node['href']
18
+ }
19
+ end
20
+ end
21
+
10
22
  class Publisher
11
23
 
12
24
  def initialize s3_access, s3_secret, s3_bucket, cf_distribution, max_age = nil
@@ -16,7 +16,7 @@ namespace :p2c do
16
16
  end
17
17
 
18
18
  desc "Analyze links of a given webpage"
19
- task :analyze do
20
- p ARGV
19
+ task :analyze, :url do |t, args|
20
+ Publish2Cloud::Analyzer.new.run args[:url]
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: publish2cloud
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Xue Yong Zhi
@@ -76,7 +76,7 @@ files:
76
76
  - lib/publish2cloud.rb
77
77
  - lib/tasks/publish2cloud.rake
78
78
  has_rdoc: true
79
- homepage:
79
+ homepage: http://github.com/yong/publish2cloud
80
80
  licenses: []
81
81
 
82
82
  post_install_message: