frazzle 0.1.1 → 0.1.2
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/.gitignore +4 -0
- data/.rvmrc +1 -0
- data/LICENCE +21 -0
- data/Rakefile.rb +9 -0
- data/example/.rvmrc +1 -0
- data/example/Gemfile +2 -0
- data/example/Gemfile.lock +10 -0
- data/example/Rakefile.rb +30 -0
- data/example/pizza/Rakefile.rb +14 -0
- data/example/pizza/bin/pizza +5 -0
- data/example/pizza/gemspec +12 -0
- data/example/pizza/lib/pizza/run.rb +19 -0
- data/example/pizza-electric-oven/Rakefile.rb +14 -0
- data/example/pizza-electric-oven/gemspec +11 -0
- data/example/pizza-electric-oven/lib/pizza-electric-oven/plugin.rb +21 -0
- data/example/pizza-stone-oven/Rakefile.rb +14 -0
- data/example/pizza-stone-oven/gemspec +11 -0
- data/example/pizza-stone-oven/lib/pizza-stone-oven/plugin.rb +21 -0
- data/frazzle.gemspec +18 -0
- data/lib/frazzle/version.rb +3 -0
- metadata +24 -4
data/.gitignore
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use 1.9.3@frazzle --create
|
data/LICENCE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
Copyright (c) 2011, All rights reserved.
|
2
|
+
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
4
|
+
modification, are permitted provided that the following conditions are met:
|
5
|
+
* Redistributions of source code must retain the above copyright
|
6
|
+
notice, this list of conditions and the following disclaimer.
|
7
|
+
* Redistributions in binary form must reproduce the above copyright
|
8
|
+
notice, this list of conditions and the following disclaimer in the
|
9
|
+
documentation and/or other materials provided with the distribution.
|
10
|
+
|
11
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
12
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
13
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
14
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
15
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
16
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
17
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
18
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
19
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
20
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
21
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/Rakefile.rb
ADDED
data/example/.rvmrc
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rvm use 1.9.3@frazzle_example --create
|
data/example/Gemfile
ADDED
data/example/Rakefile.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
gems = [ "pizza", "pizza-stone-oven", "pizza-electric-oven" ]
|
2
|
+
|
3
|
+
desc "Setup the example"
|
4
|
+
task :setup do
|
5
|
+
gems.each do |gem|
|
6
|
+
cd "#{gem}" do
|
7
|
+
sh("rake install")
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
desc "Teardown the example"
|
13
|
+
task :teardown do
|
14
|
+
gems.each do |gem|
|
15
|
+
cd "#{gem}" do
|
16
|
+
sh("rake uninstall")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
desc "Run the example"
|
22
|
+
task :run => [:setup] do
|
23
|
+
sh("pizza")
|
24
|
+
Rake::Task["teardown"].invoke
|
25
|
+
end
|
26
|
+
|
27
|
+
desc "Run the example as test"
|
28
|
+
task :test => [:setup, :run, :teardown]
|
29
|
+
|
30
|
+
task :default => [:test]
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require "rubygems/package_task"
|
2
|
+
|
3
|
+
spec = Gem::Specification.load("gemspec")
|
4
|
+
Gem::PackageTask.new(spec){ |pkg| }
|
5
|
+
|
6
|
+
desc "Install the gem"
|
7
|
+
task :install => [:gem] do
|
8
|
+
sh("gem install pkg/#{spec.name}-#{spec.version}.gem")
|
9
|
+
end
|
10
|
+
|
11
|
+
desc "Uninstall the gem"
|
12
|
+
task :uninstall => [:clobber_package] do
|
13
|
+
sh("gem uninstall #{spec.name}")
|
14
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
spec = Gem::Specification.new do |s|
|
2
|
+
s.name = "pizza"
|
3
|
+
s.version = "0.1.0"
|
4
|
+
s.author = "Kevin russ"
|
5
|
+
s.email = "kevin.russ@esrlabs.com"
|
6
|
+
s.platform = Gem::Platform::RUBY
|
7
|
+
s.summary = "pizza example"
|
8
|
+
s.files = FileList["lib/**/*.rb"].to_a
|
9
|
+
s.require_path = "lib"
|
10
|
+
s.has_rdoc = false
|
11
|
+
s.executables = ["pizza"]
|
12
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "frazzle/frazzle"
|
2
|
+
|
3
|
+
class PizzaFactory
|
4
|
+
|
5
|
+
def initialize()
|
6
|
+
puts "This is the pizza factory"
|
7
|
+
@registry = Frazzle::Registry.new("pizza")
|
8
|
+
end
|
9
|
+
|
10
|
+
def run()
|
11
|
+
pizzas = [ "Margerita", "Fungi", "Scampi" ]
|
12
|
+
plugins = @registry.get_plugins("oven")
|
13
|
+
plugins.each do |plugin|
|
14
|
+
oven = @registry.load_plugin(plugin).create({ :pizza_type => pizzas.pop })
|
15
|
+
oven.make_pizza()
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require "rubygems/package_task"
|
2
|
+
|
3
|
+
spec = Gem::Specification.load("gemspec")
|
4
|
+
Gem::PackageTask.new(spec){ |pkg| }
|
5
|
+
|
6
|
+
desc "Install the gem"
|
7
|
+
task :install => [:gem] do
|
8
|
+
sh("gem install pkg/#{spec.name}-#{spec.version}.gem")
|
9
|
+
end
|
10
|
+
|
11
|
+
desc "Uninstall the gem"
|
12
|
+
task :uninstall => [:clobber_package] do
|
13
|
+
sh("gem uninstall #{spec.name}")
|
14
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
spec = Gem::Specification.new do |s|
|
2
|
+
s.name = "pizza-electric-oven"
|
3
|
+
s.version = "0.1.0"
|
4
|
+
s.author = "Kevin russ"
|
5
|
+
s.email = "kevin.russ@esrlabs.com"
|
6
|
+
s.platform = Gem::Platform::RUBY
|
7
|
+
s.summary = "pizza example"
|
8
|
+
s.files = FileList["lib/**/*.rb"].to_a
|
9
|
+
s.require_path = "lib"
|
10
|
+
s.has_rdoc = false
|
11
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
|
2
|
+
class PizzaElectricOven
|
3
|
+
def initialize(options)
|
4
|
+
@pizza_type = options[:pizza_type]
|
5
|
+
end
|
6
|
+
def make_pizza()
|
7
|
+
if @pizza_type != nil then
|
8
|
+
puts "The pizza-electric-oven is making a #{@pizza_type} pizza"
|
9
|
+
else
|
10
|
+
puts "The pizza-electric-oven is idle"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class PluginLoader
|
16
|
+
def create(options = nil)
|
17
|
+
return PizzaElectricOven.new(options)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
PluginLoader.new()
|
21
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require "rubygems/package_task"
|
2
|
+
|
3
|
+
spec = Gem::Specification.load("gemspec")
|
4
|
+
Gem::PackageTask.new(spec){ |pkg| }
|
5
|
+
|
6
|
+
desc "Install the gem"
|
7
|
+
task :install => [:gem] do
|
8
|
+
sh("gem install pkg/#{spec.name}-#{spec.version}.gem")
|
9
|
+
end
|
10
|
+
|
11
|
+
desc "Uninstall the gem"
|
12
|
+
task :uninstall => [:clobber_package] do
|
13
|
+
sh("gem uninstall #{spec.name}")
|
14
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
spec = Gem::Specification.new do |s|
|
2
|
+
s.name = "pizza-stone-oven"
|
3
|
+
s.version = "0.1.0"
|
4
|
+
s.author = "Kevin russ"
|
5
|
+
s.email = "kevin.russ@esrlabs.com"
|
6
|
+
s.platform = Gem::Platform::RUBY
|
7
|
+
s.summary = "pizza example"
|
8
|
+
s.files = FileList["lib/**/*.rb"].to_a
|
9
|
+
s.require_path = "lib"
|
10
|
+
s.has_rdoc = false
|
11
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
|
2
|
+
class PizzaStoneOven
|
3
|
+
def initialize(options)
|
4
|
+
@pizza_type = options[:pizza_type]
|
5
|
+
end
|
6
|
+
def make_pizza()
|
7
|
+
if @pizza_type != nil then
|
8
|
+
puts "The pizza-stone-oven is making a #{@pizza_type} pizza"
|
9
|
+
else
|
10
|
+
puts "The pizza-stone-oven is idle"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class PluginLoader
|
16
|
+
def create(options = nil)
|
17
|
+
return PizzaStoneOven.new(options)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
PluginLoader.new()
|
21
|
+
|
data/frazzle.gemspec
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
gem_name = 'frazzle'
|
3
|
+
require File.expand_path("lib/#{gem_name}/version")
|
4
|
+
|
5
|
+
spec = Gem::Specification.new do |s|
|
6
|
+
s.name = gem_name
|
7
|
+
s.version = Frazzle::VERSION
|
8
|
+
|
9
|
+
s.description = 'plugin registry based on gems'
|
10
|
+
s.author = "Kevin russ"
|
11
|
+
s.email = "kevin.russ@esrlabs.com"
|
12
|
+
s.platform = Gem::Platform::RUBY
|
13
|
+
s.summary = "gem plugin-manager using extention-points"
|
14
|
+
s.files = `git ls-files`.split($\)
|
15
|
+
s.require_path = "lib"
|
16
|
+
s.has_rdoc = false
|
17
|
+
s.extra_rdoc_files = ["README"]
|
18
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: frazzle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-18 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: plugin registry based on gems
|
15
15
|
email: kevin.russ@esrlabs.com
|
@@ -18,9 +18,29 @@ extensions: []
|
|
18
18
|
extra_rdoc_files:
|
19
19
|
- README
|
20
20
|
files:
|
21
|
-
-
|
22
|
-
-
|
21
|
+
- .gitignore
|
22
|
+
- .rvmrc
|
23
|
+
- LICENCE
|
23
24
|
- README
|
25
|
+
- Rakefile.rb
|
26
|
+
- example/.rvmrc
|
27
|
+
- example/Gemfile
|
28
|
+
- example/Gemfile.lock
|
29
|
+
- example/Rakefile.rb
|
30
|
+
- example/pizza-electric-oven/Rakefile.rb
|
31
|
+
- example/pizza-electric-oven/gemspec
|
32
|
+
- example/pizza-electric-oven/lib/pizza-electric-oven/plugin.rb
|
33
|
+
- example/pizza-stone-oven/Rakefile.rb
|
34
|
+
- example/pizza-stone-oven/gemspec
|
35
|
+
- example/pizza-stone-oven/lib/pizza-stone-oven/plugin.rb
|
36
|
+
- example/pizza/Rakefile.rb
|
37
|
+
- example/pizza/bin/pizza
|
38
|
+
- example/pizza/gemspec
|
39
|
+
- example/pizza/lib/pizza/run.rb
|
40
|
+
- frazzle.gemspec
|
41
|
+
- lib/frazzle/core/registry.rb
|
42
|
+
- lib/frazzle/frazzle.rb
|
43
|
+
- lib/frazzle/version.rb
|
24
44
|
homepage:
|
25
45
|
licenses: []
|
26
46
|
post_install_message:
|