in /opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh
Replace bundle with bundle exec at line 13
in /opt/elasticbeanstalk/hooks/appdeploy/pre/10_bundle_install.sh
| class Node | |
| attr_accessor :value, :next_node, :previous_node | |
| def initialize(value, next_node, previous_node) | |
| @value = value | |
| @next_node = next_node | |
| @previous_node = previous_node | |
| end | |
| end |
| class Node | |
| attr_accessor :value, :next_node, :previous_node | |
| def initialize(value, next_node, previous_node) | |
| @value = value | |
| @next_node = next_node | |
| @previous_node = previous_node | |
| end | |
| end |
| require "net/http" | |
| require "uri" | |
| module Net | |
| class HTTP | |
| alias old_initialize initialize | |
| def initialize(*args) | |
| old_initialize(*args) | |
| @open_timeout = @read_timeout = 1 # 1 second |
| #!/usr/bin/env ruby | |
| # Usage: | |
| # $ curl http://date.jsontest.com | ./debug_json.rb | |
| r = $stdin.dup | |
| input = r.read | |
| $stdin.reopen("/dev/tty") | |
| require 'json' | |
| require 'recursive-open-struct' | |
| require 'awesome_print' |
| class Dog | |
| age: -> | |
| @human_age * 7.002 | |
| my_dog = new Dog() | |
| my_dog.human_age = 4.5 | |
| my_dog.name = "Stewie" | |
| my_dog.greeting = -> | |
| "Woof! I'm #{this.name}" |
| # assumes UserAgent gem is available | |
| # https://rubygems.org/gems/useragent | |
| class ApplicationController < ActionController::Base | |
| # blacklist recognized browser with lower versions than those below | |
| Browser = Struct.new(:browser, :version) | |
| BROWSERS = [ | |
| Browser.new("Chrome", "3.0"), | |
| Browser.new("Firefox", "3.0"), |
| source 'https://rubygems.org' | |
| # bundle from git and the ext/ directory in the gem is not found in the require path | |
| gem 'rbtagger', :git => "git://github.com/taf2/rb-brill-tagger.git" | |
| # bundling from rubygems or local path works, however | |
| # gem 'rbtagger' | |
| # or | |
| # gem 'rbtagger', :path => "~/play/rb-brill-tagger" |
| require 'benchmark' | |
| array = (0..10000000).to_a | |
| benchmark = Benchmark.bm(10) do |x| | |
| x.report("Ruby 2.0: ") do | |
| 100000.times { array.bsearch { |e| 7777777 <=> e } } | |
| end | |
| require 'bsearch' | |
| x.report("bsearch gem:") do |
Gabe Kopley