zed.0xff.me

Advanced Ruby: percent-literals

most used %-literals:

% code result description
%q %q(all `quotes` 'are' "ok") "all `quotes` 'are' \"ok\"" creates String
%r %r(i_am/a/regexp) /i_am\/a\/regexp/ creates Regexp
%w %w(abc def ghi) ["abc", "def", "ghi"] splits string into Array
%x %x(ls -a /tmp) ".\n..\nfile1\nfile2\n" alias of `cmd`

highlighted

1
2
3
4
5
6
7
%q(all `quotes` 'are' "ok") => "all `quotes` 'are' \"ok\""

%r(i_am/a/regexp)           => /i_am\/a\/regexp/

%w(abc def ghi)             => ["abc", "def", "ghi"]

%x(ls -a /tmp)              => ".\n..\nfile1\nfile2\n"

interpolation

1
2
3
4
5
6
7
8
9
10
11
# lowercase 'w': as-is
%w'a #{2+2} b' => ["a", "\#{2+2}", "b"] 

# uppercase 'W': interpolate
%W'a #{2+2} b' => ["a", "4", "b"] 

# lowercase 'q': as-is
%q'a #{2+2} b' => "a \#{2+2} b" 

# uppercase 'Q': interpolate
%Q'a #{2+2} b' => "a 4 b" 

other %-literals

1
2
3
4
5
6
7
8
# %s: convert to symbol
%s'foo' => :foo 

# %i: convert to array of symbols - not released yet, will be in Ruby 2.0 ?
%i'foo bar baz' => [:foo, :bar, :baz]

# '%' w/o any letter - alias for %Q
%'a #{2+2} b' => "a 4 b"
  1. Gravatar DorisVeibe says:

    Absolutely NEW update of SEO/SMM package "XRumer 16.0 + XEvil 3.0":
    captchas regignizing of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another categories of captcha,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other software.

    Interested? You can find a lot of impessive videos about XEvil in YouTube.
    Good luck ;)


    XRumer201707

  2. Gravatar DorisVeibe says:

    Revolutional update of SEO/SMM software "XRumer 16.0 + XEvil":
    captcha recognition of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another categories of captcha,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other programms.

    Interested? You can find a lot of introducing videos about XEvil in YouTube.
    Good luck!


    XRumer201707

  3. Gravatar DorothyPlaum says:

    Absolutely NEW update of SEO/SMM package "XRumer 16.0 + XEvil":
    captcha solution of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another size-types of captchas,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other software.

    Interested? There are a lot of demo videos about XEvil in YouTube.
    Good luck ;)


    XRumer20170717

  4. Gravatar DorothyPlaum says:

    Absolutely NEW update of SEO/SMM package "XRumer 16.0 + XEvil 3.0":
    captcha solution of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another size-types of captcha,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM programms: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other programms.

    Interested? There are a lot of impessive videos about XEvil in YouTube.
    See you later ;)


    XRumer20170718

  5. Gravatar DorothyPlaum says:

    Revolutional update of SEO/SMM software "XRumer 16.0 + XEvil 3.0":
    captcha regignizing of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another size-types of captchas,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other programms.

    Interested? There are a lot of introducing videos about XEvil in YouTube.
    See you later ;)


    XRumer20170718

  6. Gravatar lolaVienome says:

    Тут посмотрела 3 и 4 серию, ЭМОЦИЙ ВАГОН ПРОСТО.

    <a href="http://tiod.ru/trejlery/igra-prestolov.html">Игра Престолов 7 сезон </a>

    p.s Жаль 5 серии еще нет обещали завтра!

  7. Gravatar lolaVienome says:

    Тут посмотрела 3 и 4 серию, ЭМОЦИЙ ВАГОН ПРОСТО.

    <a href="http://tiod.ru/trejlery/igra-prestolov.html">Игра Престолов 7 сезон </a>

    p.s Жаль 5 серии еще нет обещали завтра!

  8. Gravatar lolaVienome says:

    Тут посмотрела 3 и 4 серию, ЭМОЦИЙ ВАГОН ПРОСТО.

    <a href="http://tiod.ru/trejlery/igra-prestolov.html">Игра Престолов 7 сезон </a>

    p.s Жаль 5 серии еще нет обещали завтра!

  9. Gravatar ArleneZer says:

    Absolutely NEW update of SEO/SMM software "XRumer 16.0 + XEvil":
    captcha solution of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another types of captchas,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other software.

    Interested? You can find a lot of impessive videos about XEvil in YouTube.
    See you later ;)


    XRumer20170721

  10. Gravatar ArleneZer says:

    Revolutional update of SEO/SMM software "XRumer 16.0 + XEvil 3.0":
    captcha breaking of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another types of captchas,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other programms.

    Interested? You can find a lot of introducing videos about XEvil in YouTube.
    Good luck!


    XRumer20170721

  11. Gravatar ArleneZer says:

    Revolutional update of SEO/SMM package "XRumer 16.0 + XEvil":
    captchas solution of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another types of captcha,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other software.

    Interested? You can find a lot of introducing videos about XEvil in YouTube.
    See you later!


    XRumer20170721

  12. Gravatar ArleneZer says:

    Revolutional update of SEO/SMM package "XRumer 16.0 + XEvil":
    captcha solving of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another categories of captchas,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other software.

    Interested? There are a lot of introducing videos about XEvil in YouTube.
    Good luck ;)


    XRumer20170721

  13. Gravatar ArleneZer says:

    Absolutely NEW update of SEO/SMM software "XRumer 16.0 + XEvil 3.0":
    captcha recognition of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another size-types of captcha,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other software.

    Interested? There are a lot of introducing videos about XEvil in YouTube.
    See you later ;)


    XRumer20170721

  14. Gravatar FlossieLef says:

    Absolutely NEW update of SEO/SMM package "XRumer 16.0 + XEvil":
    captchas regignizing of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another subtypes of captchas,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other software.

    Interested? There are a lot of introducing videos about XEvil in YouTube.
    See you later!


    XRumer20170725

  15. Gravatar FlossieLef says:

    Absolutely NEW update of SEO/SMM software "XRumer 16.0 + XEvil":
    captcha solving of Google, Facebook, Bing, Hotmail, SolveMedia, Yandex,
    and more than 8400 another subtypes of captchas,
    with highest precision (80..100%) and highest speed (100 img per second).
    You can connect XEvil 3.0 to all most popular SEO/SMM software: XRumer, GSA SER, ZennoPoster, Srapebox, Senuke, and more than 100 of other programms.

    Interested? There are a lot of demo videos about XEvil in YouTube.
    See you later!


    XRumer20170725

Post a comment


(lesstile enabled - surround code blocks with ---)