template/lib/generators/auth_browserid/auth_browserid_generator.rb
# Insert the gem devise_browserid_authenticatable into Gemfile
Insert the gem devise_browserid_authenticatable into Gemfile
Insert the gem devise_browserid_authenticatable into Gemfile
def insert_gemfile
    file = 'Gemfile'
    if FileTest.exists?(file) then
      if File.readlines(file).grep(/devise_browserid_authenticatable/).size <= 0
        inject_into_file file, :after => /gem 'devise'/ do
          "\ngem 'devise_browserid_authenticatable'"
        end
        run "bundle install"
      else
        say "'devise' already added !"
      end
    else
      say "'Gemfile' does not exists !"
    end
  end
def insert_gemfile file = 'Gemfile' if FileTest . exists? ( file ) then if File . readlines ( file ) . grep ( / devise_browserid_authenticatable / ) . size <= 0 inject_into_file file , :after => / gem 'devise' / do "\ngem 'devise_browserid_authenticatable'" end run "bundle install" else say "'devise' already added !" end else say "'Gemfile' does not exists !" end end
Insert the gem devise_browserid_authenticatable into Gemfile
Insert the gem devise_browserid_authenticatable into Gemfile