Sha256: e6297d89c84672414f4dc8b7d1aca2d9d2d376cca74eaa6f91cfabd2d7c5a268

Contents?: true

Size: 592 Bytes

Versions: 4

Compression:

Stored size: 592 Bytes

Contents

require 'thor'

class Scaffolding < Thor::Group
  include Thor::Actions

  argument :name
  argument :path, optional: true

  def self.source_root
    File.dirname(__FILE__) + '/templates'
  end

  def generate_class
    template('page_object.tt', default_path("page_objects/pages/#{name}_page.rb") )
  end

  def generate_feature
    template('feature.tt', default_path("features/#{name}.feature"))
  end

  def generate_spec
    template('spec.tt', default_path("./spec/#{name}_page.rb"))
  end

  def default_path(standard_path)
    path.nil? ? standard_path : "#{path}/#{name}"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby_raider-0.2.9 lib/scaffolding/scaffolding.rb
ruby_raider-0.2.8 lib/scaffolding/scaffolding.rb
ruby_raider-0.2.7 lib/scaffolding/scaffolding.rb
ruby_raider-0.2.6 lib/scaffolding/scaffolding.rb