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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/share +6 -7
  3. metadata +27 -29
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 93463b0b247405a7daddb3ae1ba517f47ea263ef
4
- data.tar.gz: e05d66ff567a8dfcef8fb7c501bb0c7117a501ef
3
+ metadata.gz: 4b97756bb20a1935d27144a0201d4d05b9390160
4
+ data.tar.gz: 0ddb7846d06924fb96248b627184b1ed2d516471
5
5
  SHA512:
6
- metadata.gz: 2f77574e17d862d2f2f578931bac9c90e2cdb711290108383fb83f977fceed04800328299c6764246f1d1117b777cab8edc28197e9a7ac73fb059801f0e9180d
7
- data.tar.gz: 3a1d888a5633060ba67c791ba1398ff2379733342c79def5bf9fdd161273c84bd7bdc00e9736a0be67e6d3ed5aa2a597d270c872b551a0d76dabac0021c25112
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} #{file} && echo '#{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? file
23
- puts "Error! Can't find \"#{file}\""
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}/#{file}"
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.7
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
- requirement: !ruby/object:Gem::Requirement
15
+ version_requirements: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.7'
20
- type: :runtime
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
- requirement: !ruby/object:Gem::Requirement
29
+ version_requirements: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.61'
34
- type: :runtime
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
- requirement: !ruby/object:Gem::Requirement
43
+ version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0.19'
48
- type: :runtime
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
- description: A wrapper for the AWS S3 command line tool (configure authentication
56
- first).
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.2.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: