[RUBY] Introduction of milkode

Introduction

It's annoying to grep the source code of multiple packages. Try adding milkode as a quick grep to text and source code.

env

$ uname -r
4.19.104-microsoft-standard
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04 LTS"

install

$ sudo apt install ruby ruby-dev
$ sudo gem install milkode

initialize

$ milk init --default
Deprecation warning: Expected string default value for '--port'; got 9292 (numeric).
This will be rejected in the future unless you explicitly pass the options `check_default_type: false` or call `allow_incompatible_default_type!` in your code
You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.
create     : /home/tkhshmsy/.milkode/milkode.yaml
create     : /home/tkhshmsy/.milkode/db/milkode.db created.

add/remove

I have already added about 4 packages.

$ git clone https://github.com/tkhshmsy/hogehoge.git
Cloning into 'hogehoge'...
remote: Enumerating objects: 87, done.
remote: Total 87 (delta 0), reused 0 (delta 0), pack-reused 87
Unpacking objects: 100% (87/87), 599.91 KiB | 777.00 KiB/s, done.

$ milk add hogehoge/
Deprecation warning: Expected string default value for '--port'; got 9292 (numeric).
This will be rejected in the future unless you explicitly pass the options `check_default_type: false` or call `allow_incompatible_default_type!` in your code
You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.
package    : hogehoge
github     : tkhshmsy/hogehoge
result     : 1 packages, 73 records, 73 add. (0.98sec)
*milkode*  : 5 packages, 976 records in /home/tkhshmsy/.milkode/db/milkode.db.

$ milk rm hogehoge/
Deprecation warning: Expected string default value for '--port'; got 9292 (numeric).
This will be rejected in the future unless you explicitly pass the options `check_default_type: false` or call `allow_incompatible_default_type!` in your code
You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.
rm_package : hogehoge
result     : 1 packages, 73 records. (0.97sec)
*milkode*  : 4 packages, 903 records in /home/tkhshmsy/.milkode/db/milkode.db.

update

$ milk update --all
Deprecation warning: Expected string default value for '--port'; got 9292 (numeric).
This will be rejected in the future unless you explicitly pass the options `check_default_type: false` or call `allow_incompatible_default_type!` in your code
You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.
package    : package1
package    : package2
package    : package3
package    : package4
result     : 4 packages, 903 records. (0.18sec)
*milkode*  : 4 packages, 903 records in /home/tkhshmsy/.milkode/db/milkode.db.

settings

--Use gmilk to search from the command line --Colored, set to search all packages

.bashrc


alias gmilk='gmilk -a --color'

Web UI

Launch the Web UI. The default public port is 9292.

$ milk web -o `hostname -I` -n

Allow WebUI to be launched from the Windows side

Make a shortcut on Windows --Right-click anywhere on the desktop => Create Shortcut`` --Set to run wsl.exe --Write only wsl in the item and go to the next (no need to refer) --Edit shortcut name, complete --Right-click on the created shortcut, Properties` --Write a command line at the link destination

wsl.exe - u <User> -- milk web -o `hostname -I` -n

Double-click the created shortcut to execute it, and will execute milk web. The IP address and port number appear in the standard output, so open it in your browser.

When you stop

--The process does not stop even if you Alt + F4 this window --If you want to stop the process, press CTRL + C to end it, and the window will also close. ――You can kill from another mouth

What became?

Not much needed in a single package,

--When chasing a process that spans multiple packages --When writing with reference to the code of other packages

It is useful for such things.

Recommended Posts

Introduction of milkode
Introduction of pay.jp
Introduction of Docker --Part 1--
[Rails] Introduction of PAY.JP
Introduction of user authentication
[Rails] Introduction of devise Basics
Introduction of javaFX in Eclipse (April 2020)
[Rails] Introduction of Rubocop by beginners
From introduction to use of ActiveHash
From introduction to usage of byebug
Summary about the introduction of Device
[Ruby on Rails] Introduction of initial data
Lombok ① Introduction
Introduction (self-introduction)
Introduction memo of automatic test using Jenkins
[In-house study session] Introduction of "Readable Code"
Personal application production 2 Introduction of WEB fonts
Introduction of Docker Hub and commands Self-learning ①
Introduction of New Generation Java Programming Guide (Java 10)
Output of the book "Introduction to Java"
[Java] Introduction
Introduction and precautions of gem Friendly Id
12 of Array
Introduction (editing)
Introduction of IDOM engineer's development environment (physics)
Introduction and usage explanation of Font Awesome
Introduction of New Generation Java Programming Guide (Java 11)
[Vue.js] Implementation of menu function Vue.js introduction rails6
Introduction of New Generation Java Programming Guide (Java 12)
[Rails] Introduction of pry-rails ~ How to debug binding.pry
[Docker] Introduction to docker compose Basic summary of docker-compose.yml
[Ruby on Rails] Until the introduction of RSpec
Introduction and basic usage of Simple Calendar gem
How to use enum (introduction of Japanese notation)
Introduction of Rspec and Japanese localization of error messages
[Introduction to Java] Basics of java arithmetic (for beginners)
Introduction and introduction of management screen generation gem Administrate