made my pryrc require everything, docker container works but fucking less pager is not installed so my paging is broken inside of docker. gg containerization
This commit is contained in:
parent
c705e0a2a8
commit
5c04cfc11e
8 changed files with 49 additions and 11 deletions
34
.pryrc
34
.pryrc
|
@ -0,0 +1,34 @@
|
||||||
|
require 'require_all'
|
||||||
|
|
||||||
|
class Array
|
||||||
|
# group elements by their identity, and count each distinct item
|
||||||
|
def counts
|
||||||
|
group_by(&:itself).map {|k,v| [k, v.count] }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if defined?(PryByebug)
|
||||||
|
Pry.commands.alias_command 'c', 'continue'
|
||||||
|
Pry.commands.alias_command 's', 'step'
|
||||||
|
Pry.commands.alias_command 'n', 'next'
|
||||||
|
Pry.commands.alias_command 'f', 'finish'
|
||||||
|
end
|
||||||
|
|
||||||
|
# Hit Enter to repeat last command
|
||||||
|
Pry::Commands.command /^$/, "repeat last command" do
|
||||||
|
_pry_.run_command Pry.history.to_a.last
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
# Obtain the present woking directory
|
||||||
|
current_dir = Dir.pwd
|
||||||
|
|
||||||
|
if current_dir =~ /^(.*?\/misc_rbtools)/
|
||||||
|
require_all './modules'
|
||||||
|
require_all './classes'
|
||||||
|
end
|
||||||
|
|
||||||
|
nvd_downloader = NvdTools::NvdDownloader.new
|
||||||
|
scans_io_downloader = ScansIoTools::ScansIoDownloader.new
|
||||||
|
scans_io_parser = ScansIoTools::ScansIoIndexParser.new(scans_io_downloader.get_json_index.body)
|
||||||
|
|
12
Dockerfile
12
Dockerfile
|
@ -3,14 +3,18 @@
|
||||||
#FROM ruby:2.5
|
#FROM ruby:2.5
|
||||||
FROM ruby:2.6
|
FROM ruby:2.6
|
||||||
|
|
||||||
RUN mkdir /usr/src/app
|
RUN mkdir /usr/src/misc_rbtools
|
||||||
ADD . /usr/src/app/
|
ADD . /usr/src/misc_rbtools/
|
||||||
WORKDIR /usr/src/app/
|
WORKDIR /usr/src/misc_rbtools/
|
||||||
|
|
||||||
RUN gem update --system
|
RUN gem update --system
|
||||||
RUN gem install bundler
|
RUN gem install bundler
|
||||||
|
RUN gem install rest-client
|
||||||
|
RUN gem install require_all
|
||||||
RUN gem install pry
|
RUN gem install pry
|
||||||
|
|
||||||
WORKDIR /usr/src/app
|
RUN apt -y install less
|
||||||
|
|
||||||
|
WORKDIR /usr/src/misc_rbtools
|
||||||
|
|
||||||
CMD pry
|
CMD pry
|
||||||
|
|
|
@ -13,4 +13,4 @@ class CveReport
|
||||||
# this should look in the returned array of cve information from self.cves
|
# this should look in the returned array of cve information from self.cves
|
||||||
# and return the given information for the cve_id
|
# and return the given information for the cve_id
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require '../modules/nvd_tools'
|
#require '../modules/nvd_tools'
|
||||||
require 'rest-client'
|
require 'rest-client'
|
||||||
|
|
||||||
module NvdTools
|
module NvdTools
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require 'rest-client'
|
require 'rest-client'
|
||||||
require 'zlib'
|
require 'zlib'
|
||||||
require 'json'
|
require 'json'
|
||||||
require '../modules/nvd_tools'
|
#require '../modules/nvd_tools'
|
||||||
|
|
||||||
module NvdTools
|
module NvdTools
|
||||||
class NvdDownloader
|
class NvdDownloader
|
||||||
|
@ -86,4 +86,4 @@ module NvdTools
|
||||||
# if there is a change, return true, if not return false
|
# if there is a change, return true, if not return false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
require '../modules/scans_io_tools'
|
#require '../modules/scans_io_tools'
|
||||||
require 'json'
|
require 'json'
|
||||||
require 'restclient'
|
require 'restclient'
|
||||||
|
|
||||||
|
|
|
@ -62,4 +62,4 @@ module ScansIoTools
|
||||||
file_info(study_name).first['size']
|
file_info(study_name).first['size']
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
module NvdTools
|
module NvdTools
|
||||||
end
|
end
|
Loading…
Add table
Reference in a new issue