{"id":9173,"date":"2013-04-09T18:49:54","date_gmt":"2013-04-09T09:49:54","guid":{"rendered":"http:\/\/www.softantenna.com\/wp\/?p=9173"},"modified":"2013-04-09T18:50:32","modified_gmt":"2013-04-09T09:50:32","slug":"decaf","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/decaf\/","title":{"rendered":"JavaScript\u306e\u304b\u308f\u308a\u306bRuby\u304c\u57cb\u3081\u8fbc\u307e\u308c\u305f\u30d6\u30e9\u30a6\u30b6\u300cDecaf\u300d"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2013\/04\/blogDecaf.png\" alt=\"Decaf\" title=\"Decaf.png\" border=\"0\" width=\"560\" height=\"403\" \/><\/p>\n<p>Web\u30d6\u30e9\u30a6\u30b6\u7d44\u307f\u8fbc\u307f\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u8a00\u8a9e\u3068\u3044\u3048\u3070JavaScript\u304c\u666e\u901a\u3067\u3059\u304c\u3001\u300c<a href=\"http:\/\/trydecaf.org\/\">Decaf<\/a>\u300d\u306b\u306f\u3001\u306a\u3093\u3068<strong>Ruby<\/strong>\u304c\u57cb\u3081\u8fbc\u307e\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>WebKit\u30d9\u30fc\u30b9\u306e\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30d6\u30e9\u30a6\u30b6\u3067\u3001DOM\u306e\u64cd\u4f5c\u306a\u3069\u3001\u901a\u5e38JavaScript\u3067\u3084\u308b\u3088\u3046\u306a\u3053\u3068\u3092\u3001Ruby\u8a00\u8a9e\u3067\u3067\u304d\u3066\u3057\u307e\u3046\u306e\u3067\u3059\u3002<!--more--><\/p>\n<h3>\u8a66\u3057\u3066\u307f\u3088\u3046<\/h3>\n<p>Mac OS X 10.8\u7528\u306e\u30d0\u30a4\u30ca\u30ea\u304c\u5bb9\u6613\u3055\u308c\u3066\u3044\u307e\u3059\u306e\u3067\u3001Mac\u30e6\u30fc\u30b6\u30fc\u306a\u3089\u7c21\u5358\u306b\u8a66\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2013\/04\/blogDecaf-1.png\" alt=\"Decaf 1\" title=\"Decaf-1.png\" border=\"0\" width=\"531\" height=\"343\" \/><\/p>\n<p>Decaf-0.1.dmg\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3001Decaf\u3092Applications\u306b\u30b3\u30d4\u30fc\u3059\u308b\u3060\u3051\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2013\/04\/blogDecaf-_-Sample-Usage.png\" alt=\"Decaf  Sample Usage\" title=\"Decaf _ Sample Usage.png\" border=\"0\" width=\"560\" height=\"478\" \/><\/p>\n<p>\u8a66\u3057\u306b<a href=\"http:\/\/trydecaf.org\/sample\/\">\u30b5\u30f3\u30d7\u30eb\u30da\u30fc\u30b8<\/a>\u3092\u8868\u793a\u3057\u3066\u307f\u307e\u3057\u305f\u3002\u300c<strong>This page was built using Ruby script\u2026<\/strong>\u300d\u306e\u90e8\u5206\u306f\u3001\u5b9f\u969b\u4ee5\u4e0b\u306eRuby\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u3063\u3066\u51fa\u529b\u3055\u308c\u3066\u3044\u308b\u90e8\u5206\u3067\u3059\u3002<\/p>\n<pre><code class=\"ruby\">def add_content\n      # Add a container for our content.\n    content_container = document.create_element('div')\n    content_container.class_list.add('sample-content')\n    @container.append_child(content_container)\n \n    logo_frame = document.create_element('iframe')\n    logo_frame.src = '..\/logo.html'\n    logo_frame.class_list.add('logo-frame')\n    @container.append_child(logo_frame);\n    \n    lines = ['This page was built using a Ruby script.',\n             'View the source below and play with the inspector.']\n    lines.each do |line|\n      line_element = document.create_element('p')\n      line_element.inner_html = line\n      line_element.class_list.add('sample-line')\n      @container.append_child(line_element)\n    end\n  end\n\n<\/code><\/pre>\n<p>\u30a4\u30f3\u30b9\u30da\u30af\u30bf\u30fc\u3067DOM\u306e\u64cd\u4f5c\u3082\u3067\u304d\u307e\u3059(\u3082\u3061\u308d\u3093Ruby\u3067)\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2013\/04\/blogDecaf-_-Sample-Usage-1.png\" alt=\"Decaf  Sample Usage 1\" title=\"Decaf _ Sample Usage-1.png\" border=\"0\" width=\"560\" height=\"478\" \/><\/p>\n<p>Hello World\u3082\u3053\u3093\u306a\u611f\u3058\u3067\u3002<\/p>\n<pre><code class=\"ruby\">window.onload do\n        introduction = document.create_element('p')\n        introduction.inner_text = 'Hello, world!'\n        document.body.append_child(introduction)\n    end\n<\/code><\/pre>\n<p>\u5b9f\u969b\u306bJavaScript\u306b\u3068\u3063\u3066\u304b\u308f\u308b\u306e\u306f\u96e3\u3057\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u5b9f\u9a13\u7684\u306a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3068\u3057\u3066\u306f\u304a\u3082\u3057\u308d\u3044\u3067\u3059\u306d\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u540c\u3058\u30da\u30fc\u30b8\u3092Chrome\u3067\u8868\u793a\u3057\u3066\u307f\u308b\u3068\u3001\u300cSomething went wrong\u300d\u3068\u8868\u793a\u3055\u308c\u307e\u3059(\u3042\u305f\u308a\u307e\u3048\u304b)\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2013\/04\/blogDecaf-_-Sample-Usage-2.png\" alt=\"Decaf  Sample Usage 2\" title=\"Decaf _ Sample Usage-2.png\" border=\"0\" width=\"560\" height=\"224\" \/><\/p>\n<p>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f<a href=\"https:\/\/github.com\/timahoney\/decaf\">Github<\/a>\u3088\u308a\u5165\u624b\u51fa\u6765\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Web\u30d6\u30e9\u30a6\u30b6\u7d44\u307f\u8fbc\u307f\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u8a00\u8a9e\u3068\u3044\u3048\u3070JavaScript\u304c\u666e\u901a\u3067\u3059\u304c\u3001\u300cDecaf\u300d\u306b\u306f\u3001\u306a\u3093\u3068Ruby\u304c\u57cb\u3081\u8fbc\u307e\u308c\u3066\u3044\u307e\u3059\u3002 WebKit\u30d9\u30fc\u30b9\u306e\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30d6\u30e9\u30a6\u30b6\u3067\u3001DOM\u306e\u64cd\u4f5c\u306a\u3069\u3001\u901a\u5e38JavaScr [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":9168,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[75],"tags":[745,154,725],"class_list":["post-9173","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-decaf","tag-ruby","tag-webkit"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/9173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=9173"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/9173\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/9168"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=9173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=9173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=9173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}