guard

running java 5/6 with JNI on java 7 gives stack guard warning

為{幸葍}努か 提交于 2019-12-10 13:18:48
问题 A java program built with 1.5 (or 1.6 with 1.5 comparability mode on) gives this warning: Java HotSpot(TM) Server VM warning: You have loaded library mynativelib.so which might have disabled stack guard. The VM will try to fix the stack guard now. It's highly recommended that you fix the library with 'execstack -c ', or link it with '-z noexecstack'. It doesn't seem to cause a problem but obviously would look a bit scary to our customers. I don't think building the java bits in 7 would fix

Swift guard else called on dictionary key with NULL value

a 夏天 提交于 2019-12-10 11:57:38
问题 If I have a Dictionary returned from a NSNotification containing the following print(notificationObj.object) Optional({ age = "<null>"; names = ( David ); }) Then the guard else is called when trying to assign this to a variable: guard let categories = notificationObj.object as? [String:[String]] else { // Gets to here return } How can I handle the case where a Dictionary key is null. 回答1: Your dictionary does contain ... Optional({ age = "<null>"; names = ( David ); }) ... and ... age = ...

Guardfile for running single cucumber feature in subdirectory?

强颜欢笑 提交于 2019-12-09 18:13:20
问题 I have my features organized in subfolders, like this: app/ features/ users/ feature1.feature feature2.feature But everytime I save a feature, Guard runs all my features (not just the one that was edited). How can I change it to only run the one that was saved? Here's my Guardfile for Cucumber: guard 'cucumber', :cli => "--drb --require features/support --require features/step_definitions" do watch(%r{features/.+\.feature}) watch(%r{features/support/.+}) { 'features' } watch(%r{features/step

Angular2 Exploring Resolved Data in canActivate Guard?

回眸只為那壹抹淺笑 提交于 2019-12-09 15:52:10
问题 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<Object> }) => { this.example = data.example; console.log('example resolver', this.example); }); } How could I manage that in the canActivate guard? This is not working: constructor(private route: ActivatedRoute) {} canActivate( route: ActivatedRouteSnapshot, state:

How to correctly use guard clause in Ruby

限于喜欢 提交于 2019-12-08 15:53:16
问题 What is the correct way to use the guard clause in this sample? def require_admin unless current_user && current_user.role == 'admin' flash[:error] = "You are not an admin" redirect_to root_path end end I don't know where to put flash message when trying to rewrite using these https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals conventions 回答1: You can use the return statement here. Essentially, there is no need for the method to continue if those conditions are met, so you can

Using guard-rspec with factory-girl-rails

一笑奈何 提交于 2019-12-08 00:59:39
问题 I'm using factory_girl_rails as a replacement for fixtures in my Rails project. I'm also using guard-rspec to automatically run my specs. Guard is not picking up the changes I make to my factory files (e.g. spec/factories/users.rb )—I have to stop guard, then reinitialize it for it to pick up those changes. What are some options for avoiding this manual process? 回答1: To add to your own answer: I limit what it runs, so it doesn't run too much: watch(%r{^spec/factories/(.+)\.rb$}) { "spec

Guard won't load WDM

守給你的承諾、 提交于 2019-12-07 01:40:31
问题 I'm working through Michael Hartl's Rails tutorial which is excellent so far. I'm on the Advanced Setup Chapter, where he goes through configuring the Rails environment in a way conducive to TDD. I installed Guard, and it runs properly all the way through running the tests I have in my spec/ folder. But then, it spits out this error: C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/listen-1.0.2/lib/listen/adapter.rb:195:in `require': cannot load such file -- wdm (LoadError) I have wdm

Ruby Guard questions - 'Please install the sqlite3 adapter' - railstutorial.org

徘徊边缘 提交于 2019-12-06 23:33:41
问题 I am following along the Ruby on Rails Tutorial and have gotten somewhat confused in the testing section, in particular - 3.6.2 - Automated tests with Guard As per the tutorial's instructions for deployment to Heroku, I've switched over to Postgresql and removed sqlite3 from my gemfile and did a bundle install to update. However, once I run bundle exec guard I receive the message: /Users/username/.rvm/gems/ruby-1.9.3-p125@global/gems/bundler-1.1.3/lib/bundler/rubygems_integration.rb:147:in

how to guard a controller through multiple of user?

瘦欲@ 提交于 2019-12-06 17:01:00
问题 It is project requirement. where i have multiple logins but some user can not access few module. like super admin and analyst can access all module but developer can only use own controller. so in this case , how can i guard a controller with multiple logins. also note that i have separate login page and table into Database. for Example phonebookController can be access by super admin and analyst but not by developers. so please tell me how can i implement this? i use this for :: if( Auth:

Listen gem not forwarding events to guard

孤街醉人 提交于 2019-12-06 15:48:53
I can't get Guard to run any action. I'm using: Gentoo x64 ( 3.14.14 ) rbx-2.5.2 guard 2.11.1 listen 2.8.5 Guardfile is just catch-it-all from Understanding guard guard :rspec, cmd: "bundle exec rspec" do watch(/(.*)/) { |m| Guard::UI.puts "Unknown file: #{m[1]}"; nil } end And here is the output of $ LISTEN_GEM_DEBUGGING=2 bundle exec guard -d I, [2015-02-04T08:11:34.995518 #25370] INFO -- : Celluloid loglevel set to: 0 I, [2015-02-04T08:11:34.997566 #25370] INFO -- : Listen version: 2.8.5 08:11:35 - DEBUG - Notiffany: gntp not available (Please add "gem 'ruby_gntp'" to your Gemfile and run