qbwc 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- qbwc (0.0.3)
4
+ qbwc (0.0.4)
5
5
  quickbooks_api (>= 0.1.6)
6
6
  rubyjedi-soap4r (>= 1.5.8.20100619003610)
7
7
 
@@ -11,24 +11,62 @@ GEM
11
11
  activesupport (3.2.8)
12
12
  i18n (~> 0.6)
13
13
  multi_json (~> 1.0)
14
+ addressable (2.3.2)
14
15
  buffered_logger (0.1.3)
15
16
  activesupport
16
17
  i18n
17
18
  term-ansicolor
19
+ coderay (1.0.8)
20
+ crack (0.3.1)
21
+ diff-lcs (1.1.3)
22
+ guard (1.5.4)
23
+ listen (>= 0.4.2)
24
+ lumberjack (>= 1.0.2)
25
+ pry (>= 0.9.10)
26
+ thor (>= 0.14.6)
27
+ guard-rspec (2.3.1)
28
+ guard (>= 1.1)
29
+ rspec (~> 2.11)
18
30
  httpclient (2.1.5.2)
19
- i18n (0.6.0)
20
- multi_json (1.3.6)
31
+ i18n (0.6.1)
32
+ listen (0.6.0)
33
+ lumberjack (1.0.2)
34
+ method_source (0.8.1)
35
+ multi_json (1.4.0)
21
36
  nokogiri (1.5.5)
22
- quickbooks_api (0.1.6)
37
+ pry (0.9.10)
38
+ coderay (~> 1.0.5)
39
+ method_source (~> 0.8)
40
+ slop (~> 3.3.1)
41
+ quickbooks_api (0.1.7)
23
42
  activesupport
24
43
  buffered_logger (>= 0.1.3)
25
44
  nokogiri
45
+ rb-fsevent (0.9.2)
46
+ rspec (2.12.0)
47
+ rspec-core (~> 2.12.0)
48
+ rspec-expectations (~> 2.12.0)
49
+ rspec-mocks (~> 2.12.0)
50
+ rspec-core (2.12.1)
51
+ rspec-expectations (2.12.0)
52
+ diff-lcs (~> 1.1.3)
53
+ rspec-mocks (2.12.0)
26
54
  rubyjedi-soap4r (1.5.8.20100619003610)
27
55
  httpclient (~> 2.1.5.2)
56
+ slop (3.3.3)
28
57
  term-ansicolor (1.0.7)
58
+ thor (0.16.0)
59
+ webmock (1.9.0)
60
+ addressable (>= 2.2.7)
61
+ crack (>= 0.1.7)
29
62
 
30
63
  PLATFORMS
31
64
  ruby
32
65
 
33
66
  DEPENDENCIES
67
+ guard
68
+ guard-rspec
34
69
  qbwc!
70
+ rb-fsevent
71
+ rspec
72
+ webmock
@@ -0,0 +1,46 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard 'rspec' do
5
+ watch(%r{^spec/.+_spec\.rb$})
6
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
7
+ watch('spec/spec_helper.rb') { "spec" }
8
+
9
+ # Rails example
10
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
11
+ watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
12
+ watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
13
+ watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
14
+ watch('config/routes.rb') { "spec/routing" }
15
+ watch('app/controllers/application_controller.rb') { "spec/controllers" }
16
+
17
+ # Capybara features specs
18
+ watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
19
+
20
+ # Turnip features and steps
21
+ watch(%r{^spec/acceptance/(.+)\.feature$})
22
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
23
+ end
24
+
25
+
26
+ guard 'rspec' do
27
+ watch(%r{^spec/.+_spec\.rb$})
28
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
29
+ watch('spec/spec_helper.rb') { "spec" }
30
+
31
+ # Rails example
32
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
33
+ watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
34
+ watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
35
+ watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
36
+ watch('config/routes.rb') { "spec/routing" }
37
+ watch('app/controllers/application_controller.rb') { "spec/controllers" }
38
+
39
+ # Capybara features specs
40
+ watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
41
+
42
+ # Turnip features and steps
43
+ watch(%r{^spec/acceptance/(.+)\.feature$})
44
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
45
+ end
46
+
@@ -25,14 +25,15 @@ QBWC.configure do |c|
25
25
  # until it is processed.
26
26
  c.delayed_processing = false
27
27
 
28
- # In the event of an error in the communcation process do you wish the sync to stop or blase through
28
+ # In the event of an error in the communication process do you wish the sync to stop or blaze through
29
29
  #
30
30
  # Options:
31
31
  # :stop
32
32
  # :continue
33
33
  c.on_error = :stop
34
34
 
35
- # Rails Cache Hot Boot (Check the rails cache for existing API object to speed app boot)
36
- c.warm_boot = true
35
+ # Rails Cache Hot Boot (Check the rails cache for existing API object to speed app boot)
36
+ # This Feature is Unstable and is Extreme Alpha. IT is known not to work
37
+ # c.warm_boot = false
37
38
 
38
39
  end
@@ -1,6 +1,6 @@
1
- class QBWCController < ApplicationController
1
+ class QbwcController < ApplicationController
2
2
  require "Quickbooks"
3
-
3
+ protect_from_forgery :except => :api
4
4
  def qwc
5
5
  qwc = <<-QWC
6
6
  <QBWCXML>
@@ -44,7 +44,7 @@ module QBWC
44
44
 
45
45
  # Check Rails Cache for Parser before boot
46
46
  mattr_accessor :warm_boot
47
- @@warm_boot = true
47
+ @@warm_boot = false
48
48
 
49
49
  class << self
50
50
 
@@ -35,10 +35,6 @@ class QBWC::Request
35
35
  QBWC.parser.qbxml_to_hash @request.to_s
36
36
  end
37
37
 
38
- def to_s
39
- @request
40
- end
41
-
42
38
  class << self
43
39
 
44
40
  def from_array(requests, response_proc)
@@ -20,7 +20,7 @@ class QBWC::Session
20
20
 
21
21
  def reset
22
22
  @progress = QBWC.jobs.blank? ? 100 : 0
23
- enabled_jobs.map { |j| j.reset } unless enabled_jobs.blank?
23
+ enabled_jobs.map { |j| j.reset }
24
24
  @requests = build_request_generator(enabled_jobs)
25
25
  end
26
26
 
@@ -33,38 +33,43 @@ class QBWC::Session
33
33
  end
34
34
 
35
35
  def response=(qbxml_response)
36
- @current_request.response = \
37
- QBWC.parser.qbxml_to_hash(qbxml_response)
38
- parse_response_header(@current_request.response)
36
+ begin
37
+ @current_request.response = QBWC.parser.qbxml_to_hash(qbxml_response)
38
+ parse_response_header(@current_request.response)
39
39
 
40
- if QBWC.delayed_processing
41
- @saved_requests << @current_request
42
- else
43
- @current_request.process_response
40
+ if QBWC.delayed_processing
41
+ @saved_requests << @current_request
42
+ else
43
+ @current_request.process_response
44
+ end
45
+ rescue => e
46
+ puts "An error occured in QBWC::Session: #{e}"
47
+ puts e
48
+ puts e.backtrace
44
49
  end
50
+
45
51
  end
46
52
 
47
53
  def process_saved_responses
48
54
  @saved_requests.each { |r| r.process_response }
49
55
  end
50
56
 
51
- private
57
+ private
52
58
 
53
59
  def enabled_jobs
54
- QBWC.jobs.values.select { |j| j.enabled? } unless QBWC.jobs.empty?
60
+ QBWC.jobs.values.select { |j| j.enabled? }
55
61
  end
56
62
 
57
63
  def build_request_generator(jobs)
58
- Fiber.new do
59
- unless jobs.blank?
60
- jobs.each do |j|
61
- @current_job = j
62
- while (r = next_request)
63
- @current_request = r
64
- Fiber.yield r
65
- end
64
+ Fiber.new do
65
+ jobs.each do |j|
66
+ @current_job = j
67
+ while (r = next_request)
68
+ @current_request = r
69
+ Fiber.yield r
66
70
  end
67
71
  end
72
+
68
73
  @progress = 100
69
74
  nil
70
75
  end
@@ -89,7 +94,7 @@ private
89
94
  new_request = @current_request.to_hash
90
95
  new_request.delete('xml_attributes')
91
96
  new_request.values.first['xml_attributes'] = {'iterator' => 'Continue', 'iteratorID' => iterator_id}
92
- @qbwc_iterator_queue << Request.new(new_request, @current_request.response_proc)
97
+ @qbwc_iterator_queue << QBWC::Request.new(new_request, @current_request.response_proc)
93
98
  else
94
99
  @qbwc_iterating = false
95
100
  end
@@ -51,11 +51,11 @@ class QBWC::QBWebConnectorSvcSoap
51
51
  # RETURNS
52
52
  # parameters SendRequestXMLResponse - {http://developer.intuit.com/}sendRequestXMLResponse
53
53
  #
54
+
54
55
  def sendRequestXML(parameters)
55
56
  qbwc_session = QBWC::Session.new_or_unfinished
56
57
  next_request = qbwc_session.next
57
- return if next_request.blank?
58
- QBWC::SendRequestXMLResponse.new(wrap_in_version(next_request.request)) unless next_request.request.blank?
58
+ QBWC::SendRequestXMLResponse.new( next_request ? wrap_in_version(next_request.request) : '')
59
59
  end
60
60
 
61
61
  # SYNOPSIS
@@ -1,3 +1,3 @@
1
1
  module QBWC
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -22,7 +22,12 @@ Gem::Specification.new do |s|
22
22
  "README.md"
23
23
  ]
24
24
 
25
- s.add_dependency "quickbooks_api", [">= 0.1.6"]
26
- s.add_dependency "rubyjedi-soap4r", [">= 1.5.8.20100619003610"]
25
+ s.add_dependency "quickbooks_api", [">= 0.1.6"]
26
+ s.add_dependency "rubyjedi-soap4r", [">= 1.5.8.20100619003610"]
27
+ s.add_development_dependency('guard')
28
+ s.add_development_dependency('guard-rspec')
29
+ s.add_development_dependency('rb-fsevent')
30
+ s.add_development_dependency('webmock')
31
+ s.add_development_dependency('rspec')
27
32
 
28
33
  end
@@ -0,0 +1,17 @@
1
+ # This file was generated by the `rspec --init` command. Conventionally, all
2
+ # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
3
+ # Require this file using `require "spec_helper"` to ensure that it is only
4
+ # loaded once.
5
+ #
6
+ # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
7
+ RSpec.configure do |config|
8
+ config.treat_symbols_as_metadata_keys_with_true_values = true
9
+ config.run_all_when_everything_filtered = true
10
+ config.filter_run :focus
11
+
12
+ # Run specs in random order to surface order dependencies. If you find an
13
+ # order dependency and want to debug it, you can fix the order by providing
14
+ # the seed, which is printed after each run.
15
+ # --seed 1234
16
+ config.order = 'random'
17
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qbwc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-11-27 00:00:00.000000000 Z
14
+ date: 2012-12-10 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: quickbooks_api
@@ -45,6 +45,86 @@ dependencies:
45
45
  - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: 1.5.8.20100619003610
48
+ - !ruby/object:Gem::Dependency
49
+ name: guard
50
+ requirement: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ type: :development
57
+ prerelease: false
58
+ version_requirements: !ruby/object:Gem::Requirement
59
+ none: false
60
+ requirements:
61
+ - - ! '>='
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ - !ruby/object:Gem::Dependency
65
+ name: guard-rspec
66
+ requirement: !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ! '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ type: :development
73
+ prerelease: false
74
+ version_requirements: !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ - !ruby/object:Gem::Dependency
81
+ name: rb-fsevent
82
+ requirement: !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ none: false
92
+ requirements:
93
+ - - ! '>='
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ - !ruby/object:Gem::Dependency
97
+ name: webmock
98
+ requirement: !ruby/object:Gem::Requirement
99
+ none: false
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ none: false
108
+ requirements:
109
+ - - ! '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ - !ruby/object:Gem::Dependency
113
+ name: rspec
114
+ requirement: !ruby/object:Gem::Requirement
115
+ none: false
116
+ requirements:
117
+ - - ! '>='
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ type: :development
121
+ prerelease: false
122
+ version_requirements: !ruby/object:Gem::Requirement
123
+ none: false
124
+ requirements:
125
+ - - ! '>='
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
48
128
  description: A Rails interface for Intuit's Quickbooks Web Connector that's OPEN SOURCE!
49
129
  email:
50
130
  - rut216@gmail.com
@@ -56,8 +136,10 @@ extra_rdoc_files:
56
136
  - README.md
57
137
  files:
58
138
  - .gitignore
139
+ - .rspec
59
140
  - Gemfile
60
141
  - Gemfile.lock
142
+ - Guardfile
61
143
  - LICENSE.txt
62
144
  - README.md
63
145
  - Rakefile
@@ -77,8 +159,7 @@ files:
77
159
  - lib/qbwc/soap_wrapper/defaultServant.rb
78
160
  - lib/qbwc/version.rb
79
161
  - qbwc.gemspec
80
- - test/helper.rb
81
- - test/test_qbwc.rb
162
+ - spec/spec_helper.rb
82
163
  homepage: ''
83
164
  licenses: []
84
165
  post_install_message:
@@ -104,5 +185,4 @@ signing_key:
104
185
  specification_version: 3
105
186
  summary: A Rails interface for Intuit's Quickbooks Web Connector
106
187
  test_files:
107
- - test/helper.rb
108
- - test/test_qbwc.rb
188
+ - spec/spec_helper.rb
@@ -1,18 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- begin
4
- Bundler.setup(:default, :development)
5
- rescue Bundler::BundlerError => e
6
- $stderr.puts e.message
7
- $stderr.puts "Run `bundle install` to install missing gems"
8
- exit e.status_code
9
- end
10
- require 'test/unit'
11
- require 'shoulda'
12
-
13
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
- $LOAD_PATH.unshift(File.dirname(__FILE__))
15
- require 'qbwc'
16
-
17
- class Test::Unit::TestCase
18
- end
@@ -1,7 +0,0 @@
1
- require 'helper'
2
-
3
- class TestQBWC < Test::Unit::TestCase
4
- should "probably rename this file and start testing for real" do
5
- flunk "hey buddy, you should probably rename this file and start testing for real"
6
- end
7
- end