knjrbfw 0.0.74 → 0.0.75

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.74
1
+ 0.0.75
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{knjrbfw}
8
- s.version = "0.0.74"
8
+ s.version = "0.0.75"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kasper Johansen"]
12
- s.date = %q{2012-07-28}
12
+ s.date = %q{2012-07-29}
13
13
  s.description = %q{Including stuff for HTTP, SSH and much more.}
14
14
  s.email = %q{k@spernj.org}
15
15
  s.extra_rdoc_files = [
@@ -60,7 +60,7 @@ module Knj::ArrayExt
60
60
  def self.hash_numeric_keys?(hash)
61
61
  all_num = true
62
62
  hash.each do |key, val|
63
- if !Php4r.is_numeric(key)
63
+ if !(Float(key) rescue false)
64
64
  all_num = false
65
65
  break
66
66
  end
@@ -1,6 +1,6 @@
1
1
  class Knj::Datestamp
2
2
  def self.in(time = Time.new)
3
- if Php4r.is_numeric(time)
3
+ if (Float(time) rescue false)
4
4
  time = Time.at(time.to_i)
5
5
  elsif time.is_a?(String)
6
6
  time = Time.local(*ParseDate.parsedate(time))
@@ -14,7 +14,7 @@ class Knj::Datestamp
14
14
  time = Time.new
15
15
  end
16
16
 
17
- if Php4r.is_numeric(time)
17
+ if (Float(time) rescue false)
18
18
  time = Time.at(time.to_i)
19
19
  elsif time.is_a?(String)
20
20
  begin
@@ -42,7 +42,7 @@ class Knj::Datestamp
42
42
 
43
43
  time = Time.new if !time
44
44
 
45
- if Php4r.is_numeric(time)
45
+ if (Float(time) rescue false)
46
46
  time = Time.at(time.to_i)
47
47
  elsif time.is_a?(String)
48
48
  time = Time.at(Php4r.strtotime(time))
@@ -137,8 +137,8 @@ class KnjDB_mysql::Columns::Column
137
137
 
138
138
  #Changes the column properties by the given hash.
139
139
  def change(data)
140
- col_escaped = "#{@args[:db].enc_col}#{@args[:db].esc_col(self.name)}#{@args[:db].enc_col}"
141
- table_escape = "#{@args[:db].enc_table}#{@args[:db].esc_table(self.table.name)}#{@args[:db].enc_table}"
140
+ col_escaped = "`#{@args[:db].esc_col(self.name)}`"
141
+ table_escape = "`#{@args[:db].esc_table(self.table.name)}`"
142
142
  newdata = data.clone
143
143
 
144
144
  newdata["name"] = self.name if !newdata.key?("name")
@@ -289,10 +289,10 @@ class KnjDB_mysql::Tables::Table
289
289
  end
290
290
 
291
291
  sql << " UNIQUE" if index_data["unique"]
292
- sql << " INDEX #{db.escape_col}#{db.esc_col(index_data["name"])}#{db.escape_col}"
292
+ sql << " INDEX `#{db.esc_col(index_data["name"])}`"
293
293
 
294
294
  if args[:on_table] or !args.key?(:on_table)
295
- sql << " ON #{db.escape_table}#{db.esc_table(args[:table_name])}#{db.escape_table}"
295
+ sql << " ON `#{db.esc_table(args[:table_name])}`"
296
296
  end
297
297
 
298
298
  sql << " ("
@@ -302,7 +302,7 @@ class KnjDB_mysql::Tables::Table
302
302
  sql << ", " if !first
303
303
  first = false if first
304
304
 
305
- sql << "#{db.escape_col}#{db.esc_col(col_name)}#{db.escape_col}"
305
+ sql << "`#{db.esc_col(col_name)}`"
306
306
  end
307
307
 
308
308
  sql << ")"
@@ -163,7 +163,7 @@ class KnjDB_sqlite3_result
163
163
 
164
164
  ret = {}
165
165
  result_hash.each do |key, val|
166
- if Php4r.is_numeric(key)
166
+ if (Float(key) rescue false)
167
167
  #do nothing.
168
168
  elsif @symbols and !key.is_a?(Symbol)
169
169
  ret[key.to_sym] = val
@@ -401,8 +401,8 @@ class Knj::Db
401
401
  end
402
402
 
403
403
  if args["limit_from"] and args["limit_to"]
404
- raise "'limit_from' was not numeric: '#{args["limit_from"]}'." if !Php4r.is_numeric(args["limit_from"])
405
- raise "'limit_to' was not numeric: '#{args["limit_to"]}'." if !Php4r.is_numeric(args["limit_to"])
404
+ raise "'limit_from' was not numeric: '#{args["limit_from"]}'." if !(Float(args["limit_from"]) rescue false)
405
+ raise "'limit_to' was not numeric: '#{args["limit_to"]}'." if !(Float(args["limit_to"]) rescue false)
406
406
  sql << " LIMIT #{args["limit_from"]}, #{args["limit_to"]}"
407
407
  end
408
408
  end
@@ -26,7 +26,7 @@ class Knj::Notify
26
26
  cmd = "notify-send"
27
27
 
28
28
  if args["time"]
29
- raise "Time is not numeric." if !Php4r.is_numeric(args["time"])
29
+ raise "Time is not numeric." if !(Float(args["time"]) rescue false)
30
30
  cmd << " -t #{args["time"]}"
31
31
  end
32
32
 
@@ -33,7 +33,6 @@ class Knj::Objects
33
33
  raise "No class path given." if !@args[:class_path] and (@args[:require] or !@args.key?(:require))
34
34
 
35
35
  if args[:require_all]
36
- require "#{$knjpath}php"
37
36
  loads = []
38
37
 
39
38
  Dir.foreach(@args[:class_path]) do |file|
@@ -1,5 +1,5 @@
1
1
  require "knj/autoload"
2
- require "#{$knjpath}php"
2
+ require "php4r"
3
3
  require "#{$knjpath}php_parser/php_parser"
4
4
 
5
5
  module Knj::Php_parser::Functions
@@ -7,7 +7,7 @@ class Knj::Rhodes
7
7
  def initialize(args = {})
8
8
  require "#{$knjpath}arrayext.rb"
9
9
  require "#{$knjpath}datet.rb"
10
- require "#{$knjpath}php.rb"
10
+ require "php4r"
11
11
  require "#{$knjpath}objects.rb"
12
12
  require "#{$knjpath}datarow.rb"
13
13
  require "#{$knjpath}event_handler.rb"
@@ -123,7 +123,7 @@ module Knj::Strings
123
123
 
124
124
  #Returns 'Yes' or 'No' based on a value. The value can be 0, 1, yes, no, true or false.
125
125
  def self.yn_str(value, str_yes = "Yes", str_no = "No")
126
- value = value.to_i if Php4r.is_numeric(value)
126
+ value = value.to_i if (Float(value) rescue false)
127
127
  value_s = value.to_s
128
128
 
129
129
  if value.is_a?(Integer)
@@ -130,7 +130,7 @@ class Knj::Web
130
130
  secname = try.to_s
131
131
  end
132
132
 
133
- secname = secname.to_sym if args[:syms] and secname.is_a?(String) and !Php4r.is_numeric(secname)
133
+ secname = secname.to_sym if args[:syms] and secname.is_a?(String) and !(Float(secname) rescue false)
134
134
  return [secname, secname_empty]
135
135
  end
136
136
 
@@ -380,7 +380,7 @@ class Knj::Web
380
380
 
381
381
  if args[:type] == :textarea
382
382
  if args.key?(:height)
383
- if Php4r.is_numeric(args[:height])
383
+ if (Float(args[:height]) rescue false)
384
384
  css["height"] = "#{args[:height]}px"
385
385
  else
386
386
  css["height"] = args[:height]
@@ -18,7 +18,7 @@ describe "Cmd_parser" do
18
18
  res = Knj::Cmd_parser.lsl(str)
19
19
 
20
20
  res.each do |file|
21
- raise "Byte was not numeric in: '#{str}'." if !Php4r.is_numeric(file[:size])
21
+ raise "Byte was not numeric in: '#{str}'." if !(Float(file[:size]) rescue false)
22
22
  end
23
23
  end
24
24
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: knjrbfw
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.74
5
+ version: 0.0.75
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kasper Johansen
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-07-28 00:00:00 +02:00
13
+ date: 2012-07-29 00:00:00 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -394,7 +394,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
394
394
  requirements:
395
395
  - - ">="
396
396
  - !ruby/object:Gem::Version
397
- hash: -1092444068000497155
397
+ hash: 1511757075564892829
398
398
  segments:
399
399
  - 0
400
400
  version: "0"