Skip to content

Latest commit

 

History

History
92 lines (62 loc) · 2.14 KB

DEVELOPMENT.md

File metadata and controls

92 lines (62 loc) · 2.14 KB

Uploadcare Widget development guide

Clone the repository.

git clone https://github.com/uploadcare/uploadcare-widget

Environment

You need a working Ruby 2.0.0 and above environment with Bundler.

Vagrant

If you don't want to set up the environment to your machine, you can use Vagrant. Just install Vagrant and VirtualBox or other provider.

After opening your terminal, go to this directory and run:

vagrant up
vagrant ssh

In Vagrant run:

bundle install
cd ./test/dummy
bundle install

Local environment (without Vagrant)

Inside folder run

npm install
npm run build

bundle install
cd ./test/dummy
bundle install

Build

  • run bundle exec rake js:latest:build to build assets to the pkg/latest directory (with the “latest” suffix).
  • run bundle exec rake js:release:build to build assets to the pkg/version directory (with the current version suffix). The version is specified in lib/uploadcare-widget/version.rb.

Development

Go to test/dummy/. There is a simple Rails app. Run it:

bundle exec rails server

Open http://127.0.0.1:3000/. Follow any link. There's going to be a widget or three. Edit code and reload the page :-)

Testing

Use Jasminerice installed under the test/dummy/ Rails app.

To run tests in your browser go to http://127.0.0.1:3000/jasmine.

For more information, see jasminerice docs.

guard-jasmine

To run tests in a terminal you must first install phantomjs.

Then, there are two options:

  • run bundle exec guard start
  • run bundle exec guard-jasmine

The first one is for continuous tests execution, the second one runs tests just once. Both should be executed from the test/dummy/ directory.

See guard-jasmine docs for more information.