smsc_manager 0.2.2 → 0.2.3
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/bin/config_smsc.rb +2 -1
- data/lib/smsc_manager/smsc_connection.rb +8 -3
- data/lib/smsc_manager/version.rb +1 -1
- metadata +1 -1
data/bin/config_smsc.rb
CHANGED
@@ -8,6 +8,7 @@ require 'rubygems'
|
|
8
8
|
gem 'smsc_manager'
|
9
9
|
require 'smsc_manager'
|
10
10
|
require 'pp'
|
11
|
+
#puts "ENV #{ENV}"
|
11
12
|
#puts "Argv is: #{ARGV} argv.size is #{ARGV.size}"
|
12
13
|
puts "configuring smsc settings"
|
13
14
|
begin
|
@@ -16,7 +17,7 @@ require 'pp'
|
|
16
17
|
rescue Exception => e
|
17
18
|
puts "exception found"
|
18
19
|
ensure
|
19
|
-
smsc=SmscConnection.new if smsc==nil
|
20
|
+
smsc=SmscManager::SmscConnection.new if smsc==nil
|
20
21
|
end
|
21
22
|
#puts "Argv is: #{ARGV} argv.size is #{ARGV.size}"
|
22
23
|
smsc.hostname=ARGV[0]
|
@@ -27,14 +27,19 @@ class SmscConnection
|
|
27
27
|
puts "-res #{@res} -time #{s}"
|
28
28
|
return @res
|
29
29
|
end
|
30
|
+
def self.path_to_config
|
31
|
+
File.join(File.dirname(__FILE__), '../../config/smsc.yml')
|
32
|
+
end
|
33
|
+
|
30
34
|
def dump
|
31
35
|
#change this in database or here
|
32
|
-
config = File.open(
|
36
|
+
config = File.open(path_to_config,'w') { |f| YAML.dump(self,f) }
|
33
37
|
end
|
34
38
|
def self.load_smsc
|
35
39
|
#change this in database or here
|
36
|
-
|
37
|
-
|
40
|
+
test_path=self.path_to_config
|
41
|
+
puts "Path to config is: #{test_path}"
|
42
|
+
config = File.open(path_to_config) { |f| YAML.load(f) }
|
38
43
|
#puts "config is: #{config} config.class is: #{config.class}"
|
39
44
|
if config.class==SmscManager::SmscConnection
|
40
45
|
smsc=config
|
data/lib/smsc_manager/version.rb
CHANGED