Skip to content

Instantly share code, notes, and snippets.

----------- vendor/gems/troelskn-handsoap-0.5.7/lib/handsoap/http.rb -----------
index 7a111fd..d499c5f 100644
@@ -419,7 +419,7 @@ module Handsoap
def self.parse_headers(raw)
header = Hash.new([].freeze)
field = nil
- raw.gsub(/^(\r\n)+|(\r\n)+$/, '').each {|line|
+ raw.gsub(/^(\r\n)+|(\r\n)+$/, '').split( /(\r\n)/ ).each {|line|
case line
when /^([A-Za-z0-9!\#$%&'*+\-.^_`|~]+):\s*(.*?)\s*\z/om
turc = TimesheetUploadRecordConverter.new( TimesheetUploadRecord.all )
turc.perform
uri = URI.parse( "https://myapp.heroku.com" )
http = Net::HTTP.new( uri.port, uri.host )
http.use_ssl = true
request = Net::HTTP::Post.new( "/mobile_app/timesheet_uploads.json" )
request["content-type"] = "application/json"
request.body = JSON.generate( { upload_data: upload_data } )
request.basic_auth( MyConfig::USERNAME, MyConfig::PASSWORD )
response = http.request( request )
# last line creates this error: "getaddrinfo: nodename nor servname provided, or not known"
getaddrinfo: nodename nor servname provided, or not known
/Users/douglivesey/.rvm/ruby-1.9.1-p243/lib/ruby/1.9.1/net/http.rb:581:in `initialize'
/Users/douglivesey/.rvm/ruby-1.9.1-p243/lib/ruby/1.9.1/net/http.rb:581:in `open'
/Users/douglivesey/.rvm/ruby-1.9.1-p243/lib/ruby/1.9.1/net/http.rb:581:in `block in connect'
/Users/douglivesey/.rvm/ruby-1.9.1-p243/lib/ruby/1.9.1/timeout.rb:44:in `timeout'
/Users/douglivesey/.rvm/ruby-1.9.1-p243/lib/ruby/1.9.1/timeout.rb:82:in `timeout'
/Users/douglivesey/.rvm/ruby-1.9.1-p243/lib/ruby/1.9.1/net/http.rb:581:in `connect'
/Users/douglivesey/.rvm/ruby-1.9.1-p243/lib/ruby/1.9.1/net/http.rb:574:in `do_start'
/Users/douglivesey/.rvm/ruby-1.9.1-p243/lib/ruby/1.9.1/net/http.rb:563:in `start'
/Users/douglivesey/.rvm/ruby-1.9.1-p243/lib/ruby/1.9.1/net/http.rb:1094:in `request'
require "eventmachine"
require "evma_httpserver"
module Xena
class Server < EM::Connection
include EM::HttpServer
attr_accessor :signature, :thread
require "spec_helper"
describe "tabs/show.html.haml", :type => :cell_view do
def render_cell( cell_name, cell_action )
render( File.join( Rails.root, "app", "cells", cell_name.to_s, "#{ cell_action.to_s }.html.haml" ) )
end
it "should be speccable" do
assign( :selected_tab, "Moose Concept" )
tabs/show.html.haml
should be speccable (FAILED - 1)
1) tabs/show.html.haml should be speccable
Failure/Error: lambda { render_cell( :tabs, :show ) }.should_not raise_error
expected no Exception, got #<ActionView::MissingTemplate: Missing partial /Users/douglivesey/work/fl/rails/bentley_ror3/app/cells/tabs/show.html with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml, :haml], :formats=>[:html, :text, :js, :css, :ics, :csv, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json], :locale=>[:en, :en]} in view paths "/Users/douglivesey/work/fl/rails/bentley_ror3/app/views">
# ./spec/cells/tabs/show.html.haml_spec.rb:11:in `block (2 levels) in <top (required)>'
Finished in 0.05272 seconds
module CellControllerHelpers
def assign_to_cell( key, value )
@opts ||= {}
@opts[key] = value
@cell.instance_variable_set( :@opts, @opts )
end
def assigned_to_cell( key )
@cell.instance_variable_get( "@#{ key.to_s }" )
module CellViewHelpers
def render_cell( cell_name, cell_action )
render( file: Rails.root.join( "app", "cells", cell_name.to_s, "#{ cell_action.to_s }.html.haml" ) )
end
end
RSpec.configure do |config|
config.include Webrat::Matchers, :type => :views
config.include GeneralHelpers
config.include ControllerHelpers, :type => :controller
config.include ModelHelpers, :type => :model
config.include ViewHelpers, :type => :views
config.include Rspec::Rails::ViewExampleGroup, :type => :cell_view