Rails 2.1 and Ruboss forced me to start using Git
I was procastinating the learning of Git until necessary, well the time came. I am about to start a new project that will require Flex 3 (using Ruboss) for the user interface and Rails 2.1 as the backend. Both frameworks, Ruboss and Rails are now using Git as their source control system, and both are hosted on GitHub.
Therefore I grabbed my beta version of Pragmatic Version Control Using Git and started my journey.
Installing Git on Windows
Yes, I am working on Windows ... I should be using a Mac instead, maybe next year. Back to business, I found a good explanation on how to do this on Kyle Cordes Blog, installed the software, generated my SSH public key and now I am ready to roll.
Installing Rails 2.1
I had two options at this point for porting my application from 2.0.2 to 2.1.0:
- Install Rails on the 'vendor' folder and leave it on the edge using Git with: git checkout master, or
- Install the Rails Gem: gem install rails -v=2.1.0 -y
Since I don't need to be on the edge I opted for option 2 and then update Rails with: rake rails:update
After starting the server I got a warning about a deprecation:
DEPRECATION WARNING: config.action_view.cache_template_extensions option has been deprecated and has no affect. Please remove it from your config files. See http://www.rubyonrails.org/deprecation for details. (called from send at c:/ruby/186_26/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/initializer.rb:455)
I removed the offending line from my config/development.rb, and voila. All routes and features work fine.
Installing Ruboss Rails 2.1 plugin from GitHub
Getting the plugin
This one was a bit tricky, I finally figured it out: right-click on the application folder, in my case "FileShare" and then click on "Git Bash here", then I installed the plugin from the new command line using the standard "ruby script/plugin install" :
$ ruby script/plugin install git://github.com/dima/ruboss_rails_integration.git removing: C:/Projects/Rails/Personal/FileShare/vendor/plugins/ruboss_rails_integration/.git Initialize C:/Projects/Rails/Personal/FileShare/vendor/plugins/ruboss_rails_integration/.git Initialized empty Git repository in C:/Projects/Rails/Personal/FileShare/vendor/plugins/ruboss_rails _integration/.git/ remote: Counting objects: 99, done.←[K remote: Compressing objects: 100% (77/77), done.←[KB/s 87% (87/99), 60.00 KiB | 103 KiB/s remote: Total 99 (delta 26), reused 78 (delta 1←[K6Receiving objects: 91% (91/99), 60.00 KiB | 103 remote: )←[K Receiving objects: 100% (99/99), 66.40 KiB | 103 KiB/s, done. Resolving deltas: 100% (26/26), done. ----------------- installed yamlscaffold into script folder copying ruboss.yml into config folder, customize if necessary fetching latest framework binary from: http://ruboss.com/releases/ruboss-latest.swc ... done. saved to lib/ruboss-latest.swc
Installing the plugin
>ruby script/generate ruboss_config identical .flexProperties overwrite .actionScriptProperties? (enter "h" for help) [Ynaqdh] y force .actionScriptProperties overwrite .project? (enter "h" for help) [Ynaqdh] y force .project create html-template/history overwrite html-template/index.template.html? (enter "h" for help) [Ynaqdh] a forcing ruboss_config force html-template/index.template.html identical html-template/AC_OETags.js identical html-template/playerProductInstall.swf create html-template/history/history.css create html-template/history/history.js create html-template/history/historyFrame.html create app/flex/fileshare/components create app/flex/fileshare/controllers create app/flex/fileshare/commands create app/flex/fileshare/models create app/flex/fileshare/events create app/flex/fileshare/components/generated create public/javascripts/swfobject.js create public/expressInstall.swf create public/index.html dependency ruboss_controller create app/flex/fileshare/controllers/FileshareController.as force app/flex/Fileshare.mxml
Creating the YAML definition of the application tables
For my application the db/model.yml looks like so:
shared_files: - name: string - location: string - size: integer - belongs_to: [company, user] roles: - name: string companies: - name: string - hash: string users: - login: string - first_name: string - last_name: string - password: string - enabled: boolean - belongs_to: [company] - has_many: [shared_files, permissions] permissions: - belongs_to: [company, user, role]
Generating the app
ruby script/yamlscaffold rake db:refresh rake ruboss:flex:build ruby script/server
Go to http://localhost:3000
- Daniel's blog
- Login to post comments
