smshelper 0.4.8 → 0.4.9
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/VERSION +1 -1
- data/lib/smshelper/api.rb +1 -1
- data/lib/smshelper/api/base.rb +28 -27
- data/smshelper.gemspec +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.9
|
data/lib/smshelper/api.rb
CHANGED
@@ -3,7 +3,7 @@ require 'virtus'
|
|
3
3
|
module Smshelper
|
4
4
|
module Api
|
5
5
|
path = (File.dirname File.expand_path(__FILE__))
|
6
|
-
VERSION = '0.0
|
6
|
+
VERSION = '0.1.0'#File.read('blahblah')
|
7
7
|
|
8
8
|
autoload :Base, "#{path}/api/base"
|
9
9
|
autoload :ResponseCodes, "#{path}/api/response_codes"
|
data/lib/smshelper/api/base.rb
CHANGED
@@ -17,43 +17,44 @@ module Smshelper
|
|
17
17
|
protected
|
18
18
|
def class_factory(*names)
|
19
19
|
names.each do |name|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
20
|
+
unless self.class.const_defined?(name)
|
21
|
+
klass = self.class.const_set(name, Class.new)
|
22
|
+
klass.class_eval do
|
23
|
+
include Virtus
|
24
|
+
|
25
|
+
define_method(:initialize) do |args = {}|
|
26
|
+
args.each do |k,v|
|
27
|
+
# Sinatra params has splat, captures
|
28
|
+
unless k.to_s =~ (/splat/ || /captures/)
|
29
|
+
self.class.attribute(k, v.class, :default => v)
|
30
|
+
end
|
29
31
|
end
|
32
|
+
self.class.attribute(:uuid, String, :default => UUID.generate) unless args[:uuid]
|
33
|
+
self.class.attribute(:service, String, :default => self.class.name.split('::')[2])
|
30
34
|
end
|
31
|
-
self.class.attribute(:uuid, String, :default => UUID.generate) unless args[:uuid]
|
32
|
-
self.class.attribute(:service, String, :default => self.class.name.split('::')[2])
|
33
|
-
end
|
34
35
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
# I was lazy to lookup which method takes precedence in
|
37
|
+
# what situation, hence:
|
38
|
+
def _dump(level)
|
39
|
+
attributes.to_yaml
|
40
|
+
end
|
40
41
|
|
41
|
-
|
42
|
-
|
43
|
-
|
42
|
+
def marshal_dump
|
43
|
+
attributes.to_yaml
|
44
|
+
end
|
44
45
|
|
45
|
-
|
46
|
-
|
47
|
-
|
46
|
+
def marshal_load(str)
|
47
|
+
self.class.new(YAML.load(str))
|
48
|
+
end
|
48
49
|
|
49
|
-
|
50
|
-
|
51
|
-
|
50
|
+
def self._load(str)
|
51
|
+
self.class.new(YAML.load(str))
|
52
|
+
end
|
52
53
|
|
54
|
+
end
|
53
55
|
end
|
54
56
|
end
|
55
57
|
end
|
56
|
-
|
57
58
|
end # class Base
|
58
59
|
end # module Api
|
59
60
|
end # module Smshelper
|
data/smshelper.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "smshelper"
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.9"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Voip Scout"]
|
12
|
-
s.date = "2012-06-
|
12
|
+
s.date = "2012-06-05"
|
13
13
|
s.description = "send sms with multiple gateways, like esendex, bulksms, clickatell etc.."
|
14
14
|
s.email = "voipscout@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smshelper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: api_smith
|
@@ -275,7 +275,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
275
275
|
version: '0'
|
276
276
|
segments:
|
277
277
|
- 0
|
278
|
-
hash: -
|
278
|
+
hash: -53658594555464700
|
279
279
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
280
280
|
none: false
|
281
281
|
requirements:
|