all repos — h3rald @ 6ed04d62656d222df819ecfd406a5afb3166d316

The sources of https://h3rald.com

content/articles/rawline-020.textile

 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
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
----- 
permalink: rawline-020
filters_pre: 
- redcloth
title: "New Release: RawLine 0.2.0"
comments: 
- :date: 
  :author: Magrabi
  :url: http://magrabi.wordpress.com
  :id: 2645
  :body: "congratulation ,\n\
    i wanna to ask you how can you write big applicaion like this project in ruby ,\n\
    iam beginner in ruby , can you tell me some bit about your begin in programming ??\n\
    thanx "
- :date: 
  :author: Fabio Cevasco
  :url: http://www.h3rald.com
  :id: 2650
  :body: "@Magrabi: First of all, RawLine is a _tiny_ project, it's actually a really small library! If you want to learn more about programming in Ruby, start from the \"official Ruby web site\":http://www.ruby-lang.org, follow the 20-minute tutorial, and then experiment yourself!"
- :date: 
  :author: Magrabi
  :url: http://magrabi.wordpress.com
  :id: 2654
  :body: |
    thnx dude but i already write scripts in ruby to do small things ,
    i wanna to ask about your journey in programming in all ,
    as you mentioned in the 10 things to learn ruby you say that you begin in school then you learn another languages in collage , how much time you spent to be good at programming ??

- :date: 
  :author: Fabio Cevasco
  :url: http://www.h3rald.com
  :id: 2656
  :body: |-
    It takes years and a lot of dedication to become a good programmer. I was good at high school and at uni, even if we did just a few exams on C++ and my thesis in Java. 
    
    Then, when I started looking for work, I choose to become a Technical Writer pursuing a wonderful opportunity which turned out to be the best thing to do. I am now a Technical Leader and I write/coordinate technical documentation, and I'm programming just in my spare time :-)
    
    It doesn't matter how long it takes, you just have to love learning new things, always. (btw, I'm trying to learn a bit of Haskell too!)
- :date: 
  :author: Magrabi
  :url: http://magrabi.wordpress.com
  :id: 2657
  :body: |-
    thnx Mr.Fabio ,
    your feeds is now readed by My Google Reader :D
date: 2008-04-02 05:33:00 +02:00
tags: 
- ruby
- programming
- opensource
- rawline
type: article
toc: true
-----
-InLine- RawLine 0.2.0 is out!

*Raw*Line is the new name for InLine, in case you didn't guess. The name was changed to avoid name collision problems with the RubyInline project.

Here's what's new:

* Added /examples and /test directory to gem.
* Escape codes can now be used in prompt.
* It is now possible to use bind(key, &block) with a String as key, even if the corresponding escape sequence is not defined.
* Added Editor#write_line(string) to print a any string (and "hit return").
* Library name changed to "RawLine" to avoid name collision issues (Bug "18879":http://rubyforge.org/tracker/?func=detail&aid=18879&group_id=5622&atid=21788).
* Provided alternative implementation for left and right arrows if terminal
supports escape sequences (on Windows, it requires the Win32Console gem).

In particular, I decided to provide an "optimized implementation" for the left and right arrows using escape sequences rather than shameful hacks. This is now possible because the Win32Console gem now enables ANSI escape sequences on Windows as well (weehee!). 

So:

* If you're on <notextile>*nix</notextile> all good, your terminal is smart and can understand escape sequences => the new implementation will be used.
* If you're on Windows and you installed Win32Console, your termnal is smart and can understand escape sequences => the new implementation will be used.
* If you're on Windows and you didn't install Win32Console, then your terminal is stupid and it doesn't understand escape sequences, so the old implementation will be used.

The new implementation is significantly faster than the old one, on Windows at least, and the cursor now blinks properly when left or right arrows are pressed.

I re-emplemented only cursor movement because I'm still having some problems in getting the delete/insert escapes to work properly (or better: how I want them to work!).