monetra-ruby 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. data/Rakefile +35 -0
  2. data/lib/monetra.rb +239 -0
  3. data/lib/monetra/active_support.rb +42 -0
  4. data/lib/monetra/active_support/binding_of_caller.rb +84 -0
  5. data/lib/monetra/active_support/breakpoint.rb +523 -0
  6. data/lib/monetra/active_support/caching_tools.rb +62 -0
  7. data/lib/monetra/active_support/clean_logger.rb +38 -0
  8. data/lib/monetra/active_support/core_ext.rb +1 -0
  9. data/lib/monetra/active_support/core_ext/array.rb +7 -0
  10. data/lib/monetra/active_support/core_ext/array/conversions.rb +72 -0
  11. data/lib/monetra/active_support/core_ext/array/grouping.rb +46 -0
  12. data/lib/monetra/active_support/core_ext/bigdecimal.rb +3 -0
  13. data/lib/monetra/active_support/core_ext/bigdecimal/formatting.rb +7 -0
  14. data/lib/monetra/active_support/core_ext/blank.rb +50 -0
  15. data/lib/monetra/active_support/core_ext/cgi.rb +5 -0
  16. data/lib/monetra/active_support/core_ext/cgi/escape_skipping_slashes.rb +14 -0
  17. data/lib/monetra/active_support/core_ext/class.rb +3 -0
  18. data/lib/monetra/active_support/core_ext/class/attribute_accessors.rb +44 -0
  19. data/lib/monetra/active_support/core_ext/class/inheritable_attributes.rb +115 -0
  20. data/lib/monetra/active_support/core_ext/class/removal.rb +24 -0
  21. data/lib/monetra/active_support/core_ext/date.rb +6 -0
  22. data/lib/monetra/active_support/core_ext/date/conversions.rb +39 -0
  23. data/lib/monetra/active_support/core_ext/enumerable.rb +62 -0
  24. data/lib/monetra/active_support/core_ext/exception.rb +33 -0
  25. data/lib/monetra/active_support/core_ext/hash.rb +13 -0
  26. data/lib/monetra/active_support/core_ext/hash/conversions.rb +148 -0
  27. data/lib/monetra/active_support/core_ext/hash/diff.rb +11 -0
  28. data/lib/monetra/active_support/core_ext/hash/indifferent_access.rb +88 -0
  29. data/lib/monetra/active_support/core_ext/hash/keys.rb +53 -0
  30. data/lib/monetra/active_support/core_ext/hash/reverse_merge.rb +25 -0
  31. data/lib/monetra/active_support/core_ext/integer.rb +7 -0
  32. data/lib/monetra/active_support/core_ext/integer/even_odd.rb +24 -0
  33. data/lib/monetra/active_support/core_ext/integer/inflections.rb +15 -0
  34. data/lib/monetra/active_support/core_ext/kernel.rb +4 -0
  35. data/lib/monetra/active_support/core_ext/kernel/agnostics.rb +11 -0
  36. data/lib/monetra/active_support/core_ext/kernel/daemonizing.rb +15 -0
  37. data/lib/monetra/active_support/core_ext/kernel/reporting.rb +51 -0
  38. data/lib/monetra/active_support/core_ext/kernel/requires.rb +24 -0
  39. data/lib/monetra/active_support/core_ext/load_error.rb +38 -0
  40. data/lib/monetra/active_support/core_ext/logger.rb +16 -0
  41. data/lib/monetra/active_support/core_ext/module.rb +7 -0
  42. data/lib/monetra/active_support/core_ext/module/aliasing.rb +57 -0
  43. data/lib/monetra/active_support/core_ext/module/attr_internal.rb +31 -0
  44. data/lib/monetra/active_support/core_ext/module/attribute_accessors.rb +44 -0
  45. data/lib/monetra/active_support/core_ext/module/delegation.rb +41 -0
  46. data/lib/monetra/active_support/core_ext/module/inclusion.rb +11 -0
  47. data/lib/monetra/active_support/core_ext/module/introspection.rb +21 -0
  48. data/lib/monetra/active_support/core_ext/module/loading.rb +13 -0
  49. data/lib/monetra/active_support/core_ext/name_error.rb +20 -0
  50. data/lib/monetra/active_support/core_ext/numeric.rb +7 -0
  51. data/lib/monetra/active_support/core_ext/numeric/bytes.rb +44 -0
  52. data/lib/monetra/active_support/core_ext/numeric/time.rb +72 -0
  53. data/lib/monetra/active_support/core_ext/object.rb +2 -0
  54. data/lib/monetra/active_support/core_ext/object/extending.rb +47 -0
  55. data/lib/monetra/active_support/core_ext/object/misc.rb +34 -0
  56. data/lib/monetra/active_support/core_ext/pathname.rb +7 -0
  57. data/lib/monetra/active_support/core_ext/pathname/clean_within.rb +14 -0
  58. data/lib/monetra/active_support/core_ext/proc.rb +12 -0
  59. data/lib/monetra/active_support/core_ext/range.rb +5 -0
  60. data/lib/monetra/active_support/core_ext/range/conversions.rb +21 -0
  61. data/lib/monetra/active_support/core_ext/string.rb +13 -0
  62. data/lib/monetra/active_support/core_ext/string/access.rb +58 -0
  63. data/lib/monetra/active_support/core_ext/string/conversions.rb +19 -0
  64. data/lib/monetra/active_support/core_ext/string/inflections.rb +153 -0
  65. data/lib/monetra/active_support/core_ext/string/iterators.rb +17 -0
  66. data/lib/monetra/active_support/core_ext/string/starts_ends_with.rb +20 -0
  67. data/lib/monetra/active_support/core_ext/symbol.rb +12 -0
  68. data/lib/monetra/active_support/core_ext/time.rb +7 -0
  69. data/lib/monetra/active_support/core_ext/time/calculations.rb +188 -0
  70. data/lib/monetra/active_support/core_ext/time/conversions.rb +36 -0
  71. data/lib/monetra/active_support/dependencies.rb +187 -0
  72. data/lib/monetra/active_support/deprecation.rb +106 -0
  73. data/lib/monetra/active_support/inflections.rb +53 -0
  74. data/lib/monetra/active_support/inflector.rb +179 -0
  75. data/lib/monetra/active_support/json.rb +37 -0
  76. data/lib/monetra/active_support/json/encoders.rb +25 -0
  77. data/lib/monetra/active_support/json/encoders/core.rb +65 -0
  78. data/lib/monetra/active_support/option_merger.rb +25 -0
  79. data/lib/monetra/active_support/ordered_options.rb +50 -0
  80. data/lib/monetra/active_support/reloadable.rb +30 -0
  81. data/lib/monetra/active_support/values/time_zone.rb +180 -0
  82. data/lib/monetra/active_support/vendor/builder.rb +13 -0
  83. data/lib/monetra/active_support/vendor/builder/blankslate.rb +63 -0
  84. data/lib/monetra/active_support/vendor/builder/xchar.rb +112 -0
  85. data/lib/monetra/active_support/vendor/builder/xmlbase.rb +145 -0
  86. data/lib/monetra/active_support/vendor/builder/xmlevents.rb +63 -0
  87. data/lib/monetra/active_support/vendor/builder/xmlmarkup.rb +328 -0
  88. data/lib/monetra/active_support/vendor/flexmock.rb +84 -0
  89. data/lib/monetra/active_support/vendor/xml_simple.rb +1019 -0
  90. data/lib/monetra/active_support/version.rb +9 -0
  91. data/lib/monetra/active_support/whiny_nil.rb +38 -0
  92. data/test/test.rb +21 -0
  93. metadata +167 -0
@@ -0,0 +1,9 @@
1
+ module ActiveSupport
2
+ module VERSION #:nodoc:
3
+ MAJOR = 1
4
+ MINOR = 3
5
+ TINY = 1
6
+
7
+ STRING = [MAJOR, MINOR, TINY].join('.')
8
+ end
9
+ end
@@ -0,0 +1,38 @@
1
+ # Extensions to nil which allow for more helpful error messages for
2
+ # people who are new to rails.
3
+ #
4
+ # The aim is to ensure that when users pass nil to methods where that isn't
5
+ # appropriate, instead of NoMethodError and the name of some method used
6
+ # by the framework users will see a message explaining what type of object
7
+ # was expected.
8
+
9
+ class NilClass
10
+ WHINERS = [ ::ActiveRecord::Base, ::Array ]
11
+
12
+ @@method_class_map = Hash.new
13
+
14
+ WHINERS.each do |klass|
15
+ methods = klass.public_instance_methods - public_instance_methods
16
+ methods.each do |method|
17
+ @@method_class_map[method.to_sym] = klass
18
+ end
19
+ end
20
+
21
+ def id
22
+ raise RuntimeError, "Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id", caller
23
+ end
24
+
25
+ private
26
+ def method_missing(method, *args, &block)
27
+ raise_nil_warning_for @@method_class_map[method], method, caller
28
+ end
29
+
30
+ def raise_nil_warning_for(klass = nil, selector = nil, with_caller = nil)
31
+ message = "You have a nil object when you didn't expect it!"
32
+ message << "\nYou might have expected an instance of #{klass}." if klass
33
+ message << "\nThe error occurred while evaluating nil.#{selector}" if selector
34
+
35
+ raise NoMethodError, message, with_caller || caller
36
+ end
37
+ end
38
+
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Created by Jade Meskill on 2006-10-24.
4
+ # Copyright (c) 2006. All rights reserved.
5
+
6
+ require File.dirname(__FILE__) + '/../lib/monetra'
7
+ require 'pp'
8
+
9
+ Monetra::Base.scheme = 'http'
10
+ Monetra::Base.port = 8555
11
+ Monetra::Base.host = 'testbox.monetra.com'
12
+ Monetra::Base.username = 'vitale'
13
+ Monetra::Base.password = 'test'
14
+
15
+ trans = Monetra::Transaction::Sale.new({:account => '4012888888881', :expdate => '1215', :amount => '14.04'})
16
+
17
+ resp_set = Monetra::Base.send([trans, trans])
18
+
19
+ resp_set.each do |resp|
20
+ pp resp.auth if resp.success?
21
+ end
metadata ADDED
@@ -0,0 +1,167 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.8.11
3
+ specification_version: 1
4
+ name: monetra-ruby
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.0.6
7
+ date: 2007-04-11 00:00:00 -07:00
8
+ summary: Ruby library for accessing Main Street Softwork's Monetra credit card processing system
9
+ require_paths:
10
+ - lib
11
+ email:
12
+ homepage:
13
+ rubyforge_project:
14
+ description: Ruby library for accessing Main Street Softwork's Monetra credit card processing system
15
+ autorequire: monetra
16
+ default_executable:
17
+ bindir: bin
18
+ has_rdoc: false
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ - - ">"
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ authors: []
29
+
30
+ files:
31
+ - Rakefile
32
+ - lib/monetra
33
+ - lib/monetra.rb
34
+ - lib/monetra/active_support
35
+ - lib/monetra/active_support.rb
36
+ - lib/monetra/active_support/binding_of_caller.rb
37
+ - lib/monetra/active_support/breakpoint.rb
38
+ - lib/monetra/active_support/caching_tools.rb
39
+ - lib/monetra/active_support/clean_logger.rb
40
+ - lib/monetra/active_support/core_ext
41
+ - lib/monetra/active_support/core_ext.rb
42
+ - lib/monetra/active_support/dependencies.rb
43
+ - lib/monetra/active_support/deprecation.rb
44
+ - lib/monetra/active_support/inflections.rb
45
+ - lib/monetra/active_support/inflector.rb
46
+ - lib/monetra/active_support/json
47
+ - lib/monetra/active_support/json.rb
48
+ - lib/monetra/active_support/option_merger.rb
49
+ - lib/monetra/active_support/ordered_options.rb
50
+ - lib/monetra/active_support/reloadable.rb
51
+ - lib/monetra/active_support/values
52
+ - lib/monetra/active_support/vendor
53
+ - lib/monetra/active_support/version.rb
54
+ - lib/monetra/active_support/whiny_nil.rb
55
+ - lib/monetra/active_support/core_ext/array
56
+ - lib/monetra/active_support/core_ext/array.rb
57
+ - lib/monetra/active_support/core_ext/bigdecimal
58
+ - lib/monetra/active_support/core_ext/bigdecimal.rb
59
+ - lib/monetra/active_support/core_ext/blank.rb
60
+ - lib/monetra/active_support/core_ext/cgi
61
+ - lib/monetra/active_support/core_ext/cgi.rb
62
+ - lib/monetra/active_support/core_ext/class
63
+ - lib/monetra/active_support/core_ext/class.rb
64
+ - lib/monetra/active_support/core_ext/date
65
+ - lib/monetra/active_support/core_ext/date.rb
66
+ - lib/monetra/active_support/core_ext/enumerable.rb
67
+ - lib/monetra/active_support/core_ext/exception.rb
68
+ - lib/monetra/active_support/core_ext/hash
69
+ - lib/monetra/active_support/core_ext/hash.rb
70
+ - lib/monetra/active_support/core_ext/integer
71
+ - lib/monetra/active_support/core_ext/integer.rb
72
+ - lib/monetra/active_support/core_ext/kernel
73
+ - lib/monetra/active_support/core_ext/kernel.rb
74
+ - lib/monetra/active_support/core_ext/load_error.rb
75
+ - lib/monetra/active_support/core_ext/logger.rb
76
+ - lib/monetra/active_support/core_ext/module
77
+ - lib/monetra/active_support/core_ext/module.rb
78
+ - lib/monetra/active_support/core_ext/name_error.rb
79
+ - lib/monetra/active_support/core_ext/numeric
80
+ - lib/monetra/active_support/core_ext/numeric.rb
81
+ - lib/monetra/active_support/core_ext/object
82
+ - lib/monetra/active_support/core_ext/object.rb
83
+ - lib/monetra/active_support/core_ext/pathname
84
+ - lib/monetra/active_support/core_ext/pathname.rb
85
+ - lib/monetra/active_support/core_ext/proc.rb
86
+ - lib/monetra/active_support/core_ext/range
87
+ - lib/monetra/active_support/core_ext/range.rb
88
+ - lib/monetra/active_support/core_ext/string
89
+ - lib/monetra/active_support/core_ext/string.rb
90
+ - lib/monetra/active_support/core_ext/symbol.rb
91
+ - lib/monetra/active_support/core_ext/time
92
+ - lib/monetra/active_support/core_ext/time.rb
93
+ - lib/monetra/active_support/core_ext/array/conversions.rb
94
+ - lib/monetra/active_support/core_ext/array/grouping.rb
95
+ - lib/monetra/active_support/core_ext/bigdecimal/formatting.rb
96
+ - lib/monetra/active_support/core_ext/cgi/escape_skipping_slashes.rb
97
+ - lib/monetra/active_support/core_ext/class/attribute_accessors.rb
98
+ - lib/monetra/active_support/core_ext/class/inheritable_attributes.rb
99
+ - lib/monetra/active_support/core_ext/class/removal.rb
100
+ - lib/monetra/active_support/core_ext/date/conversions.rb
101
+ - lib/monetra/active_support/core_ext/hash/conversions.rb
102
+ - lib/monetra/active_support/core_ext/hash/diff.rb
103
+ - lib/monetra/active_support/core_ext/hash/indifferent_access.rb
104
+ - lib/monetra/active_support/core_ext/hash/keys.rb
105
+ - lib/monetra/active_support/core_ext/hash/reverse_merge.rb
106
+ - lib/monetra/active_support/core_ext/integer/even_odd.rb
107
+ - lib/monetra/active_support/core_ext/integer/inflections.rb
108
+ - lib/monetra/active_support/core_ext/kernel/agnostics.rb
109
+ - lib/monetra/active_support/core_ext/kernel/daemonizing.rb
110
+ - lib/monetra/active_support/core_ext/kernel/reporting.rb
111
+ - lib/monetra/active_support/core_ext/kernel/requires.rb
112
+ - lib/monetra/active_support/core_ext/module/aliasing.rb
113
+ - lib/monetra/active_support/core_ext/module/attr_internal.rb
114
+ - lib/monetra/active_support/core_ext/module/attribute_accessors.rb
115
+ - lib/monetra/active_support/core_ext/module/delegation.rb
116
+ - lib/monetra/active_support/core_ext/module/inclusion.rb
117
+ - lib/monetra/active_support/core_ext/module/introspection.rb
118
+ - lib/monetra/active_support/core_ext/module/loading.rb
119
+ - lib/monetra/active_support/core_ext/numeric/bytes.rb
120
+ - lib/monetra/active_support/core_ext/numeric/time.rb
121
+ - lib/monetra/active_support/core_ext/object/extending.rb
122
+ - lib/monetra/active_support/core_ext/object/misc.rb
123
+ - lib/monetra/active_support/core_ext/pathname/clean_within.rb
124
+ - lib/monetra/active_support/core_ext/range/conversions.rb
125
+ - lib/monetra/active_support/core_ext/string/access.rb
126
+ - lib/monetra/active_support/core_ext/string/conversions.rb
127
+ - lib/monetra/active_support/core_ext/string/inflections.rb
128
+ - lib/monetra/active_support/core_ext/string/iterators.rb
129
+ - lib/monetra/active_support/core_ext/string/starts_ends_with.rb
130
+ - lib/monetra/active_support/core_ext/time/calculations.rb
131
+ - lib/monetra/active_support/core_ext/time/conversions.rb
132
+ - lib/monetra/active_support/json/encoders
133
+ - lib/monetra/active_support/json/encoders.rb
134
+ - lib/monetra/active_support/json/encoders/core.rb
135
+ - lib/monetra/active_support/values/time_zone.rb
136
+ - lib/monetra/active_support/vendor/builder
137
+ - lib/monetra/active_support/vendor/builder.rb
138
+ - lib/monetra/active_support/vendor/flexmock.rb
139
+ - lib/monetra/active_support/vendor/xml_simple.rb
140
+ - lib/monetra/active_support/vendor/builder/blankslate.rb
141
+ - lib/monetra/active_support/vendor/builder/xchar.rb
142
+ - lib/monetra/active_support/vendor/builder/xmlbase.rb
143
+ - lib/monetra/active_support/vendor/builder/xmlevents.rb
144
+ - lib/monetra/active_support/vendor/builder/xmlmarkup.rb
145
+ - test/test.rb
146
+ test_files: []
147
+
148
+ rdoc_options: []
149
+
150
+ extra_rdoc_files: []
151
+
152
+ executables: []
153
+
154
+ extensions: []
155
+
156
+ requirements: []
157
+
158
+ dependencies:
159
+ - !ruby/object:Gem::Dependency
160
+ name: builder
161
+ version_requirement:
162
+ version_requirements: !ruby/object:Gem::Version::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: "1.2"
167
+ version: