juggalo 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/juggalo/layout.rb +1 -1
- data/lib/juggalo/page/loader/base.rb +5 -1
- data/lib/juggalo/page/loader/http.rb +0 -2
- data/lib/juggalo/page/loader/yaml.rb +2 -1
- data/lib/juggalo/portlet.rb +5 -11
- data/lib/juggalo/portlet/factory.rb +14 -0
- data/lib/juggalo/portlet/loader.rb +17 -0
- data/lib/juggalo/portlet/loader/http.rb +12 -0
- data/lib/juggalo/version.rb +1 -1
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0479c42bf929c0531b81687e00843db8b394e5d
|
4
|
+
data.tar.gz: 81514ef0c85161c8ed511b2c27aab2916b9eac71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02db1108760334acfd201ed072979bcf150e1a9d71a9bd48c3b291c87005f7cdbe20e9db79f2a313c50fa43d52cda0f93ccfbf79a7a733f3ef0c68e235c3d5c0
|
7
|
+
data.tar.gz: 096d38e8401052f73b4ad38a1153d51d296ff8d1cb12fe9047693d39fa3781b04eaf60e43c29ce0c668fc0fd28b27267d0e63ae77f9995b74bc933f5d08b30f3
|
data/lib/juggalo/layout.rb
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
require 'juggalo/page'
|
2
2
|
require 'juggalo/portlet'
|
3
|
+
require 'juggalo/portlet/factory'
|
3
4
|
|
4
5
|
module Juggalo
|
5
6
|
class Page::Loader
|
6
7
|
class Base
|
7
8
|
def components; raise NotImplementedError; end
|
9
|
+
|
10
|
+
def create_component_from(config)
|
11
|
+
Portlet::Factory.create(config)
|
12
|
+
end
|
8
13
|
end
|
9
14
|
end
|
10
15
|
end
|
11
16
|
|
12
|
-
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'yaml'
|
2
|
+
require 'juggalo/portlet'
|
2
3
|
require 'juggalo/page'
|
3
4
|
require 'juggalo/page/loader/base'
|
4
5
|
|
@@ -10,7 +11,7 @@ module Juggalo
|
|
10
11
|
end
|
11
12
|
|
12
13
|
def components
|
13
|
-
page_hash["components"].map { |c|
|
14
|
+
page_hash["components"].map { |c| create_component_from c }
|
14
15
|
end
|
15
16
|
|
16
17
|
private
|
data/lib/juggalo/portlet.rb
CHANGED
@@ -2,21 +2,15 @@ module Juggalo
|
|
2
2
|
class Portlet
|
3
3
|
attr_reader :id, :type, :opts, :location
|
4
4
|
|
5
|
-
def initialize(opts, loader
|
6
|
-
@opts
|
7
|
-
|
5
|
+
def initialize(opts, loader)
|
6
|
+
@opts = opts
|
7
|
+
@loader = loader
|
8
8
|
@location = opts["location"]
|
9
9
|
end
|
10
10
|
|
11
|
-
def
|
12
|
-
|
11
|
+
def present
|
12
|
+
@loader.load opts
|
13
13
|
end
|
14
14
|
end
|
15
|
-
|
16
|
-
class Portlet::Loader
|
17
|
-
attr_reader :adapter
|
18
|
-
|
19
|
-
class HTTP; end
|
20
|
-
end
|
21
15
|
end
|
22
16
|
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'juggalo/portlet'
|
2
|
+
require 'juggalo/portlet/loader/http'
|
3
|
+
|
4
|
+
module Juggalo
|
5
|
+
class Portlet::Factory
|
6
|
+
def self.create(c)
|
7
|
+
adapter = Portlet::Loader::HTTP.new
|
8
|
+
loader = Portlet::Loader.new(adapter)
|
9
|
+
|
10
|
+
Juggalo::Portlet.new(c, loader)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'juggalo/portlet'
|
2
|
+
require 'juggalo/portlet/loader/http'
|
3
|
+
|
4
|
+
module Juggalo
|
5
|
+
class Portlet::Loader
|
6
|
+
attr_reader :adapter
|
7
|
+
|
8
|
+
def initialize(adapter)
|
9
|
+
@adapter = adapter
|
10
|
+
end
|
11
|
+
|
12
|
+
def load(opts)
|
13
|
+
@adapter.get opts
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
data/lib/juggalo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: juggalo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Kenny
|
@@ -73,6 +73,9 @@ files:
|
|
73
73
|
- lib/juggalo/page/loader/http.rb
|
74
74
|
- lib/juggalo/page/loader/yaml.rb
|
75
75
|
- lib/juggalo/portlet.rb
|
76
|
+
- lib/juggalo/portlet/factory.rb
|
77
|
+
- lib/juggalo/portlet/loader.rb
|
78
|
+
- lib/juggalo/portlet/loader/http.rb
|
76
79
|
- lib/juggalo/version.rb
|
77
80
|
homepage: ''
|
78
81
|
licenses:
|