Sha256: 74c0f2c3c0f2d6dd65758a6e41c84574ceef067498ca7b7ab03117b77cfd85d8

Contents?: true

Size: 632 Bytes

Versions: 295

Compression:

Stored size: 632 Bytes

Contents

class TemplateRunner
  attr_reader :template, :config, :app_name, :dir, :rails_dir, :output
  def initialize(template, config)
    @template = template
    @config = config
  end

  def run(app_name = 'rails_app')
    @app_name = app_name
    @dir = Dir.mktmpdir
    @rails_dir = File.join(@dir, @app_name)
    Dir.chrdir(@dir) do
      template_file = File.open 'template.rb', 'w'
      template_file.write
      template_file.close
      @output = `rails new #{@app_name} -m template.rb`
    end
    @output
  end

  def rails
    RailsDirectory.new(@rails_dir)
  end

  def clean
    FileUtils.remove_entry_secure @dir
  end
end

Version data entries

295 entries across 295 versions & 9 rubygems

Version Path
rails_apps_composer-3.1.36 spec/support/template_runner.rb
rails_apps_composer-3.1.35 spec/support/template_runner.rb
rails_apps_composer-3.1.34 spec/support/template_runner.rb
rails_apps_composer-3.1.33 spec/support/template_runner.rb
rails_apps_composer-3.1.31 spec/support/template_runner.rb
rails_apps_composer-3.1.30 spec/support/template_runner.rb
rails_apps_composer-3.1.29 spec/support/template_runner.rb
rails_apps_composer-3.1.28 spec/support/template_runner.rb
rails_apps_composer-3.1.27 spec/support/template_runner.rb
rails_apps_composer-3.1.25 spec/support/template_runner.rb
rails_apps_composer-3.1.24 spec/support/template_runner.rb
rails_apps_composer-3.1.23 spec/support/template_runner.rb
rails_apps_composer-3.1.22 spec/support/template_runner.rb
rails_apps_composer-3.1.21 spec/support/template_runner.rb
rails_apps_composer-3.1.20 spec/support/template_runner.rb
rails_apps_composer-3.1.19 spec/support/template_runner.rb
rails_apps_composer-3.1.18 spec/support/template_runner.rb
rails_apps_composer-3.1.17 spec/support/template_runner.rb
rails_apps_composer-3.1.16 spec/support/template_runner.rb
rails_apps_composer-3.1.15 spec/support/template_runner.rb