-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
You need to configure the file /config/initializers/aws.rb to set up all personal information of your server.
- BASE_URL= base URL of the server
- PART_SIZE= 5242880 # 5MB: 5 * 1024 * 1024 => default size of the file's parts to send or receive
- DEFAULT_SPACE=1073741824 # 1GB: 1024 * 1024 * 1024 => default space for a user
- Storage::path='./storage' # default storage location on your server
- Storage::use_aws = true OR false
- AWS_ACCESS = 'AKIAIG....5TWCXQ' OR ''
- AWS_SECRET = 'W9AWHw....FerD91' OR ''
First of all run:
bundle install
This will do a bunch of things and then possibly crash on you. If so, it's because you don't have the necessary packages, use sudo aptitude install or something to get them.
You need gcc, make & cie., as well as libpq-dev, libmysqlclient-dev and possibly others. Just try to understand the error messages.
Then prepare the db with:
bundle exec rake db:migrate
And finally launch the server (on http://127.0.0.1:3000) with:
bundle exec rails s
You can perform some actions to this server using the webservices with a curl command:
curl -k cookies.txt -c cookies.txt -b https://127.0.0.1/ -X [REST Methods] -d "argument1=value1&arguement2=value2"
And that's how it's done. The default db is sqlite, so don't worry about having a mysql server or whatever. Not necessary.
If you really want to change the db, look at the config/database.yml file, and use https://github.com/datamapper/dm-rails#sample-databaseyml-files to understand how to modify it.
To deploy the server, install everything and then run:
/script/start_server
/script/stop_server
The testing framework we use for unit testing is rspec. Launch the tests using:
bundle exec rspec
You can use continuous testing with:
bundle exec autotest -q
If you want to write your own tests (and you should), look up the files in the spec directory. The file must have the same path and name as the file you're testing and end in _spec.rb.
Launch the script/setup_project to install stuff that everyone of you should use. In particular, this will install git hooks that will launch the tests at every commit, and prevent the commit if a test fails or if the test coverage is less than 95%.
Try to keep the test coverage at 100% !