php4r 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/php4r.rb +8 -2
  3. data/php4r.gemspec +2 -2
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -1,7 +1,13 @@
1
1
  # coding: utf-8
2
2
 
3
3
  module Php4r
4
- def is_numeric(n) Float n rescue false end
4
+ def is_numeric(number)
5
+ if (Float(number) rescue false)
6
+ return true
7
+ else
8
+ return false
9
+ end
10
+ end
5
11
 
6
12
  def call_user_func(*paras)
7
13
  if paras[0].is_a?(String)
@@ -662,7 +668,7 @@ module Php4r
662
668
  date_object = Time.now
663
669
  elsif date_input.respond_to?(:to_time)
664
670
  date_object = date_input.to_time
665
- elsif Php4r.is_numeric(date_input)
671
+ elsif (Float(date_input) rescue false)
666
672
  date_object = Time.at(date_input.to_i)
667
673
  elsif date_input.is_a?(Time)
668
674
  date_object = date_input
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{php4r}
8
- s.version = "0.0.1"
8
+ s.version = "0.0.2"
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{A lib containing various PHP-functions coded in Ruby. You can either use it or use it as a reference, if you are coming from PHP to Ruby or the other way around.}
14
14
  s.email = %q{k@spernj.org}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: php4r
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
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
@@ -115,7 +115,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - ">="
117
117
  - !ruby/object:Gem::Version
118
- hash: 3717817282737004000
118
+ hash: -4274394864324462355
119
119
  segments:
120
120
  - 0
121
121
  version: "0"