Browse Source

Fixing

remotes/origin/dependabot/bundler/haml-5.1.2
Pjotr Prins 5 years ago
parent
commit
890687e464
4 changed files with 31 additions and 17 deletions
  1. +2
    -2
      INSTALL.md
  2. +12
    -4
      bin/fetch-geminfo.rb
  3. +13
    -7
      bin/fetch-gemlist.rb
  4. +4
    -4
      lib/helpers/content_helpers.rb

+ 2
- 2
INSTALL.md View File

@@ -30,7 +30,7 @@ A 'quick' test run

## Generating the website

### Fetch gems from rubygems.org
### Fetch biogems from rubygems.org

The first step is to fetch relevant gems from http://rubygems.org/. This
is done with
@@ -60,7 +60,7 @@ or
In the third step fetch github information and run with the GITHUB TOKEN

```sh
env GITHUB_API_TOKEN="3b3955c1b672d0c4a7" ./bin/fetch-githubinfo.rg < data/geminfo_biogems.yaml > data/biogems.yaml
env GITHUB_API_TOKEN="3b3955c1b672d0c4a7" ./bin/fetch-githubinfo.rb < data/geminfo_biogems.yaml > data/biogems.yaml
```

## Fetch biolinux and Debian bio-med info


+ 12
- 4
bin/fetch-geminfo.rb View File

@@ -69,9 +69,14 @@ end

h = YAML.load(ARGF.read)

nlist = {}

h.each do | gem, info |
info = {} if not info
$stderr.print "Fetching rubygem.org gem info for ",gem,"\n"
fetch = `gem specification -r #{gem.strip}`
command = "gem specification -r #{gem.strip}"
$stderr.print "RUNNING "+command+"\n"
fetch = `#{command}`
if fetch != ''
spec = YAML::load(fetch)
info[:authors] = spec.authors
@@ -88,10 +93,13 @@ h.each do | gem, info |
versions = get_versions(gem)
info[:downloads90],info[:recent_gem] = get_downloads90(gem, versions)
else
info[:version] = 'pre'
info[:status] = 'pre'
info[:version] = 'pre'
info[:status] = 'pre'
info[:downloads] = 0
info[:downloads90] = 0
end
nlist[gem] = info
end

print h.to_yaml
print nlist.to_yaml


+ 13
- 7
bin/fetch-gemlist.rb View File

@@ -17,19 +17,25 @@ 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','bio-publisci']
dirname = 'biogems'
if ARGV.index '--rubygems'
dirname = 'rubygems'
list = []
else
list = `gem search bio-`.split(/\n/)
list = list.map { |item| item.split(" ")[0] }
$stderr.print "Get all rubygems starting with bio- (bio dash)\n"
if is_testing
list = ['bio','bio-blastxmlparser','bio-publisci']
else
list = `gem search bio-`.split(/\n/)
list = list.map { |item| item.split(" ")[0] }
end
end

h = {}
list.each { |n| h[n] = nil }
$stderr.print "Get information from YAML files in ./etc/biogems/\n"
list2 = Dir.glob("./etc/biogems/*.yaml")
$stderr.print "Get information from YAML files in ./etc/#{dirname}/\n"
list2 = Dir.glob("./etc/#{dirname}/*.yaml")
list2.each do | yamlfn |
gem = File.basename(yamlfn,".yaml")
# p gem


+ 4
- 4
lib/helpers/content_helpers.rb View File

@@ -56,19 +56,19 @@ module ContentHelpers
if cite
cite = 'http://dx.doi.org/'+plugin[:doi] if cite !~ /^http:/
end
stargazers = plugin[:stargazers]
stargazers = plugin[:github_stargazers_uri]
if not stargazers
stargazers = src
stargazers += '/stargazers' if stargazers =~ /github/
end
num_stargazers = plugin[:num_stargazers]
num_stargazers = plugin[:github_stargazers]
num_stargazers = 0 if num_stargazers == nil
issues = plugin[:issues]
issues = plugin[:github_issues_uri]
if not issues
issues = src
issues += '/issues' if issues =~ /github/
end
num_issues = plugin[:num_issues]
num_issues = plugin[:github_issues]
num_issues = '' if num_issues == nil
num_issues = '...' if num_issues == 0
commit = plugin[:commit]


Loading…
Cancel
Save