dimples 4.0.1 → 4.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/dimples +9 -4
- data/lib/dimples/configuration.rb +10 -1
- data/lib/dimples/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd1dfcb170bc3880ea8ea1391d1020abab51209c
|
4
|
+
data.tar.gz: a7499bb4bc0d2582397a3f3c0013a566c02f397e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b925776ae7af279586dc90b839dba7bf5859d1101c6fa3c7accc84b68ac2ee7b22f8bbfa9b42c000754e6335901277a6db0ec479300f2ad8ff4fa8f316daeeee
|
7
|
+
data.tar.gz: 4c387d0ccc57b4ea7b602702c6db73b634e6b2b37fbcd8a6e9c3fbc57b5a09d531c55774a608800fb97d6fd84bf1070aee91d57bd81a81839ded8919d6e3a536
|
data/bin/dimples
CHANGED
@@ -42,7 +42,10 @@ config_path = options[:config] || File.join(Dir.pwd, 'config.json')
|
|
42
42
|
|
43
43
|
if File.exist?(config_path)
|
44
44
|
begin
|
45
|
-
|
45
|
+
file_contents = File.read(config_path)
|
46
|
+
Trollop.die "Config file is empty (#{config_path})" if file_contents.empty?
|
47
|
+
|
48
|
+
config = JSON.parse(file_contents, symbolize_names: true)
|
46
49
|
rescue
|
47
50
|
Trollop.die "Invalid or malformed config file (#{config_path})"
|
48
51
|
end
|
@@ -50,7 +53,7 @@ else
|
|
50
53
|
Trollop.die "Unable to find config file (#{config_path})"
|
51
54
|
end
|
52
55
|
|
53
|
-
config[:verbose_logging] = options[:verbose]
|
56
|
+
config[:verbose_logging] = options[:verbose] if options[:verbose]
|
54
57
|
|
55
58
|
if Dir.exist?(lib_path)
|
56
59
|
Dir.glob(File.join(lib_path, '**', '*.rb')) do |path|
|
@@ -58,8 +61,10 @@ if Dir.exist?(lib_path)
|
|
58
61
|
end
|
59
62
|
end
|
60
63
|
|
61
|
-
|
62
|
-
|
64
|
+
site_klass_name = config.dig(:class_overrides, :site)
|
65
|
+
|
66
|
+
site_klass = if site_klass_name
|
67
|
+
Object.const_get(site_klass_name)
|
63
68
|
else
|
64
69
|
Dimples::Site
|
65
70
|
end
|
@@ -4,7 +4,16 @@ module Dimples
|
|
4
4
|
# A class that models a site's configuration.
|
5
5
|
class Configuration
|
6
6
|
def initialize(config = {})
|
7
|
-
@settings = Configuration.default_settings
|
7
|
+
@settings = Dimples::Configuration.default_settings
|
8
|
+
|
9
|
+
config.each_key do |key|
|
10
|
+
case @settings[key]
|
11
|
+
when Hash
|
12
|
+
@settings[key].merge!(config[key])
|
13
|
+
else
|
14
|
+
@settings[key] = config[key]
|
15
|
+
end
|
16
|
+
end
|
8
17
|
end
|
9
18
|
|
10
19
|
def [](key)
|
data/lib/dimples/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dimples
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Bogan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tilt
|