2013-07-09 1 views
1

여기까지 어떻게 끝났는지 모르겠지만, 언제든지 guard init을 실행하면 바깥 쪽을 약간 보일 것 같습니다. 한 번씩 coffeescript/sass/livereload를 추가하는 대신 각 그들 중 몇 번이나. 여기 가드 초기화를 실행하면 워처 라인이 복제됩니다.

내가 guard init를 실행 한 후 명령 행에서 무엇을 얻을 :이되는 내용으로

WARN: Unresolved specs during Gem::Specification.reset: 
     thor (>= 0.14.6) 
     lumberjack (>= 1.0.2) 
     ffi (>= 0.5.0) 
WARN: Clearing out unresolved specs. 
Please report a bug if this causes problems. 
11:39:55 - INFO - Writing new Guardfile to /var/www/the-newbies-guide-to-test-driven-development/Guardfile 
11:39:55 - INFO - coffeescript guard added to Guardfile, feel free to edit it 
11:39:55 - INFO - coffeescript guard added to Guardfile, feel free to edit it 
11:39:55 - INFO - coffeescript guard added to Guardfile, feel free to edit it 
11:39:57 - INFO - compass guard added to Guardfile, feel free to edit it 
11:39:57 - INFO - concat guard added to Guardfile, feel free to edit it 
11:39:58 - INFO - livereload guard added to Guardfile, feel free to edit it 
11:39:58 - INFO - livereload guard added to Guardfile, feel free to edit it 
11:39:58 - INFO - There are 2 definitions in your Guardfile for 'livereload', you may want to clean up your Guardfile as this could cause issues. 
11:39:58 - INFO - livereload guard added to Guardfile, feel free to edit it 
11:39:58 - INFO - There are 3 definitions in your Guardfile for 'livereload', you may want to clean up your Guardfile as this could cause issues. 
11:39:58 - INFO - phpunit guard added to Guardfile, feel free to edit it 
11:39:58 - INFO - sass guard added to Guardfile, feel free to edit it 
11:39:58 - INFO - sass guard added to Guardfile, feel free to edit it 
11:39:58 - INFO - sass guard added to Guardfile, feel free to edit it 
11:39:58 - INFO - sass guard added to Guardfile, feel free to edit it 
11:39:58 - INFO - sass guard added to Guardfile, feel free to edit it 
11:39:58 - INFO - uglify guard added to Guardfile, feel free to edit it 

Guardfile : 분명히

# A sample Guardfile 
# More info at https://github.com/guard/guard#readme 

guard 'coffeescript', :input => 'app/assets/javascripts' 

guard 'coffeescript', :input => 'app/assets/javascripts' 

guard 'coffeescript', :input => 'app/assets/javascripts' 

guard 'compass' do 
    watch('^src/(.*)\.s[ac]ss') 
end 

# This will concatenate the javascript files specified in :files to public/js/all.js 
guard :concat, type: "js", files: %w(), input_dir: "public/js", output: "public/js/all" 

guard :concat, type: "css", files: %w(), input_dir: "public/css", output: "public/css/all" 

guard 'livereload' do 
    watch(%r{app/views/.+\.(erb|haml|slim)$}) 
    watch(%r{app/helpers/.+\.rb}) 
    watch(%r{public/.+\.(css|js|html)}) 
    watch(%r{config/locales/.+\.yml}) 
    # Rails Assets Pipeline 
    watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html))).*}) { |m| "/assets/#{m[3]}" } 
end 

guard 'livereload' do 
    watch(%r{app/views/.+\.(erb|haml|slim)$}) 
    watch(%r{app/helpers/.+\.rb}) 
    watch(%r{public/.+\.(css|js|html)}) 
    watch(%r{config/locales/.+\.yml}) 
    # Rails Assets Pipeline 
    watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html))).*}) { |m| "/assets/#{m[3]}" } 
end 

guard 'livereload' do 
    watch(%r{app/views/.+\.(erb|haml|slim)$}) 
    watch(%r{app/helpers/.+\.rb}) 
    watch(%r{public/.+\.(css|js|html)}) 
    watch(%r{config/locales/.+\.yml}) 
    # Rails Assets Pipeline 
    watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html))).*}) { |m| "/assets/#{m[3]}" } 
end 

guard 'phpunit', :cli => '--colors' do 
    watch(%r{^.+Test\.php$}) 
end 

guard 'sass', :input => 'sass', :output => 'css' 

guard 'sass', :input => 'sass', :output => 'css' 

guard 'sass', :input => 'sass', :output => 'css' 

guard 'sass', :input => 'sass', :output => 'css' 

guard 'sass', :input => 'sass', :output => 'css' 

guard 'uglify', :destination_file => "public/javascripts/application.js" do 
    watch (%r{app/assets/javascripts/application.js}) 
end 

난 그냥 가서 중복을 제거 할 수 있습니다 라인,하지만 난 왜 처음에 그런 일이 있었는지 궁금 해서요.

답변

3

가드가 init을 실행할 때 사용 가능한 모든 플러그인 버전을 사용하는 것처럼 보입니다. 실제로 실행될 때 (걱정할 것입니다.) 확실하지는 않습니다.

guard (1.8.2, 1.8.0, 1.7.0, 1.6.2, 1.6.1, 1.5.4, 1.0.3, 1.0.1) 
guard-concat (0.0.3) 
guard-rspec (3.0.0, 2.5.3, 2.4.1, 2.3.3, 2.1.2, 1.2.1, 0.7.2, 0.7.0) 
guard-sass (1.3.2) 
guard-spork (0.8.0) 
guard-uglify (0.1.0) 
terminal-notifier-guard (1.5.3) 

이 반복됩니다 가드 플러그인에 보석 정리를 실행 :

gem list | grep guard 

이 내가 설치 한 얼마나 많은 보호 관련 플러그인 버전의 저를 보여 주었다 : 저도 같은 문제가 내 보석의 목록을 확인했다 모든 것을 정리 :

gem cleanup guard-rspec 

gem list | grep guard 

후 보여 어떤 :

guard (1.8.2, 1.8.0, 1.7.0, 1.6.2, 1.6.1, 1.5.4, 1.0.3, 1.0.1) 
guard-concat (0.0.3) 
guard-rspec (3.0.0) 
guard-sass (1.3.2) 
guard-spork (0.8.0) 
guard-uglify (0.1.0) 
terminal-notifier-guard (1.5.3) 

guard init을 실행할 때 GuardFile에 반복 코드가 없습니다.

+0

가드 프로젝트에 github 문제가 기록되었습니다. https://github.com/guard/guard/issues/471 – OharaSi

+0

감사합니다. 이것은 내 문제를 부분적으로 해결 한 것으로 보이며'gem cleanup ... '명령을 실행하여 많은 오래된 버전을 제거 할 수 있었지만, 어떤 이유로 든'guard- livereload'는'(1.4.0, 1.0.3)'(원래 3 개)를 설치했기 때문에 새로 생성 된'Guardfile'에서 livereload를 위해 두 개의 항목을 얻고 있습니다. 왜 이런 일이 일어날 지 모릅니다. –

+0

하나 이상의 버전이 아직 설치되어 있다고 생각하는 유일한 이유는 프로젝트 중 하나에 이전 버전에 대한 종속성이 있다는 것입니다. 번들러를 사용하고 있다면 항상 모든 종속성을 충족시킵니다. 어쩌면 당신은 특정 버전에 고정되어있는 보석을 가지고 있을까요? 경비원을 돌보는 사람들은 최근에 중복 문제를 해결했지만 공개되면 업데이트 할 가치가 있습니다. – OharaSi