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 "yaml/store" | |
| db = YAML::Store.new("db.yml") | |
| email = "james@graysoftinc.com" | |
| db.transaction do | |
| db[email] = [ ] | |
| end | |
| db.transaction do |
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
| module Extensions | |
| module_function | |
| def separate(path) | |
| extensions = path.reverse | |
| .scan(/\G\w+\./) | |
| .map { |e| e[0..-2].reverse } | |
| .reverse | |
| file_name = path.split(".")[0..-(extensions.size + 1)].join(".") | |
| [file_name, extensions] |
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 "typhoeus" | |
| require "vcr" | |
| VCR.configure do |config| | |
| config.cassette_library_dir = "vcr_cassettes" | |
| config.hook_into :typhoeus | |
| end | |
| describe VCR do | |
| it "should work with a queue" do |
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
| GEM | |
| remote: http://rubygems.org/ | |
| specs: | |
| diff-lcs (1.1.3) | |
| ethon (0.5.2) | |
| ffi (~> 1.0.11) | |
| mime-types (~> 1.18) | |
| ffi (1.0.11) | |
| mime-types (1.19) | |
| rake (0.9.2.2) |
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
| gem "typhoeus", git: "https://github.com/typhoeus/typhoeus.git", | |
| ref: "8e815cdf4fed2322947e2338d6f5b084c820a70b" | |
| gem "vcr" | |
| gem "rspec" |
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
| source :rubygems | |
| gem "typhoeus", "~> 0.5.2" | |
| gem "vcr", "~> 2.3.0" | |
| gem "rspec" |
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
| class MethodCounter | |
| def initialize | |
| @signature = ENV.fetch("COUNT_CALLS_TO") | |
| @path = @signature.split(/(?:::|#)/) | |
| @scope = @signature.include?("#") ? :instance : :class_or_module | |
| @count = 0 | |
| @wrapping = false | |
| @wrapped = false | |
| end |
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
| app@botqueen1:/u/apps/botqueen/current$ bundle exec ruby foo.rb | |
| Ran 100 requests ****************************** | |
| Ran 100 requests ****************************** | |
| Ran 100 requests ****************************** | |
| Ran 100 requests ****************************** | |
| Ran 100 requests ****************************** | |
| Ran 100 requests ****************************** | |
| Ran 100 requests ****************************** | |
| Ran 100 requests ****************************** |