rbbt-util 5.17.87 → 5.17.88
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/etc/app.d/entities.rb +8 -4
- data/lib/rbbt/util/misc/development.rb +16 -0
- data/share/rbbt_commands/tsv/sort +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86b82101fc67bc2487900d9724f87edcd80eb993
|
4
|
+
data.tar.gz: aae5819b0436ad15b426eb55ecb51ddffb24ce87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdc2c960706e1d1c48b4145d7f693faa3a8da4c86584a38814bab2fef13b179d10f9654ccbcc6bb7b77bab04b015840114b9727ff1da7c8333ea236db34e91e4
|
7
|
+
data.tar.gz: e4afc4ba6bee4284eda09da1bd1f4523fdb40402e02cc867d8dd6b6f9d9798c667180f9e13ce2ec7fa895ef5ee6c82e5cd98164d37f37f92f6625055e4b03737
|
data/etc/app.d/entities.rb
CHANGED
@@ -13,10 +13,14 @@ Entity.entity_property_cache = Rbbt.var.sinatra.find.entity_properties
|
|
13
13
|
#{{{ Prepare REST entities
|
14
14
|
Rbbt.etc.entities.read.split("\n").each do |name|
|
15
15
|
next if name.empty?
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
begin
|
17
|
+
mod = Kernel.const_get name
|
18
|
+
Log.debug("Including Entity::REST for #{ name }")
|
19
|
+
mod.module_eval do
|
20
|
+
include Entity::REST
|
21
|
+
end
|
22
|
+
rescue
|
23
|
+
Log.warn "Could extend REST entity: #{ name }"
|
20
24
|
end
|
21
25
|
end if Rbbt.etc.entities.exists?
|
22
26
|
|
@@ -348,4 +348,20 @@ module Misc
|
|
348
348
|
`curl -s --header "Authorization: Bearer #{key}" -X POST https://api.pushbullet.com/v2/pushes --header 'Content-Type: application/json' --data-binary '{"type": "note", "title": "#{event}", "body": "#{description}"}'`
|
349
349
|
end
|
350
350
|
end
|
351
|
+
|
352
|
+
def self.unzip_in_dir(file, dir)
|
353
|
+
raise "Target is not a directory: #{file}" if File.exists?(dir) and not File.directory?(dir)
|
354
|
+
if Open.remote? file
|
355
|
+
file = file.find if Path === file
|
356
|
+
Open.open(file) do |stream|
|
357
|
+
TmpFile.with_file(stream.read, true, :extension => 'zip') do |zip_file|
|
358
|
+
CMD.cmd("unzip '#{zip_file}' -d '#{dir}'")
|
359
|
+
end
|
360
|
+
end
|
361
|
+
else
|
362
|
+
file = file.find if Path === file
|
363
|
+
zip_file = file
|
364
|
+
CMD.cmd("unzip '#{zip_file}' -d '#{dir}'")
|
365
|
+
end
|
366
|
+
end
|
351
367
|
end
|
@@ -27,7 +27,9 @@ field = options[:field] || '2'
|
|
27
27
|
if field =~ /^\d+$/
|
28
28
|
field_pos = field.to_i
|
29
29
|
else
|
30
|
-
|
30
|
+
parser = TSV.parse_header(file, options)
|
31
|
+
field_pos = parser.all_fields.index(field) + 1
|
32
|
+
saved_line = parser.line
|
31
33
|
end
|
32
34
|
|
33
35
|
rest = ARGV.inject("-t\"\t\" -g -k#{field_pos}"){|acc,e| acc << " '#{e}'" }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbbt-util
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.17.
|
4
|
+
version: 5.17.88
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|