Sha256: 70400006ef3f97ef17783813614fd39d82409fa08ebdc74095e3c409ac3009f9

Contents?: true

Size: 734 Bytes

Versions: 7

Compression:

Stored size: 734 Bytes

Contents

require 'guard/awestruct'

module Awestruct
  module CLI
    class Auto

      def initialize(config)
        @config = config
      end

      def run()
        Guard.setup
        Guard.start( :guardfile_contents=>guardfile_contents,
                     :watchdir=>@config.dir,
                     :watch_all_modifications=>true )
      end

      def guardfile_contents
        ignored = [ 
          "'.awestruct'",
          "'#{File.basename( @config.tmp_dir )}'",
          "'#{File.basename( @config.output_dir )}'",
        ] 
        c = ''
        c += "guard :awestruct do\n"
        c += "  watch %r(.*)\n"
        c += "  ignore_paths #{ignored.join(', ')}"
        c += "end\n"
        c
      end
    end

  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
awestruct-0.4.2.x6 lib/awestruct/cli/auto.rb
awestruct-0.4.2.x5 lib/awestruct/cli/auto.rb
awestruct-0.4.2.x4 lib/awestruct/cli/auto.rb
awestruct-0.4.2.x3 lib/awestruct/cli/auto.rb
awestruct-0.4.2.x2 lib/awestruct/cli/auto.rb
awestruct-0.4.2.x1 lib/awestruct/cli/auto.rb
awestructx-0.4.1.x1 lib/awestruct/cli/auto.rb