:note

Ruby

jsとrubyで構文解析

構文解析 polygonplanet/Chiffon A very small ECMAScript parser, tokenizer and minify written in JavaScript. var Chiffon = require('chiffon'); var code = "#target 'InDesign'\nvar doc = app.documents[0];\nvar foo=1;\t\tif (foo === 0){ doc.textFrames.add() }"; var tokens = Chiffon.tokenize(code); console.log(tokens); var unto = Chiffon.untokenize ( tokens ); console.log(unto); var minim = Chiffon.minify(code); console.log(minim); // % node index.js // [ { type: 'Identifier', value: '#target' }, // { type: 'String', value: '\'InDesign\''

middleman-syntaxでrougeがwarningだす

middleman-blog を bundle update したら rouge がwarningを出すようになった % be middleman == The Middleman is loading /Users/milligramme/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/rouge-1.9.1/lib/rouge/lexers/shell.rb:20: warning: already initialized constant Rouge::Lexers::Shell::KEYWORDS /Users/milligramme/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/rouge-1.9.1/lib/rouge/lexers/shell.rb:20: warning: previous definition of KEYWORDS was here /Users/milligramme/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/rouge-1.9.1/lib/rouge/lexers/shell.rb:25: warning: already initialized constant Rouge::Lexers::Shell::BUILTINS /Users/milligramme/.rbenv/versions/2.0.0-p576/lib/ruby/gems/2.0.0/gems/rouge-1.9.1/lib/rouge/lexers/shell.rb:25: warning: previous definition of BUILTINS was here middleman-syntax でrequire

rubyXLでxlsxの編集生成

rubyで xls, xlsx の編集、新規作成するとき、内容によってgemを zdavatz/spreadsheet -> xlsの読み込み、xlsの書き出し randym/axlsx -> xlsxの読み込みはできない、xlsx

back to top