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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4bd3119b3a65a4ec0f090da00094249bda46c955
4
- data.tar.gz: 267fc560eeefbe9bc110c605f0990b4b95ec019f
3
+ metadata.gz: 24827b834b22a83117291c6dcf367cbf29122a23
4
+ data.tar.gz: 4c7c01ef7964013f6c1063e3c4822e275b5d9222
5
5
  SHA512:
6
- metadata.gz: 4ac1c72d72cce3e7e71989e3b3731e44d768cb9cebbc2d78ecb9f29f6c1e2be17ce3e0a1cc163ad0ce66b8a4ed4a350686b64ceaf38876e1c56a9ccd32779041
7
- data.tar.gz: c6a476c6d21dd861fc2906cb61e273c36eac6d76521f3df18ad3a4396fdc2d8b479a060f23fc834d1036f369e5f4a71c21c18d7323d0997f7c6105776ed445e2
6
+ metadata.gz: 3a6b0addf226a3bd46b0a45dba729ee83075bb1a96eda9b062cba33ddbc1161bb19f76632a928b855b9875ea9e9e36798674d22bc1187573db828fb1efd5f934
7
+ data.tar.gz: 14a1858f578e577e8225af3dfedf9c14ea53800fba52280287ba1401282fd3d0d48ebc07220f7006df1d2832056c0b5e4226e62547073418436a8ea134abe725
@@ -22,7 +22,7 @@ module Vidsy
22
22
  attr_reader :json
23
23
 
24
24
  def configuration
25
- Vidsy::Cloudkit::Configuration
25
+ Configuration
26
26
  end
27
27
 
28
28
  def env
@@ -4,7 +4,7 @@ module Vidsy
4
4
  module Cloudkit
5
5
  class Configuration
6
6
  class << self
7
- attr_accessor :root
7
+ attr_accessor :namespace, :root
8
8
 
9
9
  def app_config
10
10
  @app_config = AppConfig.new
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Vidsy
2
2
  module Cloudkit
3
- VERSION = "0.6.0"
3
+ VERSION = "0.7.0"
4
4
  end
5
5
  end
@@ -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.6.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-05 00:00:00.000000000 Z
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