php_embed_interface 0.1.2 → 0.1.3

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/README.md CHANGED
@@ -1,7 +1,9 @@
1
- PHPEI
1
+ php_embed_interface
2
2
  =================
3
3
 
4
- Interface for calling PHP functions.
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
  -----------------
@@ -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
- # ruby -r php_embed_interface -e "puts PHPEI.json_encode({:foo => 'FOO'})"
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
 
@@ -1,3 +1,3 @@
1
1
  module PHPEI
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -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{interface for Ruby to call PHP functions}
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.2
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: &73044880 !ruby/object:Gem::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: *73044880
25
- description: interface for Ruby to call PHP functions
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: []