'Program/RUBY'에 해당되는 글 6건

  1. 2007/08/07 Test-First Development for Rails
  2. 2007/07/10 Ajax on Rails
  3. 2007/05/19 Ruby를 이용한 Directory 보는 구문
  4. 2007/05/07 Ruby, ADO 이용한 SQL Server 연결
  5. 2007/05/06 Ruby App. CD-ROM 열기
  6. 2007/04/29 루비(Ruby) 로 초간단 프로그램 작성 (2)
2007/08/07 15:41

Test-First Development for Rails

http://peepcode.com/articles/2006/11/26/test-first-development

http://topfunky.com/clients/peepcode/previews/peepcode-004-testing-tips.mov

http://topfunky.com/clients/peepcode/REST-preview.mov


Test-first development can improve your workflow, improve the quality of your software, and give you confidence.

If you have looked at the “test” directory sitting at the bottom of your Rails applications and have wondered what it’s there for, this is the screencast for you!

This screencast walks through the basics of writing a simple application with the principles of test-first and behavior-driven development. You’ll use the features already built into Rails and learn how to extend it for your own needs, too.

The download includes the actual code discussed in the screencast (recently updated for Rails 1.2.2). Rails 1.2.2 is used for the project but most of the content applies to any current version of Rails.

NOTE: Advanced or cutting edge topics such as rSpec and Test::Rails are not discussed in this screencast but will be covered in a future episode.

크리에이티브 커먼즈 라이선스
Creative Commons License

'Program > RUBY' 카테고리의 다른 글

Test-First Development for Rails  (0) 2007/08/07
Ajax on Rails  (0) 2007/07/10
Ruby를 이용한 Directory 보는 구문  (0) 2007/05/19
Ruby, ADO 이용한 SQL Server 연결  (0) 2007/05/07
Ruby App. CD-ROM 열기  (0) 2007/05/06
루비(Ruby) 로 초간단 프로그램 작성  (2) 2007/04/29
올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


이 포스팅이 도움이 되었다면 구글에서 관련 정보를 찾아 보세요 ^^


Trackback 0 Comment 0

Trackback : http://i-ruru.com/trackback/123 관련글 쓰기

2007/07/10 11:01

Ajax on Rails

http://www.onlamp.com/pub/a/onlamp/2005/06/09/rails_ajax.html

자주보는 Ajax 관련된 사설입니다.

Ajax on Rails 시간날 때 한번 해석해 보시길..
크리에이티브 커먼즈 라이선스
Creative Commons License

'Program > RUBY' 카테고리의 다른 글

Test-First Development for Rails  (0) 2007/08/07
Ajax on Rails  (0) 2007/07/10
Ruby를 이용한 Directory 보는 구문  (0) 2007/05/19
Ruby, ADO 이용한 SQL Server 연결  (0) 2007/05/07
Ruby App. CD-ROM 열기  (0) 2007/05/06
루비(Ruby) 로 초간단 프로그램 작성  (2) 2007/04/29
올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


이 포스팅이 도움이 되었다면 구글에서 관련 정보를 찾아 보세요 ^^


Trackback 0 Comment 0

Trackback : http://i-ruru.com/trackback/102 관련글 쓰기

2007/05/19 16:49

Ruby를 이용한 Directory 보는 구문

# directory access
# list all files but .*/*~/*.o
dirp = Dir.open(".")
for f in dirp
  case f
  when /^\./, /~$/, /\.o/
    # do not print
  else
    print f, "\n"
  end
end
dirp.close

PHP 할때같은 기분이 든다.

상당히 짧은 코드

정규표현식도 바로 사용하는 것이 참 마음에 든다.

.*과 *~, *.o는 보안상 제외시킨다.
크리에이티브 커먼즈 라이선스
Creative Commons License

'Program > RUBY' 카테고리의 다른 글

Test-First Development for Rails  (0) 2007/08/07
Ajax on Rails  (0) 2007/07/10
Ruby를 이용한 Directory 보는 구문  (0) 2007/05/19
Ruby, ADO 이용한 SQL Server 연결  (0) 2007/05/07
Ruby App. CD-ROM 열기  (0) 2007/05/06
루비(Ruby) 로 초간단 프로그램 작성  (2) 2007/04/29
올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


이 포스팅이 도움이 되었다면 구글에서 관련 정보를 찾아 보세요 ^^


Trackback 0 Comment 0

Trackback : http://i-ruru.com/trackback/28 관련글 쓰기

2007/05/07 00:05

Ruby, ADO 이용한 SQL Server 연결

RUBY로  win32 OLE 를 이용해 ADO 연결하는 방법을 아래 소개합니다.
출처 : http://rubyonwindows.blogspot.com/search/label/sqlserver


require 'win32ole'

class SqlServer
    # This class manages database connection and queries
    attr_accessor :connection, :data, :fields

    def initialize
        @connection = nil
        @data = nil
    end

    def open
        # Open ADO connection to the SQL Server database
        connection_string =  "Provider=SQLOLEDB.1;"
        connection_string << "Persist Security Info=False;"
        connection_string << "User ID=USER_ID;"
        connection_string << "password=PASSWORD;"
        connection_string << "Initial Catalog=DATABASE;"
        connection_string << "Data Source=IP_ADDRESS;"
        connection_string << "Network Library=dbmssocn"
        @connection = WIN32OLE.new('ADODB.Connection')
        @connection.Open(connection_string)
    end

    def query(sql)
        # Create an instance of an ADO Recordset
        recordset = WIN32OLE.new('ADODB.Recordset')
        # Open the recordset, using an SQL statement and the
        # existing ADO connection
        recordset.Open(sql, @connection)
        # Create and populate an array of field names
        @fields = []
        recordset.Fields.each do |field|
            @fields << field.Name
        end
        begin
            # Move to the first record/row, if any exist
            recordset.MoveFirst
            # Grab all records
            @data = recordset.GetRows
        rescue
            @data = []
        end
        recordset.Close
        # An ADO Recordset's GetRows method returns an array
        # of columns, so we'll use the transpose method to
        # convert it to an array of rows
        @data = @data.transpose
    end

    def close
        @connection.Close
    end
end

You can then use this class as follows:


db = SqlServer.new
db.open
db.query("SELECT PLAYER FROM PLAYERS WHERE TEAM = 'REDS';")
field_names = db.fields
players = db.data
db.close

크리에이티브 커먼즈 라이선스
Creative Commons License

'Program > RUBY' 카테고리의 다른 글

Test-First Development for Rails  (0) 2007/08/07
Ajax on Rails  (0) 2007/07/10
Ruby를 이용한 Directory 보는 구문  (0) 2007/05/19
Ruby, ADO 이용한 SQL Server 연결  (0) 2007/05/07
Ruby App. CD-ROM 열기  (0) 2007/05/06
루비(Ruby) 로 초간단 프로그램 작성  (2) 2007/04/29
올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


이 포스팅이 도움이 되었다면 구글에서 관련 정보를 찾아 보세요 ^^


Trackback 0 Comment 0

Trackback : http://i-ruru.com/trackback/17 관련글 쓰기

2007/05/06 19:01

Ruby App. CD-ROM 열기


이하 내용은 구글의 루비 그룹에서 발췌한 내용입니다. ^ ^
CD-ROM을 여는 흥미로운 내용이 있어서 가져와봤네용~
Windows App.를 개발하실 일 있을때 사용하시면 될 것 같습니다.


On May 5, 8:15 pm, "Eder Quiñones" <eder...@gmail.com> wrote: > Hi, anyone knows what is the problem with this function, i believe i did > everything right, but it just does not open the cd-rom, maybe the > problem is in the part "InvokeVerb". Any help would be highly > appreciated. > > def ejectDrives > > @wbem = WIN32OLE.new('WbemScripting.SWbemLocator') > @a = @wbem.ConnectServer > @b = @a.InstancesOf('Win32_LogicalDisk') > cdroms = Array.new > > @b.each do | object | > if object.Description =~ /cd/i > cdroms << object.Name > end > end > > @shell = WIN32OLE.new('Shell.Application') > > cdroms.each do | name | > > @ej1 = @shell.NameSpace(name) > @ej2 = @ej1.Self > @ej3 = @ej2.InvokeVerb("Expu&lsar") > > end > > end > > This is another version using "WMPlayer.OCX" that actually work. > > def ejectDrivesWMP > > @wmp = WIN32OLE.new('WMPlayer.OCX') > > @cdromCol = @wmp.cdromCollection > @cdromCount = @cdromCol.Count > > i = 1 > while i <= @cdromCount > @cdromCol.Item(i - 1).Eject > i += 1 > end > > end > > -- > Posted viahttp://www.ruby-forum.com/. You might try a variation of the following (where D is the CDROM drive)... WIN32OLE.new("Shell.Application").NameSpace(17).ParseName("D:\ \").InvokeVerb("E&ject") ...or perhaps... WIN32OLE.new("Shell.Application").NameSpace(17).ParseName("D:\ \").InvokeVerb("Expu&lsar") David Mullet http://rubyonwindows.blogspot.com
크리에이티브 커먼즈 라이선스
Creative Commons License

'Program > RUBY' 카테고리의 다른 글

Test-First Development for Rails  (0) 2007/08/07
Ajax on Rails  (0) 2007/07/10
Ruby를 이용한 Directory 보는 구문  (0) 2007/05/19
Ruby, ADO 이용한 SQL Server 연결  (0) 2007/05/07
Ruby App. CD-ROM 열기  (0) 2007/05/06
루비(Ruby) 로 초간단 프로그램 작성  (2) 2007/04/29
올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


이 포스팅이 도움이 되었다면 구글에서 관련 정보를 찾아 보세요 ^^


Trackback 0 Comment 0

Trackback : http://i-ruru.com/trackback/16 관련글 쓰기

2007/04/29 21:12

루비(Ruby) 로 초간단 프로그램 작성

너무 간단해서 공부에 도움은 안되지만 -_ -;;
루비로 아직 할줄 아는게 없어서
99단만 한번 짜봤다..


for i in 2..9
    print i, "단\n"
    for j in 1..9
        print i, " * ", j, " = ", i * j, "\n"
    end
    print "\n"
end




역시나 짧은 코드 -_ ;;

'99단.rb' 처럼 파일로 저장한 후
ruby 99단.rb
위 코멘드로 실행해 보자~
크리에이티브 커먼즈 라이선스
Creative Commons License

'Program > RUBY' 카테고리의 다른 글

Test-First Development for Rails  (0) 2007/08/07
Ajax on Rails  (0) 2007/07/10
Ruby를 이용한 Directory 보는 구문  (0) 2007/05/19
Ruby, ADO 이용한 SQL Server 연결  (0) 2007/05/07
Ruby App. CD-ROM 열기  (0) 2007/05/06
루비(Ruby) 로 초간단 프로그램 작성  (2) 2007/04/29
올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


이 포스팅이 도움이 되었다면 구글에서 관련 정보를 찾아 보세요 ^^


Trackback 0 Comment 2

Trackback : http://i-ruru.com/trackback/4 관련글 쓰기

  1. Favicon of http://deuxist.tistory.com/ BlogIcon 백쉰 2007/04/30 07:49 address edit & del reply

    ^^ 좋네용..루비구구단..!

    • Favicon of http://ruru.tistory.com BlogIcon 써니루루 2007/05/01 17:54 address edit & del

      아직 할줄아는게 없어서;;
      간단한 거 밖에 못짜겠네요 ㅠ