share_cli 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/bin/share +35 -0
  3. metadata +89 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4ac6d64827a6d0be54f38565e308798e2d5ea0a0
4
+ data.tar.gz: bfb64c9019ae5a199499608fce4e513c53ecd2af
5
+ SHA512:
6
+ metadata.gz: ad02ddc18bc4229eeac0a6ecc09c764a16a8b9bfa5c4b9d91f7e3bbe7d04f33d5278a3f9ceaea762cb04e274062a3130be35e7ecee9797356cddda6da7089167
7
+ data.tar.gz: 87933aae43b8f3ab3c34bfa5942b65aba2381cbb35d9b4fbaa95b6b9003e9a8c0f309c74937d75e6ac95e9296fd40ba02446758f03e4dd1f596de4af267cebcf
data/bin/share ADDED
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'csv'
4
+ require 'json'
5
+ require 'thor'
6
+ require 'digest/sha1'
7
+
8
+ class Share < Thor
9
+
10
+ desc "get FILE", "Post file to S3"
11
+ def get(file)
12
+ sha = Digest::SHA1.hexdigest(file)
13
+ command = "aws s3 cp s3://xnh/public/#{sha}/#{file} #{file} && echo '#{file}'"
14
+ exec(command)
15
+ end
16
+
17
+ desc "post FILE", "Post file to S3"
18
+ def post(file = nil)
19
+ unless File.exists? file
20
+ puts "Error! Can't find \"#{file}\""
21
+ end
22
+ location = "#{Dir.pwd}/#{file}"
23
+ sha = Digest::SHA1.hexdigest(file)
24
+ command = "aws s3 cp #{location} s3://xnh/public/#{sha}/#{file} --acl public-read && echo 'https://s3.amazonaws.com/xnh/public/#{sha}/#{file}' | pbcopy && echo 'https://s3.amazonaws.com/xnh/public/#{sha}/#{file}'"
25
+ exec(command)
26
+ end
27
+ default_task :post
28
+
29
+ end
30
+
31
+
32
+ # Start Thor as usual
33
+ Share.start
34
+
35
+
metadata ADDED
@@ -0,0 +1,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: share_cli
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Patrick McConlogue
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-02-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rest-client
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: aws-sdk
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.61'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.61'
41
+ - !ruby/object:Gem::Dependency
42
+ name: thor
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.19'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.19'
55
+ description: A wrapper for the AWS S3 command line tool (configure authentication
56
+ first).
57
+ email: p@tricks.email
58
+ executables:
59
+ - share
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - bin/share
64
+ homepage: https://github.com/thnkr/share
65
+ licenses:
66
+ - MIT
67
+ metadata: {}
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: 1.9.3
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubyforge_project:
84
+ rubygems_version: 2.2.2
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: A wrapper for the AWS S3 command line tool (configure authentication first).
88
+ test_files: []
89
+ has_rdoc: