블로그 이미지
언제나 늘 푸른 소나무처럼. 자신의 의지로 오롯이 서기
예섬수진

공지사항

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함

calendar

1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

메타블로그 가입

2010. 1. 7. 23:20 | Posted by 예섬수진

1. 믹시(http://mixsh.com/) : 블로그 관리 > 내 블로그 등록
    - 인증 : IjxzNy-i8yhMZVnXNzSuXqh-9xcIXSwZO3i2_Q8KNFQ,

2. 올블로그(http://www.allblog.net/) : 마이올블로그 > 내 블로그 관리

3. 레뷰(http://www.revu.co.kr/) : 마이레뷰 > 블러그 관리 > 블로그/리뷰 등록 > 블로그추가
  - 인증 : 7942FB1A7DF244228F8A2568DC140691

4. 한RSS(http://www.hanrss.com/) : RSS 추가


        For i = 0 To TCGenDialog.lbEnum.ListCount + 1
            If TCGenDialog.lbEnum.Selected(i) = True Then ' 선택한 라인 찾기
                TCGenDialog.tbParameterValues.value = TCGenDialog.lbEnum.List(i, 1)   ' 0부터 시작히므로 2번째 컬럼은 1이 됨
                GoTo Update ' break가 안되므로 GoTo 문을 이용
            End If
        Next

        Update: 

'컴퓨터 > 기타' 카테고리의 다른 글

네이버 검색 등록  (0) 2010.01.09
메타블로그 가입  (0) 2010.01.07
Rails]Rails를 이용한 DB Table 생성(sqlite3)  (0) 2009.12.14
Ant]pass parameter  (0) 2009.12.12
rails를 이용한 Web Application 만들기  (0) 2009.12.06

Rails]Rails를 이용한 DB Table 생성(sqlite3)

2009. 12. 14. 23:25 | Posted by 예섬수진
rails web으로 기본 골격 생성

cd web
rake db:create로 DB 생성

ruby script/generate model build_info build_type:string model_name:string build_time:string rom_file:string 로 model 생성
  ※ model을 이용하면 DB의 CRUD를 할 수 있음
  ※ 나는 model 이름을 build_info라고 하였으나, 실제 모델 이름은 BuildInfo 임
       - web\app\models\build_info.rb
class BuildInfo < ActiveRecord::Base
            end

rake db:migrate DB에서 적용안된 내용을 적용하기 위함

생성된 table 이름 확인
  - web\db\schema.db에 가면, build_infos로 테이블이 생성된 것을 확인할 수 있음
       create_table "build_infos", :force => true do |t|
         t.string   "build_type"
         t.string   "model_name"
         t.string   "build_time"
         t.string   "rom_file"
         t.datetime "created_at"
         t.datetime "updated_at"
       end

Mapping
   - web\config\routes.rb에서 다음 라인을 2째 줄에 추가함
       map.resources :build_infos

ruby script/generate controller build_info add get를 이용하여 Controller 생성
   1. web\app\controllers\build_info_controller.rb 수정
       class BuildInfoController < ApplicationController
          def add
             @build_type = params['build_type']
             @model_name = params['name']
             @build_time = params['started_at']
             @rom_file = params['rom_file']
             BuildInfo.create(:build_type => @build_type, :model_name => @model_name, :build_time => @build_time, :rom_file => @rom_file)
 
             @build_infos = BuildInfo.all
             respond_to do |format|
                 format.html # add.html.erb
                 format.xml  { render :xml => @build_infos }
             end
          end

          def get
              @build_infos = BuildInfo.all
              respond_to do |format|
                   format.html # get.html.erb
                   format.xml  { render :xml => @build_infos }
              end
           end
        end

    2. web\app\views\build_info의 add.html.erb/get.html.erb를 아래와 같이 수정함
        <h1>Listing build_info</h1>
        <table>
              <% @build_infos.each do |build_info| %>
                <tr>
                     <td><%=h build_info.build_type %></td>
                     <td><%=h build_info.model_name %></td>
                     <td><%=h build_info.build_time %></td>
                     <td><%=h build_info.rom_file %></td>
                </tr>
              <% end %>
         </table>

웹서버 실행을 ruby script/server를 실행함

DB Table에 해당 Record가 삽입되었는지 확인하려면, 주소창에 다음을 입력함
http://localhost:3000/build_info/add?build_type=target&name=BlueMT&started_at=091214_12000&rom_file=kernrom 


Ant]pass parameter

2009. 12. 12. 14:18 | Posted by 예섬수진
in cmd prompt
     ant -buildfile build_xxx.xml -Dparam_name1=param_value1 -Dparam_name2=param_value2

in build_xxx.xml
     ${param_value1} ${param_value2}

rails를 이용한 Web Application 만들기

2009. 12. 6. 16:40 | Posted by 예섬수진

1. rails를 이용한 기본 프로젝트 생성
rails blog

2. SQLite3 설치 (on Win32)
  1) cd blog (in cmd prompt)

  2) http://www.sqlite.org/download.html 에서 Precompiled Binaries For Windows에서 sqlitedll.zip Download. 
 
  3) 압축 해제 후, 2개의 파일(def, dll)을 ruby 설치 폴더\bin이나 c:\Windows\System32에 복사함
     ※ http://www.skorks.com/2009/08/installing-and-using-sqlite-with-ruby-on-windows/

  4) gem install sqlite3-ruby --include-dependencies

3. blog 프로젝트를 위한 DB 생성
   - cd blog
   - rake db:create

4. "Hello, Worlds" 출력
    1) ruby script/generate controller home index

    2) blog 폴더 내 app\views\home\index.html.erb 파일에서 내용을 지우고 다음과 같이 적임
      <h1>hello, world</h1>

    3) Web Server의 실행을 위해, 다음을 입력함
        ruby script/server

    4) In Web browser, 주소창에 http://localhost:3000/home/index를 입력하면 "hello, world"가 보임

5. Default Page 대신 "hello, world" Page 보여 주기
    1) rm public/index.html

    2) Open config\routes.rb using a edit program, write following 1st line
      map.root :controller => "home"
      map.connect ':controller/:action/:id'
      map.connect ':controller/:action/:id.:format'

      * routes.rb : tells Rails how to connect incoming request to controllers and actions.

    3) In web-browser, 주소창에 http://localhost:3000를 입력하면 "hello, world"가 보임



 

Mongrel 설치 & 실행 on Win32

2009. 12. 5. 16:37 | Posted by 예섬수진
1. Ruby 설치 (V1.8.6)
  ※ Ruby 설치 버젼 확인 : ruby -v

2. RubyGem Update 
   1) RubyForge에서 최신 RubyGem 압축 파일(.zip)을 받음
   2) 로컬에서 압축을 푼 후, cmd prompt에서 그 압축 폴더로 이동함
   3) ruby setup.rb를 입력함

  ※ 또는 cmd propt에서 gem update --system을 입력함

3. Rails 설치
    gem install rails --include-dependencies

4. Mongrel 설치
    gem install mongrel --include-dependencies
    gem install mongrel_service --include-dependencies
    gem install win32-service --include-dependencies

5. Mongrel 설치 확인
    mongrel_rails start -h

6. Rails를 이용한 Web Application 작성
   http://www.advanceecomsolutions.com/resources/developing_web_applications_using_Ruby_on_Rails_framework.asp
   rails web_application_name

7. Mongrel을 이용한 Web Server 실행
   web_application_foloder]mongrel_rails start -p port_num -a host_ip
    ※ Web Server 실행 확인 : http://host_ip:port_num
 
이전 1 2 다음