php4r 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -5,6 +5,7 @@ source "http://rubygems.org"
5
5
 
6
6
  gem "http2"
7
7
  gem "datet"
8
+ gem "string-strtr"
8
9
 
9
10
  # Add dependencies to develop your gem here.
10
11
  # Include everything needed to run rake, tests, features, etc.
@@ -1,18 +1,18 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- datet (0.0.12)
4
+ datet (0.0.22)
5
5
  diff-lcs (1.1.3)
6
6
  git (1.2.5)
7
- http2 (0.0.5)
7
+ http2 (0.0.13)
8
8
  jeweler (1.8.4)
9
9
  bundler (~> 1.0)
10
10
  git (>= 1.2.5)
11
11
  rake
12
12
  rdoc
13
- json (1.7.4)
14
- rake (0.9.2.2)
15
- rdoc (3.12)
13
+ json (1.7.7)
14
+ rake (10.0.3)
15
+ rdoc (3.12.2)
16
16
  json (~> 1.4)
17
17
  rspec (2.8.0)
18
18
  rspec-core (~> 2.8.0)
@@ -22,6 +22,7 @@ GEM
22
22
  rspec-expectations (2.8.0)
23
23
  diff-lcs (~> 1.1.2)
24
24
  rspec-mocks (2.8.0)
25
+ string-strtr (0.0.2)
25
26
 
26
27
  PLATFORMS
27
28
  ruby
@@ -33,3 +34,4 @@ DEPENDENCIES
33
34
  jeweler (~> 1.8.4)
34
35
  rdoc (~> 3.12)
35
36
  rspec (~> 2.8.0)
37
+ string-strtr
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -950,6 +950,11 @@ module Php4r
950
950
  return hash
951
951
  end
952
952
 
953
+ def strtr(str, replace_pairs)
954
+ require "string-strtr"
955
+ return str.to_s.strtr(replace_pairs)
956
+ end
957
+
953
958
  private
954
959
 
955
960
  def Php4r.parse_str_name(seton, varname, value)
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{php4r}
8
- s.version = "0.0.3"
7
+ s.name = "php4r"
8
+ s.version = "0.0.4"
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-08-16}
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
- s.email = %q{k@spernj.org}
12
+ s.date = "2013-03-25"
13
+ s.description = "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
+ s.email = "k@spernj.org"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
17
17
  "README.rdoc"
@@ -30,11 +30,11 @@ Gem::Specification.new do |s|
30
30
  "spec/php4r_spec.rb",
31
31
  "spec/spec_helper.rb"
32
32
  ]
33
- s.homepage = %q{http://github.com/kaspernj/php4r}
33
+ s.homepage = "http://github.com/kaspernj/php4r"
34
34
  s.licenses = ["MIT"]
35
35
  s.require_paths = ["lib"]
36
- s.rubygems_version = %q{1.6.2}
37
- s.summary = %q{A lib containing various PHP-functions coded in Ruby.}
36
+ s.rubygems_version = "1.8.25"
37
+ s.summary = "A lib containing various PHP-functions coded in Ruby."
38
38
 
39
39
  if s.respond_to? :specification_version then
40
40
  s.specification_version = 3
@@ -42,6 +42,7 @@ Gem::Specification.new do |s|
42
42
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
43
43
  s.add_runtime_dependency(%q<http2>, [">= 0"])
44
44
  s.add_runtime_dependency(%q<datet>, [">= 0"])
45
+ s.add_runtime_dependency(%q<string-strtr>, [">= 0"])
45
46
  s.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
46
47
  s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
47
48
  s.add_development_dependency(%q<bundler>, [">= 1.0.0"])
@@ -49,6 +50,7 @@ Gem::Specification.new do |s|
49
50
  else
50
51
  s.add_dependency(%q<http2>, [">= 0"])
51
52
  s.add_dependency(%q<datet>, [">= 0"])
53
+ s.add_dependency(%q<string-strtr>, [">= 0"])
52
54
  s.add_dependency(%q<rspec>, ["~> 2.8.0"])
53
55
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
54
56
  s.add_dependency(%q<bundler>, [">= 1.0.0"])
@@ -57,6 +59,7 @@ Gem::Specification.new do |s|
57
59
  else
58
60
  s.add_dependency(%q<http2>, [">= 0"])
59
61
  s.add_dependency(%q<datet>, [">= 0"])
62
+ s.add_dependency(%q<string-strtr>, [">= 0"])
60
63
  s.add_dependency(%q<rspec>, ["~> 2.8.0"])
61
64
  s.add_dependency(%q<rdoc>, ["~> 3.12"])
62
65
  s.add_dependency(%q<bundler>, [">= 1.0.0"])
@@ -103,4 +103,14 @@ describe "Php4r" do
103
103
  raise "strtolower did not return expected result: '#{teststr}'."
104
104
  end
105
105
  end
106
+
107
+ it "strtr" do
108
+ str = "AA BB"
109
+ res = Php4r.strtr(str, {
110
+ "AA" => "BB",
111
+ "BB" => "AA"
112
+ })
113
+
114
+ res.should eql("BB AA")
115
+ end
106
116
  end
metadata CHANGED
@@ -1,94 +1,138 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: php4r
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.4
4
5
  prerelease:
5
- version: 0.0.3
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Kasper Johansen
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2012-08-16 00:00:00 +02:00
14
- default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
12
+ date: 2013-03-25 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
17
15
  name: http2
18
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
19
17
  none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
24
22
  type: :runtime
25
23
  prerelease: false
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
28
31
  name: datet
29
- requirement: &id002 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
30
41
  none: false
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: "0"
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
47
+ name: string-strtr
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
35
54
  type: :runtime
36
55
  prerelease: false
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
39
63
  name: rspec
40
- requirement: &id003 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
41
65
  none: false
42
- requirements:
66
+ requirements:
43
67
  - - ~>
44
- - !ruby/object:Gem::Version
68
+ - !ruby/object:Gem::Version
45
69
  version: 2.8.0
46
70
  type: :development
47
71
  prerelease: false
48
- version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 2.8.0
78
+ - !ruby/object:Gem::Dependency
50
79
  name: rdoc
51
- requirement: &id004 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
52
81
  none: false
53
- requirements:
82
+ requirements:
54
83
  - - ~>
55
- - !ruby/object:Gem::Version
56
- version: "3.12"
84
+ - !ruby/object:Gem::Version
85
+ version: '3.12'
57
86
  type: :development
58
87
  prerelease: false
59
- version_requirements: *id004
60
- - !ruby/object:Gem::Dependency
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: '3.12'
94
+ - !ruby/object:Gem::Dependency
61
95
  name: bundler
62
- requirement: &id005 !ruby/object:Gem::Requirement
96
+ requirement: !ruby/object:Gem::Requirement
63
97
  none: false
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
67
101
  version: 1.0.0
68
102
  type: :development
69
103
  prerelease: false
70
- version_requirements: *id005
71
- - !ruby/object:Gem::Dependency
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: 1.0.0
110
+ - !ruby/object:Gem::Dependency
72
111
  name: jeweler
73
- requirement: &id006 !ruby/object:Gem::Requirement
112
+ requirement: !ruby/object:Gem::Requirement
74
113
  none: false
75
- requirements:
114
+ requirements:
76
115
  - - ~>
77
- - !ruby/object:Gem::Version
116
+ - !ruby/object:Gem::Version
78
117
  version: 1.8.4
79
118
  type: :development
80
119
  prerelease: false
81
- version_requirements: *id006
82
- description: 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.
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ version: 1.8.4
126
+ description: A lib containing various PHP-functions coded in Ruby. You can either
127
+ use it or use it as a reference, if you are coming from PHP to Ruby or the other
128
+ way around.
83
129
  email: k@spernj.org
84
130
  executables: []
85
-
86
131
  extensions: []
87
-
88
- extra_rdoc_files:
132
+ extra_rdoc_files:
89
133
  - LICENSE.txt
90
134
  - README.rdoc
91
- files:
135
+ files:
92
136
  - .document
93
137
  - .rspec
94
138
  - Gemfile
@@ -101,36 +145,32 @@ files:
101
145
  - php4r.gemspec
102
146
  - spec/php4r_spec.rb
103
147
  - spec/spec_helper.rb
104
- has_rdoc: true
105
148
  homepage: http://github.com/kaspernj/php4r
106
- licenses:
149
+ licenses:
107
150
  - MIT
108
151
  post_install_message:
109
152
  rdoc_options: []
110
-
111
- require_paths:
153
+ require_paths:
112
154
  - lib
113
- required_ruby_version: !ruby/object:Gem::Requirement
155
+ required_ruby_version: !ruby/object:Gem::Requirement
114
156
  none: false
115
- requirements:
116
- - - ">="
117
- - !ruby/object:Gem::Version
118
- hash: 1310432363639261759
119
- segments:
157
+ requirements:
158
+ - - ! '>='
159
+ - !ruby/object:Gem::Version
160
+ version: '0'
161
+ segments:
120
162
  - 0
121
- version: "0"
122
- required_rubygems_version: !ruby/object:Gem::Requirement
163
+ hash: -2202615095684632170
164
+ required_rubygems_version: !ruby/object:Gem::Requirement
123
165
  none: false
124
- requirements:
125
- - - ">="
126
- - !ruby/object:Gem::Version
127
- version: "0"
166
+ requirements:
167
+ - - ! '>='
168
+ - !ruby/object:Gem::Version
169
+ version: '0'
128
170
  requirements: []
129
-
130
171
  rubyforge_project:
131
- rubygems_version: 1.6.2
172
+ rubygems_version: 1.8.25
132
173
  signing_key:
133
174
  specification_version: 3
134
175
  summary: A lib containing various PHP-functions coded in Ruby.
135
176
  test_files: []
136
-