Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

any-jump 0.6 #100

Merged
merged 7 commits into from
Oct 28, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor
  • Loading branch information
pechorin committed Oct 11, 2022
commit 32bf200db1311708eacb7d9c8084793c02cc3358
5 changes: 3 additions & 2 deletions generator/lib/download.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
require 'http'

class Download
URL = 'https://raw.githubusercontent.com/jacktasia/dumb-jump/master/dumb-jump.el'
PARSE_PATTERNS = {
head: '(defcustom dumb-jump-find-rules',
tail: '"List of regex patttern templates'
}

def call
scp = HTTP.get('https://raw.githubusercontent.com/jacktasia/dumb-jump/master/dumb-jump.el').to_s
result = ""
scp = HTTP.get(URL).to_s
head = scp.index(PARSE_PATTERNS[:head])
tail = scp.index(PARSE_PATTERNS[:tail])

# 1. get body
extracted = scp[head,tail - head]

# 2. remove definition start
extracted.sub!('(defcustom dumb-jump-find-rules', '')
extracted.sub!(PARSE_PATTERNS[:head], '')

# 3. remove whitespaces and some syntax elements
extracted.strip!
Expand Down