Snapshot của dkhamsing/awesome_bot: 904★ · Ruby · Automation. :white_check_mark: Validate links in awesome projects
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
awesome_bot checks for valid URLs in a file, it can be used to verify pull requests updating a README.
Installation
$ gem install awesome_bot
Usage
Command Line
Usage: awesome_bot [file or files]
awesome_bot [options]
-f, --files [files] Comma separated files to check
-a, --allow [errors] Status code errors to allow
--allow-dupe Duplicate URLs are allowed
--allow-ssl SSL errors are allowed
--allow-redirect Redirected URLs are allowed
--allow-timeout URLs that time out are allowed
--base-url [base url] Base URL to use for relative links
-d, --request-delay [seconds] Set request delay
-t, --set-timeout [seconds] Set connection timeout (default: 30)
--skip-save-results Skip saving results
-w, --white-list [urls] Comma separated URLs to white list
You can check multiple files (comma separated or * pattern, look below for details).
By default, duplicate URLs or any status code other than 200 are flagged as failures.
Use option --allow-dupe to allow duplicates.
Use option --allow-redirect to allow redirects.
Use option --allow to allow specific status code errors.
Use option --white-list (-w for short) to prevent links from being flagged: -w domain1.com/post/article,domain2.com white lists domain1.com/post/article and all links matching domain2.com.
$ awesome_bot README.md --allow-dupe --allow-redirect -w rubydoc,giphy
# allow redirects, dupes and white list all links matching rubydoc and giphy
$ awesome_bot README.md,README-zh.md
# check links in 2 files
$ awesome_bot docs/*.md
# check all Markdown files in the docs/ directory
$ awesome_bot README.md --allow-timeout -t 5
# speed up validation by setting a timeout of 5 seconds per link request and allowing timeouts
$ awesome_bot README.md --allow 403,429
# allow status code errors 403 and 429
# --allow 301 would be similar to --allow-redirect
$ awesome_bot README.md --base-url https://github.com/IDR/idr-notebooks/blob/master/
# check relative links using the base URL provided
irb(main):001:0> require 'awesome_bot'
=> true
irb(main):002:0> content = File.read 'README.md'
=> "..."
irb(main):003:0> result = AwesomeBot.check content
=> #<AwesomeBot::Result:0x007fdde39f4408 @links=...>
# AwesomeBot Result with success, statuses_issues, dupes and more
irb(main):004:0> puts result.success ? 'No errors' : ':-('
:-(
More information at rubydoc.
Validate Pull Requests
Does your GitHub README contain a lot of links? awesome_bot can help you validate them when a pull request is created (or a commit is pushed). It is used by:
https://github.com/tiimgreen/github-cheat-sheet
https://github.com/enaqx/awesome-react
https://github.com/ziadoz/awesome-php
https://github.com/vsouza/awesome-ios
https://github.com/alebcay/awesome-shell
https://github.com/matteocrippa/awesome-swift
and more.
Tips
Use the keyword [ci skip] in your commit title/message to skip verification.
Use Danger.
GitHub Actions
To use awesome_bot with GitHub Actions (workflows), here is an example:
CircleCI, Codeship, and Semaphore CI support running tests without adding a file to the repo (a public configuration file can however help others contribute).
# Codeship
Setup
rvm use 2.4.1 --install
gem install awesome_bot
Test
awesome_bot README.md
To add the Travis CI build status badge above to your project, use the following code
[](https://travis-ci.org/<username>/<project>)
i.e.
[](https://travis-ci.org/dkhamsing/awesome_bot)
As it happens, the default code snippet provided contains a redirect so adding a badge could fail your status :sob:.. one way to fix this is to white list travis-ci, i.e.
- awesome_bot README.md --white-list travis-ci
You can also add a badge for other CI tools, check out shields.io.
Danger
Integrate awesome_bot with Danger and have results reported back to the pull request.
Here's the step in your Dangerfile:
# Check links
require 'json'
results = File.read 'ab-results-README.md-markdown-table.json'
j = JSON.parse results
if j['error']==true
fail j['title']
markdown j['message']
end
Contact
github.com/dkhamsing
twitter.com/dkhamsing
License
This project is available under the MIT license. See the LICENSE file for more info.
dkhamsing/awesome_bot thuộc nhóm Automation trên TopGit, cùng 11 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
dkhamsing/awesome_bot có bao nhiêu sao?
dkhamsing/awesome_bot có 904 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/dkhamsing/awesome_bot. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
dkhamsing/awesome_bot có phải mã nguồn mở không?
Có — dkhamsing/awesome_bot phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/dkhamsing/awesome_bot.
dkhamsing/awesome_bot có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho dkhamsing/awesome_bot. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
dkhamsing/awesome_bot là gì?
dkhamsing/awesome_bot (dkhamsing/awesome_bot) là dự án Ruby trên GitHub. Theo mô tả gốc: :white_check_mark: Validate links in awesome projects
dkhamsing/awesome_bot so với các dự án Automation khác thế nào?
dkhamsing/awesome_bot được TopGit xếp vào nhóm Automation, với 904 sao GitHub và viết bằng Ruby. Xem trang chủ đề Automation trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Đọc thêm về dkhamsing/awesome_bot ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/dkhamsing/awesome_bot là nguồn chính thức.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về awesome_bot?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về awesome_bot.