Sha256: 6ebe8e66face6a1eb97558de0a4d2ec5efbcb6c414466361180a606594beecac

Contents?: true

Size: 397 Bytes

Versions: 38

Compression:

Stored size: 397 Bytes

Contents

require 'rails/generators'

module Clean
  module Generators
    class GemfileGenerator < ::Rails::Generators::Base
      source_root File.expand_path("../templates", __FILE__)

      desc "remove commented lines and multiple blank lines from a Gemfile"

      def clean_gemfile
        gsub_file 'Gemfile', /#.*\n/, "\n"
        gsub_file 'Gemfile', /\n^\s*\n/, "\n"
      end

    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
rails_apps_pages-0.6.7 lib/generators/clean/gemfile_generator.rb
rails_apps_pages-0.6.6 lib/generators/clean/gemfile_generator.rb
rails_apps_pages-0.6.5 lib/generators/clean/gemfile_generator.rb
rails_apps_pages-0.6.4 lib/generators/clean/gemfile_generator.rb
rails_apps_pages-0.6.3 lib/generators/clean/gemfile_generator.rb
rails_apps_pages-0.6.2 lib/generators/clean/gemfile_generator.rb
rails_apps_pages-0.6.0 lib/generators/clean/gemfile_generator.rb
rails_apps_pages-0.5.16 lib/generators/clean/gemfile_generator.rb
rails_apps_pages-0.5.15 lib/generators/clean/gemfile_generator.rb
rails_apps_pages-0.5.14 lib/generators/clean/gemfile_generator.rb
rails_apps_pages-0.5.13 lib/generators/clean/gemfile_generator.rb
rails_apps_pages-0.5.12 lib/generators/clean/gemfile_generator.rb
rails_apps_pages-0.5.11 lib/generators/clean/gemfile_generator.rb
rails_apps_pages-0.5.10 lib/generators/clean/gemfile_generator.rb
rails_apps_pages-0.5.9 lib/generators/clean/gemfile_generator.rb
rails_apps_pages-0.5.8 lib/generators/clean/gemfile_generator.rb
rails_apps_pages-0.5.7 lib/generators/clean/gemfile_generator.rb
rails_apps_pages-0.5.6 lib/generators/clean/gemfile_generator.rb
rails_apps_pages-0.5.5 lib/generators/clean/gemfile_generator.rb
rails_apps_pages-0.5.4 lib/generators/clean/gemfile_generator.rb