padrino-goon 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.rdoc +0 -0
- data/lib/padrino-goon/padrino-goon.rb +52 -0
- data/padrino-goon.gemspec +20 -0
- data/test/helper.rb +0 -0
- metadata +63 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 96eb3bd7c2d84acae47f843380c9695882b8913f
|
4
|
+
data.tar.gz: 3f71d64d4764781bf3b94f303e12e3b5b7231440
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3ea1ec6de1f04b1db8a61e406111eaa2f1f7f617f15a25b9f394dd4b38411c83522fddf2a5ed1bccd325d396e62f4857a904665c5d95805d532ff290eaf4bad2
|
7
|
+
data.tar.gz: 4636e31fa01f8d9ebdcdecbadbb76185730704ddd7cbbca428972f1931eb8f4bef8de085b4d4c2f794d998ddc3df8a6acae3befbf248507238bf029136014b88
|
data/README.rdoc
ADDED
File without changes
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'celluloid'
|
2
|
+
require 'yaml'
|
3
|
+
|
4
|
+
module PadrinoGoon
|
5
|
+
|
6
|
+
module Extensions
|
7
|
+
class DelayedClass
|
8
|
+
#Use plain celluloid here!
|
9
|
+
def init(args=nil)
|
10
|
+
end
|
11
|
+
|
12
|
+
def perform(yml)
|
13
|
+
(target, method_name, args) = YAML.load(yml)
|
14
|
+
target.send(method_name, *args)
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.ojete(opts)
|
18
|
+
args = opts["args"].collect{|arg| ::YAML.load(arg)}
|
19
|
+
args.each do |arg|
|
20
|
+
klass = arg[0]
|
21
|
+
if klass.methods.include?(arg[1])
|
22
|
+
return arg[0].send(arg[1], arg[2])
|
23
|
+
else
|
24
|
+
return arg[0].new.send(arg[1], arg[2])
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
module Klass
|
31
|
+
def goon(options={})
|
32
|
+
GoonProxy.new(DelayedClass, self, options)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
class GoonProxy < BasicObject
|
37
|
+
def initialize(performable, target, options={})
|
38
|
+
@performable = performable
|
39
|
+
@target = target
|
40
|
+
@opts = options
|
41
|
+
end
|
42
|
+
|
43
|
+
def method_missing(name, *args)
|
44
|
+
obj = [@target, name, args]
|
45
|
+
@performable.ojete({ 'class' => @performable, 'args' => [::YAML.dump(obj)] }.merge(@opts))
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
Module.send(:include, PadrinoGoon::Extensions::Klass)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = "padrino-goon"
|
3
|
+
s.rubyforge_project = "padrino-goon"
|
4
|
+
s.authors = ["Carlos Donderis"]
|
5
|
+
s.email = "cdonderis@gmail.com"
|
6
|
+
s.summary = "Padrino background processing support"
|
7
|
+
s.homepage = "http://github.com/CaDs/padrino-goon"
|
8
|
+
s.description = "Padrino background processing support, Padrino's goons will take care"
|
9
|
+
s.version = "0.0.1"
|
10
|
+
s.date = Time.now.strftime("%Y-%m-%d")
|
11
|
+
|
12
|
+
s.extra_rdoc_files = Dir["*.rdoc"]
|
13
|
+
s.files = `git ls-files`.split("\n")
|
14
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
15
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
18
|
+
|
19
|
+
s.add_dependency('celluloid', '~> 0.12.0')
|
20
|
+
end
|
data/test/helper.rb
ADDED
File without changes
|
metadata
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: padrino-goon
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Carlos Donderis
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-05-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: celluloid
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.12.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.12.0
|
27
|
+
description: Padrino background processing support, Padrino's goons will take care
|
28
|
+
email: cdonderis@gmail.com
|
29
|
+
executables: []
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files:
|
32
|
+
- README.rdoc
|
33
|
+
files:
|
34
|
+
- README.rdoc
|
35
|
+
- lib/padrino-goon/padrino-goon.rb
|
36
|
+
- padrino-goon.gemspec
|
37
|
+
- test/helper.rb
|
38
|
+
homepage: http://github.com/CaDs/padrino-goon
|
39
|
+
licenses: []
|
40
|
+
metadata: {}
|
41
|
+
post_install_message:
|
42
|
+
rdoc_options:
|
43
|
+
- --charset=UTF-8
|
44
|
+
require_paths:
|
45
|
+
- lib
|
46
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - '>='
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '0'
|
51
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
requirements: []
|
57
|
+
rubyforge_project: padrino-goon
|
58
|
+
rubygems_version: 2.0.0
|
59
|
+
signing_key:
|
60
|
+
specification_version: 4
|
61
|
+
summary: Padrino background processing support
|
62
|
+
test_files:
|
63
|
+
- test/helper.rb
|