ruby-smpp 0.1.0

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.
@@ -0,0 +1,34 @@
1
+ desc 'Release the website and new gem version'
2
+ task :deploy => [:check_version, :release] do
3
+ puts "Remember to create SVN tag:"
4
+ puts "svn copy svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/trunk " +
5
+ "svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
6
+ puts "Suggested comment:"
7
+ puts "Tagging release #{CHANGES}"
8
+ end
9
+
10
+ desc 'Runs install_gem as a local deployment of the gem'
11
+ task :local_deploy => [:install_gem]
12
+
13
+ task :check_version do
14
+ unless ENV['VERSION']
15
+ puts 'Must pass a VERSION=x.y.z release version'
16
+ exit
17
+ end
18
+ unless ENV['VERSION'] == VERS
19
+ puts "Please update your version.rb to match the release version, currently #{VERS}"
20
+ exit
21
+ end
22
+ end
23
+
24
+ desc 'Install the package as a gem, without generating documentation(ri/rdoc)'
25
+ task :install_gem_no_doc => [:clean, :package] do
26
+ sh "#{'sudo ' unless Hoe::WINDOZE }gem install pkg/*.gem --no-rdoc --no-ri"
27
+ end
28
+
29
+ namespace :manifest do
30
+ desc 'Recreate Manifest.txt to include ALL files'
31
+ task :refresh do
32
+ `rake check_manifest | patch -p0 > Manifest.txt`
33
+ end
34
+ end
@@ -0,0 +1,7 @@
1
+ task :ruby_env do
2
+ RUBY_APP = if RUBY_PLATFORM =~ /java/
3
+ "jruby"
4
+ else
5
+ "ruby"
6
+ end unless defined? RUBY_APP
7
+ end
data/test/smpp_test.rb ADDED
@@ -0,0 +1,54 @@
1
+ $:.unshift File.dirname(__FILE__) + '/../lib/'
2
+
3
+ require 'test/unit'
4
+ require 'stringio'
5
+ require 'smpp'
6
+
7
+ module Server1
8
+ def receive_data(data)
9
+ send_data Smpp::Pdu::Unbind.new.data
10
+ end
11
+ end
12
+
13
+ module Server2
14
+ def receive_data(data)
15
+ # problem: our Pdu's should have factory methods for "both ways"; ie. when created
16
+ # by client, and when created from wire data.
17
+ send_data Smpp::Pdu::SubmitSmResponse.new(1, 2, "100").data
18
+ end
19
+ end
20
+
21
+ class SmppTest < Test::Unit::TestCase
22
+
23
+ def config
24
+ {
25
+ :host => 'localhost',
26
+ :port => 2775,
27
+ :system_id => 'foo',
28
+ :password => 'bar',
29
+ :source_ton => 0,
30
+ :source_npi => 1,
31
+ :destination_ton => 1,
32
+ :destination_npi => 1,
33
+ :source_address_range => '',
34
+ :destination_address_range => ''
35
+ }
36
+ end
37
+
38
+ def test_transceiver_should_bind_and_unbind_and_stop
39
+ EventMachine.run {
40
+ EventMachine.start_server "localhost", 9000, Server1
41
+ EventMachine.connect "localhost", 9000, Smpp::Transceiver, config, nil, nil
42
+ }
43
+ # should not hang here: the server's response should have caused the client to terminate
44
+ end
45
+
46
+ def ____test_transceiver_should_send_mt
47
+ EventMachine.run {
48
+ EventMachine.start_server "localhost", 9000, Server2
49
+ EventMachine.connect "localhost", 9000, Smpp::Transceiver, config, nil, nil
50
+ }
51
+ # should not hang here: the server's response should have caused the client to terminate
52
+ end
53
+
54
+ end
@@ -0,0 +1,2 @@
1
+ require 'test/unit'
2
+ require File.dirname(__FILE__) + '/../lib/smpp'
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby-smpp
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - August Z. Flatby
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-04-09 00:00:00 +02:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: eventmachine
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.10.0
23
+ version:
24
+ description: Ruby-implementation of the SMPP protocol, based on EventMachine. SMPP is a protocol that allows ordinary people outside the mobile network to exchange SMS messages directly with mobile operators.
25
+ email:
26
+ - august@apparat.no
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - History.txt
33
+ - License.txt
34
+ - Manifest.txt
35
+ - README.txt
36
+ files:
37
+ - History.txt
38
+ - License.txt
39
+ - Manifest.txt
40
+ - README.txt
41
+ - Rakefile
42
+ - examples/sample_gateway.rb
43
+ - config/hoe.rb
44
+ - config/requirements.rb
45
+ - lib/smpp.rb
46
+ - lib/smpp/version.rb
47
+ - lib/smpp/base.rb
48
+ - lib/smpp/pdu/base.rb
49
+ - lib/smpp/pdu/bind_transceiver.rb
50
+ - lib/smpp/pdu/bind_transceiver_response.rb
51
+ - lib/smpp/pdu/deliver_sm.rb
52
+ - lib/smpp/pdu/deliver_sm_response.rb
53
+ - lib/smpp/pdu/enquire_link.rb
54
+ - lib/smpp/pdu/enquire_link_response.rb
55
+ - lib/smpp/pdu/generic_nack.rb
56
+ - lib/smpp/pdu/submit_sm.rb
57
+ - lib/smpp/pdu/submit_sm_response.rb
58
+ - lib/smpp/pdu/unbind.rb
59
+ - lib/smpp/pdu/unbind_response.rb
60
+ - lib/smpp/transceiver.rb
61
+ - lib/sms.rb
62
+ - log/
63
+ - script/console
64
+ - script/destroy
65
+ - script/generate
66
+ - script/txt2html
67
+ - setup.rb
68
+ - tasks/deployment.rake
69
+ - tasks/environment.rake
70
+ - test/smpp_test.rb
71
+ - test/test_helper.rb
72
+ has_rdoc: true
73
+ homepage: http://ruby-smpp.rubyforge.org
74
+ post_install_message:
75
+ rdoc_options:
76
+ - --main
77
+ - README.txt
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: "0"
85
+ version:
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: "0"
91
+ version:
92
+ requirements: []
93
+
94
+ rubyforge_project: ruby-smpp
95
+ rubygems_version: 1.0.1
96
+ signing_key:
97
+ specification_version: 2
98
+ summary: Ruby-implementation of the SMPP protocol, based on EventMachine. SMPP is a protocol that allows ordinary people outside the mobile network to exchange SMS messages directly with mobile operators.
99
+ test_files:
100
+ - test/test_helper.rb