cheezmiz 0.0.1
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/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +661 -0
- data/README.rdoc +41 -0
- data/Rakefile +52 -0
- data/VERSION +1 -0
- data/cheezmiz.geany +20 -0
- data/cheezmiz.gemspec +68 -0
- data/docs/chikka-1.capture +37 -0
- data/examples/callbacks.rb +84 -0
- data/lib/broker.rb +120 -0
- data/lib/cheezmiz.rb +20 -0
- data/lib/helper.rb +59 -0
- data/lib/protocol.rb +34 -0
- data/lib/protocol/buddy.rb +49 -0
- data/lib/protocol/client_ready.rb +28 -0
- data/lib/protocol/connection_established.rb +25 -0
- data/lib/protocol/information.rb +74 -0
- data/lib/protocol/keep_alive.rb +34 -0
- data/lib/protocol/login.rb +49 -0
- data/lib/protocol/message.rb +108 -0
- data/lib/protocol/submit.rb +56 -0
- data/lib/protocol/system_message.rb +32 -0
- data/lib/protocol/unknown_operation.rb +25 -0
- data/test/helper.rb +27 -0
- data/test/test_cheezmiz.rb +22 -0
- metadata +83 -0
@@ -0,0 +1,56 @@
|
|
1
|
+
# cheezmiz - a ruby library for Chikka
|
2
|
+
# Copyright (C) 2010 parasquid
|
3
|
+
#
|
4
|
+
# This file is part of cheezmiz
|
5
|
+
#
|
6
|
+
# This program is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU Affero General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# This program is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU Affero General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU Affero General Public License
|
17
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
|
19
|
+
$: << File.expand_path(File.dirname(__FILE__))
|
20
|
+
require 'message'
|
21
|
+
|
22
|
+
module Cheezmiz
|
23
|
+
class SubmitRequest < Message
|
24
|
+
def params_lut
|
25
|
+
{
|
26
|
+
:message => '032',
|
27
|
+
:buddy_number => '021', # buddy list number
|
28
|
+
:origin => '023', # optional
|
29
|
+
:time_stamp => '022', # optional
|
30
|
+
:type => '030',
|
31
|
+
:msisdn => '001'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
def operation_code
|
36
|
+
'14'
|
37
|
+
end
|
38
|
+
|
39
|
+
def default_params(params)
|
40
|
+
params[:type] ||= 1 # pc or mobile?
|
41
|
+
params
|
42
|
+
end
|
43
|
+
|
44
|
+
def check_params(params)
|
45
|
+
if params.has_key?(:msisdn) && params.has_key?(:buddy_number)
|
46
|
+
raise 'msisdn and buddy_number cannot be both present'
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
class SubmitResponse < Message
|
52
|
+
def operation_code
|
53
|
+
'64'
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# cheezmiz - a ruby library for Chikka
|
2
|
+
# Copyright (C) 2010 parasquid
|
3
|
+
#
|
4
|
+
# This file is part of cheezmiz
|
5
|
+
#
|
6
|
+
# This program is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU Affero General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# This program is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU Affero General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU Affero General Public License
|
17
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
|
19
|
+
$: << File.expand_path(File.dirname(__FILE__))
|
20
|
+
require 'message'
|
21
|
+
|
22
|
+
module Cheezmiz
|
23
|
+
class SystemMessage < Message
|
24
|
+
def params_lut
|
25
|
+
{ :message => '032' }
|
26
|
+
end
|
27
|
+
|
28
|
+
def operation_code
|
29
|
+
'55'
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# cheezmiz - a ruby library for Chikka
|
2
|
+
# Copyright (C) 2010 parasquid
|
3
|
+
#
|
4
|
+
# This file is part of cheezmiz
|
5
|
+
#
|
6
|
+
# This program is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU Affero General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# This program is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU Affero General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU Affero General Public License
|
17
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
|
19
|
+
$: << File.expand_path(File.dirname(__FILE__))
|
20
|
+
require 'message'
|
21
|
+
|
22
|
+
module Cheezmiz
|
23
|
+
class UnknownOperation < Message
|
24
|
+
end
|
25
|
+
end
|
data/test/helper.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# cheezmiz - a ruby library for Chikka
|
2
|
+
# Copyright (C) 2010 parasquid
|
3
|
+
#
|
4
|
+
# This file is part of cheezmiz
|
5
|
+
#
|
6
|
+
# This program is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU Affero General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# This program is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU Affero General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU Affero General Public License
|
17
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
|
19
|
+
require 'rubygems'
|
20
|
+
require 'test/unit'
|
21
|
+
|
22
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
23
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
24
|
+
require 'cheezmiz'
|
25
|
+
|
26
|
+
class Test::Unit::TestCase
|
27
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# cheezmiz - a ruby library for Chikka
|
2
|
+
# Copyright (C) 2010 parasquid
|
3
|
+
#
|
4
|
+
# This file is part of cheezmiz
|
5
|
+
#
|
6
|
+
# This program is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU Affero General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# This program is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU Affero General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU Affero General Public License
|
17
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
|
19
|
+
require 'helper'
|
20
|
+
|
21
|
+
class TestCheezmiz < Test::Unit::TestCase
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cheezmiz
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- parasquid
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2010-02-19 00:00:00 +08:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: a ruby library for Chikka
|
17
|
+
email: parasquid@gmail.com
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- LICENSE
|
24
|
+
- README.rdoc
|
25
|
+
files:
|
26
|
+
- .document
|
27
|
+
- .gitignore
|
28
|
+
- LICENSE
|
29
|
+
- README.rdoc
|
30
|
+
- Rakefile
|
31
|
+
- VERSION
|
32
|
+
- cheezmiz.geany
|
33
|
+
- cheezmiz.gemspec
|
34
|
+
- docs/chikka-1.capture
|
35
|
+
- examples/callbacks.rb
|
36
|
+
- lib/broker.rb
|
37
|
+
- lib/cheezmiz.rb
|
38
|
+
- lib/helper.rb
|
39
|
+
- lib/protocol.rb
|
40
|
+
- lib/protocol/buddy.rb
|
41
|
+
- lib/protocol/client_ready.rb
|
42
|
+
- lib/protocol/connection_established.rb
|
43
|
+
- lib/protocol/information.rb
|
44
|
+
- lib/protocol/keep_alive.rb
|
45
|
+
- lib/protocol/login.rb
|
46
|
+
- lib/protocol/message.rb
|
47
|
+
- lib/protocol/submit.rb
|
48
|
+
- lib/protocol/system_message.rb
|
49
|
+
- lib/protocol/unknown_operation.rb
|
50
|
+
- test/helper.rb
|
51
|
+
- test/test_cheezmiz.rb
|
52
|
+
has_rdoc: true
|
53
|
+
homepage: http://github.com/parasquid/cheezmiz
|
54
|
+
licenses: []
|
55
|
+
|
56
|
+
post_install_message:
|
57
|
+
rdoc_options:
|
58
|
+
- --charset=UTF-8
|
59
|
+
require_paths:
|
60
|
+
- lib
|
61
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: "0"
|
66
|
+
version:
|
67
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: "0"
|
72
|
+
version:
|
73
|
+
requirements: []
|
74
|
+
|
75
|
+
rubyforge_project:
|
76
|
+
rubygems_version: 1.3.5
|
77
|
+
signing_key:
|
78
|
+
specification_version: 3
|
79
|
+
summary: a ruby library for Chikka
|
80
|
+
test_files:
|
81
|
+
- test/test_cheezmiz.rb
|
82
|
+
- test/helper.rb
|
83
|
+
- examples/callbacks.rb
|