unipept 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/bin/uniprot +12 -6
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3741e36ed209999fb0e3f9681511e7996881042b
4
- data.tar.gz: 74ba05b1628709073778658a77cb82cf28e65b86
3
+ metadata.gz: 7e2b134dc5a0b633c5d3aba0b1e21e290dc821c3
4
+ data.tar.gz: 63972b5c62b6272f9fe27ef0145739e0a152d535
5
5
  SHA512:
6
- metadata.gz: d472fc9b3c19c1e37d0681457d9f49f212ba35713d3374d52f7d23308a9dac047fe24deecd26c3efab1ceb28bdc69e60767772c32cec186e1aa67b55fe123cb9
7
- data.tar.gz: 8059101525cf92cb68fefda22112fcebbce377f90b9d53b0b634e3f1858121470d6634393e04fac9dfb51043cb54c5941aac4f907666f7b0f5c8a3cff406013d
6
+ metadata.gz: 5e66de364e9a572a17e9ae32c1cc3a3c18aa002f22d9a22525f6c610619e814cf277cc7c9a25c599ae401cf586e0b996aec9ed52e435648bd807eee073b91a2c
7
+ data.tar.gz: 135dce274a849f9dff3ffd94cf7a04d25a7f32c0066ec80a7e1c38e1486bd2041b40d9de1a7e811a868e97e07444bc1c21a4dcd35c52c7267246b536fe92bfb3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.1
1
+ 0.5.2
data/bin/uniprot CHANGED
@@ -1,23 +1,29 @@
1
1
  #!/usr/bin/env ruby
2
- require 'faraday'
2
+ require 'typhoeus'
3
3
  require 'cri'
4
4
 
5
5
  Signal.trap("PIPE", "EXIT")
6
6
  Signal.trap("INT", "EXIT")
7
7
 
8
- def get_uniprot_entry(arg)
9
- resp = Faraday.get("http://www.uniprot.org/uniprot/#{arg}.fasta")
8
+ def get_uniprot_entry(arg, fasta = false)
9
+ resp = Typhoeus.get("http://www.uniprot.org/uniprot/#{arg}.fasta")
10
10
  if resp.success?
11
- puts resp.body.lines.map(&:chomp)[1..-1].join("")
11
+ if fasta
12
+ puts resp.response_body
13
+ else
14
+ puts resp.response_body.lines.map(&:chomp)[1..-1].join("")
15
+ end
12
16
  end
13
17
  end
14
18
 
19
+ fasta = ARGV.delete "--fasta"
20
+
15
21
  if ARGV.empty?
16
22
  STDIN.each_line do |pept|
17
- get_uniprot_entry(pept.chomp)
23
+ get_uniprot_entry(pept.chomp, fasta)
18
24
  end
19
25
  else
20
26
  ARGV.each do |pept|
21
- get_uniprot_entry(pept)
27
+ get_uniprot_entry(pept, fasta)
22
28
  end
23
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unipept
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toon Willems