bcl 0.5.3 → 0.5.4
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/base_xml.rb +33 -16
- data/lib/bcl/component.rb +388 -390
- data/lib/bcl/component_from_spreadsheet.rb +34 -37
- data/lib/bcl/component_methods.rb +864 -790
- data/lib/bcl/component_spreadsheet.rb +295 -309
- data/lib/bcl/core_ext.rb +38 -6
- data/lib/bcl/master_taxonomy.rb +533 -552
- data/lib/bcl/tar_ball.rb +78 -80
- data/lib/bcl/version.rb +2 -2
- data/lib/bcl.rb +41 -34
- metadata +84 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 651c1e172bb8131e1a172d00914045dba3274711
|
4
|
+
data.tar.gz: 0742ebe62c0d50f3578c0bcd518098924a782dfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03060573da0b0e9b2da8b1123d65369ef5d1d1f50e84d95aa2d673f282cfc0631fc7fc805fb366030fdc144785fdf8d8d22b40f5609b534d69aa6e8ef30e7911
|
7
|
+
data.tar.gz: 6438d96b80af12eb64a9b480aa2f184682767be797e25b3d6a32f60ef6eaa38c248be398973f01b23146fa9fb568b923f7dc086fc13d61ea12d282077ad52c56
|
data/lib/bcl/base_xml.rb
CHANGED
@@ -1,4 +1,21 @@
|
|
1
|
-
|
1
|
+
######################################################################
|
2
|
+
# Copyright (c) 2008-2014, Alliance for Sustainable Energy.
|
3
|
+
# All rights reserved.
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
|
+
######################################################################
|
2
19
|
|
3
20
|
module BCL
|
4
21
|
ProvStruct = Struct.new(:author, :datetime, :comment)
|
@@ -24,24 +41,24 @@ module BCL
|
|
24
41
|
attr_accessor :tags
|
25
42
|
attr_accessor :provenances
|
26
43
|
|
27
|
-
def initialize(
|
28
|
-
@name =
|
29
|
-
@description =
|
30
|
-
@modeler_description =
|
44
|
+
def initialize(_save_path)
|
45
|
+
@name = '' # this is also a unique identifier to the component...
|
46
|
+
@description = ''
|
47
|
+
@modeler_description = ''
|
31
48
|
|
32
49
|
@provenances = []
|
33
50
|
@tags = []
|
34
51
|
@attributes = []
|
35
52
|
@files = []
|
36
53
|
|
37
|
-
@schema_url =
|
54
|
+
@schema_url = 'schema.xsd'
|
38
55
|
end
|
39
56
|
|
40
|
-
def generate_uuid
|
57
|
+
def generate_uuid
|
41
58
|
@uuid = UUID.new.generate
|
42
59
|
end
|
43
60
|
|
44
|
-
def generate_vuid
|
61
|
+
def generate_vuid
|
45
62
|
@vuid = UUID.new.generate
|
46
63
|
end
|
47
64
|
|
@@ -83,17 +100,17 @@ module BCL
|
|
83
100
|
fs.fqp_file = fqp_file
|
84
101
|
fs.filename = filename
|
85
102
|
fs.filetype = filetype
|
86
|
-
fs.usage_type = usage_type
|
87
|
-
fs.checksum = checksum
|
103
|
+
fs.usage_type = usage_type unless usage_type.nil?
|
104
|
+
fs.checksum = checksum unless checksum.nil?
|
88
105
|
|
89
106
|
@files << fs
|
90
107
|
end
|
91
108
|
|
92
|
-
#return the title case of the string
|
109
|
+
# return the title case of the string
|
93
110
|
def tc(input)
|
94
111
|
val = input.gsub(/\b\w/) { $&.upcase }
|
95
|
-
if val.downcase ==
|
96
|
-
val =
|
112
|
+
if val.downcase == 'energyplus'
|
113
|
+
val = 'EnergyPlus'
|
97
114
|
end
|
98
115
|
|
99
116
|
val
|
@@ -119,11 +136,11 @@ module BCL
|
|
119
136
|
input_value = test.match('\.').nil? ? Integer(test) : Float(test) rescue test.to_s
|
120
137
|
|
121
138
|
if input_value.is_a?(Fixnum) || input_value.is_a?(Bignum)
|
122
|
-
dt =
|
139
|
+
dt = 'int'
|
123
140
|
elsif input_value.is_a?(Float)
|
124
|
-
dt =
|
141
|
+
dt = 'float'
|
125
142
|
else
|
126
|
-
dt =
|
143
|
+
dt = 'string'
|
127
144
|
end
|
128
145
|
|
129
146
|
dt
|