freewifi 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c54a90d059d00b5db738b84aa5a2caa533699b19
4
- data.tar.gz: 3fadd571c3e5f9bb3a856aa88af7b8a7f80ef223
3
+ metadata.gz: f7e5300af83a7fca2253ee131b16800853195723
4
+ data.tar.gz: 5b3d74f4b4106e9ec53d7e0309859ee137c34773
5
5
  SHA512:
6
- metadata.gz: 914c4f949ff352b3e08ca1a79d5500e253f2bc5d03263736b1b94d920a518132de3f0a12898a086e8b9c946cffa9049bdb321032d876310ed5a54791a10f8760
7
- data.tar.gz: e2c4dbe414c54c6c252e3e8df144f6a3ce2ba2d20d7cec652915989551cde497fb29f7fdfb736898db6a1b15c8a59892428c205f4deab3dee6d029d3301da12d
6
+ metadata.gz: 91b9be69e8e84fe3194174600d5a8d617c99e53d8cd1fd483db316c26e2fa5350168ed7fd3ad8ee04a6d32a0a6c9a3c811bff262f8202e6858962c73c8fe87e6
7
+ data.tar.gz: 71e387524313bec8a6379a2495a3e469b447fcfe6bed386a447ad77703e99fb309c831f99648c009f15b06d77b5e1cce5a2f7cf1191aff9ecd85c321096b3af2
data/.idea/workspace.xml CHANGED
@@ -21,7 +21,7 @@
21
21
  <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/freewifi.rb" />
22
22
  <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/freewifi/additional/additional_functions.rb" />
23
23
  <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/freewifi/database/mongo/mongoconnector.rb" />
24
- <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/freewifi/database/mysql/database_methods.rb" />
24
+ <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/freewifi/database/mysql/database_methods_wifi.rb" />
25
25
  <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/freewifi/mikrotik/getsubscribermikrotik.rb" />
26
26
  <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/freewifi/mikrotik/hewhub_mtik_ssh.rb" />
27
27
  <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/lib/freewifi/version.rb" />
@@ -37,7 +37,7 @@
37
37
  </component>
38
38
  <component name="ChangesViewManager" flattened_view="false" />
39
39
  <component name="CoverageDataManager">
40
- <SUITE FILE_PATH="coverage/freewifi@test_helper.coverage" NAME="test_helper Coverage Results" MODIFIED="1587949998457" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test" MODULE_NAME="freewifi" />
40
+ <SUITE FILE_PATH="coverage/freewifi@test_helper.coverage" NAME="test_helper Coverage Results" MODIFIED="1587955989063" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test" MODULE_NAME="freewifi" />
41
41
  <SUITE FILE_PATH="coverage/freewifi@test.coverage" NAME="test Coverage Results" MODIFIED="1587924491650" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/test" MODULE_NAME="freewifi" />
42
42
  <SUITE FILE_PATH="coverage/freewifi@hewhub_mtik_ssh.coverage" NAME="hewhub_mtik_ssh Coverage Results" MODIFIED="1587796347972" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="rcov" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/lib/freewifi/mikrotik" MODULE_NAME="freewifi" />
43
43
  </component>
@@ -64,11 +64,21 @@
64
64
  </provider>
65
65
  </entry>
66
66
  </file>
67
- <file leaf-file-name="test_helper.rb" pinned="false" current-in-tab="true">
67
+ <file leaf-file-name="test_helper.rb" pinned="false" current-in-tab="false">
68
68
  <entry file="file://$PROJECT_DIR$/test/test_helper.rb">
69
69
  <provider selected="true" editor-type-id="text-editor">
70
- <state relative-caret-position="417">
71
- <caret line="47" column="0" lean-forward="true" selection-start-line="47" selection-start-column="0" selection-end-line="47" selection-end-column="0" />
70
+ <state relative-caret-position="656">
71
+ <caret line="46" column="37" lean-forward="false" selection-start-line="46" selection-start-column="37" selection-end-line="46" selection-end-column="37" />
72
+ <folding />
73
+ </state>
74
+ </provider>
75
+ </entry>
76
+ </file>
77
+ <file leaf-file-name="getsubscribermikrotik.rb" pinned="false" current-in-tab="false">
78
+ <entry file="file://$PROJECT_DIR$/lib/freewifi/mikrotik/getsubscribermikrotik.rb">
79
+ <provider selected="true" editor-type-id="text-editor">
80
+ <state relative-caret-position="0">
81
+ <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
72
82
  <folding />
73
83
  </state>
74
84
  </provider>
@@ -77,58 +87,58 @@
77
87
  <file leaf-file-name="hewhub_mtik_ssh.rb" pinned="false" current-in-tab="false">
78
88
  <entry file="file://$PROJECT_DIR$/lib/freewifi/mikrotik/hewhub_mtik_ssh.rb">
79
89
  <provider selected="true" editor-type-id="text-editor">
80
- <state relative-caret-position="-313">
81
- <caret line="148" column="6" lean-forward="false" selection-start-line="148" selection-start-column="6" selection-end-line="148" selection-end-column="6" />
90
+ <state relative-caret-position="968">
91
+ <caret line="182" column="11" lean-forward="true" selection-start-line="182" selection-start-column="11" selection-end-line="182" selection-end-column="11" />
82
92
  <folding />
83
93
  </state>
84
94
  </provider>
85
95
  </entry>
86
96
  </file>
87
- <file leaf-file-name="freewifi.rb" pinned="false" current-in-tab="false">
88
- <entry file="file://$PROJECT_DIR$/lib/freewifi.rb">
97
+ <file leaf-file-name="mongoconnector.rb" pinned="false" current-in-tab="false">
98
+ <entry file="file://$PROJECT_DIR$/lib/freewifi/database/mongo/mongoconnector.rb">
89
99
  <provider selected="true" editor-type-id="text-editor">
90
- <state relative-caret-position="257">
91
- <caret line="114" column="56" lean-forward="false" selection-start-line="114" selection-start-column="56" selection-end-line="114" selection-end-column="56" />
100
+ <state relative-caret-position="105">
101
+ <caret line="7" column="11" lean-forward="false" selection-start-line="7" selection-start-column="11" selection-end-line="7" selection-end-column="11" />
92
102
  <folding />
93
103
  </state>
94
104
  </provider>
95
105
  </entry>
96
106
  </file>
97
- <file leaf-file-name="version.rb" pinned="false" current-in-tab="false">
98
- <entry file="file://$PROJECT_DIR$/lib/freewifi/version.rb">
107
+ <file leaf-file-name="freewifi.rb" pinned="false" current-in-tab="false">
108
+ <entry file="file://$PROJECT_DIR$/lib/freewifi.rb">
99
109
  <provider selected="true" editor-type-id="text-editor">
100
- <state relative-caret-position="0">
101
- <caret line="0" column="15" lean-forward="false" selection-start-line="0" selection-start-column="7" selection-end-line="0" selection-end-column="15" />
110
+ <state relative-caret-position="1364">
111
+ <caret line="114" column="33" lean-forward="false" selection-start-line="114" selection-start-column="33" selection-end-line="114" selection-end-column="33" />
102
112
  <folding />
103
113
  </state>
104
114
  </provider>
105
115
  </entry>
106
116
  </file>
107
- <file leaf-file-name="mongoconnector.rb" pinned="false" current-in-tab="false">
108
- <entry file="file://$PROJECT_DIR$/lib/freewifi/database/mongo/mongoconnector.rb">
117
+ <file leaf-file-name="database_methods_wifi.rb" pinned="false" current-in-tab="false">
118
+ <entry file="file://$PROJECT_DIR$/lib/freewifi/database/mysql/database_methods_wifi.rb">
109
119
  <provider selected="true" editor-type-id="text-editor">
110
- <state relative-caret-position="339">
111
- <caret line="31" column="43" lean-forward="false" selection-start-line="31" selection-start-column="43" selection-end-line="31" selection-end-column="43" />
120
+ <state relative-caret-position="195">
121
+ <caret line="13" column="0" lean-forward="true" selection-start-line="13" selection-start-column="0" selection-end-line="13" selection-end-column="0" />
112
122
  <folding />
113
123
  </state>
114
124
  </provider>
115
125
  </entry>
116
126
  </file>
117
- <file leaf-file-name="additional_functions.rb" pinned="false" current-in-tab="false">
118
- <entry file="file://$PROJECT_DIR$/lib/freewifi/additional/additional_functions.rb">
127
+ <file leaf-file-name="version.rb" pinned="false" current-in-tab="true">
128
+ <entry file="file://$PROJECT_DIR$/lib/freewifi/version.rb">
119
129
  <provider selected="true" editor-type-id="text-editor">
120
- <state relative-caret-position="169">
121
- <caret line="15" column="93" lean-forward="false" selection-start-line="15" selection-start-column="60" selection-end-line="15" selection-end-column="93" />
130
+ <state relative-caret-position="15">
131
+ <caret line="1" column="18" lean-forward="false" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
122
132
  <folding />
123
133
  </state>
124
134
  </provider>
125
135
  </entry>
126
136
  </file>
127
- <file leaf-file-name="test.rb" pinned="false" current-in-tab="false">
128
- <entry file="file://$PROJECT_DIR$/test/test.rb">
137
+ <file leaf-file-name="additional_functions.rb" pinned="false" current-in-tab="false">
138
+ <entry file="file://$PROJECT_DIR$/lib/freewifi/additional/additional_functions.rb">
129
139
  <provider selected="true" editor-type-id="text-editor">
130
- <state relative-caret-position="75">
131
- <caret line="5" column="22" lean-forward="false" selection-start-line="5" selection-start-column="22" selection-end-line="5" selection-end-column="22" />
140
+ <state relative-caret-position="405">
141
+ <caret line="27" column="6" lean-forward="false" selection-start-line="27" selection-start-column="6" selection-end-line="27" selection-end-column="6" />
132
142
  <folding />
133
143
  </state>
134
144
  </provider>
@@ -146,12 +156,13 @@
146
156
  <option value="$PROJECT_DIR$/test/test.rb" />
147
157
  <option value="$PROJECT_DIR$/lib/freewifi/database/mysql/database_methods.rb" />
148
158
  <option value="$PROJECT_DIR$/freewifi.gemspec" />
149
- <option value="$PROJECT_DIR$/lib/freewifi/mikrotik/hewhub_mtik_ssh.rb" />
150
- <option value="$PROJECT_DIR$/lib/freewifi.rb" />
151
- <option value="$PROJECT_DIR$/test/test_helper.rb" />
152
- <option value="$PROJECT_DIR$/lib/freewifi/version.rb" />
153
159
  <option value="$PROJECT_DIR$/lib/freewifi/additional/additional_functions.rb" />
160
+ <option value="$PROJECT_DIR$/test/test_helper.rb" />
161
+ <option value="$PROJECT_DIR$/lib/freewifi/database/mysql/database_methods_wifi.rb" />
154
162
  <option value="$PROJECT_DIR$/lib/freewifi/database/mongo/mongoconnector.rb" />
163
+ <option value="$PROJECT_DIR$/lib/freewifi.rb" />
164
+ <option value="$PROJECT_DIR$/lib/freewifi/mikrotik/hewhub_mtik_ssh.rb" />
165
+ <option value="$PROJECT_DIR$/lib/freewifi/version.rb" />
155
166
  </list>
156
167
  </option>
157
168
  </component>
@@ -587,23 +598,22 @@
587
598
  <workItem from="1586123375665" duration="1948000" />
588
599
  <workItem from="1586354062505" duration="297000" />
589
600
  <workItem from="1586463231468" duration="598000" />
590
- <workItem from="1587794173933" duration="20030000" />
601
+ <workItem from="1587794173933" duration="25175000" />
591
602
  </task>
592
603
  <servers />
593
604
  </component>
594
605
  <component name="TimeTrackingManager">
595
- <option name="totallyTimeSpent" value="32162000" />
606
+ <option name="totallyTimeSpent" value="37307000" />
596
607
  </component>
597
608
  <component name="ToolWindowManager">
598
609
  <frame x="0" y="0" width="1440" height="900" extended-state="0" />
599
- <editor active="true" />
600
610
  <layout>
601
- <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.30615166" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
611
+ <window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.30615166" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
602
612
  <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
603
613
  <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
604
614
  <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
605
615
  <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.329602" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
606
- <window_info id="Run" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.3283582" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
616
+ <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3283582" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
607
617
  <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
608
618
  <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.24964234" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
609
619
  <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
@@ -948,14 +958,6 @@
948
958
  </state>
949
959
  </provider>
950
960
  </entry>
951
- <entry file="file://$PROJECT_DIR$/lib/freewifi/mikrotik/getsubscribermikrotik.rb">
952
- <provider selected="true" editor-type-id="text-editor">
953
- <state relative-caret-position="0">
954
- <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
955
- <folding />
956
- </state>
957
- </provider>
958
- </entry>
959
961
  <entry file="file://$PROJECT_DIR$/test/test.rb">
960
962
  <provider selected="true" editor-type-id="text-editor">
961
963
  <state relative-caret-position="75">
@@ -964,10 +966,10 @@
964
966
  </state>
965
967
  </provider>
966
968
  </entry>
967
- <entry file="file://$PROJECT_DIR$/lib/freewifi/database/mysql/database_methods.rb">
969
+ <entry file="file://$PROJECT_DIR$/Gemfile">
968
970
  <provider selected="true" editor-type-id="text-editor">
969
- <state relative-caret-position="120">
970
- <caret line="8" column="68" lean-forward="false" selection-start-line="8" selection-start-column="17" selection-end-line="8" selection-end-column="68" />
971
+ <state relative-caret-position="0">
972
+ <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
971
973
  <folding />
972
974
  </state>
973
975
  </provider>
@@ -980,58 +982,66 @@
980
982
  </state>
981
983
  </provider>
982
984
  </entry>
983
- <entry file="file://$PROJECT_DIR$/Gemfile">
985
+ <entry file="file://$PROJECT_DIR$/lib/freewifi/database/mongo/mongoconnector.rb">
984
986
  <provider selected="true" editor-type-id="text-editor">
985
- <state relative-caret-position="0">
986
- <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
987
+ <state relative-caret-position="105">
988
+ <caret line="7" column="11" lean-forward="false" selection-start-line="7" selection-start-column="11" selection-end-line="7" selection-end-column="11" />
987
989
  <folding />
988
990
  </state>
989
991
  </provider>
990
992
  </entry>
991
- <entry file="file://$PROJECT_DIR$/lib/freewifi/mikrotik/hewhub_mtik_ssh.rb">
993
+ <entry file="file://$PROJECT_DIR$/lib/freewifi/database/mysql/database_methods_wifi.rb">
992
994
  <provider selected="true" editor-type-id="text-editor">
993
- <state relative-caret-position="-313">
994
- <caret line="148" column="6" lean-forward="false" selection-start-line="148" selection-start-column="6" selection-end-line="148" selection-end-column="6" />
995
+ <state relative-caret-position="195">
996
+ <caret line="13" column="0" lean-forward="true" selection-start-line="13" selection-start-column="0" selection-end-line="13" selection-end-column="0" />
995
997
  <folding />
996
998
  </state>
997
999
  </provider>
998
1000
  </entry>
999
- <entry file="file://$PROJECT_DIR$/lib/freewifi.rb">
1001
+ <entry file="file://$PROJECT_DIR$/lib/freewifi/additional/additional_functions.rb">
1000
1002
  <provider selected="true" editor-type-id="text-editor">
1001
- <state relative-caret-position="257">
1002
- <caret line="114" column="56" lean-forward="false" selection-start-line="114" selection-start-column="56" selection-end-line="114" selection-end-column="56" />
1003
+ <state relative-caret-position="405">
1004
+ <caret line="27" column="6" lean-forward="false" selection-start-line="27" selection-start-column="6" selection-end-line="27" selection-end-column="6" />
1003
1005
  <folding />
1004
1006
  </state>
1005
1007
  </provider>
1006
1008
  </entry>
1007
- <entry file="file://$PROJECT_DIR$/lib/freewifi/version.rb">
1009
+ <entry file="file://$PROJECT_DIR$/test/test_helper.rb">
1008
1010
  <provider selected="true" editor-type-id="text-editor">
1009
- <state relative-caret-position="0">
1010
- <caret line="0" column="15" lean-forward="false" selection-start-line="0" selection-start-column="7" selection-end-line="0" selection-end-column="15" />
1011
+ <state relative-caret-position="656">
1012
+ <caret line="46" column="37" lean-forward="false" selection-start-line="46" selection-start-column="37" selection-end-line="46" selection-end-column="37" />
1011
1013
  <folding />
1012
1014
  </state>
1013
1015
  </provider>
1014
1016
  </entry>
1015
- <entry file="file://$PROJECT_DIR$/lib/freewifi/additional/additional_functions.rb">
1017
+ <entry file="file://$PROJECT_DIR$/lib/freewifi.rb">
1016
1018
  <provider selected="true" editor-type-id="text-editor">
1017
- <state relative-caret-position="169">
1018
- <caret line="15" column="93" lean-forward="false" selection-start-line="15" selection-start-column="60" selection-end-line="15" selection-end-column="93" />
1019
+ <state relative-caret-position="1364">
1020
+ <caret line="114" column="33" lean-forward="false" selection-start-line="114" selection-start-column="33" selection-end-line="114" selection-end-column="33" />
1019
1021
  <folding />
1020
1022
  </state>
1021
1023
  </provider>
1022
1024
  </entry>
1023
- <entry file="file://$PROJECT_DIR$/lib/freewifi/database/mongo/mongoconnector.rb">
1025
+ <entry file="file://$PROJECT_DIR$/lib/freewifi/mikrotik/getsubscribermikrotik.rb">
1024
1026
  <provider selected="true" editor-type-id="text-editor">
1025
- <state relative-caret-position="339">
1026
- <caret line="31" column="43" lean-forward="false" selection-start-line="31" selection-start-column="43" selection-end-line="31" selection-end-column="43" />
1027
+ <state relative-caret-position="0">
1028
+ <caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
1027
1029
  <folding />
1028
1030
  </state>
1029
1031
  </provider>
1030
1032
  </entry>
1031
- <entry file="file://$PROJECT_DIR$/test/test_helper.rb">
1033
+ <entry file="file://$PROJECT_DIR$/lib/freewifi/mikrotik/hewhub_mtik_ssh.rb">
1034
+ <provider selected="true" editor-type-id="text-editor">
1035
+ <state relative-caret-position="968">
1036
+ <caret line="182" column="11" lean-forward="true" selection-start-line="182" selection-start-column="11" selection-end-line="182" selection-end-column="11" />
1037
+ <folding />
1038
+ </state>
1039
+ </provider>
1040
+ </entry>
1041
+ <entry file="file://$PROJECT_DIR$/lib/freewifi/version.rb">
1032
1042
  <provider selected="true" editor-type-id="text-editor">
1033
- <state relative-caret-position="417">
1034
- <caret line="47" column="0" lean-forward="true" selection-start-line="47" selection-start-column="0" selection-end-line="47" selection-end-column="0" />
1043
+ <state relative-caret-position="15">
1044
+ <caret line="1" column="18" lean-forward="false" selection-start-line="1" selection-start-column="18" selection-end-line="1" selection-end-column="18" />
1035
1045
  <folding />
1036
1046
  </state>
1037
1047
  </provider>
@@ -11,7 +11,7 @@ class InternalFunc
11
11
  d_curr.to_s
12
12
  end
13
13
 
14
- def printer_texter(text, log_level)
14
+ def printer_texter_wifi(text, log_level)
15
15
  begin
16
16
  mess = {:datetime => datetimenow, :sdk => "freewifi", :sdk_version => Freewifi::VERSION, :message => text}
17
17
  p mess
@@ -25,7 +25,7 @@ class InternalFunc
25
25
  "#{tunnel_id.to_s}_eoip_hub_auto_#{comp_name}"
26
26
  end
27
27
 
28
- def company_check(compname)
28
+ def company_check_wifi(compname)
29
29
  compname2=""
30
30
  if compname.include?(" ")
31
31
  compname2 = compname.gsub(" ","")
@@ -5,7 +5,7 @@ require 'rubygems'
5
5
  require 'freewifi/additional/additional_functions'
6
6
 
7
7
  #class for communication with mongo database for iot API
8
- class MongoWifi
8
+ class MongoWifiCl
9
9
 
10
10
  attr_accessor :mongo_ip, :mongo_port, :client, :mongo_database, :additional_func
11
11
 
@@ -18,7 +18,7 @@ class MongoWifi
18
18
  @additional_func = InternalFunc.new
19
19
  end
20
20
 
21
- def audit_logger(proc_name, src_ip, input_json, output_json, real_ip, subscriber_ip)
21
+ def audit_logger_wifi(proc_name, src_ip, input_json, output_json, real_ip, subscriber_ip)
22
22
  out_resp = {}
23
23
  begin
24
24
  current = additional_func.datetimenow
@@ -36,7 +36,7 @@ class MongoWifi
36
36
  rescue
37
37
  out_resp = {:code => 507, :result => "audit_logger: Unknown SDK error"}
38
38
  end
39
- additional_func.printer_texter(out_resp, "debug")
39
+ additional_func.printer_texter_wifi(out_resp, "debug")
40
40
  out_resp
41
41
  end
42
42
 
@@ -51,11 +51,11 @@ class MongoWifi
51
51
  rescue
52
52
  output_params = {:code => 500, :result => "data_ap_auto_created_insert: failed insert data to mongo"}
53
53
  end
54
- additional_func.printer_texter({:input_params => input_params, :output_params => output_params, :procedure => "data_ap_auto_created_insert", :file => "freewifi/database/mongo/mongoconnector.rb"}, "debug")
54
+ additional_func.printer_texter_wifi({:input_params => input_params, :output_params => output_params, :procedure => "data_ap_auto_created_insert", :file => "freewifi/database/mongo/mongoconnector.rb"}, "debug")
55
55
  output_params
56
56
  end
57
57
 
58
- def get_ap_info_sim_ip(sim_ipaddress, sim_msisdn)
58
+ def get_ap_info_sim_ip_wifi(sim_ipaddress, sim_msisdn)
59
59
  begin
60
60
  result_ps = []
61
61
  collection = client[:ap_auto_created]
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'mysql2'
4
4
 
5
- class DatabaseMethods
5
+ class DatabaseMethodsWifi
6
6
 
7
7
  attr_accessor :database_username, :database_password, :database_host
8
8
 
@@ -6,9 +6,9 @@ require 'date'
6
6
  require "freewifi/additional/additional_functions"
7
7
 
8
8
 
9
- class NEWhub
9
+ class NEWhubWifi
10
10
 
11
- attr_accessor :t_id_min, :t_id_max, :all_tunids, :additional_func
11
+ attr_accessor :t_id_min, :t_id_max, :all_tunids, :additional_func_wifi
12
12
 
13
13
  def initialize
14
14
  @t_id_min = 10001
@@ -106,7 +106,7 @@ class NEWhub
106
106
  rescue
107
107
  output_params = {:code => 500, :result => "get_tun_id2: Something Wrong"}
108
108
  end
109
- additional_func.printer_texter({:input_params => input_params, :output_params => output_params, :procedure => "get_tun_id2"}, "debug")
109
+ additional_func_wifi.printer_texter_wifi({:input_params => input_params, :output_params => output_params, :procedure => "get_tun_id2"}, "debug")
110
110
  output_params
111
111
  end
112
112
 
@@ -135,7 +135,7 @@ class NEWhub
135
135
  output_params = {:code => 500, :result => "hub_get_all_eoip_tunnels: Something Wrong"}
136
136
  end
137
137
 
138
- additional_func.printer_texter({:input_params => input_params, :output_params => output_params, :procedure => "hub_get_all_eoip_tunnels"}, "debug")
138
+ additional_func_wifi.printer_texter_wifi({:input_params => input_params, :output_params => output_params, :procedure => "hub_get_all_eoip_tunnels"}, "debug")
139
139
  output_params
140
140
 
141
141
  #m1 = reg_tunnelid.scan(result)
@@ -146,7 +146,7 @@ class NEWhub
146
146
  end
147
147
 
148
148
 
149
- def add_eoip_for_mikr(bridge_name, ap_ip_address, company_name, hub1, hub2, user_hub, password_hub)
149
+ def add_eoip_for_mikr_wifi(bridge_name, ap_ip_address, company_name, hub1, hub2, user_hub, password_hub)
150
150
 
151
151
  input_params = {:bridge_name => bridge_name,
152
152
  :ap_ip_address => ap_ip_address,
@@ -161,7 +161,7 @@ class NEWhub
161
161
  hub2_processed = ""
162
162
 
163
163
  get_tun_id_answ = get_tun_id2(1, hub_get_all_eoip_tunnels(hub1, user_hub, password_hub)[:body][:busy_tunnel_ids])
164
- eoip_tunnel_name = additional_func.hub_tunnelname_generator(get_tun_id_answ[:body][:selected_tun_ids][0], company_name)
164
+ eoip_tunnel_name = additional_func_wifi.hub_tunnelname_generator(get_tun_id_answ[:body][:selected_tun_ids][0], company_name)
165
165
 
166
166
  if get_tun_id_answ[:code] == 200
167
167
 
@@ -190,7 +190,7 @@ class NEWhub
190
190
  else
191
191
  output_params = {:code => 500, :result => "add_eoip_for_mikr: Something Wrong with empty eoip tun id"}
192
192
  end
193
- additional_func.printer_texter({:input_params => input_params, :output_params => output_params, :procedure => "add_eoip_for_mikr"}, "debug")
193
+ additional_func_wifi.printer_texter_wifi({:input_params => input_params, :output_params => output_params, :procedure => "add_eoip_for_mikr"}, "debug")
194
194
  output_params
195
195
  end
196
196
 
@@ -1,3 +1,3 @@
1
1
  module Freewifi
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
data/lib/freewifi.rb CHANGED
@@ -6,7 +6,7 @@ $LOAD_PATH.unshift File.expand_path("../additional", __dir__)
6
6
 
7
7
  require "freewifi/version"
8
8
  require 'freewifi/mikrotik/hewhub_mtik_ssh'
9
- require 'freewifi/database/mysql/database_methods'
9
+ require 'freewifi/database/mysql/database_methods_wifi'
10
10
  require 'freewifi/database/mongo/mongoconnector'
11
11
  require 'date'
12
12
 
@@ -20,22 +20,22 @@ module Freewifi
20
20
  :password_hub,
21
21
  :cps_class,
22
22
  :db_mysql,
23
- :additional_func,
23
+ :additional_func_wifi,
24
24
  :ssh_mikrotik_connector,
25
- :mongo_connector,
25
+ :mongo_connector_wifi,
26
26
  :remote_ip,
27
27
  :real_ip,
28
28
  :subscriber_ip
29
29
 
30
- def initialize(hub1ip, hub2ip, username_hub, password_hub, database_username, database_password, database_host, mongo_ip, mongo_port, mongo_database, remote_ip, real_ip,subscriber_ip)
30
+ def initialize(hub1ip, hub2ip, username_hub, password_hub, database_username, database_password, database_host, mongo_ip, mongo_port, mongo_database, remote_ip, real_ip, subscriber_ip)
31
31
  @mtik_hub1_ip = hub1ip
32
32
  @mtik_hub2_ip = hub2ip
33
33
  @user_hub = username_hub
34
34
  @password_hub = password_hub
35
- @db_mysql = DatabaseMethods.new(database_username, database_password, database_host)
36
- @additional_func = InternalFunc.new
37
- @ssh_mikrotik_connector = NEWhub.new
38
- @mongo_connector = MongoWifi.new(mongo_ip, mongo_port, mongo_database)
35
+ @db_mysql = DatabaseMethodsWifi.new(database_username, database_password, database_host)
36
+ @additional_func_wifi = InternalFunc.new
37
+ @ssh_mikrotik_connector = NEWhubWifi.new
38
+ @mongo_connector = MongoWifiCl.new(mongo_ip, mongo_port, mongo_database)
39
39
  @remote_ip = remote_ip
40
40
  @real_ip = real_ip
41
41
  @subscriber_ip = subscriber_ip
@@ -62,18 +62,18 @@ module Freewifi
62
62
 
63
63
  begin
64
64
 
65
- processed_comp_name = additional_func.company_check(company_name)
65
+ processed_comp_name = additional_func_wifi.company_check_wifi(company_name)
66
66
  #p ap_state = db_mysql.check_mikrotik_ap_exists(sim_ipaddress, sim_msisdn).to_s
67
- ap_state = mongo_connector.get_ap_info_sim_ip(sim_ipaddress, sim_msisdn).to_s
67
+ ap_state = mongo_connector_wifi.get_ap_info_sim_ip_wifi(sim_ipaddress, sim_msisdn).to_s
68
68
 
69
69
  if ap_state == "" || ap_state == nil || ap_state == "[]" || ap_state == "fttx"
70
- tunnel_addition = ssh_mikrotik_connector.add_eoip_for_mikr(bridge_name_hub,
71
- sim_ipaddress,
72
- processed_comp_name,
73
- mtik_hub1_ip,
74
- mtik_hub2_ip,
75
- user_hub,
76
- password_hub)
70
+ tunnel_addition = ssh_mikrotik_connector.add_eoip_for_mikr_wifi(bridge_name_hub,
71
+ sim_ipaddress,
72
+ processed_comp_name,
73
+ mtik_hub1_ip,
74
+ mtik_hub2_ip,
75
+ user_hub,
76
+ password_hub)
77
77
 
78
78
 
79
79
  if tunnel_addition[:code] == 200
@@ -97,7 +97,7 @@ module Freewifi
97
97
  :created_date => DateTime.now
98
98
  }
99
99
 
100
- mongo_response = mongo_connector.data_ap_auto_created_insert(data)
100
+ mongo_response = mongo_connector_wifi.data_ap_auto_created_insert(data)
101
101
  if mongo_response[:code]==200
102
102
  output_params = {:code => 200, :result => "Request completed successfully", :body => {:tunnel_id => tunnel_addition[:body][:eoip_tunnel_id], :tunnel_name => tunnel_addition[:body][:eoip_tunnel_name]}}
103
103
  else
@@ -112,34 +112,34 @@ module Freewifi
112
112
  rescue
113
113
  output_params = {:code => 507, :result => "Unknown SDK error"}
114
114
  end
115
- mongo_connector.audit_logger("add_mikrotik_ap_mobile", remote_ip, input_params, output_params, real_ip, subscriber_ip)
115
+ mongo_connector_wifi.audit_logger_wifi("add_mikrotik_ap_mobile", remote_ip, input_params, output_params, real_ip, subscriber_ip)
116
116
  #additional_func.printer_texter({:input_params => input_params, :output_params => output_params, :procedure => "add_mikrotik_ap_mobile", :file => "freewifi.rb"}, "info")
117
117
  output_params
118
118
  end
119
119
 
120
120
 
121
121
  def add_eoip_for_mikr_hub(bridge_name, ap_ip_address, tunnel_name)
122
- newhub = NEWhub.new
123
- newhub.add_eoip_for_mikr(bridge_name,
124
- ap_ip_address,
125
- tunnel_name,
126
- mtik_hub1_ip,
127
- mtik_hub2_ip,
128
- user_hub,
129
- password_hub)
122
+ newhub = NEWhubWifi.new
123
+ newhub.add_eoip_for_mikr_wifi(bridge_name,
124
+ ap_ip_address,
125
+ tunnel_name,
126
+ mtik_hub1_ip,
127
+ mtik_hub2_ip,
128
+ user_hub,
129
+ password_hub)
130
130
  end
131
131
 
132
132
  def del_one_eoip_from_mikr_hub(tunnel_id)
133
- newhub1 = NEWhub.new
133
+ newhub1 = NEWhubWifi.new
134
134
  newhub1.del_eoip_for_mikr(tunnel_id, mtik_hub1_ip, mtik_hub2_ip, user_hub, password_hub)
135
135
  p tid = tunnel_id.to_i
136
- mongo_connector.tunnelid_remove_single_mongo(tid)
136
+ mongo_connector_wifi.tunnelid_remove_single_mongo(tid)
137
137
  end
138
138
 
139
139
  def test()
140
140
  #newhub1 = NEWhub.new
141
141
  #newhub1.hub_get_all_eoip_tunnels("172.24.223.132", "soapgw", "fr8Hn3Ed2k0Im4gWmav2Nh7Y1qAm8KlmRh3Dcu2Wcok5gBdm")
142
- mongo_connector.data_ap_auto_created_insert(:test => "test")
142
+ mongo_connector_wifi.data_ap_auto_created_insert(:test => "test")
143
143
  end
144
144
  end
145
145
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freewifi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dzmitry Buynovskiy
@@ -162,7 +162,7 @@ files:
162
162
  - lib/freewifi.rb
163
163
  - lib/freewifi/additional/additional_functions.rb
164
164
  - lib/freewifi/database/mongo/mongoconnector.rb
165
- - lib/freewifi/database/mysql/database_methods.rb
165
+ - lib/freewifi/database/mysql/database_methods_wifi.rb
166
166
  - lib/freewifi/mikrotik/getsubscribermikrotik.rb
167
167
  - lib/freewifi/mikrotik/hewhub_mtik_ssh.rb
168
168
  - lib/freewifi/version.rb