Sha256: 39fbb96451e96330024fe9e36e808cc8f8e11b94f71ab84df4c8a171fd5271a2

Contents?: true

Size: 1.19 KB

Versions: 7

Compression:

Stored size: 1.19 KB

Contents

#!/usr/bin/env ruby

def create_feature_file(name)
  opts = { name: camelize(name) }
  template('feature', File.join(FileUtils.pwd, 'features', 'specs',
                                "#{name.downcase}.feature"), opts)
end

def create_steps_file(name)
  opts = { name: camelize(name) }
  template('steps', File.join(FileUtils.pwd, 'features', 'steps_definitions',
                              "#{name.downcase}_steps.rb"), opts)
end

def create_page_file(name)
  opts = { name: camelize(name) }
  template('page', File.join(FileUtils.pwd, 'features/support', 'pages',
                             "#{name.downcase}_page.rb"), opts)
end

def create_service_file(name)
  opts = { name: camelize(name) }
  template('services', File.join(FileUtils.pwd, 'features/support', 'services',
                                 "#{name.downcase}_services.rb"), opts)
end

def camelize(string)
  camelized = ''
  string.split('_').each do |s|
    camelized += s.capitalize
  end
  camelized
end

def in_root_project_folder?
  unless Dir.exist?(File.join(FileUtils.pwd, 'features', 'specs'))
    puts 'Please run this command on the root folder of the project'
    exist 1
  end
  true
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
SaudeiD-0.2.5 lib/SaudeiD/SaudeiD_helper.rb
SaudeiD-0.2.4 lib/SaudeiD/SaudeiD_helper.rb
SaudeiD-0.2.2 lib/SaudeiD/SaudeiD_helper.rb
SaudeiD-0.2.0 lib/SaudeiD/SaudeiD_helper.rb
GeneSaudeId-0.1.4 lib/GeneSaudeId/GeneSaudeId_helper.rb
GeneSaudeId-0.1.3 lib/GeneSaudeId/GeneSaudeId_helper.rb
GeneSaudeId-0.1.2 lib/GeneSaudeId/GeneSaudeId_helper.rb