rainfall 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 97f5f489c934f6bf865dcd2a06df4c3230bd803d
4
+ data.tar.gz: 116f5686fa66c7f5eab424eeceee2221ff25ad15
5
+ SHA512:
6
+ metadata.gz: 84af6fe8c0de04cba42296f6301367b341ba3e85ca8e863d091cfd7664a3f94bd046d61088a3142c3b688fc44c7f7a04f466c9517406a1c04fd83aaffc7e99b0
7
+ data.tar.gz: 0460a6132d08bcf507473015e90d1762365d2f7e8767b3c4ae1afeeaa34e5a181d81bdefdefaab1fb272c7991a787c79773c7a9258fb973e8d9447edff772cd8
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ pkg/*
4
+ .DS_store
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # gem dependencies are specified in rainfall.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,30 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ rainfall (0.1.0)
5
+ cloudapp_api (~> 0.4.0)
6
+ httparty (~> 0.12.0)
7
+ stamp
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ cloudapp_api (0.4.0)
13
+ httparty
14
+ httparty
15
+ mime-types
16
+ httparty (0.12.0)
17
+ json (~> 1.8)
18
+ multi_xml (>= 0.5.2)
19
+ json (1.8.1)
20
+ mime-types (2.0)
21
+ multi_xml (0.5.5)
22
+ rake (10.1.0)
23
+ stamp (0.5.0)
24
+
25
+ PLATFORMS
26
+ ruby
27
+
28
+ DEPENDENCIES
29
+ rainfall!
30
+ rake
data/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # Rainfall
2
+
3
+ A ruby gem CLI for downloading everything in your [cloudapp](http://getcloudapp.com/) account to your hard drive.
4
+
5
+ ## Installation
6
+
7
+ gem install rainfall
8
+
9
+ ## Usage
10
+
11
+ rainfall ./target/download/dir
12
+
13
+ ## License
14
+
15
+ WTFPL
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/rainfall ADDED
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ %w(date uri rubygems cloudapp_api httparty stamp).each {|lib| require lib }
4
+
5
+ if ARGV.empty?
6
+ puts "\nUsage: rainfall ./path/to/download/dir\n"
7
+ exit(1)
8
+ else
9
+ dir = ARGV.last
10
+ end
11
+
12
+ puts "What's your cloudapp email address?"
13
+ email = $stdin.gets.chomp
14
+ puts "What's your cloudapp password?"
15
+ password = $stdin.gets.chomp
16
+
17
+ CloudApp.authenticate email, password
18
+
19
+ # Create the downloads directory if it doesn't already exist.
20
+ Dir.mkdir(dir) unless File.exists?(dir)
21
+
22
+ 1.upto(100) do |page|
23
+
24
+ drops = CloudApp::Drop.all({
25
+ :per_page => 100,
26
+ :page => page
27
+ })
28
+
29
+ for drop in drops
30
+ date_prefix = Date.parse(drop.data["created_at"]).stamp("2012-12-31")
31
+ name = drop.data["name"]
32
+ url = drop.data["remote_url"]
33
+ filename = File.join(dir, "/#{date_prefix} #{name}")
34
+ puts filename
35
+ puts url
36
+ puts
37
+
38
+ next if filename.include? "http://"
39
+ next unless url =~ URI::regexp
40
+
41
+ unless File.exists? filename
42
+ File.open(filename, "w+") do |f|
43
+ f.write HTTParty.get(url).parsed_response
44
+ end
45
+ end
46
+ end
47
+
48
+ end
data/rainfall.gemspec ADDED
@@ -0,0 +1,16 @@
1
+ # -*- encoding: utf-8 -*-
2
+ Gem::Specification.new do |gem|
3
+ gem.name = "rainfall"
4
+ gem.authors = ["Zeke Sikelianos"]
5
+ gem.email = ["zeke@sikelianos.com"]
6
+ gem.description = %q{Download everything in your cloudapp account to your hard drive.}
7
+ gem.summary = %q{Download everything in your cloudapp account to your hard drive.}
8
+ gem.homepage = "https://github.com/zeke/rainfall"
9
+ gem.files = `git ls-files`.split($\)
10
+ gem.executables = ["rainfall"]
11
+ gem.version = "0.1.0"
12
+ gem.add_development_dependency 'rake'
13
+ gem.add_dependency 'cloudapp_api', '~> 0.4.0'
14
+ gem.add_dependency 'httparty', '~> 0.12.0'
15
+ gem.add_dependency 'stamp'
16
+ end
metadata ADDED
@@ -0,0 +1,107 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rainfall
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Zeke Sikelianos
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-11-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: cloudapp_api
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 0.4.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 0.4.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: httparty
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 0.12.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 0.12.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: stamp
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Download everything in your cloudapp account to your hard drive.
70
+ email:
71
+ - zeke@sikelianos.com
72
+ executables:
73
+ - rainfall
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - .gitignore
78
+ - Gemfile
79
+ - Gemfile.lock
80
+ - README.md
81
+ - Rakefile
82
+ - bin/rainfall
83
+ - rainfall.gemspec
84
+ homepage: https://github.com/zeke/rainfall
85
+ licenses: []
86
+ metadata: {}
87
+ post_install_message:
88
+ rdoc_options: []
89
+ require_paths:
90
+ - lib
91
+ required_ruby_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - '>='
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ required_rubygems_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - '>='
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ requirements: []
102
+ rubyforge_project:
103
+ rubygems_version: 2.0.3
104
+ signing_key:
105
+ specification_version: 4
106
+ summary: Download everything in your cloudapp account to your hard drive.
107
+ test_files: []