File: file_data.rb

package info (click to toggle)
ruby-compass 0.12.2~dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 8,308 kB
  • sloc: ruby: 10,474; makefile: 42; xml: 14
file content (21 lines) | stat: -rw-r--r-- 502 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module Compass
  module Configuration
    class FileData < Data
      def self.new_from_file(config_file, defaults = nil)
        data = new(config_file)
        data.with_defaults(defaults) do
          data._parse(config_file)
        end
        data
      end

      def self.new_from_string(contents, filename, defaults = nil)
        data = new(filename)
        data.with_defaults(defaults) do
          data.parse_string(contents, filename)
        end
        data
      end
    end
  end
end