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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 265a9f79fd2f991eceb38cc3c5fd87967b562113
4
- data.tar.gz: c77fa6332f8f39d7757517ef5c309e0b3a84ba6d
3
+ metadata.gz: 3c80a172ab9ee26dc36c2211eb540d772f99bdfc
4
+ data.tar.gz: ca89d313471de4e5f0491aaf7db0fa948cb19e02
5
5
  SHA512:
6
- metadata.gz: 80ae06378a9247515ac9e2bc1dc22587679df35315e3dcca08b4ab5633e92acd299ba41677fec348cd2f50eec741caca723e19ecfb9cbf77f0a957948273cd08
7
- data.tar.gz: 626e86a95ccb37fbe45957f883ac5fa24145959ccaef8af68f5af70e1bf8206e540a1be75a581aca10ae5521b05e926bd42f54e60332a4b43f73b3efc02422e0
6
+ metadata.gz: 4aa146632042b305f23c2c86758c98cf8c988653cd8219d9c980ae74ffe56b5eb6fd46d5e5de9a474fde4a88897018643bc6626fd6e13066183e7e981101f1fa
7
+ data.tar.gz: 75be3944b2d396ee5098c353c64362ef0df3246676fbaf115d8a05b088ed3ae4420f6e747f3afd4628492750b65e71ff40d91c71d26289a3e03b4a6ce36ed925
data/lib/bl.rb CHANGED
@@ -13,6 +13,7 @@ require 'bl/milestone'
13
13
  require 'bl/wiki'
14
14
  require 'bl/project'
15
15
  require 'bl/recent'
16
+ require 'bl/file'
16
17
  require 'bl/cli'
17
18
 
18
19
  Bl::CLI.start(ARGV)
@@ -285,5 +285,8 @@ module Bl
285
285
 
286
286
  desc 'recent SUBCOMMAND ...ARGS', 'list recent stuff'
287
287
  subcommand 'recent', Recent
288
+
289
+ desc 'file SUBCOMMAND ...ARGS', 'manage files'
290
+ subcommand 'file', File
288
291
  end
289
292
  end
@@ -8,8 +8,8 @@ module Bl
8
8
  include Singleton
9
9
 
10
10
  def initialize
11
- file = File.join(Dir.home, Bl::CONFIG_FILE)
12
- if File.exist?(file)
11
+ file = ::File.join(Dir.home, Bl::CONFIG_FILE)
12
+ if ::File.exist?(file)
13
13
  @config = YAML.load_file(file)
14
14
  else
15
15
  @config = nil
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Bl
2
- VERSION = '0.2.2'.freeze
2
+ VERSION = '0.2.3'.freeze
3
3
  end
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.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
@@ -1,3 +0,0 @@
1
- linter:
2
- rubocop:
3
- options: