- Foster and support the Ruby programming language, it's users, community and ecosystem in New Zealand.
- Advocate for Open Source in general, and the Ruby programming language in particular.
- Provide organisational, financial and legal support for Ruby community events.
- Provide for the safety and welcome inclusion of all people within the Ruby community and Ruby community events regardless of; gender, gender expression, sexuality, marital status, religious belief, ethical belief, colour, race, ethnic or national origin, disability, age, political opinion, employment or family status.
This file contains 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
def bytecode g | |
pos g | |
g.push_rubinius | |
g.create_block block_from_children g | |
g.send_stack_with_block :lambda, 0 | |
g.ret | |
end |
This file contains 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
source 'https://rubygems.org' | |
gem 'oedipus_lex' | |
gem 'rake' | |
gem 'rspec-core' | |
gem 'rspec-mocks' | |
gem 'rspec-expectations' |
This file contains 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
# Our simple example of a Turnstile state machine. | |
class Turnstile | |
def initialize | |
@state = "Locked" | |
end | |
def push! | |
@state = "Locked" if unlocked? | |
end |
This file contains 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
class ApiController < ApplicationController | |
skip_before_action :verify_authenticity_token | |
respond_to :json | |
rescue_from UserAuthenticationService::NotAuthorized, with: :not_authorized | |
rescue_from ActiveRecord::RecordNotFound, with: :not_found | |
before_filter :api_session_token_authenticate! | |
private | |
def signed_in? |
This file contains 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
/* | |
* This is a JS file from a library that our client wanted us to use. It included a dependency on a JS lib called `classie` which is | |
* used for adding and removing HTML classes to elements. The project already includes jQuery. | |
*/ | |
(function() { | |
$(document).ready(function() { |
This file contains 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
source 'https://rubygems.org/' | |
jem <<EOF | |
` ` ` | |
`````````` ` ` ` ` | |
,:::::::::::,,,:;, +,,,,,,,,.#@.`'::,,,,,,,,,,,+'+,,,,,;;:;,....`````````..... ':' `.,` '..,,``` :,,,,,,...,.,,,,,,,,.``...,,,,,,,....,,,,,,,, | |
:::::::::::,,,,' ;,,,,,,,,,;#'`::,,,,,,,,.,:: ':,; ;.````````.......` . `.,: ` #,,`';.``, :,.,,,,,,,,,,,,,,,,,....,,,,,,,,,...,,,,,,,,, | |
:::::::::::::+` .;.,,,,,,,,.;@. '::,,,,,,,,+ ;;`' `,,`,`,; `,``````..........`...' :.,,#.,:.`, ,,,,,,,,,,,,,,,,,,,.,,,,,,,,,,,,...,,,,,,,,, | |
:::::::::::;, +.,,,,,,.....`#@ :,,,,,,,,:+ .: ` #+ ' `.````. .````.............,: `,,,;+..'...` ',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,...,,,,,,,,, | |
::::::::::+ ;,.,,,.........`:@, ',,:,,,,; .```.``'# ` ....````` .```..... |
This file contains 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
m = Module.new { def a; :a; end } | |
# => #<Module:0x3cbea6af> | |
method = m.instance_method :a | |
# => #<UnboundMethod: #<Module:0x3cbea6af>#a> | |
o = Object.new | |
# => #<Object:0x590bcaf1> | |
o.define_singleton_method :a, method | |
# TypeError: bind argument must be an instance of #<Module:0x3cbea6af> | |
# from org/jruby/RubyModule.java:1521:in `define_method' | |
# from org/jruby/RubyKernel.java:1491:in `define_singleton_method' |
This file contains 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
# For example: | |
App.Adapter = Ep.RestAdapter.extend | |
namespace: '/api/v1/' | |
routes: | |
# some magic DSL. |