guard

Bundler error on deployment

萝らか妹 提交于 2019-12-03 05:54:57
问题 I'm currently using guard i.e. guard-coffeescript gem to compile my javascript (and in the future I'll probably add some more guard tasks) on my OSX dev system. I added the rb-fsevent gem to my Gemspec, now I saw that in a lot of Gemspecs it is added with an if statement like this: gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i Trying to deploy to my staging/production environment, which is running under Linux, the script executed on the server uses the bundle install -

What is the difference between Pattern Matching and Guards?

有些话、适合烂在心里 提交于 2019-12-03 00:53:20
问题 I am very new to Haskell and to functional programming in general. My question is pretty basic. What is the difference between Pattern Matching and Guards? Function using pattern matching check :: [a] -> String check [] = "Empty" check (x:xs) = "Contains Elements" Function using guards check_ :: [a] -> String check_ lst | length lst < 1 = "Empty" | otherwise = "Contains elements" To me it looks like Pattern Matching and Guards are fundamentally the same. Both evaluate a condition, and if true

Foreman running guard with color ouput

喜夏-厌秋 提交于 2019-12-02 21:16:37
I can run guard from within my foreman procfile - but the output is not as colorful as I'd like. The only color I see in my output is from Foreman... I want to have a guardfile that manages rspec, cucumber and jasmine - AND have that nice color output when those tests run. It would seem as if foreman ignores guard file settings. Any idea how to change that? Add the --tty option to your rspec guard cli: guard "rspec", :version => 2, :cli => "--tty ...other options..." For version 4.5.0 of guard-rspec the following worked for me guard :rspec, cmd_additional_args: "--tty", cmd: ...other... EDIT:

When trying to run rspec, I get “uninitialized constant ActiveModel”

拈花ヽ惹草 提交于 2019-12-02 18:50:14
问题 When I run rspec spec I get the following: /usr/local/lib/ruby/gems/1.9.1/gems/rspec-rails-2.7.0/lib/rspec/rails/extensions/active_record/base.rb:26:in `': uninitialized constant ActiveModel (NameError) from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-rails-2.7.0/lib/rspec/rails/extensions.rb:1:in `require' from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-rails-2.7.0/lib/rspec/rails/extensions.rb:1:in `' from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-rails-2.7.0/lib/rspec/rails.rb:8:in `require'

Is it impossible to use Guard with RubyMine?

☆樱花仙子☆ 提交于 2019-12-02 15:42:57
For some inexplicable reason, RubyMine autosaves every change you make and so every key stroke will trigger Guard to run your tests! And the most ridiculous thing is that there's apparently no way to disable this autosaving "feature". I'm just wondering, RubyMine seems to be a very popular editor among Rails developers and Guard seems to be an indispensable tool used to automate testing. Since Guard is impossible to use reasonably with RubyMine, how do people deal with automating their tests with RubyMine? Netzpirat Im using RubyMine with Guard all day, and in fact, some parts of Guard have

Reloading Guardfile on changes to files other than the Guardfile

让人想犯罪 __ 提交于 2019-12-02 14:27:44
问题 Currently, Guard::Setuper reloads just the Guardfile when it changes. I'm loading some additional code into my guard file (via require ), and I'd like to also reload when some of those required files change. I guess I'm really just looking for a plugin, but that seems like I'd be trying resurrect guard-ego. Is there a better way of accomplishing this? 回答1: You could probably try something like this in your Guardfile (using guard-shell): guard :shell do watch(%r{path/to/your/required/files}) {

What is the difference between Pattern Matching and Guards?

前提是你 提交于 2019-12-02 14:21:31
I am very new to Haskell and to functional programming in general. My question is pretty basic. What is the difference between Pattern Matching and Guards? Function using pattern matching check :: [a] -> String check [] = "Empty" check (x:xs) = "Contains Elements" Function using guards check_ :: [a] -> String check_ lst | length lst < 1 = "Empty" | otherwise = "Contains elements" To me it looks like Pattern Matching and Guards are fundamentally the same. Both evaluate a condition, and if true will execute the expression hooked to it. Am I correct in my understanding? In this example I can

Reloading Guardfile on changes to files other than the Guardfile

假如想象 提交于 2019-12-02 07:04:17
Currently, Guard::Setuper reloads just the Guardfile when it changes . I'm loading some additional code into my guard file (via require ), and I'd like to also reload when some of those required files change. I guess I'm really just looking for a plugin, but that seems like I'd be trying resurrect guard-ego . Is there a better way of accomplishing this? You could probably try something like this in your Guardfile (using guard-shell ): guard :shell do watch(%r{path/to/your/required/files}) { Guard.evaluator.reevaluate_guardfile } end @Zach: Up-to-date documentation is at http://guardgem.org

Swift讲解专题六——流程控制

泄露秘密 提交于 2019-12-02 00:45:26
Swift讲解专题六——流程控制 一、引言 一种编程语言的强大与否,很大程度上取决于其提供的程序流程控制方案,就如使用汇编语言实现复杂的程序流程是一件痛苦的事情。Swift中提供了许多强大的流程控制语句,例如快速遍历for-in,while循环,repeat-while循环,switch选择等,需要注意的是,在Swift2.2中,for(a;b;c)循环已经被弃用掉,并且Swift中的Switch语句也更加强大,可以处理任意数据类型。 二、for-in循环 配合范围运算符,for-in循环可以用来执行确定次数的循环,示例如下: for index in 1...5 { print(index) } //如果不需要获取循环中每次的循环次数 可以使用如下方式 var sum=0; for _ in 1...3 { sum += 1 } for-in循环也通常会用来遍历数组,字典,集合等,示例如下: var collection1:Array = [1,2,3,4] var collection2:Dictionary = [1:1,2:2,3:4,4:4] var collection3:Set = [1,2,3,4] for obj in collection1 { print(obj) } for (key , value) in collection2 { print(key

How do you get cucumber/guard to filter on tags like @wip?

大憨熊 提交于 2019-12-01 17:13:01
I'm running spork and guard and all has been going very well with my RSpec tests which were all run correctly. In order to speed up the tests I could successfully filter my RSpec tests with tags I placed in my .rspec file. .rspec --colour --debug --tag focus --tag now Unfortunately though I have not been able to filter my cucumber tags. Every time cucumber runs it runs either everything or just the file that changed. How can I get cucumber/spork/guard to respect tags like @wip, @now etc and run only those tests? Is there some equivalent to the .rspec file for cucumber tags? You could use a