Sha256: 9786566451bbce12247a4e7ab4dd907f8c54e48861069aa3af272f63113f6702

Contents?: true

Size: 900 Bytes

Versions: 6

Compression:

Stored size: 900 Bytes

Contents

module Stationed
  module Generators
    module Plugins
      module Guard
        def self.prepended(base)
          base.class_option :guard,
            type: :boolean,
            default: true,
            desc: 'Include Guard for Rspec and Livereload'
        end

        def finish_template
          return super unless options[:guard]
          gem_group :development do
            gem 'guard'
            gem 'guard-rspec'
            gem 'guard-livereload'
            gem 'terminal-notifier-guard'
          end
          super
        end

        def run_bundle
          super
          return unless options[:guard]
          run 'bundle exec guard init rspec'
          run 'bundle exec guard init livereload'
          gsub_file 'Guardfile',
                    /guard :rspec do/,
                    "guard :rspec, cmd: 'spring rspec' do"
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
stationed-0.6.0 lib/stationed/generators/plugins/guard.rb
stationed-0.5.0 lib/stationed/generators/plugins/guard.rb
stationed-0.4.0 lib/stationed/generators/plugins/guard.rb
stationed-0.3.0 lib/stationed/generators/plugins/guard.rb
stationed-0.2.0 lib/stationed/generators/plugins/guard.rb
stationed-0.1.0 lib/stationed/generators/plugins/guard.rb