railscasts_download 0.2.1 → 0.2.2
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.
- data/README.md +1 -1
- data/lib/railscasts_download/page_explorer.rb +9 -10
- data/lib/railscasts_download/version.rb +1 -1
- metadata +7 -7
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Download all revised and pro railscasts with one-line command!
|
4
4
|
|
5
|
-
Downloader use Railscasts rss feed to get list of all videos. Automatic downloads for pro accounts
|
5
|
+
Downloader use Railscasts rss feed to get list of all videos. Automatic downloads for pro accounts working with V > 0.2.2.
|
6
6
|
|
7
7
|
## Example
|
8
8
|
|
@@ -15,21 +15,20 @@ module RailscastsDownload
|
|
15
15
|
def get_rss_body
|
16
16
|
if @login
|
17
17
|
login_to_pro( @login_uri, @login, @password )
|
18
|
-
|
19
|
-
@body = link.click.body
|
18
|
+
@body = pro_rss_link.click.body
|
20
19
|
else
|
21
20
|
@body = open( @free_uri ).read
|
22
21
|
end
|
23
|
-
@body
|
24
22
|
end
|
25
23
|
|
26
24
|
private
|
27
|
-
def
|
28
|
-
@agent.
|
25
|
+
def pro_rss_link
|
26
|
+
@page_with_rss_link = @agent.mech.get("https://railscasts.com/subscriptions/current")
|
27
|
+
@page_with_rss_link.links.map{|link| link if link.text == "RSS Feed"}.compact.first
|
29
28
|
end
|
30
29
|
|
31
|
-
def
|
32
|
-
unless
|
30
|
+
def validate_signed_in!
|
31
|
+
unless @page.links.map{|link| link if link.text == "Rss"}.compact.first
|
33
32
|
puts '!!! Bad login/password combination !!!'
|
34
33
|
exit
|
35
34
|
end
|
@@ -39,8 +38,8 @@ module RailscastsDownload
|
|
39
38
|
@agent = Mechanize.new.get( login_uri )
|
40
39
|
@agent.form.login = login
|
41
40
|
@agent.form.password = password
|
42
|
-
@
|
43
|
-
|
41
|
+
@page = @agent.form.submit
|
42
|
+
validate_signed_in!
|
44
43
|
end
|
45
44
|
end
|
46
|
-
end
|
45
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: railscasts_download
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-03-30 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mechanize
|
16
|
-
requirement: &
|
16
|
+
requirement: &17771200 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *17771200
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: highline
|
27
|
-
requirement: &
|
27
|
+
requirement: &17770260 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *17770260
|
36
36
|
description: Download all revised and pro railscasts with oneline command.
|
37
37
|
email:
|
38
38
|
- karol@knowicki.pl
|
@@ -78,7 +78,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
78
78
|
version: '0'
|
79
79
|
segments:
|
80
80
|
- 0
|
81
|
-
hash:
|
81
|
+
hash: 4169054339208887493
|
82
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
87
|
version: '0'
|
88
88
|
segments:
|
89
89
|
- 0
|
90
|
-
hash:
|
90
|
+
hash: 4169054339208887493
|
91
91
|
requirements: []
|
92
92
|
rubyforge_project: railscasts_download
|
93
93
|
rubygems_version: 1.8.17
|