solvebio 1.7.4 → 1.7.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.bumpversion.cfg +1 -1
- data/README.md +1 -1
- data/lib/solvebio.rb +24 -0
- data/lib/solvebio/api_operations.rb +1 -1
- data/lib/solvebio/version.rb +1 -1
- metadata +2 -2
data/.bumpversion.cfg
CHANGED
data/README.md
CHANGED
data/lib/solvebio.rb
CHANGED
@@ -51,4 +51,28 @@ module SolveBio
|
|
51
51
|
File::expand_path File.join(dir, 'solvebio.log')
|
52
52
|
end
|
53
53
|
@logger = Logger.new(logfile)
|
54
|
+
|
55
|
+
def self.login(opts={})
|
56
|
+
# Clear any existing auth keys
|
57
|
+
@access_token = nil
|
58
|
+
@api_key = nil
|
59
|
+
|
60
|
+
# Helper method to load credentials from local file in Ruby scripts.
|
61
|
+
if opts[:access_token]
|
62
|
+
@access_token = opts[:access_token]
|
63
|
+
elsif opts[:api_key]
|
64
|
+
@api_key = opts[:api_key]
|
65
|
+
else
|
66
|
+
# creds
|
67
|
+
require 'solvebio/cli/credentials'
|
68
|
+
_, @api_key = SolveBio::CLI::Credentials.get_credentials
|
69
|
+
end
|
70
|
+
|
71
|
+
if @api_key.nil? and @access_token.nil?
|
72
|
+
puts "No credentials found. Requests to SolveBio may fail. Use 'solvebio.rb login' to save your API key."
|
73
|
+
return false
|
74
|
+
end
|
75
|
+
|
76
|
+
return true
|
77
|
+
end
|
54
78
|
end
|
data/lib/solvebio/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solvebio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-02-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: netrc
|