cyborg 0.5.29 → 0.5.30

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: d7041f48468017270743cdfc26336d402568953d
4
- data.tar.gz: bb422badee36a72d6b95e1579c0461a6e10b78f3
3
+ metadata.gz: 1211252d2a0270de1e6fa9f831a15a4cc8db010c
4
+ data.tar.gz: 06c7f865f38d528fcaeedbc030af0137ce87f114
5
5
  SHA512:
6
- metadata.gz: 734f129ae228c94c9588f5683bd027ebda0d822a01911beca3fb9b7baf955dbbb520ee7f2484122160b08d6a6de25ff43ab8721afe6e4e51b0a5dafbd8e9424d
7
- data.tar.gz: 8b599519bdfd241a52ab1a37b2860d8000fb17880a2c6953a39643f9014db82e284af8aad9a47342026820c41caefcf6683613cfeebf4a713ace2fd6203b943e
6
+ metadata.gz: 98869d4c947aac582e6c26aecb6fb73799383975bb9ceae9de5773cf6901d96d1b82ea0c20d48bb881a2f4c85679ac92017fc099343e21adbc3c5da27e7fd13e
7
+ data.tar.gz: 579fc370410569dfbf915842b44085e1c65991a0e6c270f79d9511b54270df1a794bf0da3414426148fa539386bde41c5ed6f0db039ef53b0b0a90f0c5f29093
@@ -0,0 +1,29 @@
1
+ module Cyborg
2
+ module ConfigData
3
+ extend self
4
+ def read(*roots)
5
+ @data ||= {}
6
+
7
+ data_files(*roots).each do |path|
8
+ name = File.basename(path, '.*')
9
+ case File.extname(path)
10
+ when '.json'
11
+ @data[name] = JSON.parse(File.read(path))
12
+ when '.yml'
13
+ @data[name] = YAML.load_file(path)
14
+ end
15
+ end
16
+
17
+ @data
18
+ end
19
+
20
+ def data_files(*roots)
21
+ files = []
22
+ [roots].flatten.each do |root|
23
+ files.concat Dir[File.join(root, 'config/data/**/*.json')]
24
+ files.concat Dir[File.join(root, 'config/data/**/*.yml')]
25
+ end
26
+ files.flatten.compact.uniq
27
+ end
28
+ end
29
+ end
@@ -1,3 +1,3 @@
1
1
  module Cyborg
2
- VERSION = "0.5.29"
2
+ VERSION = "0.5.30"
3
3
  end
data/lib/cyborg.rb CHANGED
@@ -8,6 +8,7 @@ require "cyborg/plugin"
8
8
  require "cyborg/assets"
9
9
  require "cyborg/sass/engine"
10
10
  require "cyborg/sass/importer"
11
+ require "cyborg/config_data"
11
12
 
12
13
  module Cyborg
13
14
  extend self
@@ -26,6 +27,10 @@ module Cyborg
26
27
  @plugin
27
28
  end
28
29
 
30
+ def config_data
31
+ Cyborg::ConfigData.read(Cyborg.plugin.root, Rails.root)
32
+ end
33
+
29
34
  def register(plugin_module, options={})
30
35
  @plugin = plugin_module.new(options)
31
36
  @plugin.create_engine
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cyborg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.29
4
+ version: 0.5.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-01 00:00:00.000000000 Z
11
+ date: 2017-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass
@@ -193,6 +193,7 @@ files:
193
193
  - lib/cyborg/command/help.rb
194
194
  - lib/cyborg/command/npm.rb
195
195
  - lib/cyborg/command/scaffold.rb
196
+ - lib/cyborg/config_data.rb
196
197
  - lib/cyborg/helpers/asset_helpers.rb
197
198
  - lib/cyborg/helpers/layout_helpers.rb
198
199
  - lib/cyborg/middleware.rb