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.6
|
||||
|
||||
RUN mkdir /usr/src/app
|
||||
ADD . /usr/src/app/
|
||||
WORKDIR /usr/src/app/
|
||||
RUN mkdir /usr/src/misc_rbtools
|
||||
ADD . /usr/src/misc_rbtools/
|
||||
WORKDIR /usr/src/misc_rbtools/
|
||||
|
||||
RUN gem update --system
|
||||
RUN gem install bundler
|
||||
RUN gem install rest-client
|
||||
RUN gem install require_all
|
||||
RUN gem install pry
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
RUN apt -y install less
|
||||
|
||||
WORKDIR /usr/src/misc_rbtools
|
||||
|
||||
CMD pry
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require '../modules/nvd_tools'
|
||||
#require '../modules/nvd_tools'
|
||||
require 'rest-client'
|
||||
|
||||
module NvdTools
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
require 'rest-client'
|
||||
require 'zlib'
|
||||
require 'json'
|
||||
require '../modules/nvd_tools'
|
||||
#require '../modules/nvd_tools'
|
||||
|
||||
module NvdTools
|
||||
class NvdDownloader
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
require '../modules/scans_io_tools'
|
||||
#require '../modules/scans_io_tools'
|
||||
require 'json'
|
||||
require 'restclient'
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue