Questions tagged [guard]

Guard is a command line tool to easily handle events on file system modifications.

Guard is a command line tool to easily handle events on file system modifications (FSEvent / Inotify / Polling support).

884 questions
18
votes
7 answers

Where can I find a good Scope Guard implementation for my C++ projects?

I just recently learned about Scope Guard C++ idiom. Unfortunately I can't find any good implementation of it. Can anyone point me to some good and usable Scope Guard implementation in C++? Thanks, Boda Cydo.
bodacydo
  • 75,521
  • 93
  • 229
  • 319
18
votes
3 answers

Error on start when using Spork and Guard

Here's the problem. When added the Guard gem everything was fine when I was calling Guard. When I added Spork, I get the following error that doesn't affect testing my tests but it brings it up every time I try to restart Guard. 19:01:28 - INFO -…
PericlesTheo
  • 2,429
  • 2
  • 19
  • 31
16
votes
2 answers

Guard w/ RSpec2, Ruby1.9.3, Rails 3.1.3

I am running Guard successfully with notifications provided by Libnotify. funkdified@funkdified-laptop:~/railsprojects/sample_app$ guard Guard uses Libnotify to send notifications. Guard is now watching at…
Abram
  • 39,950
  • 26
  • 134
  • 184
16
votes
3 answers

Bundler error on deployment

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…
Mark
  • 7,891
  • 5
  • 27
  • 36
16
votes
3 answers

How to speed up assets compilation for tests?

Running Guard with Spin works great to keep my testing fast, except when assets are relevant and need compiling. It seems that the test environments recompiles all assets whenever I change something in them. I've seen examples of deployment scripts…
Jasper Kennis
  • 3,225
  • 6
  • 41
  • 74
15
votes
2 answers

Laravel: Argument 2 passed to Illuminate\Auth\SessionGuard::__construct()

I have a application where I have created a new guard called residents which is the exact copy of the default User class that comes with the laravel. But when i change the guard it start showing this error: Argument 2 passed to…
Mr.Singh
  • 1,421
  • 6
  • 21
  • 46
15
votes
1 answer

Angular2 Exploring Resolved Data in canActivate Guard?

Is it possible to access resolved data of a route (-Resolver) inside a canActivate guard. Currently I can access the resolved data in the component by ngOnInit() { this.route.data .subscribe((data: { example: Array }) => { …
Max Solid
  • 1,213
  • 3
  • 21
  • 32
13
votes
2 answers

Compare Pros and Cons of Autofeature/autotest vs Guard?

Does anyone have any concrete reasoning for using one autotesting runner over another? I've used both Autofeature+autotest, I really like the built-in process that this sets up in that it runs my rspec unit tests first, and then the cucumber tests,…
Tonys
  • 3,349
  • 4
  • 24
  • 27
12
votes
2 answers

guard desugaring

I often hear the phrase, guards are just syntactic sugar for if-then-else (or case statements). Can somebody please desugar the following instance: halfOf :: Int -> Int halfOf x | even x = div x 2 (The function is intentionally partial) Thanks,
Ozgur
  • 994
  • 7
  • 13
12
votes
3 answers

Swift: Nil is incompatible with return type String

I have this code in Swift: guard let user = username else{ return nil } But I'm getting the following errors: Nil is incompatible with return type String Any of you knows why or how I return nil in this case? I'll really appreciate…
user2924482
  • 8,380
  • 23
  • 89
  • 173
12
votes
2 answers

How can you get rspec to print failed test backtraces *as* it is running?

Our test quite takes a while to run, and there is always this 5-10 minute period where we know which test has failed, but we can't see the failure message or backtrace until the suite finishes. It would be more efficient to see the backtraces as…
Brian Armstrong
  • 19,707
  • 17
  • 115
  • 144
11
votes
3 answers

Why do non-exhaustive guards cause irrefutable pattern match to fail?

I have this function in Haskell: test :: (Eq a) => a -> a -> Maybe a test a b | a == b = Just a test _ _ = Nothing This is what I got when I tried the function with different inputs: ghci>test 3 4 Nothing ghci>test 3 3 Just 3 According to Real…
Matt Fenwick
  • 48,199
  • 22
  • 128
  • 192
11
votes
5 answers

Is it better to use guards than patterns for recursion functions in Haskell?

I'm just wondering about a recursion function I'm laying out in Haskell. Is it generally better to use guards than patterns for recursion functions? I'm just not sure on what the best layout is but I do know that patterns are better when defining…
maclunian
  • 7,893
  • 10
  • 37
  • 45
11
votes
2 answers

How to handle connection loss page in Angular 7?

What I want is that, If the network is not available, and the user tries to navigate to the next page ConnectionLost Component would be there. But if there is no network and user do not take any action means not navigating to the second page. then…
Ravi Sevta
  • 2,817
  • 21
  • 37
11
votes
1 answer

When did `guard let foo = foo` become legal?

Back in November of 2016 I posted a question asking why I couldn't use guard to create an unwrapped version of a variable using the same name as the optional, like you can with if let: Link: Why isn't guard let foo = foo valid? When I wrote that…
Duncan C
  • 128,072
  • 22
  • 173
  • 272
1
2
3
58 59