rbbt-util 5.21.85 → 5.21.86

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b0026548f0fd257ee1c8034c380bc81421e6b43
4
- data.tar.gz: 3d71f163382164f5403f405c22f46f810dc94fff
3
+ metadata.gz: 14c71affcd04cfc765824f452e0455dd0a59befe
4
+ data.tar.gz: 57821f59ec541b8cb173fbcf64861ca793a0a032
5
5
  SHA512:
6
- metadata.gz: 1cbbdfe188342713c7656ddd3f0dca2e85b8dfcf920aad550e66128d5c57151553c1ec213c5bfd0f09646ed2bc1e2dde4e6a55d3a4844481d2016eec0595464d
7
- data.tar.gz: 3164ac445b99c1a05e6741bde5c59bb8352ae7ff9c7bae7fef99bf0aad523f54291f14d59f4d4b9e71daa1dccf2f12f5e6926cb33ada09d104ca212a6743731c
6
+ metadata.gz: 81cd59fb9a32bddf24ca25a7bb614faab5ced6bfdff678454b688992674c84029312d8c52dc2a29f9c3511945daf6be91e90375ba8b661e184a08330229be203
7
+ data.tar.gz: 2e45a91dcd62e667d9f16e83ff1c20f58bbf2111ab631e82a0e287cfa97a8e5c46af6fe6f0c79f75b99c30d6fceb62d91dcca2fe72eec4bc28d313386483df1f
@@ -10,7 +10,7 @@ module Association
10
10
  end
11
11
 
12
12
  def self.parse_field_specification(spec)
13
- return [2,nil,nil] if Fixnum === spec
13
+ return [2,nil,nil] if Numeric === spec
14
14
  spec = spec.split "=>" unless Array === spec
15
15
  field_part, final_format = spec
16
16
 
@@ -131,7 +131,7 @@ module Association
131
131
  header = case field
132
132
  when String
133
133
  field
134
- when Fixnum
134
+ when Numeric
135
135
  all_fields[field]
136
136
  when :key
137
137
  all_fields.first
@@ -75,7 +75,7 @@ module Persist
75
75
  end
76
76
 
77
77
  def include?(i)
78
- return true if Fixnum === i and i < pos(@size)
78
+ return true if Numeric === i and i < pos(@size)
79
79
  return true if metadata.include? i
80
80
  false
81
81
  end
@@ -62,7 +62,7 @@ module Persist
62
62
 
63
63
  def add(key, value)
64
64
  key = pos_function.call(key) if pos_function
65
- if Fixnum === key
65
+ if Numeric === key
66
66
  @_last ||= -1
67
67
  skipped = key - @_last - 1
68
68
  skipped.times do
@@ -79,7 +79,7 @@ module Persist
79
79
  end
80
80
 
81
81
  def include?(i)
82
- return true if Fixnum === i and i < size
82
+ return true if Numeric === i and i < size
83
83
  return true if metadata.include? i
84
84
  false
85
85
  end
@@ -114,7 +114,7 @@ module TSV
114
114
  end
115
115
  when @new_fields == :all
116
116
  fields
117
- when (Fixnum === @new_fields and @new_fields <= 0)
117
+ when (Numeric === @new_fields and @new_fields <= 0)
118
118
  new = fields.dup
119
119
  new.delete_at(- @new_fields)
120
120
  new.unshift key_field
@@ -127,13 +127,13 @@ module TSV
127
127
  self.instance_eval do alias process process_null end
128
128
  when @new_key_field == :key
129
129
  if type == :double
130
- if Fixnum === @new_fields and @new_fields <= 0
130
+ if Numeric === @new_fields and @new_fields <= 0
131
131
  self.instance_eval do alias process process_subset_all_but_double end
132
132
  else
133
133
  self.instance_eval do alias process process_subset_double end
134
134
  end
135
135
  else
136
- if Fixnum === @new_fields and @new_fields <= 0
136
+ if Numeric === @new_fields and @new_fields <= 0
137
137
  self.instance_eval do alias process process_subset_all_but_list end
138
138
  else
139
139
  self.instance_eval do alias process process_subset_list end
@@ -523,7 +523,7 @@ module TSV
523
523
  end
524
524
  end
525
525
 
526
- when Fixnum === method
526
+ when Numeric === method
527
527
  with_unnamed do
528
528
  through :key, key do |key, values|
529
529
  new[key] = self[key] if invert ^ (values.flatten.length >= method)
@@ -571,7 +571,7 @@ module TSV
571
571
  when TrueClass
572
572
  max = guess_max(obj)
573
573
  Log::ProgressBar.new_bar(max, nil)
574
- when Fixnum
574
+ when Numeric
575
575
  max = guess_max(obj)
576
576
  Log::ProgressBar.new_bar(bar)
577
577
  when Hash
data/lib/rbbt/util/R.rb CHANGED
@@ -112,7 +112,7 @@ source('#{UTIL}');
112
112
  "#{ object }"
113
113
  when String
114
114
  object[0] == ":" ? object[1..-1] : "'#{ object }'"
115
- when Fixnum, Float
115
+ when Numeric
116
116
  object
117
117
  when TrueClass
118
118
  "TRUE"
@@ -105,7 +105,7 @@ model = rbbt.model.load('#{model_file}');
105
105
  predict(model, data.frame(#{R.ruby2R tsv}));
106
106
  EOF
107
107
  Array === tsv.values.first ? res : res.first
108
- when Fixnum, Array, Float, String
108
+ when Numeric, Array, String
109
109
  field = formula.split("~").last.strip
110
110
  field.gsub!(/log\((.*)\)/,'\1')
111
111
 
@@ -31,7 +31,7 @@ module R
31
31
  case v
32
32
  when FalseClass, TrueClass
33
33
  "'logical'"
34
- when Fixnum, Float
34
+ when Numeric
35
35
  "'numeric'"
36
36
  when String
37
37
  if v.strip =~ /^[-+]?[\d\.]+$/
@@ -97,7 +97,7 @@ module R
97
97
  case v
98
98
  when FalseClass, TrueClass
99
99
  "'logical'"
100
- when Fixnum, Float
100
+ when Numeric
101
101
  "'numeric'"
102
102
  when String
103
103
  if v.strip =~ /^[-+]?[\d\.]+$/
@@ -178,7 +178,7 @@ data = NULL
178
178
  case v
179
179
  when FalseClass, TrueClass
180
180
  "'logical'"
181
- when Fixnum, Float
181
+ when Numeric
182
182
  "'numeric'"
183
183
  when String
184
184
  if v.strip =~ /^[-+]?[\d\.]+$/
@@ -106,7 +106,7 @@ class Color
106
106
  return val if val.is_a?(Color)
107
107
 
108
108
  # Single value, assume grayscale
109
- return Color.new(val, val, val) if val.is_a?(Fixnum)
109
+ return Color.new(val, val, val) if val.is_a?(Numeric)
110
110
 
111
111
  # Assume string
112
112
  str = val.to_s.upcase
@@ -74,7 +74,7 @@ module Colorize
74
74
 
75
75
  def self.tsv(tsv, options = {})
76
76
  values = tsv.values.flatten
77
- if Fixnum === values.first or Float === values.first or (values.first.to_f != 0 and values[0] != "0" and values[0] != "0.0")
77
+ if Numeric === values.first or (values.first.to_f != 0 and values[0] != "0" and values[0] != "0.0")
78
78
  value_colors = Misc.process_to_hash(values){continuous(values)}
79
79
  else
80
80
  value_colors = Misc.process_to_hash(values){distinct(values)}
@@ -62,7 +62,7 @@ class RbbtProcessQueue
62
62
  multiplier = case multiplier
63
63
  when String
64
64
  multiplier.to_s
65
- when Fixnum
65
+ when Numeric
66
66
  multiplier.to_i
67
67
  else
68
68
  3
data/lib/rbbt/util/log.rb CHANGED
@@ -54,8 +54,8 @@ module Log
54
54
 
55
55
  def self.get_level(level)
56
56
  case level
57
- when Fixnum
58
- level
57
+ when Numeric
58
+ level.to_i
59
59
  when String
60
60
  begin
61
61
  Log.const_get(level.upcase)
@@ -123,7 +123,7 @@ module Log
123
123
  def self.color(severity, str = nil, reset = false)
124
124
  return str || "" if nocolor
125
125
  color = reset ? Term::ANSIColor.reset : ""
126
- color << SEVERITY_COLOR[severity] if Fixnum === severity
126
+ color << SEVERITY_COLOR[severity] if Integer === severity
127
127
  color << Term::ANSIColor.send(severity) if Symbol === severity and Term::ANSIColor.respond_to? severity
128
128
  if str.nil?
129
129
  color
@@ -47,8 +47,8 @@ module Misc
47
47
  when FalseClass
48
48
  value === FalseClass or (String === value and value.downcase == 'false')
49
49
  when String
50
- Fixnum === value ? value.to_f == condition.to_f : value == condition
51
- when Fixnum
50
+ Numeric === value ? value.to_f == condition.to_f : value == condition
51
+ when Numeric
52
52
  value.to_f == condition.to_f
53
53
  when Array
54
54
  case condition.first
@@ -45,7 +45,7 @@ module Misc
45
45
 
46
46
  def self.hash2string(hash)
47
47
  hash.sort_by{|k,v| k.to_s}.collect{|k,v|
48
- next unless %w(Symbol String Float Fixnum Integer TrueClass FalseClass Module Class Object).include? v.class.to_s
48
+ next unless %w(Symbol String Float Fixnum Integer Numeric TrueClass FalseClass Module Class Object).include? v.class.to_s
49
49
  [ Symbol === k ? ":" << k.to_s : k,
50
50
  Symbol === v ? ":" << v.to_s : v] * "="
51
51
  }.compact * "#"
@@ -62,7 +62,7 @@ module Misc
62
62
 
63
63
  def self.hash2GET_params(hash)
64
64
  hash.sort_by{|k,v| k.to_s}.collect{|k,v|
65
- next unless %w(Symbol String Float Fixnum Integer TrueClass FalseClass Module Class Object Array).include? v.class.to_s
65
+ next unless %w(Symbol String Float Fixnum Integer Numeric TrueClass FalseClass Module Class Object Array).include? v.class.to_s
66
66
  v = case
67
67
  when Symbol === v
68
68
  v.to_s
@@ -97,7 +97,7 @@ module Misc
97
97
  [k,"'" << v.to_s << "'"] * "="
98
98
  when TrueClass === v
99
99
  [k,"'" << v.to_s << "'"] * "="
100
- when (Fixnum === v or Float === v)
100
+ when Numeric === v
101
101
  [k,"'" << v.to_s << "'"] * "="
102
102
  else
103
103
  nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.21.85
4
+ version: 5.21.86
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-15 00:00:00.000000000 Z
11
+ date: 2017-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake