snackpack 0.1.5 → 0.1.6

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.
Files changed (3) hide show
  1. data/bin/snackpack +19 -4
  2. data/lib/snackpack.rb +2 -2
  3. metadata +4 -3
data/bin/snackpack CHANGED
@@ -1,14 +1,29 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'snackpack'
4
+ require 'etc'
4
5
 
5
- unless FileTest.exists?('snackpack.yml')
6
- puts "Missing snackpack.yml"
7
- exit
6
+ user = Etc.getlogin
7
+ config = File.join(Dir.home(user), ".snackpack")
8
+
9
+ unless FileTest.exists?(config)
10
+ puts "Missing #{config}"
11
+ puts "Would you like to create it? (y/n)"
12
+ input = gets
13
+ case input.downcase.strip
14
+ when "y", "yes"
15
+ puts "Where would you like to save ruby tapas episodes? "
16
+ puts "example: /home/username/ruby-tapas/"
17
+ puts "Make sure to include the trailing slash /"
18
+ save_folder = gets.strip
19
+ File.open(config, 'w') { |f| f.puts ":stomach: " + save_folder.inspect }
20
+ else
21
+ exit
22
+ end
8
23
  end
9
24
 
10
25
  if ARGV.count >= 2
11
- Snackpack.new.enter_avdis_kitchen
26
+ Snackpack.new(config).enter_avdis_kitchen
12
27
  else
13
28
  puts "usage: snackpack username password"
14
29
  end
data/lib/snackpack.rb CHANGED
@@ -9,8 +9,8 @@ require_relative 'snackpack/snack_log.rb'
9
9
 
10
10
  class Snackpack
11
11
 
12
- def initialize
13
- @config = YAML.load_file('snackpack.yml')
12
+ def initialize(config)
13
+ @config = YAML.load_file(config)
14
14
  @email = ARGV[0]
15
15
  @password = ARGV[1]
16
16
  @snacker = Mechanize.new
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snackpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,10 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-14 00:00:00.000000000 Z
12
+ date: 2012-11-15 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: ! " Snackpack logs into your RubyTapas subscription and downloads\n
15
- \ all the available episodes with their supporting files onto your local\n computer.\n"
15
+ \ all the available episodes with their supporting files onto your local\n computer.
16
+ While also injecting the videos into the html files for easier\n viewing.\n"
16
17
  email: cory@schmitty.me
17
18
  executables:
18
19
  - snackpack