Code Monkey home page Code Monkey logo

guard-copy's People

Contributors

ijcd avatar marcisme avatar tonyskn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

guard-copy's Issues

Wishful: Abstract the folder handling into a Guard::Folder base class

Hey,

hope you're not going to shoot me down with all these ideas... :)

I'm also developing a Guard and was thinking of implementing a bit more sophisticated folder control in it, quite similar to what you're doing with recreating the folder structure from watchers under the source folder, etc.

But before I just blatantly copy-paste code from your Guard, I was thinking that this is fairly generic functionality for pretty much any Guard which is dealing with files and there's more and more for (pre)compiling various formats, etc.

I can take a stab at trying to isolate this, but wanted to hear first if you think it's a good idea worth exploring?

Delete files in 'target' if deleted in 'source'

Hey,

would be nice if there was an option to keep folders in synch by deleting files which are removed from source folder.

I can eventually submit a pull request but as far as I can see you just begun and also I'm a bit intimidated by the thoroughness of the test cases, not sure if my cowboy Ruby skills are enough to keep this quality :)

New folders and files put in them are not picked up

Just ran into an edge case today, I did a little bit of reorganisation in one of my folders which involved creating a few new folders and moving files into them.

Apparently this wasn't picked up by Guard-Copy, so I had to restart Guard to get them copied across.

I presume this is because of the fact that freshly created folders were involved and might very well be a Guard / Listen bug, but thought I should write down just so it's possible to track it.

This is how my settings look like at the moment:

  guard 'copy', {
      :from => "#{src_dir}/#{js_dir}",
      :to => "#{build_dir}/js",
      :mkpath => true,
      :delete => true,
      :verbose => true,
      :run_at_start => true
    } do
    puts "Starting to watch JavaScript files."
    watch(%r{^.*\.js$})
  end

nothing happens when using :absolute=>true option

hi,
i'm running mac os x, the latest ruby (2.0) and have this config working just fine

guard 'copy', {
:from => tmp1',
:to => 'tmp2',
:mkpath => true,
:delete => true,
:verbose => true,
:run_at_start => true
} do

puts "Starting to watch JavaScript files."
watch(%r{^.*\.js$})

end

but when i use absolute paths

guard 'copy', {
:from => '/Volumes/U3/ru-egogo/tmp1',
:to => '/Volumes/U3/ru-egogo/tmp2',
:mkpath => true,
:delete => true,
:verbose => true,
:absolute => true,
:run_at_start => true
} do

puts "Starting to watch JavaScript files."
watch(%r{^.*\.js$})

end

nothing happens. Am I doing something wrong?

Many thanks for your help.

Option to create target folder if it doesn't exist

Would it be possible to have an option to create the target folder on demand?

At the moment I'm using a somewhat dirty hack to make sure the target folder exists:

guard 'copy', :from => 'src/common/img', :to => 'build/img', :delete  => true, :verbose => true do
  puts "Starting to watch image files."
  Dir.mkdir('build/img') unless File.directory?('build/img')
  watch(%r{^src/common/img/[^/]*.(jpg|jpeg|png|gif)$})
end

I also use Guard to create a build from scratch on the CI server on each commit where this is quite useful to have.

Thanks!

Guard pattern doesn't seem to follow convention

Just wondering if you plan to support regex based file watching / filtering with the standard guard setup like this (at the moment this doesn't seem to work):

guard 'copy', :from => 'src/common/fonts', :to => 'build/font' do
  puts "Starting to watch font files."
  Dir.mkdir('build/font') unless File.directory?('build/font')
  watch(%r{^#{src_dir}/#{font_dir}/.*\.(woff|svg|ttf)$})
end

Update Guard dependency

Any chance we can update the dependency on Guard ~> 1.1 to Guard ~> 2.0 so as to be in line with other guard utilities (e.g. guard-compass).

The dependency on 1.1 is causing dependency conflicts on my project

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.