This repository has been archived by the owner on Dec 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Begin populating search index with API docs
With these changes, we populate the search index with all instance methods present in the latest version of Atom. Next up, we'll need to add classes, class methods, and instance properties to the search index. Co-Authored-By: Antonio Scandurra <[email protected]>
- Loading branch information
1 parent
5dfe19b
commit aeee307
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require('json') | ||
|
||
def latest_atom_version_apis | ||
items = @items.find_all("/api/v#{latest_atom_version_number}/*.json") | ||
items.map { |item| JSON.parse(File.read(item.raw_filename)) } | ||
end | ||
|
||
def latest_atom_version_number | ||
@latest_atom_version_number ||= begin | ||
versions = @items.find_all('/api/*/*.json').map { |item| item.path.split('/')[2] }.uniq | ||
|
||
exploded_version_numbers = versions.map { |version| | ||
version_without_prefix = version[1..-1] | ||
version_without_prefix.split('.') | ||
} | ||
|
||
exploded_version_numbers.sort.last.join('.') | ||
end | ||
end |