enable_beer 1.0.1
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.
- checksums.yaml +7 -0
- data/bin/enable_beer +4 -0
- data/lib/enable_beer.rb +57 -0
- metadata +61 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e5b8c6f115e8090e1b7f63ded355cb407da95875
|
4
|
+
data.tar.gz: fb4566ce8c09cd36a1352ce9576c11058a028da1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4e26f50ab46319655e47ffcd57764a4bee641c260d4d3d041340464be8d3401e83488c661fcb49a09aefbf85f1db31a4274f02fb5e051399e5700562e96eedf7
|
7
|
+
data.tar.gz: 54af5fcff0572f0c28f3cff2185dc3ad9d7d676559ec78f2bcdfd5eaa1626c01868b9edced42250a09a96a3b523fd0f9ee198b20c3fe5a41a87e0250a230db5e
|
data/bin/enable_beer
ADDED
data/lib/enable_beer.rb
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
require 'github_api'
|
4
|
+
|
5
|
+
def save_the_beers(args)
|
6
|
+
|
7
|
+
if args.length != 1
|
8
|
+
puts "USAGE: ./enable_beer <GH USERNAME>"
|
9
|
+
exit
|
10
|
+
end
|
11
|
+
|
12
|
+
begin
|
13
|
+
require 'io/console'
|
14
|
+
rescue LoadError
|
15
|
+
end
|
16
|
+
|
17
|
+
if STDIN.respond_to?(:noecho)
|
18
|
+
def get_password(prompt="Password: ")
|
19
|
+
print prompt
|
20
|
+
STDIN.noecho(&:gets).chomp
|
21
|
+
end
|
22
|
+
else
|
23
|
+
def get_password(prompt="Password: ")
|
24
|
+
`read -s -p "#{prompt}" password; echo $password`.chomp
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
pwd = Dir.pwd
|
29
|
+
`ln -f -s ~/Dropbox #{pwd}/dropbox`
|
30
|
+
`mkdir -p #{pwd}/dropbox/gh_rescued_beers`
|
31
|
+
`mkdir -p #{pwd}/sources`
|
32
|
+
|
33
|
+
user = args[0]
|
34
|
+
|
35
|
+
pass = get_password("Enter your GH password here for #{user}: ")
|
36
|
+
github = Github.new login: user, password: pass
|
37
|
+
|
38
|
+
puts "Listing repos with #BACKUP in the description"
|
39
|
+
a = github.repos.list(:sources)
|
40
|
+
|
41
|
+
puts "-> Repos marked #BACKUP in the description"
|
42
|
+
puts "-------"
|
43
|
+
|
44
|
+
marked = a.select { | r | r.description.match('#BACKUP') }
|
45
|
+
marked.each do |repo|
|
46
|
+
puts "-> #{repo.full_name} - #{repo.description}"
|
47
|
+
end
|
48
|
+
|
49
|
+
marked.each do |repo|
|
50
|
+
puts "Cloning...."
|
51
|
+
`git clone #{repo.ssh_url} #{pwd}/sources/#{repo.name}`
|
52
|
+
`cd #{pwd}/sources && tar czvf #{repo.name}.tgz #{repo.name}`
|
53
|
+
end
|
54
|
+
`cp #{pwd}/sources/*.tgz #{pwd}/dropbox/gh_rescued_beers`
|
55
|
+
|
56
|
+
puts "Add #BACKUP in the description to back it up.."
|
57
|
+
end
|
metadata
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: enable_beer
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Emile Bosch
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-08-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: github_api
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.10'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.10'
|
27
|
+
description: 'Enable_beer backs up your private git repo''s to dropbox so you can
|
28
|
+
save money and buy beers instead. '
|
29
|
+
email: emilebosch@me.com
|
30
|
+
executables:
|
31
|
+
- enable_beer
|
32
|
+
extensions: []
|
33
|
+
extra_rdoc_files: []
|
34
|
+
files:
|
35
|
+
- lib/enable_beer.rb
|
36
|
+
- bin/enable_beer
|
37
|
+
homepage: https://github.com/emilebosch/enable_beer
|
38
|
+
licenses:
|
39
|
+
- MIT
|
40
|
+
metadata: {}
|
41
|
+
post_install_message:
|
42
|
+
rdoc_options: []
|
43
|
+
require_paths:
|
44
|
+
- lib
|
45
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - '>='
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
requirements: []
|
56
|
+
rubyforge_project:
|
57
|
+
rubygems_version: 2.0.2
|
58
|
+
signing_key:
|
59
|
+
specification_version: 4
|
60
|
+
summary: Beer enabler
|
61
|
+
test_files: []
|