vidsy-cloudkit 0.1.0 → 0.2.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: 2b76e65927dcf3c60fc340d0b6f76dde7f87ab5c
4
- data.tar.gz: fd9f405ab05c76e6efdbf5ef1710dabd79f6bb95
3
+ metadata.gz: 481b562187f447cc2e565fbaeda6eec1d06c48b9
4
+ data.tar.gz: e01b24258a9d31d7d90ca3f22a876b018cefd9a5
5
5
  SHA512:
6
- metadata.gz: 1640b3a1147d4a601bfdba1179d145fa614ef7a9b6ffeb90f51a9746ae390bb426ef6b7120900a9920baf29fd911d90754f4d92ba70dcbd6a504b9e0889d9387
7
- data.tar.gz: ce2d0ddbde1bc20a1970b9c3d5b923b3dd4ee13468896b53f19faab211a9ad52476ca6293ddbeeb68ebba56eb764f67b9e501652cb54272316f31c0bfdb3ab75
6
+ metadata.gz: 478860600eceda87259967190c20c3558c8e6b82cd338b1d4719014f8690189a73dceedcf2051e3130abe7d9a04aacae7b47500554eea92809381351d9d5e514
7
+ data.tar.gz: 8006797d5390849efa68dd132008408ff7b932e40b8414fc0b4e6df649d712523592bfbe6f995f8a561a13f79575c8a788bc2b3fcaf3162257083aa3f0767bb7
@@ -0,0 +1,43 @@
1
+ require "json"
2
+ require "ostruct"
3
+ require "vidsy/cloudkit/configuration"
4
+
5
+ module Vidsy
6
+ module Cloudkit
7
+ class AppConfig
8
+ def initialize
9
+ @json = parse
10
+ end
11
+
12
+ private
13
+
14
+ attr_reader :json
15
+
16
+ def configuration
17
+ Vidsy::Cloudkit::Configuration
18
+ end
19
+
20
+ def env
21
+ configuration.env
22
+ end
23
+
24
+ def path
25
+ File.join(
26
+ root, "config", "#{env}.config.json"
27
+ )
28
+ end
29
+
30
+ def parse
31
+ OpenStruct.new(
32
+ JSON.parse(
33
+ File.read path
34
+ )
35
+ )
36
+ end
37
+
38
+ def root
39
+ configuration.root
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,24 @@
1
+ require "vidsy/cloudkit/app_config"
2
+
3
+ module Vidsy
4
+ module Cloudkit
5
+ class Configuration
6
+ class << self
7
+ attr_accessor :root
8
+
9
+ def app_config
10
+ @app_config = AppConfig.new
11
+ end
12
+
13
+ def configure(&block)
14
+ yield self
15
+ self
16
+ end
17
+
18
+ def env
19
+ ENV["RACK_ENV"] || "development"
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -1,5 +1,5 @@
1
1
  module Vidsy
2
2
  module Cloudkit
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
@@ -2,5 +2,12 @@ require "vidsy/cloudkit/version"
2
2
 
3
3
  module Vidsy
4
4
  module Cloudkit
5
+ def config
6
+ Configuration.app_config
7
+ end
8
+
9
+ def env
10
+ Configuration.env
11
+ end
5
12
  end
6
13
  end
@@ -20,4 +20,6 @@ Gem::Specification.new do |spec|
20
20
  spec.add_development_dependency "bundler", "~> 1.11"
21
21
  spec.add_development_dependency "rake", "~> 10.0"
22
22
  spec.add_development_dependency "rspec", "~> 3.0"
23
+
24
+ spec.add_dependency "json"
23
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vidsy-cloudkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charlie Revett
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: json
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  description:
56
70
  email:
57
71
  - charlie@vidsy.co
@@ -61,6 +75,8 @@ extra_rdoc_files: []
61
75
  files:
62
76
  - Gemfile
63
77
  - lib/vidsy/cloudkit.rb
78
+ - lib/vidsy/cloudkit/app_config.rb
79
+ - lib/vidsy/cloudkit/configuration.rb
64
80
  - lib/vidsy/cloudkit/version.rb
65
81
  - vidsy-cloudkit.gemspec
66
82
  homepage: http://vidsy.co/jobs