30 April 2013

Starting With Rubymotion



Rubymotion

 RubyMotion is a revolutionary toolchain for iOS.
It lets you quickly develop and test native iOS applications for iPhone or iPad, all using the awesome Ruby language you know and love.

29 March 2013

TCS RSS Feed Reader 123


TCS RSS Feed
This is an iOS application build using

Running on Simulator/Device

You will need Rubymotion installed on your Mac.
  1. Clone repo git clone git@github.com:upadhyay-ashish/TCSRssReader.git
  2. Bundle gems bundle install
  3. Setup cocoapods pod setup
  4. Setup Developer license reference in the Rakefile
  5. To run on simulator rake else to run on a Device rake device
  6. To create a distribution IPA rake archive:distribution

25 February 2013

Replacing master with a branch GIT



This will help us to overwrite the master branch with a new branch incase the new branch is in a better state than the master


  • git checkout seotweaks
  • git merge -s ours master
  • git checkout master
  • git merge seotweaks



Thanks

08 January 2013

Using Oracle JDBC with JRuby on Mac OSx

Please follow the below steps to create a jruby library to connect to any oracle database on Mac OS x using Java ODBC drivers.


STEP 1: Create the Library folder and the Ruby file. eg Sample.rb
Step 2 : Add Gemfile to enable using jruby to connect to the database

Step 3 :  add the following gems to the Gemfile
gem 'activerecord'
gem "activerecord-jdbc-adapter"

Step 4 : In the ruby file Sample.rb here please use the following lines and then write appropriate  code to access the data.

class Person < ActiveRecord::Base

    establish_connection(
      :adapter  => 'jdbc',
      :driver   => 'oracle.jdbc.driver.OracleDriver',
      :url      => 'jdbc:oracle:thin:@server:port/sid',
      :username => 'ors',
      :password => 'ors'
      )

      self.table_name = :table_name_here

        def self.all

          connection.select_all <<-SQL
                  select * from table_name_here
             SQL
        end
 end

Step 5 : Go to terminal , run


bundle install 
jruby Sample.rb

Step 6 : If there is a driver not found error please download the driver from oracle site here 
and place it in /Library/Java/Extensions/ on your mac.

Have Fun !