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