-
Notifications
You must be signed in to change notification settings - Fork 27
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
Configure Travis CI to download Rubygems data for listed gems #46
Open
ashmaroli
wants to merge
4
commits into
jekyll:master
Choose a base branch
from
ashmaroli:gem-data
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9b6e880
list plugins and themes in a master data file
ashmaroli e8738f5
add a Ruby script to handle remote gem data
ashmaroli 4e110f2
set up Travis to build and deploy on master branch
ashmaroli ed482d5
reword conditional to resemble a Ruby expression
ashmaroli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
.bundle | ||
.sass-cache | ||
_data/plugins | ||
_data/themes | ||
_site/ | ||
*.swp | ||
pkg/ | ||
|
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -2,3 +2,8 @@ | |
script/fmt | ||
script/test | ||
script/scan | ||
|
||
if [[ -v $DEPLOY_BUILD ]]; then | ||
script/segregate | ||
bundle exec jekyll build | ||
fi |
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,23 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
require "open-uri" | ||
require "safe_yaml" | ||
|
||
def data_dir(*entries) | ||
File.expand_path(File.join("..", "_data", *entries), __dir__) | ||
end | ||
|
||
entries = SafeYAML.load_file(data_dir("entries.yml")) | ||
entries.each do |type, list| | ||
FileUtils.mkdir_p(data_dir(type)) | ||
list.each do |item| | ||
begin | ||
data = open("https://rubygems.org/api/v1/gems/#{item}.yaml").read | ||
File.open(data_dir("#{type}/#{item}.yml"), "wb") { |file| file.puts data } | ||
rescue OpenURI::HTTPError | ||
puts "'#{item}' does not seem to exist at rubygems.org" | ||
next | ||
end | ||
end | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wat?
Isn't this condition always true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going for commits pushed to
master
(merge commits from PRs, though I now realize that JekyllBot adds[ci skip]
to the merge commits)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I was getting at is that you mean
AND
rather thanOR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the
type:
can be either ofpush
,pull_request
,api
,cron
. I felt usingOR
to be more optimal. But if you feelAND
would be better, I'm fine with that..There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
OR
statement will only evaluate to false if bothtype != pull_request
andtype != api
are false (because that is what disjunctions are for). How is this possible? What value oftype
will possibly make both of these statements false?You may as well replace the whole condition with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think about it this way.
We can use DeMorgan's Law to write the following, logically equivalent statement:
It is not possible for
type == pull_request
andtype == api
to both be true for any particular value oftype
, so theAND
will always be false, and!(false)
istrue
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pathawks I concede. I've fixed the error and replaced the operators with "aliases" to resemble the operators used in Ruby