Sha256: f2e0a16da32f0c926c0d25443af08dd8b750158aa5b88d9fc204f9f0f1ccbd18

Contents?: true

Size: 994 Bytes

Versions: 13

Compression:

Stored size: 994 Bytes

Contents

module BubbleWrap
  module Ext
    module ConfigTask

      def self.included(base) 
        base.class_eval do
          alias_method :files_dependencies_without_bubblewrap, :files_dependencies
          alias_method :files_dependencies, :files_dependencies_with_bubblewrap
        end
      end

      def path_matching_expression
        /^\.?\//
      end

      def files_dependencies_with_bubblewrap(deps_hash)
        res_path = lambda do |x|
          path = path_matching_expression.match(x) ? x : File.join('.', x)
          unless @files.include?(path)
            Motion::Project::App.send(:fail, "Can't resolve dependency `#{x}' because #{path} is not in #{@files.inspect}")
          end
          path
        end
        deps_hash.each do |path, deps|
          deps = [deps] unless deps.is_a?(Array)
          @dependencies[res_path.call(path)] = deps.map(&res_path)
        end
      end

    end
  end
end

Motion::Project::Config.send(:include, BubbleWrap::Ext::ConfigTask)

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
bubble-wrap-1.4.0 lib/bubble-wrap/ext/motion_project_config.rb
bubble-wrap-1.3.0 lib/bubble-wrap/ext/motion_project_config.rb
bubble-wrap-1.3.0.osx lib/bubble-wrap/ext/motion_project_config.rb
bubble-wrap-1.2.0 lib/bubble-wrap/ext/motion_project_config.rb
bubble-wrap-1.2.0.pre lib/bubble-wrap/ext/motion_project_config.rb
bubble-wrap-1.1.5 lib/bubble-wrap/ext/motion_project_config.rb
bubble-wrap-1.1.4 lib/bubble-wrap/ext/motion_project_config.rb
bubble-wrap-1.1.3 lib/bubble-wrap/ext/motion_project_config.rb
bubble-wrap-1.1.2 lib/bubble-wrap/ext/motion_project_config.rb
bubble-wrap-1.1.1 lib/bubble-wrap/ext/motion_project_config.rb
bubble-wrap-1.1.0 lib/bubble-wrap/ext/motion_project_config.rb
bubble-wrap-1.0.0 lib/bubble-wrap/ext/motion_project_config.rb
bubble-wrap-1.0.0.pre.2 lib/bubble-wrap/ext/motion_project_config.rb