Sha256: 8de81f7f563dfa56b0299f4afb4d4d98e0fc1a97c62ecfc480d96bf3ef7a7ede

Contents?: true

Size: 540 Bytes

Versions: 4

Compression:

Stored size: 540 Bytes

Contents

module Space
  module Model
    class Project
      class Bundler
        class Config
          attr_reader :config

          def initialize(config)
            @config = config
          end

          def lines
            config.split("\n")[2..-1] || []
          end

          def data
            lines.map_slice(3) do |name, value, _|
              [name, value =~ /: "(.*)"/ && $1]
            end.compact.flatten
          end

          def to_hash
            Hash[*data]
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
space-0.0.9 lib/space/model/project/bundler/config.rb
space-0.0.8 lib/space/model/project/bundler/config.rb
space-0.0.7 lib/space/model/project/bundler/config.rb
space-0.0.6 lib/space/model/project/bundler/config.rb