picasaweb-backup 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,2 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
  gem "gdata_19", "~> 1.1.5"
3
+ gem "artii", "~> 2.0.1"
4
+ gem "colored", "~> 1.2"
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Picasaweb::Backup
2
2
 
3
- TODO: Write a gem description
3
+ A gem and executable to backup all your photos stored on Google's Picasaweb
4
+ service.
4
5
 
5
6
  ## Installation
6
7
 
@@ -18,7 +19,19 @@ Or install it yourself as:
18
19
 
19
20
  ## Usage
20
21
 
21
- TODO: Write usage instructions here
22
+ Create an empty folder an place a file called `account.yml` with the following
23
+ content:
24
+
25
+ ```yaml
26
+ username: YOUR_USERNAME
27
+ password: PASSWORD
28
+ ```
29
+
30
+ In the same directory run the following command
31
+ ```bash
32
+ $ picasaweb-backup
33
+ ```
34
+ and watch your photos being downloaded.
22
35
 
23
36
  ## Contributing
24
37
 
data/bin/picasaweb-backup CHANGED
@@ -2,23 +2,37 @@
2
2
  require 'rubygems'
3
3
  require 'optparse'
4
4
  require 'picasaweb-backup'
5
+ require 'artii'
6
+ require 'colored'
5
7
 
6
- data = {}
7
- usage = %{picasaweb-backup v.#{Picasaweb::Backup::VERSION}}
8
+ opts = {}
9
+ usage =
8
10
 
9
- OptionParser.new('Backing up your Picasaweb photos') do |opt|
10
- opt.version = '2'
11
- opt.on('--dir DIR') do |dir|
12
- data[:dir] = dir
11
+ opt_parser = OptionParser.new('Backing up your Picasaweb photos') do |opt|
12
+ artii = Artii::Base.new :font => "small"
13
+ opt.banner = artii.send(:output, "picasaweb-backup").green
14
+ opt.separator ""
15
+ opt.separator "version #{Picasaweb::Backup::VERSION}"
16
+ opt.separator ""
17
+ opt.separator "Options"
18
+ opt.on("--dir DIR", "optional directory in which the download should be executed") do |dir|
19
+ opts[:dir] = dir
20
+ end
21
+ opt.on("-h","--help", "print this help section") do
22
+ puts opt_parser
23
+ exit 0
13
24
  end
14
- begin
15
- opt.parse!(ARGV)
16
- rescue
17
- puts usage
18
- end
19
25
  end
20
26
 
27
+ opt_parser.parse!(ARGV)
28
+
21
29
  begin
30
+
31
+ if opts[:dir]
32
+ puts "Changing working directory to #{opts[:dir]}"
33
+ Dir.chdir opts[:dir]
34
+ end
35
+
22
36
  account = File.open("account.yml", 'r') { |f| YAML.load f }
23
37
  verify_account account
24
38
  client = picasa_client account["username"], account["password"]
@@ -72,7 +86,8 @@ begin
72
86
  end
73
87
  end
74
88
  rescue => e
75
- puts e.message
76
- puts usage
89
+ puts "ERROR: #{e.message}".red
90
+ puts ""
91
+ puts opt_parser
77
92
  end
78
93
 
@@ -1,5 +1,5 @@
1
1
  module Picasaweb
2
2
  module Backup
3
- VERSION = "0.1.1"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -10,7 +10,9 @@ Gem::Specification.new do |gem|
10
10
 
11
11
  gem.homepage = 'http://github.com/lenniboy/picasaweb-backup'
12
12
 
13
- gem.add_dependency('gdata_19', '~> 1.1.5')
13
+ gem.add_dependency('gdata_19', '~> 1.1.5')
14
+ gem.add_dependency('artii', '~> 2.0.1')
15
+ gem.add_dependency('colored', '~> 1.2')
14
16
 
15
17
  gem.files = `git ls-files`.split($\)
16
18
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: picasaweb-backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-02 00:00:00.000000000 Z
12
+ date: 2012-07-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gdata_19
@@ -27,6 +27,38 @@ dependencies:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  version: 1.1.5
30
+ - !ruby/object:Gem::Dependency
31
+ name: artii
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 2.0.1
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 2.0.1
46
+ - !ruby/object:Gem::Dependency
47
+ name: colored
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: '1.2'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '1.2'
30
62
  description: ! "Backup all your photos from Google's Picasa Web Albums service,\n
31
63
  \ can be run repeatedly on the same folder and only downloads new files."
32
64
  email: