bcl 0.5.7.pre → 0.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/bcl/component_methods.rb +8 -8
- data/lib/bcl/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 317f08f02e79fd41f98a711a6cff460d55125fd0
|
4
|
+
data.tar.gz: 3c29a18af6c83f742537e00a96f422f5e5dc8500
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9023fdac7c3cfbb86e8e38ac776eb2483b87123936c90785a62f98c00870dde73bafa3e0f1cd56f1cd415b357032921befaa9b81fd6b104689722f50ae53ca12
|
7
|
+
data.tar.gz: 98e2043d5d609d8a29cfc080c76d2269d836221e3a94c33e41102f85d57031882815abe747ceae0b73a341ee47f582df2c393ad0ca5e03f20cd5b2822ce4dbcf
|
@@ -38,7 +38,7 @@ module BCL
|
|
38
38
|
load_config
|
39
39
|
end
|
40
40
|
|
41
|
-
def login(username = nil,
|
41
|
+
def login(username = nil, password = nil, url = nil, group_id = nil)
|
42
42
|
# figure out what url to use
|
43
43
|
if url.nil?
|
44
44
|
url = @config[:server][:url]
|
@@ -53,10 +53,10 @@ module BCL
|
|
53
53
|
url = url.gsub('http://', '')
|
54
54
|
url = url.gsub('https://', '')
|
55
55
|
|
56
|
-
if username.nil? ||
|
56
|
+
if username.nil? || passwrord.nil?
|
57
57
|
# log in via cached credentials
|
58
58
|
username = @config[:server][:user][:username]
|
59
|
-
|
59
|
+
password = @config[:server][:user][:password]
|
60
60
|
@group_id = group_id || @config[:server][:user][:group]
|
61
61
|
puts "logging in using credentials in .bcl/config.yml: Connecting to #{url} on port #{port} as #{username} with group #{@group_id}"
|
62
62
|
else
|
@@ -74,9 +74,9 @@ module BCL
|
|
74
74
|
@http.use_ssl = true
|
75
75
|
end
|
76
76
|
|
77
|
-
data = %({"username":"#{username}","
|
77
|
+
data = %({"username":"#{username}","password":"#{password}"})
|
78
78
|
|
79
|
-
login_path = '/api/user/
|
79
|
+
login_path = '/api/user/login.json'
|
80
80
|
headers = { 'Content-Type' => 'application/json' }
|
81
81
|
|
82
82
|
res = @http.post(login_path, data, headers)
|
@@ -633,7 +633,7 @@ module BCL
|
|
633
633
|
end
|
634
634
|
|
635
635
|
# pushes component to the bcl and publishes them (if logged-in as BCL Website Admin user).
|
636
|
-
# username,
|
636
|
+
# username, password, and group_id are set in the ~/.bcl/config.yml file
|
637
637
|
def push_content(filename_and_path, write_receipt_file, content_type)
|
638
638
|
fail 'Please login before pushing components' if @session.nil?
|
639
639
|
fail 'Do not have a valid access token; try again' if @access_token.nil?
|
@@ -661,7 +661,7 @@ module BCL
|
|
661
661
|
end
|
662
662
|
|
663
663
|
# pushes updated content to the bcl and publishes it (if logged-in as BCL Website Admin user).
|
664
|
-
# username and
|
664
|
+
# username and password set in ~/.bcl/config.yml file
|
665
665
|
def update_content(filename_and_path, write_receipt_file, uuid = nil)
|
666
666
|
fail 'Please login before pushing components' unless @session
|
667
667
|
|
@@ -916,7 +916,7 @@ module BCL
|
|
916
916
|
url: 'https://bcl.nrel.gov',
|
917
917
|
user: {
|
918
918
|
username: 'ENTER_BCL_USERNAME',
|
919
|
-
|
919
|
+
password: 'ENTER_BCL_PASSWORD',
|
920
920
|
group: 'ENTER_GROUP_ID'
|
921
921
|
}
|
922
922
|
}
|
data/lib/bcl/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bcl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Macumber
|
@@ -202,9 +202,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
202
202
|
version: 1.9.3
|
203
203
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
204
204
|
requirements:
|
205
|
-
- - "
|
205
|
+
- - ">="
|
206
206
|
- !ruby/object:Gem::Version
|
207
|
-
version:
|
207
|
+
version: '0'
|
208
208
|
requirements: []
|
209
209
|
rubyforge_project:
|
210
210
|
rubygems_version: 2.4.5
|