- day 1 : Ruby 입문
- Ruby 기초
- 랜덤 함수 : sample.rb
- Ruby 활용 Scraping : Nokogiri, HTTParty
- create file & rename file : File.open, File.rename
- Ruby 기초
- day 2 : Sinatra 입문
- Sinatra : http://www.sinatrarb.com/intro-ko.html
- Sinatra 활용
- 점심 메뉴 추천 : hash
- 로또 번호 추천
- op.gg 스크래핑 : Nokogiri, HTTParty, logging(csv, http://ruby-doc.org/stdlib-2.0.0/libdoc/csv/rdoc/CSV.html)
- 서버 : Heroku
- day 3 :
- rails CRUD
- rails 맛보기
- routing(routes.rb)
- controller 생성(
rails g controller post
) : app/controllers/post_controller.rb - model 생성(
rails g model post
) : app/modles/post.rb, db/migrate/20171108022640_create_posts.rb, db/schema.rb- rails_db : https://github.com/igorkasyanchuk/rails_db
- Active Record
- ex) Post.all, Post.first, Post.last ..
- primary key를 정수값으로 자동 생성 : id
- Create : create 1) CSV 2) ORM(데이터베이스를 사용했지만 사용하지 않은 것 처럼) : create
- Read : show
- destroy : destory
- update : modify, update
- Bootstrap을 이용한 CSS 맛보기
- rails 맛보기
- Ruby Test
- block
- Unit Test(잘 모르겠다)
- calculator.rb
- calculator_test.rb
- RSpec : http://rspec.info/
- rails CRUD
- day 4 :
- rspec
- 설치 : gem install rspec
require 'rspec'
- 실행 : rspec intro_spec.rb
- ruby_intro
- reduce(:+) array의 원소를 더하면서 압축 : https://ruby-doc.org/core-2.1.0/Enumerable.html
- %w, %q : https://simpleror.wordpress.com/2009/03/15/q-q-w-w-x-r-s/
- .include? : https://apidock.com/ruby/String/include%3F
- 정규 표현식
- rails signUp
- user list
- user create : 암호화(md5, 이제 뚫을 수 있다. 테스트에서만 사용할 것)
- MD5 Decrypter가 존재
- user modify
- user destroy
- login
- session :
session['key']
- session :
- rspec
- day 5:
- rails lotto
- cf : http://konkuk.likelion.org/challenge-w3-lotto
- lotto/index : 추천 버튼
- lotto/show :
arr.sample(6)
- lotto/api
- lotto API : http://www.nlotto.co.kr/common.do?method=getLottoNumber&drwNo=
- JSON 파싱
require 'httparty' require 'json' response = HTTParty.get(uri) info = JSON.parse(response.body)
arr1 = [1, 2, 3, 4] arr2 = [1, 5, 4, 2] arr1 & arr2 #=> [1, 2, 4]
- ASCII art
-
artii : https://github.com/miketierney/artii
- gem 'artii'
require 'artii' a = Artii::Base.new(font:'사용할 폰트') a.asciify('바꿔줄 문자열')
-
개발을 위해 필요한 Gem
- gem 'rails_db'
- gem 'pry-rails' : https://github.com/rweng/pry-rails
- gem 'awesome_print'
-
- rails-asked
- question : 질문을 받는 페이지와 보여주는 페이지(작성자를 입력안할 경우 익명으로 DB에 입력)
- sign-up
- login/logout
- rails lotto