ns_connector 0.0.17 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e17da637c8c309ba9a350d03380bd9e8d41ccb70
4
+ data.tar.gz: 0a9447b638aa22c7a9fed82c90a89571cfc4b3fc
5
+ SHA512:
6
+ metadata.gz: 157472663c6f639d71dc0d29b4dfcc9067a0711a08fbdf8402f1f3bb0ccbb6ed67a3d9e330824b25bce7ed672c756552b90b8ec34bc76240927ae9ccfc06cb6d
7
+ data.tar.gz: b2bf6546d0b6e06d7930f6a68e4073fd32dce217c04a2b726a08d1e7f96f6356c7378f83a9761593d4b633095cfd58b100867df2fdf759529ba2e66932dc1955
@@ -1,50 +1,56 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- addressable (2.3.6)
4
+ addressable (2.4.0)
5
5
  builder (3.2.2)
6
- celluloid (0.15.2)
7
- timers (~> 1.1.0)
8
- celluloid-io (0.15.0)
9
- celluloid (>= 0.15.0)
10
- nio4r (>= 0.5.0)
11
6
  coderay (1.1.0)
12
- coveralls (0.7.0)
13
- multi_json (~> 1.3)
14
- rest-client
15
- simplecov (>= 0.7)
16
- term-ansicolor
17
- thor
18
- crack (0.4.2)
7
+ coveralls (0.8.10)
8
+ json (~> 1.8)
9
+ rest-client (>= 1.6.8, < 2)
10
+ simplecov (~> 0.11.0)
11
+ term-ansicolor (~> 1.3)
12
+ thor (~> 0.19.1)
13
+ tins (~> 1.6.0)
14
+ crack (0.4.3)
19
15
  safe_yaml (~> 1.0.0)
20
16
  descendants_tracker (0.0.4)
21
17
  thread_safe (~> 0.3, >= 0.3.1)
22
18
  diff-lcs (1.2.5)
23
- docile (1.1.3)
24
- faraday (0.9.0)
19
+ docile (1.1.5)
20
+ domain_name (0.5.25)
21
+ unf (>= 0.0.5, < 1.0.0)
22
+ faraday (0.9.2)
25
23
  multipart-post (>= 1.2, < 3)
26
- ffi (1.9.3)
27
- formatador (0.2.4)
28
- git (1.2.6)
29
- github_api (0.11.3)
24
+ ffi (1.9.10)
25
+ formatador (0.2.5)
26
+ git (1.2.9.1)
27
+ github_api (0.13.0)
30
28
  addressable (~> 2.3)
31
- descendants_tracker (~> 0.0.1)
29
+ descendants_tracker (~> 0.0.4)
32
30
  faraday (~> 0.8, < 0.10)
33
- hashie (>= 1.2)
31
+ hashie (>= 3.4)
34
32
  multi_json (>= 1.7.5, < 2.0)
35
- nokogiri (~> 1.6.0)
33
+ nokogiri (~> 1.6.6)
36
34
  oauth2
37
- guard (2.6.0)
35
+ guard (2.13.0)
38
36
  formatador (>= 0.2.4)
39
- listen (~> 2.7)
37
+ listen (>= 2.7, <= 4.0)
40
38
  lumberjack (~> 1.0)
39
+ nenv (~> 0.1)
40
+ notiffany (~> 0.0)
41
41
  pry (>= 0.9.12)
42
+ shellany (~> 0.0)
42
43
  thor (>= 0.18.1)
43
- guard-rspec (4.2.8)
44
+ guard-compat (1.2.1)
45
+ guard-rspec (4.6.4)
44
46
  guard (~> 2.1)
45
- rspec (>= 2.14, < 4.0)
46
- hashie (2.1.1)
47
- highline (1.6.21)
47
+ guard-compat (~> 1.1)
48
+ rspec (>= 2.99.0, < 4.0)
49
+ hashdiff (0.2.3)
50
+ hashie (3.4.3)
51
+ highline (1.7.8)
52
+ http-cookie (1.0.2)
53
+ domain_name (~> 0.5)
48
54
  jeweler (2.0.1)
49
55
  builder
50
56
  bundler (>= 1.0)
@@ -54,67 +60,78 @@ GEM
54
60
  nokogiri (>= 1.5.10)
55
61
  rake
56
62
  rdoc
57
- json (1.8.1)
58
- jwt (0.1.11)
59
- multi_json (>= 1.5)
60
- listen (2.7.2)
61
- celluloid (>= 0.15.2)
62
- celluloid-io (>= 0.15.0)
63
+ json (1.8.3)
64
+ jwt (1.5.2)
65
+ listen (3.0.5)
63
66
  rb-fsevent (>= 0.9.3)
64
67
  rb-inotify (>= 0.9)
65
- lumberjack (1.0.5)
68
+ lumberjack (1.0.9)
66
69
  method_source (0.8.2)
67
- mime-types (2.2)
68
- mini_portile (0.5.3)
69
- multi_json (1.9.3)
70
+ mime-types (2.99)
71
+ mini_portile2 (2.0.0)
72
+ multi_json (1.11.2)
70
73
  multi_xml (0.5.5)
71
74
  multipart-post (2.0.0)
72
- nio4r (1.0.0)
73
- nokogiri (1.6.1)
74
- mini_portile (~> 0.5.0)
75
- oauth2 (0.9.3)
75
+ nenv (0.2.0)
76
+ netrc (0.11.0)
77
+ nokogiri (1.6.7)
78
+ mini_portile2 (~> 2.0.0.rc2)
79
+ notiffany (0.0.8)
80
+ nenv (~> 0.1)
81
+ shellany (~> 0.0)
82
+ oauth2 (1.0.0)
76
83
  faraday (>= 0.8, < 0.10)
77
- jwt (~> 0.1.8)
84
+ jwt (~> 1.0)
78
85
  multi_json (~> 1.3)
79
86
  multi_xml (~> 0.5)
80
87
  rack (~> 1.2)
81
- pry (0.9.12.6)
82
- coderay (~> 1.0)
83
- method_source (~> 0.8)
88
+ pry (0.10.3)
89
+ coderay (~> 1.1.0)
90
+ method_source (~> 0.8.1)
84
91
  slop (~> 3.4)
85
- rack (1.5.2)
86
- rake (10.3.1)
87
- rb-fsevent (0.9.4)
88
- rb-inotify (0.9.4)
92
+ rack (1.6.4)
93
+ rake (10.4.2)
94
+ rb-fsevent (0.9.6)
95
+ rb-inotify (0.9.5)
89
96
  ffi (>= 0.5.0)
90
- rdoc (4.1.1)
91
- json (~> 1.4)
92
- rest-client (1.6.7)
93
- mime-types (>= 1.16)
94
- rspec (2.14.1)
95
- rspec-core (~> 2.14.0)
96
- rspec-expectations (~> 2.14.0)
97
- rspec-mocks (~> 2.14.0)
98
- rspec-core (2.14.8)
99
- rspec-expectations (2.14.5)
100
- diff-lcs (>= 1.1.3, < 2.0)
101
- rspec-mocks (2.14.6)
102
- safe_yaml (1.0.3)
103
- simplecov (0.8.2)
97
+ rdoc (4.2.0)
98
+ rest-client (1.8.0)
99
+ http-cookie (>= 1.0.2, < 2.0)
100
+ mime-types (>= 1.16, < 3.0)
101
+ netrc (~> 0.7)
102
+ rspec (3.4.0)
103
+ rspec-core (~> 3.4.0)
104
+ rspec-expectations (~> 3.4.0)
105
+ rspec-mocks (~> 3.4.0)
106
+ rspec-core (3.4.1)
107
+ rspec-support (~> 3.4.0)
108
+ rspec-expectations (3.4.0)
109
+ diff-lcs (>= 1.2.0, < 2.0)
110
+ rspec-support (~> 3.4.0)
111
+ rspec-mocks (3.4.0)
112
+ diff-lcs (>= 1.2.0, < 2.0)
113
+ rspec-support (~> 3.4.0)
114
+ rspec-support (3.4.1)
115
+ safe_yaml (1.0.4)
116
+ shellany (0.0.1)
117
+ simplecov (0.11.1)
104
118
  docile (~> 1.1.0)
105
- multi_json
106
- simplecov-html (~> 0.8.0)
107
- simplecov-html (0.8.0)
108
- slop (3.5.0)
109
- term-ansicolor (1.3.0)
119
+ json (~> 1.8)
120
+ simplecov-html (~> 0.10.0)
121
+ simplecov-html (0.10.0)
122
+ slop (3.6.0)
123
+ term-ansicolor (1.3.2)
110
124
  tins (~> 1.0)
111
125
  thor (0.19.1)
112
- thread_safe (0.3.3)
113
- timers (1.1.0)
114
- tins (1.1.0)
115
- webmock (1.17.4)
116
- addressable (>= 2.2.7)
126
+ thread_safe (0.3.5)
127
+ tins (1.6.0)
128
+ unf (0.1.4)
129
+ unf_ext
130
+ unf_ext (0.0.7.1)
131
+ webmock (1.22.3)
132
+ addressable (>= 2.3.6)
117
133
  crack (>= 0.3.2)
134
+ hashdiff
118
135
 
119
136
  PLATFORMS
120
137
  ruby
@@ -129,3 +146,6 @@ DEPENDENCIES
129
146
  rdoc
130
147
  rspec
131
148
  webmock
149
+
150
+ BUNDLED WITH
151
+ 1.10.6
@@ -60,7 +60,7 @@ An example config:
60
60
  })
61
61
  === Options
62
62
  ==== :account_id (mandatory)
63
- TODO: Document how to find an account ID.
63
+ You can find your Account ID by visiting [Web Service Preferences](https://system.netsuite.com/app/webservices/setup.nl?whence=)
64
64
 
65
65
  ==== :email (mandatory)
66
66
  The email address you log into the NetSuite web site with that matches the
data/Rakefile CHANGED
@@ -19,7 +19,7 @@ Jeweler::Tasks.new do |gem|
19
19
  gem.description = "This library provides an interface to NetSuite via"\
20
20
  "'RESTlets'. This appears to be a quicker and more reliable"\
21
21
  "way of interfacing with NetSuite records than the SOAP API."
22
- gem.authors = ["Christian Marie <pingu@anchor.com.au>"]
22
+ gem.authors = ["Christian Marie <christian@ru>"]
23
23
  gem.license = 'MIT'
24
24
  end
25
25
  Jeweler::RubygemsDotOrgTasks.new
@@ -27,19 +27,8 @@ Jeweler::RubygemsDotOrgTasks.new
27
27
  task :default => :test
28
28
  RSpec::Core::RakeTask.new :test
29
29
 
30
- task :deploy_to_hopper => [:build, :rdoc, :test] do
31
- `scp pkg/ns_connector-$(cat VERSION).gem packages@hopper.engineroom.anchor.net.au:public_html/gems/gems/`
32
- `ssh packages@hopper.engineroom.anchor.net.au "cd /home/packages/public_html/gems && make"`
33
- if $?.to_i == 0 then
34
- puts "Deploy to hopper successful"
35
- else
36
- raise RuntimeError, "Deploy failed :("
37
- end
38
- end
39
-
40
30
  Rake::RDocTask.new do |rd|
41
31
  rd.main = "README.rdoc"
42
32
  rd.title = 'NSConnector documentation'
43
33
  rd.rdoc_files.include("README.rdoc", "lib/**/*.rb")
44
- `scp -r html/* packages@hopper.engineroom.anchor.net.au:public_html/gems/docs/ns_connector/`
45
34
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.17
1
+ 0.1.0
@@ -5,12 +5,21 @@ module NSConnector::FieldStore
5
5
  # method to retrieve and set the key 'name' in our @store
6
6
  def create_store_accessors!
7
7
  fields.each do |field|
8
- self.class.class_eval do
9
- define_method field do
8
+ self.class.class_eval do
9
+ # Let's determine the name of our helper method.
10
+ # This makes sure we don't inadvertantly nuke a field that already exists,
11
+ # such as "class".
12
+ method_name = field.to_s
13
+ while self.respond_to? method_name.to_sym
14
+ method_name = "_" + method_name
15
+ end
16
+ method_name = method_name.to_sym
17
+
18
+ define_method method_name do
10
19
  @store[field.to_s]
11
20
  end
12
21
 
13
- define_method "#{field}=" do |value|
22
+ define_method "#{method_name}=" do |value|
14
23
  @store[field.to_s] = value
15
24
  end
16
25
  end
@@ -1,4 +1,9 @@
1
1
  require 'ns_connector/resources/contact'
2
+ require 'ns_connector/resources/credit_memo'
2
3
  require 'ns_connector/resources/customer'
4
+ require 'ns_connector/resources/customer_deposit'
3
5
  require 'ns_connector/resources/customer_payment'
6
+ require 'ns_connector/resources/discount_item'
4
7
  require 'ns_connector/resources/invoice'
8
+ require 'ns_connector/resources/non_inventory_item'
9
+ require 'ns_connector/resources/sales_order'
@@ -0,0 +1,314 @@
1
+ require 'ns_connector/resource'
2
+
3
+ # == CreditMemo resource
4
+ # === Fields
5
+ # * id
6
+ # * account
7
+ # * althandlingcost
8
+ # * altshippingcost
9
+ # * amountpaid
10
+ # * amountremaining
11
+ # * applied
12
+ # * autoapply
13
+ # * balance
14
+ # * billaddr1
15
+ # * billaddr2
16
+ # * billaddr3
17
+ # * billaddress
18
+ # * billaddressee
19
+ # * billaddresslist
20
+ # * billattention
21
+ # * billcity
22
+ # * billcountry
23
+ # * billisresidential
24
+ # * billphone
25
+ # * billstate
26
+ # * billzip
27
+ # * class
28
+ # * consolidatebalance
29
+ # * couponcode
30
+ # * createddate
31
+ # * createdfrom
32
+ # * currency
33
+ # * currencyname
34
+ # * currencysymbol
35
+ # * customform
36
+ # * deferredrevenue
37
+ # * department
38
+ # * discountitem
39
+ # * discountrate
40
+ # * discounttotal
41
+ # * email
42
+ # * entity
43
+ # * entitynexus
44
+ # * estgrossprofit
45
+ # * estgrossprofitpercent
46
+ # * exchangerate
47
+ # * excludecommission
48
+ # * externalid
49
+ # * handlingcost
50
+ # * handlingtax1rate
51
+ # * handlingtaxcode
52
+ # * isbasecurrency
53
+ # * istaxable
54
+ # * lastmodifieddate
55
+ # * leadsource
56
+ # * location
57
+ # * memo
58
+ # * message
59
+ # * messagesel
60
+ # * muccpromocodeinstance
61
+ # * nexus
62
+ # * otherrefnum
63
+ # * partner
64
+ # * postingperiod
65
+ # * promocode
66
+ # * promocodepluginimpl
67
+ # * recognizedrevenue
68
+ # * revenuestatus
69
+ # * revreconrevcommitment
70
+ # * saleseffectivedate
71
+ # * salesgroup
72
+ # * salesrep
73
+ # * shipaddr1
74
+ # * shipaddr2
75
+ # * shipaddr3
76
+ # * shipaddress
77
+ # * shipaddressee
78
+ # * shipaddresslist
79
+ # * shipattention
80
+ # * shipcity
81
+ # * shipcountry
82
+ # * shipisresidential
83
+ # * shipmethod
84
+ # * shipoverride
85
+ # * shipphone
86
+ # * shippingcost
87
+ # * shippingcostoverridden
88
+ # * shippingtax1rate
89
+ # * shippingtaxcode
90
+ # * shipstate
91
+ # * shipzip
92
+ # * source
93
+ # * status
94
+ # * statusRef
95
+ # * subsidiary
96
+ # * subtotal
97
+ # * syncpartnerteams
98
+ # * syncsalesteams
99
+ # * taxitem
100
+ # * taxrate
101
+ # * taxtotal
102
+ # * tobeemailed
103
+ # * tobefaxed
104
+ # * tobeprinted
105
+ # * total
106
+ # * totalcostestimate
107
+ # * trandate
108
+ # * tranid
109
+ # * tranisvsoebundle
110
+ # * unapplied
111
+ # * unbilledorders
112
+ # * vsoeautocalc
113
+ # === Sublists
114
+ # * apply
115
+ # * item
116
+ # * partners
117
+ # * salesteam
118
+
119
+ class NSConnector::CreditMemo < NSConnector::Resource
120
+ @type_id = 'creditmemo'
121
+ @fields = [
122
+ :id,
123
+ :account,
124
+ :althandlingcost,
125
+ :altshippingcost,
126
+ :amountpaid,
127
+ :amountremaining,
128
+ :applied,
129
+ :autoapply,
130
+ :balance,
131
+ :billaddr1,
132
+ :billaddr2,
133
+ :billaddr3,
134
+ :billaddress,
135
+ :billaddressee,
136
+ :billaddresslist,
137
+ :billattention,
138
+ :billcity,
139
+ :billcountry,
140
+ :billisresidential,
141
+ :billphone,
142
+ :billstate,
143
+ :billzip,
144
+ :class,
145
+ :consolidatebalance,
146
+ :couponcode,
147
+ :createddate,
148
+ :createdfrom,
149
+ :currency,
150
+ :currencyname,
151
+ :currencysymbol,
152
+ :customform,
153
+ :deferredrevenue,
154
+ :department,
155
+ :discountitem,
156
+ :discountrate,
157
+ :discounttotal,
158
+ :email,
159
+ :entity,
160
+ :entitynexus,
161
+ :estgrossprofit,
162
+ :estgrossprofitpercent,
163
+ :exchangerate,
164
+ :excludecommission,
165
+ :externalid,
166
+ :handlingcost,
167
+ :handlingtax1rate,
168
+ :handlingtaxcode,
169
+ :isbasecurrency,
170
+ :istaxable,
171
+ :lastmodifieddate,
172
+ :leadsource,
173
+ :location,
174
+ :memo,
175
+ :message,
176
+ :messagesel,
177
+ :muccpromocodeinstance,
178
+ :nexus,
179
+ :otherrefnum,
180
+ :partner,
181
+ :postingperiod,
182
+ :promocode,
183
+ :promocodepluginimpl,
184
+ :recognizedrevenue,
185
+ :revenuestatus,
186
+ :revreconrevcommitment,
187
+ :saleseffectivedate,
188
+ :salesgroup,
189
+ :salesrep,
190
+ :shipaddr1,
191
+ :shipaddr2,
192
+ :shipaddr3,
193
+ :shipaddress,
194
+ :shipaddressee,
195
+ :shipaddresslist,
196
+ :shipattention,
197
+ :shipcity,
198
+ :shipcountry,
199
+ :shipisresidential,
200
+ :shipmethod,
201
+ :shipoverride,
202
+ :shipphone,
203
+ :shippingcost,
204
+ :shippingcostoverridden,
205
+ :shippingtax1rate,
206
+ :shippingtaxcode,
207
+ :shipstate,
208
+ :shipzip,
209
+ :source,
210
+ :status,
211
+ :statusRef,
212
+ :subsidiary,
213
+ :subtotal,
214
+ :syncpartnerteams,
215
+ :syncsalesteams,
216
+ :taxitem,
217
+ :taxrate,
218
+ :taxtotal,
219
+ :tobeemailed,
220
+ :tobefaxed,
221
+ :tobeprinted,
222
+ :total,
223
+ :totalcostestimate,
224
+ :trandate,
225
+ :tranid,
226
+ :tranisvsoebundle,
227
+ :unapplied,
228
+ :unbilledorders,
229
+ :vsoeautocalc,
230
+ ]
231
+ @sublists = {
232
+ :apply => [
233
+ :amount,
234
+ :apply,
235
+ :applydate,
236
+ :createdfrom,
237
+ :doc,
238
+ :due,
239
+ :duedate,
240
+ :internalid,
241
+ :job,
242
+ :line,
243
+ :refnum,
244
+ :total,
245
+ :url,
246
+ ],
247
+ :item => [
248
+ :account,
249
+ :amortizationperiod,
250
+ :amortizationtype,
251
+ :amount,
252
+ :billvariancestatus,
253
+ :costestimate,
254
+ :costestimaterate,
255
+ :costestimatetype,
256
+ :daysbeforeexpiration,
257
+ :deferrevrec,
258
+ :description,
259
+ :giftcertfrom,
260
+ :giftcertmessage,
261
+ :giftcertrecipientemail,
262
+ :giftcertrecipientname,
263
+ :id,
264
+ :inventorydetail,
265
+ :isdropshipment,
266
+ :istaxable,
267
+ :isvsoebundle,
268
+ :item,
269
+ :itemsubtype,
270
+ :itemtype,
271
+ :job,
272
+ :line,
273
+ :linenumber,
274
+ :matrixtype,
275
+ :options,
276
+ :price,
277
+ :printitems,
278
+ :quantity,
279
+ :rate,
280
+ :rateschedule,
281
+ :revrecenddate,
282
+ :revrecschedule,
283
+ :revrecstartdate,
284
+ :taxcode,
285
+ :taxrate1,
286
+ :units,
287
+ :vsoeallocation,
288
+ :vsoeamount,
289
+ :vsoedeferral,
290
+ :vsoedelivered,
291
+ :vsoeisestimate,
292
+ :vsoepermitdiscount,
293
+ :vsoeprice,
294
+ :vsoesopgroup,
295
+ ],
296
+ :partners => [
297
+ :contribution,
298
+ :id,
299
+ :isprimary,
300
+ :partner,
301
+ :partnerrole,
302
+ :transaction,
303
+ ],
304
+ :salesteam => [
305
+ :contribution,
306
+ :employee,
307
+ :id,
308
+ :isprimary,
309
+ :issalesrep,
310
+ :salesrole,
311
+ :transaction,
312
+ ]
313
+ }
314
+ end
@@ -0,0 +1,147 @@
1
+ require 'ns_connector/resource'
2
+
3
+ # == CustomerDeposit resource
4
+ # === Fields
5
+ # * id
6
+ # * account
7
+ # * allowemptycards
8
+ # * authcode
9
+ # * ccapproved
10
+ # * ccavsstreetmatch
11
+ # * ccavszipmatch
12
+ # * ccexpiredate
13
+ # * cchold
14
+ # * ccholdetails
15
+ # * cciavsmatch
16
+ # * ccispurchasecardbin
17
+ # * ccname
18
+ # * ccnumber
19
+ # * ccprocessoraccount
20
+ # * ccsecuritycode
21
+ # * ccsecuritycodematch
22
+ # * ccstreet
23
+ # * cczipcode
24
+ # * chargeit
25
+ # * checknum
26
+ # * class
27
+ # * createddate
28
+ # * creditcard
29
+ # * creditcardprocessor
30
+ # * currency
31
+ # * currencyname
32
+ # * currencysymbol
33
+ # * customer
34
+ # * customercode
35
+ # * customform
36
+ # * debitcardissueno
37
+ # * department
38
+ # * entitynexus
39
+ # * exchangerate
40
+ # * externalid
41
+ # * ignoreavs
42
+ # * ignorecsc
43
+ # * isbasecurrency
44
+ # * ispurchasecard
45
+ # * lastmodifieddate
46
+ # * location
47
+ # * memo
48
+ # * nexus
49
+ # * overridehold
50
+ # * overrideholdchecked
51
+ # * payment
52
+ # * paymenteventdate
53
+ # * paymenteventholdreason
54
+ # * paymenteventpurchasedatasent
55
+ # * paymenteventresult
56
+ # * paymenteventtype
57
+ # * paymenteventupdatedby
58
+ # * paymentmethod
59
+ # * pnrefnum
60
+ # * postingperiod
61
+ # * salesorder
62
+ # * softdescriptor
63
+ # * status
64
+ # * statusRef
65
+ # * subsidiary
66
+ # * threedstatuscode
67
+ # * tobeemailed
68
+ # * trandate
69
+ # * tranid
70
+ # * undepfunds
71
+ # * validfrom
72
+ # === Sublists
73
+
74
+ class NSConnector::CustomerDeposit < NSConnector::Resource
75
+ @type_id = 'customerdeposit'
76
+ @fields = [
77
+ :id,
78
+ :account,
79
+ :allowemptycards,
80
+ :authcode,
81
+ :ccapproved,
82
+ :ccavsstreetmatch,
83
+ :ccavszipmatch,
84
+ :ccexpiredate,
85
+ :cchold,
86
+ :ccholdetails,
87
+ :cciavsmatch,
88
+ :ccispurchasecardbin,
89
+ :ccname,
90
+ :ccnumber,
91
+ :ccprocessoraccount,
92
+ :ccsecuritycode,
93
+ :ccsecuritycodematch,
94
+ :ccstreet,
95
+ :cczipcode,
96
+ :chargeit,
97
+ :checknum,
98
+ :class,
99
+ :createddate,
100
+ :creditcard,
101
+ :creditcardprocessor,
102
+ :currency,
103
+ :currencyname,
104
+ :currencysymbol,
105
+ :customer,
106
+ :customercode,
107
+ :customform,
108
+ :debitcardissueno,
109
+ :department,
110
+ :entitynexus,
111
+ :exchangerate,
112
+ :externalid,
113
+ :ignoreavs,
114
+ :ignorecsc,
115
+ :isbasecurrency,
116
+ :ispurchasecard,
117
+ :lastmodifieddate,
118
+ :location,
119
+ :memo,
120
+ :nexus,
121
+ :overridehold,
122
+ :overrideholdchecked,
123
+ :payment,
124
+ :paymenteventdate,
125
+ :paymenteventholdreason,
126
+ :paymenteventpurchasedatasent,
127
+ :paymenteventresult,
128
+ :paymenteventtype,
129
+ :paymenteventupdatedby,
130
+ :paymentmethod,
131
+ :pnrefnum,
132
+ :postingperiod,
133
+ :salesorder,
134
+ :softdescriptor,
135
+ :status,
136
+ :statusRef,
137
+ :subsidiary,
138
+ :threedstatuscode,
139
+ :tobeemailed,
140
+ :trandate,
141
+ :tranid,
142
+ :undepfunds,
143
+ :validfrom,
144
+ ]
145
+ @sublists = {
146
+ }
147
+ end
@@ -68,7 +68,7 @@ describe NSConnector::ChunkedSearching do
68
68
 
69
69
  expect(ret).to be_a(Array)
70
70
  # 5 iterations returning 3 each
71
- expect(ret).to have(6 * 3).things
71
+ expect(ret.size).to eq(6 * 3)
72
72
  end
73
73
 
74
74
  it 'does a threaded search correctly' do
@@ -76,7 +76,7 @@ describe NSConnector::ChunkedSearching do
76
76
 
77
77
  ret = MagicResource.threaded_search_by_chunks('filters')
78
78
  expect(ret).to be_a(Array)
79
- expect(ret).to have(6 * 3).things
79
+ expect(ret.size).to eq(6 * 3)
80
80
  end
81
81
 
82
82
  end
@@ -10,7 +10,7 @@ describe NSConnector::Config do
10
10
 
11
11
  it 'sets a valid config' do
12
12
  NSConnector::Config.set_config!(valid_config)
13
- expect(NSConnector::Config.check_valid!).to be_true
13
+ expect(NSConnector::Config.check_valid!).to be true
14
14
  end
15
15
 
16
16
  it 'sets an invalid config' do
@@ -180,7 +180,7 @@ describe PseudoResource do
180
180
  ['email', nil, 'isempty']
181
181
  ])
182
182
  expect(result).to be_a(Array)
183
- expect(result).to have(2).things
183
+ expect(result.size).to eq(2)
184
184
 
185
185
  expect(result.first).to be_a(PseudoResource)
186
186
  expect(result.first.firstname).to eql('unique')
@@ -304,7 +304,7 @@ describe PseudoResource do
304
304
  end
305
305
 
306
306
  it 'returns false trying to delete an object not in NS' do
307
- expect(@p.delete!).to be_false
307
+ expect(@p.delete!).to be false
308
308
  end
309
309
  end
310
310
 
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ include NSConnector
4
+ describe CreditMemo do
5
+ it 'should not explode on creation' do
6
+ x = CreditMemo.new
7
+ expect(x).to respond_to(:_class)
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ include NSConnector
4
+ describe CustomerDeposit do
5
+ it 'should not explode on creation' do
6
+ x = CustomerDeposit.new
7
+ expect(x).to respond_to(:_class)
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ include NSConnector
4
+ describe DiscountItem do
5
+ it 'should not explode on creation' do
6
+ x = DiscountItem.new
7
+ expect(x).to respond_to(:_class)
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ include NSConnector
4
+ describe NonInventoryItem do
5
+ it 'should not explode on creation' do
6
+ x = NonInventoryItem.new
7
+ expect(x).to respond_to(:_class)
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ include NSConnector
4
+ describe SalesOrder do
5
+ it 'should not explode on creation' do
6
+ x = SalesOrder.new
7
+ expect(x).to respond_to(:_class)
8
+ end
9
+ end
@@ -14,6 +14,5 @@ Coveralls.wear!
14
14
 
15
15
  RSpec.configure do |config|
16
16
  config.order = "random"
17
- config.color_enabled = true
18
17
  end
19
18
 
@@ -35,7 +35,7 @@ describe SubList do
35
35
  )
36
36
 
37
37
  expect(sublist).to be_a(Array)
38
- expect(sublist).to have(2).things
38
+ expect(sublist.size).to eq(2)
39
39
  sublist.each do |item|
40
40
  expect(item).to be_a(SubListItem)
41
41
  end
@@ -6,6 +6,13 @@ require "erb"
6
6
  require "ostruct"
7
7
  require "open-uri"
8
8
 
9
+ if ARGV.length < 2
10
+ puts "NetSuite type scraper"
11
+ puts "Turns NetSuite record documentation into ns_connector classes"
12
+ puts "Usage: type-scraper.rb (internal id) (final class name) > lib/ns_connector/resources/(ruby file name).rb"
13
+ exit 1
14
+ end
15
+
9
16
  page = ARGV[0]
10
17
  class_name = ARGV[1]
11
18
 
@@ -23,7 +23,7 @@ class NSConnector::<%= resource_type %> < NSConnector::Resource
23
23
  <% v.each do |_v| -%>
24
24
  :<%= _v.to_s %>,
25
25
  <% end -%>
26
- ]<% if k == @sublists.keys.last %>,<% end %>
26
+ ]<% if k != sublists.keys.last %>,<% end %>
27
27
  <% end -%>
28
28
  }
29
29
  end
metadata CHANGED
@@ -1,158 +1,139 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ns_connector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.17
5
- prerelease:
4
+ version: 0.1.0
6
5
  platform: ruby
7
6
  authors:
8
- - Christian Marie <pingu@anchor.com.au>
7
+ - Christian Marie <christian@ru>
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-05-02 00:00:00.000000000 Z
11
+ date: 2015-12-08 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rspec
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: webmock
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rake
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - ">="
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - ">="
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: jeweler
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: nokogiri
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - ">="
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - ">="
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: bundler
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - ">="
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - ">="
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: rdoc
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - ">="
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - ">="
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0'
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: guard-rspec
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
- - - ! '>='
115
+ - - ">="
132
116
  - !ruby/object:Gem::Version
133
117
  version: '0'
134
118
  type: :development
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
- - - ! '>='
122
+ - - ">="
140
123
  - !ruby/object:Gem::Version
141
124
  version: '0'
142
125
  - !ruby/object:Gem::Dependency
143
126
  name: coveralls
144
127
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
128
  requirements:
147
- - - ! '>='
129
+ - - ">="
148
130
  - !ruby/object:Gem::Version
149
131
  version: '0'
150
132
  type: :development
151
133
  prerelease: false
152
134
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
135
  requirements:
155
- - - ! '>='
136
+ - - ">="
156
137
  - !ruby/object:Gem::Version
157
138
  version: '0'
158
139
  description: This library provides an interface to NetSuite via'RESTlets'. This appears
@@ -165,7 +146,7 @@ extra_rdoc_files:
165
146
  - LICENSE.txt
166
147
  - README.rdoc
167
148
  files:
168
- - .travis.yml
149
+ - ".travis.yml"
169
150
  - CHANGELOG
170
151
  - Gemfile
171
152
  - Gemfile.lock
@@ -185,7 +166,9 @@ files:
185
166
  - lib/ns_connector/resource.rb
186
167
  - lib/ns_connector/resources.rb
187
168
  - lib/ns_connector/resources/contact.rb
169
+ - lib/ns_connector/resources/credit_memo.rb
188
170
  - lib/ns_connector/resources/customer.rb
171
+ - lib/ns_connector/resources/customer_deposit.rb
189
172
  - lib/ns_connector/resources/customer_payment.rb
190
173
  - lib/ns_connector/resources/discount_item.rb
191
174
  - lib/ns_connector/resources/invoice.rb
@@ -203,9 +186,14 @@ files:
203
186
  - spec/config_spec.rb
204
187
  - spec/resource_spec.rb
205
188
  - spec/resources/contact_spec.rb
189
+ - spec/resources/credit_memo_spec.rb
190
+ - spec/resources/customer_deposit_spec.rb
206
191
  - spec/resources/customer_payment_spec.rb
207
192
  - spec/resources/customer_spec.rb
193
+ - spec/resources/discount_item_spec.rb
208
194
  - spec/resources/invoice_spec.rb
195
+ - spec/resources/non_inventory_item_spec.rb
196
+ - spec/resources/sales_order_spec.rb
209
197
  - spec/restlet_spec.rb
210
198
  - spec/spec_helper.rb
211
199
  - spec/sublist_item_spec.rb
@@ -220,29 +208,25 @@ files:
220
208
  homepage: ''
221
209
  licenses:
222
210
  - MIT
211
+ metadata: {}
223
212
  post_install_message:
224
213
  rdoc_options: []
225
214
  require_paths:
226
215
  - lib
227
216
  required_ruby_version: !ruby/object:Gem::Requirement
228
- none: false
229
217
  requirements:
230
- - - ! '>='
218
+ - - ">="
231
219
  - !ruby/object:Gem::Version
232
220
  version: '0'
233
- segments:
234
- - 0
235
- hash: 2583574235940207
236
221
  required_rubygems_version: !ruby/object:Gem::Requirement
237
- none: false
238
222
  requirements:
239
- - - ! '>='
223
+ - - ">="
240
224
  - !ruby/object:Gem::Version
241
225
  version: '0'
242
226
  requirements: []
243
227
  rubyforge_project:
244
- rubygems_version: 1.8.23
228
+ rubygems_version: 2.4.5.1
245
229
  signing_key:
246
- specification_version: 3
230
+ specification_version: 4
247
231
  summary: An interface to NetSuite records via RESTlets.
248
232
  test_files: []