ThoughtWorks アンソロジーの 10章 Ant ビルドファイルのリファクタリング p154 の項目抜き出し
- macrodef の抽出
- ターゲットの抽出
- 宣言の導入
- 依存による call の置き換え
- filtersfile の導入
- プロパティファイルの導入
| # coding: utf-8 | |
| require 'cinch' | |
| def unko | |
| "💩" | |
| end | |
| def shit | |
| unko | |
| end |
ThoughtWorks アンソロジーの 10章 Ant ビルドファイルのリファクタリング p154 の項目抜き出し
| _module_ 'App.Main', -> | |
| class @MainContext extends Base.Context | |
| startup: -> | |
| @commandMap.when(@startupDone).then(App.Main.SayHelloCommand) | |
| shutdown: -> |
| package | |
| { | |
| import flash.display.Sprite; | |
| public class Main extends Sprite | |
| { | |
| public function Main() | |
| { | |
| trace(int(new Foo).valueOf()); //=> 123 | |
| } |
| var object:* = new Object; | |
| var foo:int = object; | |
| trace(foo); //=> 0 |
| % elixir main.exs | |
| > unused_x_variableain.exs:4: variable x is unused | |
| > foo |
| module.exports = (grunt) -> | |
| grunt.loadNpmTasks 'grunt-exec' | |
| grunt.initConfig | |
| exec: | |
| rustrun: | |
| command: 'rust run main.rs' | |
| grunt.registerTask 'default', ['exec:rustrun'] |
| #!/usr/bin/env ruby | |
| require 'carrier-pigeon' | |
| require 'json' | |
| require 'pp' | |
| command = <<EOS | |
| ssh gerrit.example.com gerrit stream-events | |
| EOS | |
| IO.popen(command, 'r+') do |io| |
| ssh gerrit.example.com -p 29418 gerrit stream-events | jq '.|select(.type == "comment-added")|{comment, url: .change.url}|.[]' --raw-output | ruby -e "require 'carrier-pigeon'; loop { message = STDIN.gets; if message then CarrierPigeon.send(uri: 'irc://gerrit:[email protected]/#gerrit', message: message, ssl:true, notice:true, join:true) ; p message ;end }" |
| button { | |
| label { | |
| position: 0 0; | |
| } | |
| image-view { | |
| position: 0 0; | |
| } | |
| } |