monetra-ruby 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +35 -0
- data/lib/monetra.rb +239 -0
- data/lib/monetra/active_support.rb +42 -0
- data/lib/monetra/active_support/binding_of_caller.rb +84 -0
- data/lib/monetra/active_support/breakpoint.rb +523 -0
- data/lib/monetra/active_support/caching_tools.rb +62 -0
- data/lib/monetra/active_support/clean_logger.rb +38 -0
- data/lib/monetra/active_support/core_ext.rb +1 -0
- data/lib/monetra/active_support/core_ext/array.rb +7 -0
- data/lib/monetra/active_support/core_ext/array/conversions.rb +72 -0
- data/lib/monetra/active_support/core_ext/array/grouping.rb +46 -0
- data/lib/monetra/active_support/core_ext/bigdecimal.rb +3 -0
- data/lib/monetra/active_support/core_ext/bigdecimal/formatting.rb +7 -0
- data/lib/monetra/active_support/core_ext/blank.rb +50 -0
- data/lib/monetra/active_support/core_ext/cgi.rb +5 -0
- data/lib/monetra/active_support/core_ext/cgi/escape_skipping_slashes.rb +14 -0
- data/lib/monetra/active_support/core_ext/class.rb +3 -0
- data/lib/monetra/active_support/core_ext/class/attribute_accessors.rb +44 -0
- data/lib/monetra/active_support/core_ext/class/inheritable_attributes.rb +115 -0
- data/lib/monetra/active_support/core_ext/class/removal.rb +24 -0
- data/lib/monetra/active_support/core_ext/date.rb +6 -0
- data/lib/monetra/active_support/core_ext/date/conversions.rb +39 -0
- data/lib/monetra/active_support/core_ext/enumerable.rb +62 -0
- data/lib/monetra/active_support/core_ext/exception.rb +33 -0
- data/lib/monetra/active_support/core_ext/hash.rb +13 -0
- data/lib/monetra/active_support/core_ext/hash/conversions.rb +148 -0
- data/lib/monetra/active_support/core_ext/hash/diff.rb +11 -0
- data/lib/monetra/active_support/core_ext/hash/indifferent_access.rb +88 -0
- data/lib/monetra/active_support/core_ext/hash/keys.rb +53 -0
- data/lib/monetra/active_support/core_ext/hash/reverse_merge.rb +25 -0
- data/lib/monetra/active_support/core_ext/integer.rb +7 -0
- data/lib/monetra/active_support/core_ext/integer/even_odd.rb +24 -0
- data/lib/monetra/active_support/core_ext/integer/inflections.rb +15 -0
- data/lib/monetra/active_support/core_ext/kernel.rb +4 -0
- data/lib/monetra/active_support/core_ext/kernel/agnostics.rb +11 -0
- data/lib/monetra/active_support/core_ext/kernel/daemonizing.rb +15 -0
- data/lib/monetra/active_support/core_ext/kernel/reporting.rb +51 -0
- data/lib/monetra/active_support/core_ext/kernel/requires.rb +24 -0
- data/lib/monetra/active_support/core_ext/load_error.rb +38 -0
- data/lib/monetra/active_support/core_ext/logger.rb +16 -0
- data/lib/monetra/active_support/core_ext/module.rb +7 -0
- data/lib/monetra/active_support/core_ext/module/aliasing.rb +57 -0
- data/lib/monetra/active_support/core_ext/module/attr_internal.rb +31 -0
- data/lib/monetra/active_support/core_ext/module/attribute_accessors.rb +44 -0
- data/lib/monetra/active_support/core_ext/module/delegation.rb +41 -0
- data/lib/monetra/active_support/core_ext/module/inclusion.rb +11 -0
- data/lib/monetra/active_support/core_ext/module/introspection.rb +21 -0
- data/lib/monetra/active_support/core_ext/module/loading.rb +13 -0
- data/lib/monetra/active_support/core_ext/name_error.rb +20 -0
- data/lib/monetra/active_support/core_ext/numeric.rb +7 -0
- data/lib/monetra/active_support/core_ext/numeric/bytes.rb +44 -0
- data/lib/monetra/active_support/core_ext/numeric/time.rb +72 -0
- data/lib/monetra/active_support/core_ext/object.rb +2 -0
- data/lib/monetra/active_support/core_ext/object/extending.rb +47 -0
- data/lib/monetra/active_support/core_ext/object/misc.rb +34 -0
- data/lib/monetra/active_support/core_ext/pathname.rb +7 -0
- data/lib/monetra/active_support/core_ext/pathname/clean_within.rb +14 -0
- data/lib/monetra/active_support/core_ext/proc.rb +12 -0
- data/lib/monetra/active_support/core_ext/range.rb +5 -0
- data/lib/monetra/active_support/core_ext/range/conversions.rb +21 -0
- data/lib/monetra/active_support/core_ext/string.rb +13 -0
- data/lib/monetra/active_support/core_ext/string/access.rb +58 -0
- data/lib/monetra/active_support/core_ext/string/conversions.rb +19 -0
- data/lib/monetra/active_support/core_ext/string/inflections.rb +153 -0
- data/lib/monetra/active_support/core_ext/string/iterators.rb +17 -0
- data/lib/monetra/active_support/core_ext/string/starts_ends_with.rb +20 -0
- data/lib/monetra/active_support/core_ext/symbol.rb +12 -0
- data/lib/monetra/active_support/core_ext/time.rb +7 -0
- data/lib/monetra/active_support/core_ext/time/calculations.rb +188 -0
- data/lib/monetra/active_support/core_ext/time/conversions.rb +36 -0
- data/lib/monetra/active_support/dependencies.rb +187 -0
- data/lib/monetra/active_support/deprecation.rb +106 -0
- data/lib/monetra/active_support/inflections.rb +53 -0
- data/lib/monetra/active_support/inflector.rb +179 -0
- data/lib/monetra/active_support/json.rb +37 -0
- data/lib/monetra/active_support/json/encoders.rb +25 -0
- data/lib/monetra/active_support/json/encoders/core.rb +65 -0
- data/lib/monetra/active_support/option_merger.rb +25 -0
- data/lib/monetra/active_support/ordered_options.rb +50 -0
- data/lib/monetra/active_support/reloadable.rb +30 -0
- data/lib/monetra/active_support/values/time_zone.rb +180 -0
- data/lib/monetra/active_support/vendor/builder.rb +13 -0
- data/lib/monetra/active_support/vendor/builder/blankslate.rb +63 -0
- data/lib/monetra/active_support/vendor/builder/xchar.rb +112 -0
- data/lib/monetra/active_support/vendor/builder/xmlbase.rb +145 -0
- data/lib/monetra/active_support/vendor/builder/xmlevents.rb +63 -0
- data/lib/monetra/active_support/vendor/builder/xmlmarkup.rb +328 -0
- data/lib/monetra/active_support/vendor/flexmock.rb +84 -0
- data/lib/monetra/active_support/vendor/xml_simple.rb +1019 -0
- data/lib/monetra/active_support/version.rb +9 -0
- data/lib/monetra/active_support/whiny_nil.rb +38 -0
- data/test/test.rb +21 -0
- metadata +167 -0
@@ -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
|
+
|
data/test/test.rb
ADDED
@@ -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:
|