Thursday, August 10, 2017

The include activation and aasm parameters of the Restful Authentication Rails Plugin are mutually exclusive

The include activation and aasm parameters of the Restful Authentication Rails Plugin are mutually exclusive


I was following the installation instructions for the Restful Authentication Rails plugin. So I executed:

script/generate authenticated user sessions --include-activation -�aasm --rspec

This resulted in:

premature end of regular expression: /A

After digging into the source code, I found that the parse! method in /usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails_generator/options.rb swallowed exceptions. Here is the original code.

def parse!(args, runtime_options = {}) self.options = {} @option_parser = OptionParser.new do |opt| opt.banner = banner add_options!(opt) add_general_options!(opt) opt.parse!(args) end return args ensure self.options = full_options(runtime_options) end

The OptionParser initialization may cause exceptions which are not properly handled. I dont know what should be down but added the following code immediately before the ensure line at least will show the exception.

 rescue => e puts("I caught a #{e.class.to_s} with message #{e.to_s}")

Now that the exception is displayed, I saw one of my underlying problems:

I caught a OptionParser::InvalidOption with message invalid option: --include-activation

So I learned that when the --aasm parameter is used, then the --include-activation must not be specified.


download file now

Continue reading ...

Tuesday, August 8, 2017

The Scientist Magazine Exclusive Offer For My Readers Valued at 39 95

The Scientist Magazine Exclusive Offer For My Readers Valued at 39 95






The Scientist is the magazine for life science professionals. For 20 years they have informed and entertained life scientists everywhere. Their target audience is active researchers that are interested in maintaining a broad view of the life sciences by reading articles that are current, concise, accurate and entertaining.



Get your free ebook Get it now

download file now

Continue reading ...