bl 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bl.rb +1 -0
- data/lib/bl/cli.rb +3 -0
- data/lib/bl/config.rb +2 -2
- data/lib/bl/file.rb +28 -0
- data/lib/bl/version.rb +1 -1
- metadata +2 -2
- data/sideci.yml +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c80a172ab9ee26dc36c2211eb540d772f99bdfc
|
4
|
+
data.tar.gz: ca89d313471de4e5f0491aaf7db0fa948cb19e02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4aa146632042b305f23c2c86758c98cf8c988653cd8219d9c980ae74ffe56b5eb6fd46d5e5de9a474fde4a88897018643bc6626fd6e13066183e7e981101f1fa
|
7
|
+
data.tar.gz: 75be3944b2d396ee5098c353c64362ef0df3246676fbaf115d8a05b088ed3ae4420f6e747f3afd4628492750b65e71ff40d91c71d26289a3e03b4a6ce36ed925
|
data/lib/bl.rb
CHANGED
data/lib/bl/cli.rb
CHANGED
data/lib/bl/config.rb
CHANGED
data/lib/bl/file.rb
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
module Bl
|
2
|
+
class File < Thor
|
3
|
+
include Bl::Requestable
|
4
|
+
|
5
|
+
def initialize(*)
|
6
|
+
@config = Bl::Config.instance
|
7
|
+
super
|
8
|
+
end
|
9
|
+
|
10
|
+
desc 'list PATH', 'list files on PATH'
|
11
|
+
def list(path='')
|
12
|
+
client.get("projects/#{@config[:project_key]}/files/metadata/#{path}").body.each do |f|
|
13
|
+
puts [f.id, f.type, f.dir, f.name, f.size, f.created, f.updated].join("\t")
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
desc 'get [ID...]', 'get files'
|
18
|
+
def get(*ids)
|
19
|
+
ids.each do |id|
|
20
|
+
res = client.get("projects/#{@config[:project_key]}/files/#{id}")
|
21
|
+
f = ::File.new(res.body.filename, "w")
|
22
|
+
f.write(res.body.content)
|
23
|
+
f.close
|
24
|
+
puts "file #{id} #{res.body.filename} downloaded."
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/bl/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- saki
|
@@ -144,6 +144,7 @@ files:
|
|
144
144
|
- lib/bl/category.rb
|
145
145
|
- lib/bl/cli.rb
|
146
146
|
- lib/bl/config.rb
|
147
|
+
- lib/bl/file.rb
|
147
148
|
- lib/bl/formatting.rb
|
148
149
|
- lib/bl/milestone.rb
|
149
150
|
- lib/bl/project.rb
|
@@ -152,7 +153,6 @@ files:
|
|
152
153
|
- lib/bl/type.rb
|
153
154
|
- lib/bl/version.rb
|
154
155
|
- lib/bl/wiki.rb
|
155
|
-
- sideci.yml
|
156
156
|
homepage: https://github.com/sakihet/bl
|
157
157
|
licenses:
|
158
158
|
- MIT
|
data/sideci.yml
DELETED