This repository has been archived by the owner on Nov 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
93 additions
and
88 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ build/ | |
data/ | ||
var/ | ||
website/ | ||
.sass-cache/ |
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 |
---|---|---|
@@ -1,42 +1,60 @@ | ||
# INSTALL | ||
|
||
Biogem.info is a middleman generated website. | ||
It comes with a number of scripts and rake tasks which generate | ||
the information displayed on the site in YAML format (usually to STDOUT). | ||
Biogem.info uses haml + sass to generate a website. | ||
|
||
## Installation | ||
|
||
You will need libxml support, e.g. | ||
The site generation consists of a number of separate steps | ||
which can easily be tested independently. | ||
|
||
apt-get install libxslt-dev libxml2-dev | ||
## Installation | ||
|
||
Install Ruby with openssl support | ||
To avoid rvm+bundler hell, the preferred route is to use GNU Guix and | ||
set the environment with my | ||
[ruby-guix-env](https://github.com/pjotrp/guix-notes/blob/master/scripts/ruby-guix-env) | ||
script. E.g. | ||
|
||
rvm pkg install openssl | ||
rvm pkg install iconv | ||
rvm remove 1.9.2 | ||
rvm install 1.9.2 -C --with-openssl-dir=$HOME/.rvm/usr,--with-iconv-dir=$HOME/.rvm/usr | ||
guix install ruby rake | ||
. ruby-guix-env | ||
gem install haml sass | ||
|
||
Checkout the source code and run bundler. See also the create_data.sh. | ||
To run the cucumber tests | ||
|
||
bundle update | ||
cucumber features/ | ||
|
||
To run the cucumber tests | ||
A 'quick' test run | ||
|
||
bundle exec cucumber features/ | ||
rake -- --test | ||
|
||
To run a 'quick' test run | ||
## Generating the website | ||
|
||
bundle exec rake -- --test | ||
### Fetch gems from rubygems.org | ||
|
||
which will generate the site with just a few biogems. Next run | ||
The first step is to fetch relevant gems from http://rubygems.org/. This | ||
is done with | ||
|
||
bundle exec middleman server | ||
./bin/fetch-gemlist.rb | ||
|
||
## Trouble shooting | ||
## Troubleshooting | ||
|
||
If you get an error | ||
|
||
./bin/fetch-geminfo.rb:163:in `block in <main>': undefined method `authors' | ||
|
||
run the script with 'bundle exec' prepended. | ||
|
||
### GitHub API access limits | ||
|
||
Without using authentication, the GitHub API allows only 60 requests | ||
per hour from a single IP address. But during the data collection | ||
phase of generating the biogems.info website, the script currently | ||
needs to make around 200 requests to this API to fetch the number of | ||
issues and stargazers for each gem. | ||
|
||
To get around this, go to the applications tab on your GitHub | ||
settings page and generate a new "Personal API access token". Then | ||
copy that token (but not into the repository!), and before running the ./create_data.sh script, | ||
set the GITHUB_API_TOKEN environment variable like this: | ||
|
||
export GITHUB_API_TOKEN="copy-here-the-token-string-from-github" | ||
|
||
That lets the script make 5000 requests per hour, which should be | ||
more then enough. |
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 |
---|---|---|
|
@@ -45,7 +45,7 @@ task :biogems do |t| | |
end | ||
|
||
task :default => [ :biogems ] do | ||
`bundle exec middleman build` | ||
`middleman build` | ||
end | ||
|
||
|
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,27 @@ | ||
#!/usr/bin/env ruby | ||
# | ||
# This script fetches information from the gem | ||
# tool | ||
|
||
$: << "lib" | ||
|
||
require 'json' | ||
require 'yaml' | ||
require 'net/http' | ||
require 'uri' | ||
require 'biogems' | ||
|
||
$is_debug = ARGV.index('--debug') | ||
is_testing = ARGV.index('--test') | ||
|
||
$stderr.print "Get all rubygems starting with bio- (bio dash)\n" | ||
if is_testing | ||
list = ['bio','bio-blastxmlparser'] | ||
else | ||
list = `gem search bio-`.split(/\n/) | ||
list = list.map { |item| item.split(" ")[0] } | ||
end | ||
|
||
|
||
|
||
print list.to_json # output to STDOUT |
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