Module: DasCatalog
- Defined in:
- lib/das_catalog.rb,
lib/das_catalog/feed.rb,
lib/das_catalog/store.rb,
lib/das_catalog/version.rb,
lib/das_catalog/downloader.rb,
lib/das_catalog/screencast.rb,
lib/das_catalog/std_logger.rb,
lib/das_catalog/screencast_data.rb
Defined Under Namespace
Modules: LoggerAccess, Store Classes: Downloader, Feed, Screencast, ScreencastData, StdLogger
Constant Summary collapse
- SIGN_IN_URL =
"https://www.destroyallsoftware.com/screencasts/users/sign_in"
- VERSION =
"0.2.1"
Class Attribute Summary collapse
-
.downloads_directory ⇒ Object
Returns the value of attribute downloads_directory.
- .logger ⇒ Object
-
.password ⇒ Object
Returns the value of attribute password.
- .tracker_file ⇒ Object
-
.username ⇒ Object
Returns the value of attribute username.
Class Method Summary collapse
-
.agent ⇒ Object
TODO spec this.
- .configure {|_self| ... } ⇒ Object
-
.sync ⇒ Object
TODO spec this.
Class Attribute Details
.downloads_directory ⇒ Object
Returns the value of attribute downloads_directory.
10 11 12 |
# File 'lib/das_catalog.rb', line 10 def downloads_directory @downloads_directory end |
.logger ⇒ Object
13 14 15 |
# File 'lib/das_catalog.rb', line 13 def logger @logger ||= StdLogger.new end |
.password ⇒ Object
Returns the value of attribute password.
9 10 11 |
# File 'lib/das_catalog.rb', line 9 def password @password end |
.tracker_file ⇒ Object
18 19 20 |
# File 'lib/das_catalog.rb', line 18 def tracker_file @tracker_file ||= File.("~/.das_tracker.pstore") end |
.username ⇒ Object
Returns the value of attribute username.
8 9 10 |
# File 'lib/das_catalog.rb', line 8 def username @username end |
Class Method Details
.agent ⇒ Object
TODO spec this
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/das_catalog.rb', line 28 def self.agent @agent ||= begin agent = Mechanize.new page = agent.get SIGN_IN_URL form = page.forms.first form['user[email]'] = username form['user[password]'] = password agent.submit form agent end end |
.configure {|_self| ... } ⇒ Object
23 24 25 |
# File 'lib/das_catalog.rb', line 23 def self.configure yield self end |
.sync ⇒ Object
TODO spec this
41 42 43 44 45 46 47 |
# File 'lib/das_catalog.rb', line 41 def self.sync feed = Feed.get feed.items.each do |entry| sc = Screencast.for_link(entry.link) sc.download end end |