cyborg 0.5.29 → 0.5.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cyborg/config_data.rb +29 -0
- data/lib/cyborg/version.rb +1 -1
- data/lib/cyborg.rb +5 -0
- 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: 1211252d2a0270de1e6fa9f831a15a4cc8db010c
         | 
| 4 | 
            +
              data.tar.gz: 06c7f865f38d528fcaeedbc030af0137ce87f114
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 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
         | 
    
        data/lib/cyborg/version.rb
    CHANGED
    
    
    
        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. | 
| 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- | 
| 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
         |