php_embed_interface 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +4 -2
- data/lib/php_embed_interface.rb +20 -1
- data/lib/php_embed_interface/version.rb +1 -1
- data/php_embed_interface.gemspec +3 -1
- metadata +6 -4
data/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
-
|
1
|
+
php_embed_interface
|
2
2
|
=================
|
3
3
|
|
4
|
-
Interface for
|
4
|
+
Interface for Ruby to call PHP functions.
|
5
|
+
php_embed_interface is a wrapper for php_embed which is interface for Ruby to call PHP functions.
|
6
|
+
php_embed_interface provides more natural calling interface than php_embed.
|
5
7
|
|
6
8
|
Installation
|
7
9
|
-----------------
|
data/lib/php_embed_interface.rb
CHANGED
@@ -1,11 +1,30 @@
|
|
1
1
|
require "php_embed"
|
2
2
|
require "php_embed_interface/version"
|
3
3
|
|
4
|
+
# interface for PhpEmbed.
|
5
|
+
# you can call PHP function like below
|
6
|
+
# require 'php_embed_interface'
|
7
|
+
# puts PHPEI.json_encode({:foo => 'FOO', :bar => ['bar', 'baz']})
|
8
|
+
# # => {"foo":"FOO","bar":["bar","baz"]}
|
4
9
|
module PHPEI
|
5
10
|
|
6
|
-
#
|
11
|
+
# default handler for PHPEI.setOutputHandler
|
12
|
+
@@defaultOutputHandler = lambda {|output|
|
13
|
+
print output
|
14
|
+
}
|
15
|
+
|
16
|
+
# wrapper for PhpEmbed.
|
17
|
+
# [handler] lambda or Proc instance
|
18
|
+
def self.setOutputHandler(handler)
|
19
|
+
PhpEmbed.setOutputHandler(handler)
|
20
|
+
end
|
21
|
+
|
22
|
+
# trap calling PHP function.
|
7
23
|
def self.method_missing(name, *args)
|
8
24
|
PhpEmbed.call(name.to_s, *args)
|
9
25
|
end
|
26
|
+
|
27
|
+
setOutputHandler(@@defaultOutputHandler)
|
28
|
+
|
10
29
|
end
|
11
30
|
|
data/php_embed_interface.gemspec
CHANGED
@@ -8,7 +8,9 @@ Gem::Specification.new do |gem|
|
|
8
8
|
gem.version = PHPEI::VERSION
|
9
9
|
gem.authors = ["Keng-ichi Ahagon"]
|
10
10
|
gem.email = ["k.ahagon@n-3.so"]
|
11
|
-
gem.description = %q{
|
11
|
+
gem.description = %q{
|
12
|
+
php_embed_interface is a wrapper for php_embed which is interface for Ruby to call PHP functions.
|
13
|
+
php_embed_interface provides more natural calling interface than php_embed.}
|
12
14
|
gem.summary = %q{interface for Ruby to call PHP functions}
|
13
15
|
gem.homepage = %q{https://github.com/oasynnoum/php_embed_interface}
|
14
16
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: php_embed_interface
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-10-17 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: php_embed
|
16
|
-
requirement: &
|
16
|
+
requirement: &73184240 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,8 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.0.3
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
25
|
-
description:
|
24
|
+
version_requirements: *73184240
|
25
|
+
description: ! "\n php_embed_interface is a wrapper for php_embed which is interface
|
26
|
+
for Ruby to call PHP functions.\n php_embed_interface provides more natural calling
|
27
|
+
interface than php_embed."
|
26
28
|
email:
|
27
29
|
- k.ahagon@n-3.so
|
28
30
|
executables: []
|