textecho 0.2.0 → 0.2.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.
- checksums.yaml +6 -14
- data/Gemfile.lock +2 -2
- data/lib/textecho/base.rb +3 -2
- data/test/test_echo.rb +16 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
YTJhYjNlZmE1MjY1MzEwZDNiYjQzNGEzYWViYTUyZTNjMzZmOTc5ODc2YzNi
|
10
|
-
NWMzOTRjYzU3MjYwZWZiMDdkOTM5Mzk3OGVhMWE5ZmNlYTJhZjI3N2NjODQx
|
11
|
-
ZDY4ZTVjNWE5M2ExYzFhOWNhM2Y1YTg4YTdhOTg5ZGE3NzBjNTY=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
Mzc1MmYyMDFjNjQzNzAzZmZmMzFmNDViNmQ3NTc5ZWJmMTk5MzBiZWJmZTVl
|
14
|
-
MDAyOGExZjk1NjQ1ODhjZjVmN2QwNTBiYTQzMTZmYmEzNTBkYThkNGU1MWU5
|
15
|
-
MTgxN2M4Njg3NGYwN2Y2ZDhmMzUwMDA3M2MxYmU3MzQzZjQwOGE=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9da72f1e2ee476df02e60ba630c04d2d735661f9
|
4
|
+
data.tar.gz: 10377d464fed76cf0ab06b331efc18cfa37391f1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a477586829eee5c5f1bf7781fe440b7064319c26751bd50331fbc3a911f542a1a69c7d79f2b9c29c7734c6a8dac5c6111ccb1145fdff2474d17f599a32d25989
|
7
|
+
data.tar.gz: 962a5c1614db25e259f0e4b7366c8ecf2959378025e75b8c8b0ac157c3b42db484c59031ecab34cdc1ff8c1fdf057fe9ae3f9af3bc01028e96066aae1c466d91
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
textecho (0.1
|
4
|
+
textecho (0.2.1)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -9,7 +9,7 @@ GEM
|
|
9
9
|
codeclimate-test-reporter (0.1.1)
|
10
10
|
simplecov (>= 0.7.1, < 1.0.0)
|
11
11
|
minitest (5.0.8)
|
12
|
-
multi_json (1.8.
|
12
|
+
multi_json (1.8.2)
|
13
13
|
simplecov (0.7.1)
|
14
14
|
multi_json (~> 1.0)
|
15
15
|
simplecov-html (~> 0.7.1)
|
data/lib/textecho/base.rb
CHANGED
@@ -3,7 +3,7 @@ require 'rubygems'
|
|
3
3
|
|
4
4
|
module Textecho
|
5
5
|
class Base
|
6
|
-
attr_accessor :input_message,:output_message, :output_list,:shortcode, :locale, :msg_source
|
6
|
+
attr_accessor :input_message,:output_message, :output_list,:shortcode, :locale, :msg_source, :params
|
7
7
|
def debug
|
8
8
|
false
|
9
9
|
end
|
@@ -25,12 +25,13 @@ module Textecho
|
|
25
25
|
self.locale="en" if !resp.keys.include? self.locale # set locale to english if not proper
|
26
26
|
return self.help_prefix + resp[self.locale]
|
27
27
|
end
|
28
|
-
def handle_message(src, msg, shortcode,locale=nil)
|
28
|
+
def handle_message(src, msg, shortcode,locale=nil,params={})
|
29
29
|
setup
|
30
30
|
self.locale=locale
|
31
31
|
self.msg_source=src
|
32
32
|
self.shortcode=shortcode
|
33
33
|
self.input_message=msg.downcase
|
34
|
+
self.params=params
|
34
35
|
puts "inspect is #{self.inspect} " if debug
|
35
36
|
process()
|
36
37
|
end
|
data/test/test_echo.rb
CHANGED
@@ -61,6 +61,22 @@ class TestEcho < Minitest::Test #Test::Unit::TestCase
|
|
61
61
|
msgs=@f.handle_message(@source,"help", @f.shortcode)
|
62
62
|
assert msgs.first.include?("Help Message:"), "should be help message but was #{msgs.first}"
|
63
63
|
end
|
64
|
+
def test_params
|
65
|
+
@f=Textecho::Timecheck.new
|
66
|
+
@f.shortcode='123'
|
67
|
+
t=Time.now.to_s
|
68
|
+
msgs=@f.handle_message(@source,"help", @f.shortcode,"en", {:test=> :fred})
|
69
|
+
assert msgs.first.include?("Help Message:"), "should be help message but was #{msgs.first}"
|
70
|
+
assert @f.params[:test]==:fred, "params should be held"
|
71
|
+
end
|
72
|
+
def test_params_blank
|
73
|
+
@f=Textecho::Timecheck.new
|
74
|
+
@f.shortcode='123'
|
75
|
+
t=Time.now.to_s
|
76
|
+
msgs=@f.handle_message(@source,"help", @f.shortcode,"en")
|
77
|
+
assert msgs.first.include?("Help Message:"), "should be help message but was #{msgs.first}"
|
78
|
+
assert @f.params.empty?, "params should be empty"
|
79
|
+
end
|
64
80
|
def test_multi
|
65
81
|
@f=Textecho::Multimessage.new
|
66
82
|
msgs=@f.handle_message(@source,@myMsg, @f.shortcode)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: textecho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Sproule
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-02-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Common application format for telkcomcel in Timor Leste.
|
14
14
|
email: scott.sproule@estormtech.com
|
@@ -36,17 +36,17 @@ require_paths:
|
|
36
36
|
- lib
|
37
37
|
required_ruby_version: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - '>='
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
|
-
- -
|
44
|
+
- - '>='
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: 1.3.4
|
47
47
|
requirements: []
|
48
48
|
rubyforge_project: textecho
|
49
|
-
rubygems_version: 2.
|
49
|
+
rubygems_version: 2.1.7
|
50
50
|
signing_key:
|
51
51
|
specification_version: 4
|
52
52
|
summary: Base sms application
|