vidsy-cloudkit 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vidsy/cloudkit/app_config.rb +1 -1
- data/lib/vidsy/cloudkit/configuration.rb +1 -1
- data/lib/vidsy/cloudkit/routing.rb +40 -0
- data/lib/vidsy/cloudkit/version.rb +1 -1
- data/lib/vidsy/cloudkit.rb +6 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24827b834b22a83117291c6dcf367cbf29122a23
|
4
|
+
data.tar.gz: 4c7c01ef7964013f6c1063e3c4822e275b5d9222
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a6b0addf226a3bd46b0a45dba729ee83075bb1a96eda9b062cba33ddbc1161bb19f76632a928b855b9875ea9e9e36798674d22bc1187573db828fb1efd5f934
|
7
|
+
data.tar.gz: 14a1858f578e577e8225af3dfedf9c14ea53800fba52280287ba1401282fd3d0d48ebc07220f7006df1d2832056c0b5e4226e62547073418436a8ea134abe725
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require "ostruct"
|
2
|
+
require "vidsy/cloudkit/configuration"
|
3
|
+
|
4
|
+
module Vidsy
|
5
|
+
module Cloudkit
|
6
|
+
class Routing
|
7
|
+
attr_reader :routes
|
8
|
+
|
9
|
+
def initialize(routes)
|
10
|
+
@routes = routes.map do |h|
|
11
|
+
OpenStruct.new(h).tap do |os|
|
12
|
+
os.klass = "#{namespace}::#{class_name os.file}"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def require_all
|
18
|
+
@routes.each { |r| require_class r.file }
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def class_name(s)
|
24
|
+
s.split("_").map(&:capitalize).join ""
|
25
|
+
end
|
26
|
+
|
27
|
+
def configuration
|
28
|
+
Configuration
|
29
|
+
end
|
30
|
+
|
31
|
+
def namespace
|
32
|
+
"#{configuration.namespace}::Controller"
|
33
|
+
end
|
34
|
+
|
35
|
+
def require_class(file)
|
36
|
+
require "app/controllers/#{file}"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/vidsy/cloudkit.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
require "vidsy/cloudkit/version"
|
2
1
|
require "vidsy/cloudkit/configuration"
|
2
|
+
require "vidsy/cloudkit/routing"
|
3
|
+
require "vidsy/cloudkit/version"
|
3
4
|
|
4
5
|
module Vidsy
|
5
6
|
module Cloudkit
|
@@ -28,6 +29,10 @@ module Vidsy
|
|
28
29
|
Configuration.env == "production"
|
29
30
|
end
|
30
31
|
|
32
|
+
def self.routing(routes)
|
33
|
+
Routing.new routes
|
34
|
+
end
|
35
|
+
|
31
36
|
def self.test?
|
32
37
|
Configuration.env == "test"
|
33
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vidsy-cloudkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Charlie Revett
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -91,6 +91,7 @@ files:
|
|
91
91
|
- lib/vidsy/cloudkit.rb
|
92
92
|
- lib/vidsy/cloudkit/app_config.rb
|
93
93
|
- lib/vidsy/cloudkit/configuration.rb
|
94
|
+
- lib/vidsy/cloudkit/routing.rb
|
94
95
|
- lib/vidsy/cloudkit/version.rb
|
95
96
|
- vidsy-cloudkit.gemspec
|
96
97
|
homepage: http://vidsy.co/jobs
|