bcl 0.5.6 → 0.5.7.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b9b595f2fbb18ac0cdf885c9cd7c94595272a0e6
4
- data.tar.gz: 4a9f7d8789ae367ad26e2b1a139c2f781aefbe45
3
+ metadata.gz: 35f0906c51b3ebb744a4980ed17a074f6221b19d
4
+ data.tar.gz: 59bf6f68230139b3a8032954f87f4063cfb03fb9
5
5
  SHA512:
6
- metadata.gz: 28a7fa4ba6ab4cca1fece24b9928d2d82e440814b6c4d92126e4792d74bc6c0cff1716218d72a2a2610529feafa354ff916a0621f3c53733038de155d7efb897
7
- data.tar.gz: cfa0c7c21b956deadfdb992324b8af6da997a0c8f3ac3a9e109de44d59c981dcb77a9f39593a3206f10c884557b27edce32bf4a8ced57ab221f60a4843b80140
6
+ metadata.gz: 3fd9470fcb35faccde668b6230fedd7a63938ed63a32019b4dae7076ab83c0ba503f1524548ffdfb43647f87a62712712e06f686db593f85bc0700674a533a7f
7
+ data.tar.gz: 9f8d0e630fa89c9700020d056d0f823c347a49d5de1febcd399efc9a502585da8befa00d428c17a222f12b5007a825365c18ad232014c107f3dd6683e746363a
@@ -38,7 +38,7 @@ module BCL
38
38
  load_config
39
39
  end
40
40
 
41
- def login(username = nil, password = nil, url = nil, group_id = nil)
41
+ def login(username = nil, secret = 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? || password.nil?
57
- # log in via cached creditials
56
+ if username.nil? || secret.nil?
57
+ # log in via cached credentials
58
58
  username = @config[:server][:user][:username]
59
- password = @config[:server][:user][:password]
59
+ secret = @config[:server][:user][:secret]
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,10 +74,9 @@ module BCL
74
74
  @http.use_ssl = true
75
75
  end
76
76
 
77
- data = %({"username":"#{username}","password":"#{password}"})
78
- # data = {"username" => username, "password" => password}
77
+ data = %({"username":"#{username}","secret":"#{secret}"})
79
78
 
80
- login_path = '/api/user/login.json'
79
+ login_path = '/api/user/loginsso.json'
81
80
  headers = { 'Content-Type' => 'application/json' }
82
81
 
83
82
  res = @http.post(login_path, data, headers)
@@ -634,7 +633,7 @@ module BCL
634
633
  end
635
634
 
636
635
  # pushes component to the bcl and publishes them (if logged-in as BCL Website Admin user).
637
- # username, password, and group_id are set in the ~/.bcl/config.yml file
636
+ # username, secret, and group_id are set in the ~/.bcl/config.yml file
638
637
  def push_content(filename_and_path, write_receipt_file, content_type)
639
638
  fail 'Please login before pushing components' if @session.nil?
640
639
  fail 'Do not have a valid access token; try again' if @access_token.nil?
@@ -662,7 +661,7 @@ module BCL
662
661
  end
663
662
 
664
663
  # pushes updated content to the bcl and publishes it (if logged-in as BCL Website Admin user).
665
- # username and password set in ~/.bcl/config.yml file
664
+ # username and secret set in ~/.bcl/config.yml file
666
665
  def update_content(filename_and_path, write_receipt_file, uuid = nil)
667
666
  fail 'Please login before pushing components' unless @session
668
667
 
@@ -917,7 +916,7 @@ module BCL
917
916
  url: 'https://bcl.nrel.gov',
918
917
  user: {
919
918
  username: 'ENTER_BCL_USERNAME',
920
- password: 'ENTER_BCL_PASSWORD',
919
+ secret: 'ENTER_BCL_SECRET',
921
920
  group: 'ENTER_GROUP_ID'
922
921
  }
923
922
  }
@@ -19,11 +19,21 @@
19
19
 
20
20
  class String
21
21
  def to_underscore
22
- gsub(/::/, '/')
23
- .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
24
- .gsub(/([a-z\d])([A-Z])/, '\1_\2')
25
- .tr('-', '_')
26
- .downcase
22
+ gsub('OpenStudio','Openstudio')
23
+ .gsub('EnergyPlus','Energyplus')
24
+ .gsub(/::/, '/')
25
+ .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
26
+ .gsub(/([a-z\d])([A-Z])/, '\1_\2')
27
+ .tr('-', '_')
28
+ .tr(' ', '_')
29
+ .squeeze('_')
30
+ .downcase
31
+ end
32
+
33
+ def to_bool
34
+ return true if self == true || self =~ (/(true|t|yes|y|1)$/i)
35
+ return false if self == false || self =~ (/(false|f|no|n|0)$/i)
36
+ fail "invalid value for Boolean: '#{self}'"
27
37
  end
28
38
 
29
39
  # simple method to create titles -- very custom to catch known inflections
@@ -18,5 +18,5 @@
18
18
  ######################################################################
19
19
 
20
20
  module BCL
21
- VERSION = '0.5.6'
21
+ VERSION = '0.5.7.pre'
22
22
  end
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.6
4
+ version: 0.5.7.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Macumber
@@ -11,160 +11,160 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-05-11 00:00:00.000000000 Z
14
+ date: 2017-10-10 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: uuid
18
18
  requirement: !ruby/object:Gem::Requirement
19
19
  requirements:
20
- - - '>='
20
+ - - ">="
21
21
  - !ruby/object:Gem::Version
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - '>='
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: '0'
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: builder
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
- - - '>='
34
+ - - ">="
35
35
  - !ruby/object:Gem::Version
36
36
  version: '0'
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - '>='
41
+ - - ">="
42
42
  - !ruby/object:Gem::Version
43
43
  version: '0'
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: zliby
46
46
  requirement: !ruby/object:Gem::Requirement
47
47
  requirements:
48
- - - '>='
48
+ - - ">="
49
49
  - !ruby/object:Gem::Version
50
50
  version: '0'
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
- - - '>='
55
+ - - ">="
56
56
  - !ruby/object:Gem::Version
57
57
  version: '0'
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: archive-tar-minitar
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - '>='
62
+ - - ">="
63
63
  - !ruby/object:Gem::Version
64
64
  version: '0'
65
65
  type: :runtime
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - '>='
69
+ - - ">="
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0'
72
72
  - !ruby/object:Gem::Dependency
73
73
  name: multi_json
74
74
  requirement: !ruby/object:Gem::Requirement
75
75
  requirements:
76
- - - '>='
76
+ - - ">="
77
77
  - !ruby/object:Gem::Version
78
78
  version: '0'
79
79
  type: :runtime
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
- - - '>='
83
+ - - ">="
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
86
  - !ruby/object:Gem::Dependency
87
87
  name: yamler
88
88
  requirement: !ruby/object:Gem::Requirement
89
89
  requirements:
90
- - - '>='
90
+ - - ">="
91
91
  - !ruby/object:Gem::Version
92
92
  version: '0'
93
93
  type: :runtime
94
94
  prerelease: false
95
95
  version_requirements: !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - '>='
97
+ - - ">="
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0'
100
100
  - !ruby/object:Gem::Dependency
101
101
  name: faraday
102
102
  requirement: !ruby/object:Gem::Requirement
103
103
  requirements:
104
- - - '>='
104
+ - - ">="
105
105
  - !ruby/object:Gem::Version
106
106
  version: '0'
107
107
  type: :runtime
108
108
  prerelease: false
109
109
  version_requirements: !ruby/object:Gem::Requirement
110
110
  requirements:
111
- - - '>='
111
+ - - ">="
112
112
  - !ruby/object:Gem::Version
113
113
  version: '0'
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: roo
116
116
  requirement: !ruby/object:Gem::Requirement
117
117
  requirements:
118
- - - '>='
118
+ - - ">="
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  type: :runtime
122
122
  prerelease: false
123
123
  version_requirements: !ruby/object:Gem::Requirement
124
124
  requirements:
125
- - - '>='
125
+ - - ">="
126
126
  - !ruby/object:Gem::Version
127
127
  version: '0'
128
128
  - !ruby/object:Gem::Dependency
129
129
  name: nokogiri
130
130
  requirement: !ruby/object:Gem::Requirement
131
131
  requirements:
132
- - - '>='
132
+ - - ">="
133
133
  - !ruby/object:Gem::Version
134
134
  version: '0'
135
135
  type: :runtime
136
136
  prerelease: false
137
137
  version_requirements: !ruby/object:Gem::Requirement
138
138
  requirements:
139
- - - '>='
139
+ - - ">="
140
140
  - !ruby/object:Gem::Version
141
141
  version: '0'
142
142
  - !ruby/object:Gem::Dependency
143
143
  name: rubyzip
144
144
  requirement: !ruby/object:Gem::Requirement
145
145
  requirements:
146
- - - '>='
146
+ - - ">="
147
147
  - !ruby/object:Gem::Version
148
148
  version: '0'
149
149
  type: :runtime
150
150
  prerelease: false
151
151
  version_requirements: !ruby/object:Gem::Requirement
152
152
  requirements:
153
- - - '>='
153
+ - - ">="
154
154
  - !ruby/object:Gem::Version
155
155
  version: '0'
156
156
  - !ruby/object:Gem::Dependency
157
157
  name: rubyXL
158
158
  requirement: !ruby/object:Gem::Requirement
159
159
  requirements:
160
- - - '>='
160
+ - - ">="
161
161
  - !ruby/object:Gem::Version
162
162
  version: '0'
163
163
  type: :runtime
164
164
  prerelease: false
165
165
  version_requirements: !ruby/object:Gem::Requirement
166
166
  requirements:
167
- - - '>='
167
+ - - ">="
168
168
  - !ruby/object:Gem::Version
169
169
  version: '0'
170
170
  description: This gem contains helper methods for generating the Component XML file
@@ -197,14 +197,14 @@ require_paths:
197
197
  - lib
198
198
  required_ruby_version: !ruby/object:Gem::Requirement
199
199
  requirements:
200
- - - '>='
200
+ - - ">="
201
201
  - !ruby/object:Gem::Version
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: '0'
207
+ version: 1.3.1
208
208
  requirements: []
209
209
  rubyforge_project:
210
210
  rubygems_version: 2.4.5