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 File.expand_path(File.dirname(__FILE__) + "/../../config/environment") | |
| require 'adhearsion' | |
| require 'adhearsion/initializer/asterisk' | |
| require 'drb' | |
| # http://help.cloudvox.com/faqs/getting-started/setup-for-ruby-adhearsion | |
| desc "Make an outgoing phone call to number provided as 'call' (via Cloudvox)" | |
| task :make_outgoing_call do | |
| if ENV['call'] | |
| # Outgoing context from Cloudvox Switchboard, under "Outgoing settings (AMI)." |
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
| mac="0800273B51A9" | |
| # With reject | |
| mac.split(/(..)/).reject {|c| c.empty?}.join(':') | |
| # With Inject | |
| mac.split(//).inject([]) do |nmac, e| | |
| if x.nil? or x>0 | |
| nmac[nmac.size-1] = nmac[nmac.size-1] + e |
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
| def self.new(element_name, atts = {}, &block) | |
| blk_proc = Proc.new do |new_node| | |
| atts.each_pair { |k, v| new_node.send :"#{k}=", v } | |
| block_return = new_node.instance_eval &block if block_given? | |
| new_node << new_node.encode_special_chars(block_return) if block_return.is_a?(String) | |
| end | |
| case RUBY_VERSION.split(/\./)[0,2].join.to_i | |
| when 18 | |
| super(element_name).tap do |n| |
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
| def self.new(element_name, atts = {}, &block) | |
| blk_proc = Proc.new do |new_node| | |
| atts.each_pair { |k, v| new_node.send :"#{k}=", v } | |
| block_return = new_node.instance_eval &block if block_given? | |
| new_node << new_node.encode_special_chars(block_return) if block_return.is_a?(String) | |
| end | |
| case RUBY_VERSION.split(/\./)[0,2].join.to_i | |
| when 18 | |
| super(element_name).tap do |n| |
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
| case RUBY_VERSION.split(/\./)[0,2].join.to_i | |
| when 18 | |
| super(element_name).tap do |new_node| | |
| atts.each_pair { |k, v| new_node.send :"#{k}=", v } | |
| block_return = new_node.instance_eval &block if block_given? | |
| new_node << new_node.encode_special_chars(block_return) if block_return.is_a?(String) | |
| end | |
| else | |
| super(element_name) do |new_node| | |
| atts.each_pair { |k, v| new_node.send :"#{k}=", v } |
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
| # This command will automatically be run when you run "ahn" with the Adhearsion gem installed from the root of your application. | |
| require File.expand_path('../../config/environment', __FILE__) | |
| require 'adhearsion' | |
| require 'adhearsion/commands' | |
| Adhearsion::CLI::AhnCommand.execute! |
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
| taylor@lindqvist:src $ rm -rf adhearsion | |
| taylor@lindqvist:src $ git clone git@github.com:mojolingo/adhearsion.git | |
| Cloning into adhearsion... | |
| remote: Counting objects: 10660, done. | |
| remote: Compressing objects: 100% (2883/2883), done. | |
| remote: Total 10660 (delta 7771), reused 10422 (delta 7534) | |
| Receiving objects: 100% (10660/10660), 2.14 MiB | 1.26 MiB/s, done. | |
| Resolving deltas: 100% (7771/7771), done. | |
| taylor@lindqvist:src $ cd adhearsion | |
| taylor@lindqvist:adhearsion $ git branch |
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
| ##### | |
| # | |
| # $ git checkout --track -b <local name> origin/<remote name> | |
| # Note: this creates a local branch <local name> based on the upstream branch and switches your working copy to that branch. | |
| # | |
| # Push a local branch remotely with this | |
| # | |
| # git push some_repo local_branch:refs/heads/new_branch | |
| # example | |
| # git push origin master:refs/heads/staging will create the branch staging in the origin repository by copying the local master branch |
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
| /Users/taylor/sw/depot/rvm/rubies/jruby-1.6.4/bin/jruby -I"lib:lib:spec" -I"/Users/taylor/sw/depot/rvm/gems/jruby-1.6.4@mojolingo/gems/rake-0.9.2.2/lib" "/Users/taylor/sw/depot/rvm/gems/jruby-1.6.4@mojolingo/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb" "spec/**/*_spec.rb" | |
| Loaded suite /Users/taylor/sw/depot/rvm/gems/jruby-1.6.4@mojolingo/gems/rake-0.9.2.2/lib/rake/rake_test_loader | |
| Started | |
| F.FE.........E.F....EFE............ | |
| Finished in 1.082000 seconds. | |
| 1) Failure: | |
| test_0014_will_remove_a_child_with_a_specific_xmlns(NiceogiriXmlNodeSpec) [/Users/taylor/work/src/clients/mojolingo/niceogiri/spec/niceogiri/xml/node_spec.rb:108]: | |
| Expected 1, not 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
| FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF | |
| Failures: | |
| 1) Nokogiri::XML::Node aliases #name to #element_name | |
| Failure/Error: node.must_respond_to :element_name | |
| NameError: | |
| uninitialized class variable @@current_spec in MiniTest::Spec | |
| # (eval):6:in `must_respond_to' | |
| # ./spec/niceogiri/core_ext/nokogiri_spec.rb:8:in `(root)' |