Skip to content

Latest commit

 

History

History
73 lines (64 loc) · 3.36 KB

README.rdoc

File metadata and controls

73 lines (64 loc) · 3.36 KB

README

  • Ruby version Developed on Ruby 1.9.3 with JRuby 1.7.10 (Java 7) and/or JRuby 9.0.5.0 (Java 8).

  • System dependencies JRuby 1.7.10 and later (Ruby 1.9.3); Java 6 or later; file - util in *nix, but needed to be installed manually on Windows (gnuwin32.sourceforge.net/packages/file.htm) Firefox for tests

  • Configuration All files are in utf-8 and it’s preferable to specify JVM option:

    -Dfile.encoding=UTF-8 (e.g. $ export JAVA_OPTS=-Dfile.encoding=UTF8)

    When running selenium webdriver tests (specs) on Java 6 set:

    -Djava.net.preferIPv4Stack=true
    
  • Database creation App uses Apache Derby Embedded which is shipped with JVM 6 and later. To create DB execute default rake tasks, e.g.: $ bundle exec rake db:setup Don’t forget to set appropriate RAILS_ENV.

  • Database initialization As usual - run $ bundle exec rake db:migrate

  • Deployment instructions To create .war distribution execute Rake tasks:

    • Create .war from scratch with DB recreation and assets precompilation

    $ bundle exec rake war:create

    • Update DB and assets (if needed) and create .war:

    $ bundle exec rake war:update All commands package all dependencies and JRuby libraries to a single web-archive. This .war file can be deployed on any servlet or EAR container (e.g. Tomcat or WebSphere). Don’t forget to patch JVM with JCE Unlimited Strength Jurisdiction Policy.

    To run Rails server in production mode:

    * precompile assets:
     $ bundle exec rake assets:precompile RAILS_ENV=production
     $ bundle exec rake assets:non_digested_ace RAILS_ENV=production
    * run as usual:
     $ bundle exec rails s -e production
  • How to run the test suite Prerequisite: Firefox 32 or near in default selenium-webdriver lookup path. However, path to firefox executable can be set by firefox_path variable (see below). For running tests there are following commands:

    • Setup test environment and run all test printing report to tmp/rspec/report.html $ bundle exec rake rspec:all

    • Only run tests printing report to tmp/rspec/report.html: $ bundle exec rake rspec:run Arguments for this command are following (name=“value”):

spec - path to specs or examples, e.g. spec=“./spec/features/welcome_spec.rb:15”

args - arguments string for rspec itself (see $ rspec --help)

firefox_path - full path to firefox executable, including .exe file firefox_profile - name of firefox profile to run tests pause - delay in seconds after each tests (for manual control of execution)

* Default rspec command is working too:
  $ bundle exec rspec
  • Generators There is useful generator for tools, based on text input and uploading files: $ bundle exec rails g editor <ns/name> [actions]

    where actions by default include name parameter, but can also include 'upload'. E.g.:
    • create xml/format tool with method ‘format’:

    $ bundle exec rails g editor xml/format

    • create xml/xsd tool with method ‘validate’ and fileupload capabilities:

    $ bundle exec rails g editor xml/xsd validate upload This generator creates skeleton of tool. It’s recommended to apply it in clean working tree, see git diff and upgrade generated code as needed. When using generator in clean working tree you can clean up generated things:

    $ git checkout app && git checkout config && git clean app/**/* -df && git clean config/**/* -df && git clean spec/features/**/* -df