This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env ruby | |
| # encoding: utf-8 | |
| # | |
| # Script to export the scripts inside the Scripts.rvdata2 data file to Data/exported_scripts as plain text Ruby files. | |
| # If you run this script from inside RPG Maker VX Ace, I would suggest creating the Data/exported_scripts folder yourself | |
| # as RGSS3 doesn't seem to support requiring FileUtils. | |
| # Based on HIRATA Yasuyuki / 平田 泰行's rvdata2_dump.rb script: https://gist.github.com/hirataya/1853033 | |
| begin | |
| require 'fileutils' | |
| rescue LoadError |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Bob = function() { | |
| this.hey = function(message) { | |
| if (this.isSilence(message)) { | |
| return "Fine, be that way."; | |
| } else if (this.isShouting(message)) { | |
| return "Woah, chill out!"; | |
| } else if (this.isAQuestion(message)) { | |
| return "Sure"; | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function() { | |
| var AppView = Backbone.View.extend({ | |
| el: $("#bobForm"), | |
| events: { | |
| "submit" : "askBob" | |
| }, | |
| initialize: function() { | |
| console.log("initializing bob app view"); | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BobController = function(button,inputText,output,outputTemplate) { | |
| console.log("Setting up the Bob Controller"); | |
| this.button = $(button); | |
| this.input = $(inputText); | |
| this.output = $(output); | |
| this.outputTemplate = $(outputTemplate); | |
| this.getStatement = function() { | |
| return this.input.val(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| _ = require('./underscore'); | |
| Scrabble = { | |
| score : function(word) { | |
| word = word || ""; | |
| var currentScore = 0; | |
| var characters = _(word.split("")); | |
| var totalScores = characters.map(function(letter) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require('./scrabble'); | |
| describe('Scrabble', function() { | |
| it("scores an empty word as zero",function() { | |
| var score = Scrabble.score(""); | |
| expect(score).toEqual(0); | |
| }); | |
| it("scores a null as zero",function() { | |
| var score = Scrabble.score(null); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BobController = function(button,inputText,output) { | |
| console.log("Setting up the Bob Controller"); | |
| this.button = $(button); | |
| this.input = $(inputText); | |
| this.output = $(output); | |
| var that = this; | |
| this.getStatement = function() { | |
| return this.input.val(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(function() { | |
| DoodlePanel = { | |
| toggle: function() { | |
| if (! this.exists()) { | |
| this.create(); | |
| } else { | |
| $(".doodle-popover").toggle(); | |
| } | |
| }, | |
| exists: function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server "runtalk", :primary | |
| default_run_options[:shell] = '/bin/bash' | |
| # role :web, "digital" | |
| # role :chat, "digital" | |
| # role :api, "digital" | |
| desc "echo" | |
| task :echo do |