cloudfiles_cli 0.0.5 → 0.0.6
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/lib/cloudfiles_cli/cli.rb +10 -2
- data/lib/cloudfiles_cli/transactions.rb +20 -2
- data/lib/cloudfiles_cli/version.rb +1 -1
- metadata +11 -17
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b7af8bd3291014a90462ca3a34cfc835df94f58b
|
4
|
+
data.tar.gz: f43cdfbbac324f0c54e017206d358c6ffbc7eba6
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8f4840062bfb46bda4ad0a38281e0c3629a0f2e4f26549f994ef88f85acc9c2da07d0a36342bbc545ab6a745d80eee2f42e7f4760b56f440579decdeaa73784c
|
7
|
+
data.tar.gz: 2962c264eb7954b896308a12ff0b9094c79abef9eaf3afcfc54f6746b8bf9389d1873e9520e96b408a9555d4b2612dc1a3539ce4265d19a5d2743809ebcd5c72
|
data/lib/cloudfiles_cli/cli.rb
CHANGED
@@ -24,12 +24,20 @@ module CloudfilesCli
|
|
24
24
|
Transactions.new(Config.new(options)).exists(container, remote_filename)
|
25
25
|
end
|
26
26
|
|
27
|
-
desc "list CONTAINER", "List container contents"
|
27
|
+
desc "list [CONTAINER]", "List containers or container contents"
|
28
28
|
option :username
|
29
29
|
option :api_key
|
30
30
|
option :auth_url
|
31
|
-
def list(container)
|
31
|
+
def list(container = nil)
|
32
32
|
Transactions.new(Config.new(options)).list(container)
|
33
33
|
end
|
34
|
+
|
35
|
+
desc "delete CONTAINER REMOTE_FILENAME", "Deletes a remote file"
|
36
|
+
option :username
|
37
|
+
option :api_key
|
38
|
+
option :auth_url
|
39
|
+
def delete(container, remote_filename)
|
40
|
+
Transactions.new(Config.new(options)).delete(container, remote_filename)
|
41
|
+
end
|
34
42
|
end
|
35
43
|
end
|
@@ -25,6 +25,15 @@ module CloudfilesCli
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
+
def delete(container_name, remotefile)
|
29
|
+
object = container(container_name).files.get(remotefile)
|
30
|
+
if object.nil?
|
31
|
+
abort "File #{remotefile} not found on cloudfiles"
|
32
|
+
else
|
33
|
+
object.destroy
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
28
37
|
def exists(container_name, remotefile)
|
29
38
|
container(container_name).files.head(remotefile) ||
|
30
39
|
abort("#{remotefile} missing from #{container_name}")
|
@@ -32,12 +41,21 @@ module CloudfilesCli
|
|
32
41
|
end
|
33
42
|
|
34
43
|
def list(container_name)
|
35
|
-
|
44
|
+
if container_name
|
45
|
+
puts container(container_name).files.map(&:key)
|
46
|
+
else
|
47
|
+
puts containers.map(&:key)
|
48
|
+
end
|
36
49
|
end
|
37
50
|
|
38
51
|
def container(container_name)
|
39
|
-
|
52
|
+
containers.get(container_name) ||
|
40
53
|
abort("Container #{container_name} not found on cloudfiles")
|
41
54
|
end
|
55
|
+
|
56
|
+
def containers
|
57
|
+
connection.directories
|
58
|
+
end
|
59
|
+
|
42
60
|
end
|
43
61
|
end
|
metadata
CHANGED
@@ -1,46 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudfiles_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.0.6
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Jacob Atzen
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-11-11 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: thor
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: fog
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
description: Simple utility for uploading and downloading files from Cloudfiles
|
@@ -65,26 +60,25 @@ files:
|
|
65
60
|
- lib/cloudfiles_cli/version.rb
|
66
61
|
homepage: https://github.com/lokalebasen/cloudfiles_cli
|
67
62
|
licenses: []
|
63
|
+
metadata: {}
|
68
64
|
post_install_message:
|
69
65
|
rdoc_options: []
|
70
66
|
require_paths:
|
71
67
|
- lib
|
72
68
|
required_ruby_version: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
69
|
requirements:
|
75
|
-
- -
|
70
|
+
- - '>='
|
76
71
|
- !ruby/object:Gem::Version
|
77
72
|
version: '0'
|
78
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
|
-
none: false
|
80
74
|
requirements:
|
81
|
-
- -
|
75
|
+
- - '>='
|
82
76
|
- !ruby/object:Gem::Version
|
83
77
|
version: '0'
|
84
78
|
requirements: []
|
85
79
|
rubyforge_project:
|
86
|
-
rubygems_version:
|
80
|
+
rubygems_version: 2.0.3
|
87
81
|
signing_key:
|
88
|
-
specification_version:
|
82
|
+
specification_version: 4
|
89
83
|
summary: Easily upload and download files from Cloudfiles
|
90
84
|
test_files: []
|