bcl 0.5.3 → 0.5.4

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: d84cc1c93cc41cbcd5e66681619123bf8a173a98
4
- data.tar.gz: 99519415353a6c8dcafe3e2b558b0f0ceba001e8
3
+ metadata.gz: 651c1e172bb8131e1a172d00914045dba3274711
4
+ data.tar.gz: 0742ebe62c0d50f3578c0bcd518098924a782dfe
5
5
  SHA512:
6
- metadata.gz: 5c78265464c68b61f6f01cbb8f312884b219e1d95f4b049ad73b2b65b8a1d5b33d3acb1bd1c92e78e5dce8549bb112d9cd0be7c24964b299a1bfd73306861183
7
- data.tar.gz: b82a8f5e0cf75223377f414ae3fec6682c8cffba04cb1904fcd655377b0a0508da278bbc98701e1e08e1e4e862e1a35076c80a07feb3305cf0641eebff34c565
6
+ metadata.gz: 03060573da0b0e9b2da8b1123d65369ef5d1d1f50e84d95aa2d673f282cfc0631fc7fc805fb366030fdc144785fdf8d8d22b40f5609b534d69aa6e8ef30e7911
7
+ data.tar.gz: 6438d96b80af12eb64a9b480aa2f184682767be797e25b3d6a32f60ef6eaa38c248be398973f01b23146fa9fb568b923f7dc086fc13d61ea12d282077ad52c56
data/lib/bcl/base_xml.rb CHANGED
@@ -1,4 +1,21 @@
1
- require 'uuid' # gem install uuid
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(save_path)
28
- @name = "" #this is also a unique identifier to the component...
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 = "schema.xsd"
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 if usage_type != nil
87
- fs.checksum = checksum if checksum != nil
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 == "energyplus"
96
- val = "EnergyPlus"
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 = "int"
139
+ dt = 'int'
123
140
  elsif input_value.is_a?(Float)
124
- dt = "float"
141
+ dt = 'float'
125
142
  else
126
- dt = "string"
143
+ dt = 'string'
127
144
  end
128
145
 
129
146
  dt