gloo 4.2.0 → 4.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf2e3b4867f61cc9d1efcf48e5bbd409301cd981c3c060fd5da9d44341886068
4
- data.tar.gz: d792df8a9e6b02db122bc4e6a59ed6169bd2cef0de02fe60a9c8c0f024551dc0
3
+ metadata.gz: f68137523fd4bda7f48c75dc97b99da12dd24b4bc12dbe6ec1a5d608b05e7ab3
4
+ data.tar.gz: 611305b9634cf5d1742ab3241c74c57b14edb19d233606ec1fe0d35401c6dc2f
5
5
  SHA512:
6
- metadata.gz: b17991f005f58b517044bd2ac2cc08f21f67f5e8bf7023cbfc3895ddbf24a7d3fdc88ed8c4ce61489c140c6d20488a2516988d72111066b2850eb92e3238ad96
7
- data.tar.gz: 5fe442bd9578e773785a66c08eb1e12b454b0e1f2d7be78401ebc893a432b066a7c94c07e69c384384c24bb26c660840cb2e45b32c61b1d431cf19c3e134c1ff
6
+ metadata.gz: ecf31d454b8bcfcaac603c73ab3bcb1b8b0d5e551a919f38e7e80f52add50000284bf5426f1f8c50050f4476bfed0528d7ff74ad1aee02fd0951fe09db1103aa
7
+ data.tar.gz: 13f51ba5152a76aa032b28f4787ec7bfc67df616339d9ab079fc253fdc37f096c177e4ef81bd3d4e34dd85a5a338d493ada871a0e29e5045db9d2cfedf91dea5
data/gloo.gemspec CHANGED
@@ -46,7 +46,7 @@ Gem::Specification.new do |spec|
46
46
  spec.add_dependency 'mysql2', '~> 0.5', '>= 0.5.3'
47
47
  spec.add_dependency 'sqlite3', '~> 1.4', '>= 1.4.2'
48
48
  spec.add_dependency 'os', '~> 1.1', '>= 1.1.4'
49
- spec.add_dependency 'pg', '~> 1.5.4'
49
+ # spec.add_dependency 'pg', '~> 1.5.4'
50
50
  spec.add_dependency 'thin', '~> 1.8.2'
51
51
  spec.add_dependency 'redcarpet', '~> 3.6.0'
52
52
  spec.add_dependency 'bcrypt', '~> 3.1.20'
data/lib/VERSION CHANGED
@@ -1 +1 @@
1
- 4.2.0
1
+ 4.3.0
data/lib/VERSION_NOTES CHANGED
@@ -1,3 +1,11 @@
1
+ 4.3.0 - 2025.07.02
2
+ - Removes postgres dependency (for now)
3
+
4
+
5
+ 4.2.1 - 2025.05.15
6
+ - Fixes bug with begin and end month date messages
7
+
8
+
1
9
  4.2.0 - 2025.05.15
2
10
  - Adds add and sub messages to date objects
3
11
 
@@ -1,216 +1,216 @@
1
- # Author:: Eric Crane (mailto:eric.crane@mac.com)
2
- # Copyright:: Copyright (c) 2023 Eric Crane. All rights reserved.
3
- #
4
- # A Postgres database connection.
5
- #
6
- # https://rubygems.org/gems/pg/versions/0.18.4
7
- # https://github.com/ged/ruby-pg
8
- #
9
- require 'pg'
10
-
11
- module Gloo
12
- module Objs
13
- class Pg < Gloo::Core::Obj
14
-
15
- KEYWORD = 'postgres'.freeze
16
- KEYWORD_SHORT = 'pg'.freeze
17
-
18
- HOST = 'host'.freeze
19
- DB = 'database'.freeze
20
- USER = 'username'.freeze
21
- PASSWD = 'password'.freeze
22
-
23
- #
24
- # The name of the object type.
25
- #
26
- def self.typename
27
- return KEYWORD
28
- end
29
-
30
- #
31
- # The short name of the object type.
32
- #
33
- def self.short_typename
34
- return KEYWORD_SHORT
35
- end
36
-
37
- # ---------------------------------------------------------------------
38
- # Children
39
- # ---------------------------------------------------------------------
40
-
41
- #
42
- # Does this object have children to add when an object
43
- # is created in interactive mode?
44
- # This does not apply during obj load, etc.
45
- #
46
- def add_children_on_create?
47
- return true
48
- end
49
-
50
- #
51
- # Add children to this object.
52
- # This is used by containers to add children needed
53
- # for default configurations.
54
- #
55
- def add_default_children
56
- fac = @engine.factory
57
- fac.create_string HOST, nil, self
58
- fac.create_string DB, nil, self
59
- fac.create_string USER, nil, self
60
- fac.create_string PASSWD, nil, self
61
- end
62
-
63
- # ---------------------------------------------------------------------
64
- # Messages
65
- # ---------------------------------------------------------------------
66
-
67
- #
68
- # Get a list of message names that this object receives.
69
- #
70
- def self.messages
71
- return super + [ 'verify' ]
72
- end
73
-
74
- #
75
- # SSH to the host and execute the command, then update result.
76
- #
77
- def msg_verify
78
- return unless connects?
79
-
80
- @engine.heap.it.set_to true
81
- end
82
-
83
- # ---------------------------------------------------------------------
84
- # DB functions (all database connections)
85
- # ---------------------------------------------------------------------
86
-
87
- #
88
- # Open a connection and execute the SQL statement.
89
- # Return the resulting data.
90
- #
91
- def query( sql, params = nil )
92
- heads = []
93
- data = []
94
- client = pg_conn
95
-
96
- if params
97
- param_arr = []
98
- params.each do |p|
99
- param_arr << { :value => p, :type => 0, :format => 0 }
100
- end
101
- rs = client.exec_params( sql, params )
102
- else
103
- rs = client.exec( sql )
104
- end
105
-
106
- if rs && ( rs.count > 0 )
107
- rs[0].each do |name, val|
108
- heads << name
109
- end
110
- rs.each_with_index do |row, index|
111
- arr = []
112
- row.each do |name, val|
113
- arr << val
114
- end
115
- data << arr
116
- end
117
- end
118
-
119
- return [ heads, data ]
120
- end
121
-
122
- #
123
- # Based on the result set, build a QueryResult object.
124
- #
125
- def get_query_result( result )
126
- return QueryResult.new result[0], result[1], @engine
127
- end
128
-
129
-
130
- # ---------------------------------------------------------------------
131
- # Private functions
132
- # ---------------------------------------------------------------------
133
-
134
- private
135
-
136
- #
137
- # Get the host from the child object.
138
- # Returns nil if there is none.
139
- #
140
- def host_value
141
- o = find_child HOST
142
- return nil unless o
143
-
144
- o = Gloo::Objs::Alias.resolve_alias( @engine, o )
145
- return o.value
146
- end
147
-
148
- #
149
- # Get the Database name from the child object.
150
- # Returns nil if there is none.
151
- #
152
- def db_value
153
- o = find_child DB
154
- return nil unless o
155
-
156
- o = Gloo::Objs::Alias.resolve_alias( @engine, o )
157
- return o.value
158
- end
159
-
160
- #
161
- # Get the Username from the child object.
162
- # Returns nil if there is none.
163
- #
164
- def user_value
165
- o = find_child USER
166
- return nil unless o
167
-
168
- o = Gloo::Objs::Alias.resolve_alias( @engine, o )
169
- return o.value
170
- end
171
-
172
- #
173
- # Get the Password name from the child object.
174
- # Returns nil if there is none.
175
- #
176
- def passwd_value
177
- o = find_child PASSWD
178
- return nil unless o
179
-
180
- o = Gloo::Objs::Alias.resolve_alias( @engine, o )
181
- return o.value
182
- end
183
-
184
- #
185
- # Try the connection and make sure it works.
186
- # Returns true if we can establish a connection.
187
- #
188
- def connects?
189
- begin
190
- result = pg_conn.exec( "SELECT NOW()" )
191
- rescue => e
192
- @engine.log_exception e
193
- @engine.heap.it.set_to false
194
- return false
195
- end
196
- return true
197
- end
198
-
199
- #
200
- # Get the PG connection.
201
- #
202
- def pg_conn
203
- if host_value
204
- conn = PG.connect(
205
- host_value, 5432, '', '',
206
- db_value,
207
- user_value,
208
- passwd_value )
209
- else
210
- conn = PG.connect( dbname: db_value )
211
- end
212
- end
213
-
214
- end
215
- end
216
- end
1
+ # # Author:: Eric Crane (mailto:eric.crane@mac.com)
2
+ # # Copyright:: Copyright (c) 2023 Eric Crane. All rights reserved.
3
+ # #
4
+ # # A Postgres database connection.
5
+ # #
6
+ # # https://rubygems.org/gems/pg/versions/0.18.4
7
+ # # https://github.com/ged/ruby-pg
8
+ # #
9
+ # require 'pg'
10
+
11
+ # module Gloo
12
+ # module Objs
13
+ # class Pg < Gloo::Core::Obj
14
+
15
+ # KEYWORD = 'postgres'.freeze
16
+ # KEYWORD_SHORT = 'pg'.freeze
17
+
18
+ # HOST = 'host'.freeze
19
+ # DB = 'database'.freeze
20
+ # USER = 'username'.freeze
21
+ # PASSWD = 'password'.freeze
22
+
23
+ # #
24
+ # # The name of the object type.
25
+ # #
26
+ # def self.typename
27
+ # return KEYWORD
28
+ # end
29
+
30
+ # #
31
+ # # The short name of the object type.
32
+ # #
33
+ # def self.short_typename
34
+ # return KEYWORD_SHORT
35
+ # end
36
+
37
+ # # ---------------------------------------------------------------------
38
+ # # Children
39
+ # # ---------------------------------------------------------------------
40
+
41
+ # #
42
+ # # Does this object have children to add when an object
43
+ # # is created in interactive mode?
44
+ # # This does not apply during obj load, etc.
45
+ # #
46
+ # def add_children_on_create?
47
+ # return true
48
+ # end
49
+
50
+ # #
51
+ # # Add children to this object.
52
+ # # This is used by containers to add children needed
53
+ # # for default configurations.
54
+ # #
55
+ # def add_default_children
56
+ # fac = @engine.factory
57
+ # fac.create_string HOST, nil, self
58
+ # fac.create_string DB, nil, self
59
+ # fac.create_string USER, nil, self
60
+ # fac.create_string PASSWD, nil, self
61
+ # end
62
+
63
+ # # ---------------------------------------------------------------------
64
+ # # Messages
65
+ # # ---------------------------------------------------------------------
66
+
67
+ # #
68
+ # # Get a list of message names that this object receives.
69
+ # #
70
+ # def self.messages
71
+ # return super + [ 'verify' ]
72
+ # end
73
+
74
+ # #
75
+ # # SSH to the host and execute the command, then update result.
76
+ # #
77
+ # def msg_verify
78
+ # return unless connects?
79
+
80
+ # @engine.heap.it.set_to true
81
+ # end
82
+
83
+ # # ---------------------------------------------------------------------
84
+ # # DB functions (all database connections)
85
+ # # ---------------------------------------------------------------------
86
+
87
+ # #
88
+ # # Open a connection and execute the SQL statement.
89
+ # # Return the resulting data.
90
+ # #
91
+ # def query( sql, params = nil )
92
+ # heads = []
93
+ # data = []
94
+ # client = pg_conn
95
+
96
+ # if params
97
+ # param_arr = []
98
+ # params.each do |p|
99
+ # param_arr << { :value => p, :type => 0, :format => 0 }
100
+ # end
101
+ # rs = client.exec_params( sql, params )
102
+ # else
103
+ # rs = client.exec( sql )
104
+ # end
105
+
106
+ # if rs && ( rs.count > 0 )
107
+ # rs[0].each do |name, val|
108
+ # heads << name
109
+ # end
110
+ # rs.each_with_index do |row, index|
111
+ # arr = []
112
+ # row.each do |name, val|
113
+ # arr << val
114
+ # end
115
+ # data << arr
116
+ # end
117
+ # end
118
+
119
+ # return [ heads, data ]
120
+ # end
121
+
122
+ # #
123
+ # # Based on the result set, build a QueryResult object.
124
+ # #
125
+ # def get_query_result( result )
126
+ # return QueryResult.new result[0], result[1], @engine
127
+ # end
128
+
129
+
130
+ # # ---------------------------------------------------------------------
131
+ # # Private functions
132
+ # # ---------------------------------------------------------------------
133
+
134
+ # private
135
+
136
+ # #
137
+ # # Get the host from the child object.
138
+ # # Returns nil if there is none.
139
+ # #
140
+ # def host_value
141
+ # o = find_child HOST
142
+ # return nil unless o
143
+
144
+ # o = Gloo::Objs::Alias.resolve_alias( @engine, o )
145
+ # return o.value
146
+ # end
147
+
148
+ # #
149
+ # # Get the Database name from the child object.
150
+ # # Returns nil if there is none.
151
+ # #
152
+ # def db_value
153
+ # o = find_child DB
154
+ # return nil unless o
155
+
156
+ # o = Gloo::Objs::Alias.resolve_alias( @engine, o )
157
+ # return o.value
158
+ # end
159
+
160
+ # #
161
+ # # Get the Username from the child object.
162
+ # # Returns nil if there is none.
163
+ # #
164
+ # def user_value
165
+ # o = find_child USER
166
+ # return nil unless o
167
+
168
+ # o = Gloo::Objs::Alias.resolve_alias( @engine, o )
169
+ # return o.value
170
+ # end
171
+
172
+ # #
173
+ # # Get the Password name from the child object.
174
+ # # Returns nil if there is none.
175
+ # #
176
+ # def passwd_value
177
+ # o = find_child PASSWD
178
+ # return nil unless o
179
+
180
+ # o = Gloo::Objs::Alias.resolve_alias( @engine, o )
181
+ # return o.value
182
+ # end
183
+
184
+ # #
185
+ # # Try the connection and make sure it works.
186
+ # # Returns true if we can establish a connection.
187
+ # #
188
+ # def connects?
189
+ # begin
190
+ # result = pg_conn.exec( "SELECT NOW()" )
191
+ # rescue => e
192
+ # @engine.log_exception e
193
+ # @engine.heap.it.set_to false
194
+ # return false
195
+ # end
196
+ # return true
197
+ # end
198
+
199
+ # #
200
+ # # Get the PG connection.
201
+ # #
202
+ # def pg_conn
203
+ # if host_value
204
+ # conn = PG.connect(
205
+ # host_value, 5432, '', '',
206
+ # db_value,
207
+ # user_value,
208
+ # passwd_value )
209
+ # else
210
+ # conn = PG.connect( dbname: db_value )
211
+ # end
212
+ # end
213
+
214
+ # end
215
+ # end
216
+ # end
@@ -97,11 +97,16 @@ module Gloo
97
97
  self.set_value( DtTools.sub( dt, modifier ) )
98
98
  @engine.heap.it.set_to self.value
99
99
  end
100
+
100
101
  #
101
102
  # Set the value to the beginning of the month.
102
103
  #
103
104
  def msg_begin_month
104
- dt = DtTools.beginning_of_month( self.value.to_time )
105
+ # dt = DtTools.beginning_of_month( self.value.to_time )
106
+ dt = self.value.to_time.beginning_of_month
107
+ self.set_value dt
108
+ @engine.heap.it.set_to dt
109
+
105
110
  self.set_value dt
106
111
  @engine.heap.it.set_to dt
107
112
  end
@@ -110,7 +115,8 @@ module Gloo
110
115
  # Set the value to the end of the month.
111
116
  #
112
117
  def msg_end_month
113
- dt = DtTools.end_of_month( self.value.to_time )
118
+ # dt = DtTools.end_of_month( self.value.to_time )
119
+ dt = self.value.to_time.end_of_month
114
120
  self.set_value dt
115
121
  @engine.heap.it.set_to dt
116
122
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gloo
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Crane
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-05-15 00:00:00.000000000 Z
11
+ date: 2025-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -294,20 +294,6 @@ dependencies:
294
294
  - - ">="
295
295
  - !ruby/object:Gem::Version
296
296
  version: 1.1.4
297
- - !ruby/object:Gem::Dependency
298
- name: pg
299
- requirement: !ruby/object:Gem::Requirement
300
- requirements:
301
- - - "~>"
302
- - !ruby/object:Gem::Version
303
- version: 1.5.4
304
- type: :runtime
305
- prerelease: false
306
- version_requirements: !ruby/object:Gem::Requirement
307
- requirements:
308
- - - "~>"
309
- - !ruby/object:Gem::Version
310
- version: 1.5.4
311
297
  - !ruby/object:Gem::Dependency
312
298
  name: thin
313
299
  requirement: !ruby/object:Gem::Requirement