orchestration 0.6.8 → 0.6.10

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: 4d60dd6a324c493308690336d31236ab4e25ff8d6def5b54c77c5d8f1f77186f
4
- data.tar.gz: 642a8a710f2b7a6989fba3e6146768d521ceb0c35d0cee693601824e2d43029e
3
+ metadata.gz: f1582f2621a3d1b76eb01abe94e305c9b4e302b0644f923d19ff11731cccdcae
4
+ data.tar.gz: 4f33c21464eecbd1bc904bf7f580e0154a4cea20db93b971759380f65e29ce01
5
5
  SHA512:
6
- metadata.gz: 7d4f6dc1c456af1cf954699dc9fed1a1990622aea6e220cfec88dd0ebe56576b75f5574cde538c1688b7f724eecc7da616a1d58c844e6ba09f479fa3b2254b05
7
- data.tar.gz: 596b42d049cabec555f8b13cfeaf728d9780f0cfd90138b93a887f4271e25ea5286dbfd2c57bf1c33032ac561c4ec5716dc7294e5c788b342bc99a28cc18918f
6
+ metadata.gz: aa78fcd687d3fd5492588212059db15ba5ff9ee84ec57d5950ed3ae55f01965d6e91133cd4e04049f9256431a39d9918bc61e84ab92f3417be936abfa6f42082
7
+ data.tar.gz: 6b1317f6cb99a6c1427e120eb95f23b356c6f7dee2bb8880581b038469eb0a7f2999f2d53cb70bbc79c472794183320faf3c6baa585589cb5ea0a46e490948f3
data/Gemfile.lock CHANGED
@@ -1,8 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- orchestration (0.6.7)
4
+ orchestration (0.6.10)
5
5
  database_url (~> 0.1.2)
6
+ dotenv-rails (~> 2.8)
6
7
  erubis (~> 2.7)
7
8
  i18n (>= 0.5)
8
9
  paint (~> 2.0)
@@ -58,6 +59,9 @@ GEM
58
59
  activerecord (6.1.4.7)
59
60
  activemodel (= 6.1.4.7)
60
61
  activesupport (= 6.1.4.7)
62
+ activerecord-postgis-adapter (7.1.1)
63
+ activerecord (~> 6.1)
64
+ rgeo-activerecord (~> 7.0.0)
61
65
  activestorage (6.1.4.7)
62
66
  actionpack (= 6.1.4.7)
63
67
  activejob (= 6.1.4.7)
@@ -71,13 +75,13 @@ GEM
71
75
  minitest (>= 5.1)
72
76
  tzinfo (~> 2.0)
73
77
  zeitwerk (~> 2.3)
74
- addressable (2.8.0)
75
- public_suffix (>= 2.0.2, < 5.0)
78
+ addressable (2.8.1)
79
+ public_suffix (>= 2.0.2, < 6.0)
76
80
  amq-protocol (2.3.2)
77
81
  ast (2.4.2)
78
82
  bson (4.15.0)
79
83
  builder (3.2.4)
80
- bunny (2.19.0)
84
+ bunny (2.20.1)
81
85
  amq-protocol (~> 2.3, >= 2.3.1)
82
86
  sorted_set (~> 1, >= 1.0.2)
83
87
  concurrent-ruby (1.1.10)
@@ -85,44 +89,62 @@ GEM
85
89
  rexml
86
90
  crass (1.0.6)
87
91
  database_url (0.1.2)
92
+ date (3.3.3)
88
93
  devpack (0.3.3)
89
94
  diff-lcs (1.5.0)
90
- erubi (1.10.0)
95
+ dotenv (2.8.1)
96
+ dotenv-rails (2.8.1)
97
+ dotenv (= 2.8.1)
98
+ railties (>= 3.2)
99
+ erubi (1.12.0)
91
100
  erubis (2.7.0)
92
101
  globalid (1.0.0)
93
102
  activesupport (>= 5.0)
94
103
  hashdiff (1.0.1)
95
- i18n (1.10.0)
104
+ i18n (1.12.0)
96
105
  concurrent-ruby (~> 1.0)
97
- loofah (2.18.0)
106
+ json (2.6.3)
107
+ loofah (2.19.1)
98
108
  crass (~> 1.0.2)
99
109
  nokogiri (>= 1.5.9)
100
- mail (2.7.1)
110
+ mail (2.8.0)
101
111
  mini_mime (>= 0.1.1)
112
+ net-imap
113
+ net-pop
114
+ net-smtp
102
115
  marcel (1.0.2)
103
116
  method_source (1.0.0)
104
117
  mini_mime (1.1.2)
105
- minitest (5.15.0)
106
- mongo (2.17.1)
107
- bson (>= 4.8.2, < 5.0.0)
108
- mongoid (7.4.0)
118
+ minitest (5.17.0)
119
+ mongo (2.18.2)
120
+ bson (>= 4.14.1, < 5.0.0)
121
+ mongoid (7.5.2)
109
122
  activemodel (>= 5.1, < 7.1, != 7.0.0)
110
123
  mongo (>= 2.10.5, < 3.0.0)
111
124
  ruby2_keywords (~> 0.0.5)
112
125
  mysql2 (0.5.4)
126
+ net-imap (0.3.4)
127
+ date
128
+ net-protocol
129
+ net-pop (0.1.2)
130
+ net-protocol
131
+ net-protocol (0.2.1)
132
+ timeout
133
+ net-smtp (0.3.3)
134
+ net-protocol
113
135
  nio4r (2.5.8)
114
- nokogiri (1.13.6-x86_64-linux)
136
+ nokogiri (1.13.10-x86_64-linux)
115
137
  racc (~> 1.4)
116
- paint (2.2.1)
138
+ paint (2.3.0)
117
139
  parallel (1.22.1)
118
- parser (3.1.2.0)
140
+ parser (3.2.0.0)
119
141
  ast (~> 2.4.1)
120
- pg (1.3.5)
121
- public_suffix (4.0.7)
122
- racc (1.6.0)
123
- rack (2.2.3)
124
- rack-test (1.1.0)
125
- rack (>= 1.0, < 3)
142
+ pg (1.4.5)
143
+ public_suffix (5.0.1)
144
+ racc (1.6.2)
145
+ rack (2.2.5)
146
+ rack-test (2.0.2)
147
+ rack (>= 1.3)
126
148
  rails (6.1.4.7)
127
149
  actioncable (= 6.1.4.7)
128
150
  actionmailbox (= 6.1.4.7)
@@ -141,8 +163,8 @@ GEM
141
163
  rails-dom-testing (2.0.3)
142
164
  activesupport (>= 4.2.0)
143
165
  nokogiri (>= 1.6)
144
- rails-html-sanitizer (1.4.2)
145
- loofah (~> 2.3)
166
+ rails-html-sanitizer (1.4.4)
167
+ loofah (~> 2.19, >= 2.19.1)
146
168
  railties (6.1.4.7)
147
169
  actionpack (= 6.1.4.7)
148
170
  activesupport (= 6.1.4.7)
@@ -151,79 +173,86 @@ GEM
151
173
  thor (~> 1.0)
152
174
  rainbow (3.1.1)
153
175
  rake (10.5.0)
154
- rbtree (0.4.5)
155
- regexp_parser (2.4.0)
176
+ rbtree (0.4.6)
177
+ regexp_parser (2.6.1)
156
178
  rexml (3.2.5)
157
- rspec (3.11.0)
158
- rspec-core (~> 3.11.0)
159
- rspec-expectations (~> 3.11.0)
160
- rspec-mocks (~> 3.11.0)
161
- rspec-core (3.11.0)
162
- rspec-support (~> 3.11.0)
163
- rspec-expectations (3.11.0)
179
+ rgeo (2.4.0)
180
+ rgeo-activerecord (7.0.1)
181
+ activerecord (>= 5.0)
182
+ rgeo (>= 1.0.0)
183
+ rspec (3.12.0)
184
+ rspec-core (~> 3.12.0)
185
+ rspec-expectations (~> 3.12.0)
186
+ rspec-mocks (~> 3.12.0)
187
+ rspec-core (3.12.0)
188
+ rspec-support (~> 3.12.0)
189
+ rspec-expectations (3.12.1)
164
190
  diff-lcs (>= 1.2.0, < 2.0)
165
- rspec-support (~> 3.11.0)
191
+ rspec-support (~> 3.12.0)
166
192
  rspec-its (1.3.0)
167
193
  rspec-core (>= 3.0.0)
168
194
  rspec-expectations (>= 3.0.0)
169
- rspec-mocks (3.11.1)
195
+ rspec-mocks (3.12.1)
170
196
  diff-lcs (>= 1.2.0, < 2.0)
171
- rspec-support (~> 3.11.0)
172
- rspec-support (3.11.0)
173
- rubocop (1.30.0)
197
+ rspec-support (~> 3.12.0)
198
+ rspec-support (3.12.0)
199
+ rubocop (1.42.0)
200
+ json (~> 2.3)
174
201
  parallel (~> 1.10)
175
- parser (>= 3.1.0.0)
202
+ parser (>= 3.1.2.1)
176
203
  rainbow (>= 2.2.2, < 4.0)
177
204
  regexp_parser (>= 1.8, < 3.0)
178
205
  rexml (>= 3.2.5, < 4.0)
179
- rubocop-ast (>= 1.18.0, < 2.0)
206
+ rubocop-ast (>= 1.24.1, < 2.0)
180
207
  ruby-progressbar (~> 1.7)
181
208
  unicode-display_width (>= 1.4.0, < 3.0)
182
- rubocop-ast (1.18.0)
209
+ rubocop-ast (1.24.1)
183
210
  parser (>= 3.1.1.0)
184
- rubocop-rails (2.14.2)
211
+ rubocop-rails (2.17.4)
185
212
  activesupport (>= 4.2.0)
186
213
  rack (>= 1.1)
187
- rubocop (>= 1.7.0, < 2.0)
214
+ rubocop (>= 1.33.0, < 2.0)
188
215
  rubocop-rake (0.5.1)
189
216
  rubocop
190
- rubocop-rspec (2.11.1)
191
- rubocop (~> 1.19)
217
+ rubocop-rspec (2.16.0)
218
+ rubocop (~> 1.33)
192
219
  ruby-progressbar (1.11.0)
193
220
  ruby2_keywords (0.0.5)
194
- set (1.0.2)
221
+ set (1.0.3)
195
222
  sorted_set (1.0.3)
196
223
  rbtree
197
224
  set (~> 1.0)
198
- sprockets (4.0.3)
225
+ sprockets (4.2.0)
199
226
  concurrent-ruby (~> 1.0)
200
- rack (> 1, < 3)
227
+ rack (>= 2.2.4, < 4)
201
228
  sprockets-rails (3.4.2)
202
229
  actionpack (>= 5.2)
203
230
  activesupport (>= 5.2)
204
231
  sprockets (>= 3.0.0)
205
- sqlite3 (1.4.2)
232
+ sqlite3 (1.5.4-x86_64-linux)
206
233
  strong_versions (0.4.5)
207
234
  i18n (>= 0.5)
208
235
  paint (~> 2.0)
209
236
  thor (1.2.1)
210
- tzinfo (2.0.4)
237
+ timeout (0.3.1)
238
+ tzinfo (2.0.5)
211
239
  concurrent-ruby (~> 1.0)
212
- unicode-display_width (2.1.0)
213
- webmock (3.14.0)
240
+ unicode-display_width (2.4.0)
241
+ webmock (3.18.1)
214
242
  addressable (>= 2.8.0)
215
243
  crack (>= 0.3.2)
216
244
  hashdiff (>= 0.4.0, < 2.0.0)
217
245
  websocket-driver (0.7.5)
218
246
  websocket-extensions (>= 0.1.0)
219
247
  websocket-extensions (0.1.5)
220
- zeitwerk (2.5.4)
248
+ zeitwerk (2.6.6)
221
249
 
222
250
  PLATFORMS
223
251
  x86_64-linux
224
252
 
225
253
  DEPENDENCIES
226
254
  activerecord (~> 6.0)
255
+ activerecord-postgis-adapter (~> 7.1)
227
256
  bunny (~> 2.12)
228
257
  devpack (~> 0.3.2)
229
258
  mongoid (~> 7.0)
data/README.md CHANGED
@@ -162,30 +162,15 @@ make push
162
162
 
163
163
  ### Development
164
164
 
165
- An [`.env` file](https://docs.docker.com/compose/env-file/) is created automatically in your project root. This file is _not_ stored in version control. Set all application environment variables in this file.
165
+ A [`.env` file](https://docs.docker.com/compose/env-file/) is created automatically in your project root. This file is _not_ stored in version control. Set all application environment variables in this file.
166
166
 
167
167
  #### Launching a development server
168
168
 
169
- To load all variables from `.env` and launch a development server, run the following command:
169
+ Use vanilla _Rails_ commands to load a server or console. If present, a `.env` file will be read and loaded (via the [dotenv](https://github.com/bkeepers/dotenv) gem) to populate the environment.
170
170
 
171
171
  ```bash
172
- make serve
173
- ```
174
-
175
- To load a _Rails_ console:
176
- ```bash
177
- make console
178
- ```
179
-
180
- The application environment will be output on launch for convenience.
181
-
182
- To pass extra commands to the _Rails_ server:
183
- ```bash
184
- # Custom server, custom port
185
- make serve server='webrick -p 3001'
186
-
187
- # Default server, custom port, custom bind address
188
- make serve server='-p 3001 -b 192.168.0.1'
172
+ bundle exec rails s # Launch a server
173
+ bundle exec rails c # Launch a console
189
174
  ```
190
175
 
191
176
  ### Testing
@@ -6,7 +6,7 @@ module Orchestration
6
6
 
7
7
  def orchestration_dir
8
8
  path = @env.orchestration_root
9
- FileUtils.mkdir(path) unless Dir.exist?(path)
9
+ FileUtils.mkdir_p(path)
10
10
 
11
11
  path
12
12
  end
@@ -2,7 +2,8 @@
2
2
  ### Environment setup ###
3
3
  SHELL:=/bin/bash
4
4
  MAKE:=mkpath=${mkpath} make --no-print-directory
5
-
5
+ ORCHESTRATION_DISABLE_ENV=1
6
+ export
6
7
  TERM ?= 'dumb'
7
8
  pwd:=$(shell pwd)
8
9
 
@@ -142,7 +143,7 @@ DOCKER_TAG ?= latest
142
143
  ifneq (,$(wildcard ./Gemfile))
143
144
  bundle_cmd = bundle exec
144
145
  endif
145
- rake=DEVPACK_DISABLE=1 RACK_ENV=${env} SECRET_KEY_BASE='placeholder-secret' RAILS_ENV=${env} ${bundle_cmd} rake
146
+ rake=ORCHESTRATION_DISABLE_ENV=1 DEVPACK_DISABLE=1 RACK_ENV=${env} SECRET_KEY_BASE='placeholder-secret' RAILS_ENV=${env} ${bundle_cmd} rake
146
147
 
147
148
  ifneq (,$(wildcard ${env_file}))
148
149
  ifeq (,$(findstring deploy,$(MAKECMDGOALS)))
@@ -1,4 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ ENV['ORCHESTRATION_DISABLE_ENV'] = '1'
4
+
3
5
  require 'orchestration'
4
6
  puts Orchestration.makefile
@@ -47,6 +47,10 @@ module Orchestration
47
47
  @settings.set(setting, read(prompt, default))
48
48
  end
49
49
 
50
+ def print_variable(variable, value)
51
+ $stderr.print "#{Paint[variable, :blue]}#{Paint['=', :white]}#{Paint[value, :cyan]}"
52
+ end
53
+
50
54
  private
51
55
 
52
56
  def prompt(message, default)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Orchestration
4
- VERSION = '0.6.8'
4
+ VERSION = '0.6.10'
5
5
  end
data/lib/orchestration.rb CHANGED
@@ -33,28 +33,67 @@ require 'orchestration/terminal'
33
33
  require 'orchestration/version'
34
34
 
35
35
  module Orchestration
36
- def self.root
37
- Pathname.new(File.dirname(__dir__))
38
- end
36
+ class << self
37
+ def root
38
+ Pathname.new(File.dirname(__dir__))
39
+ end
39
40
 
40
- def self.makefile
41
- root.join('lib', 'orchestration', 'make', 'orchestration.mk')
42
- end
41
+ def makefile
42
+ root.join('lib', 'orchestration', 'make', 'orchestration.mk')
43
+ end
43
44
 
44
- def self.rakefile
45
- root.join('lib', 'Rakefile')
46
- end
45
+ def rakefile
46
+ root.join('lib', 'Rakefile')
47
+ end
47
48
 
48
- def self.error(key, options = {})
49
- warn('# Orchestration Error')
50
- warn("# #{I18n.t("orchestration.#{key}", options)}")
51
- end
49
+ def error(key, options = {})
50
+ warn('# Orchestration Error')
51
+ warn("# #{I18n.t("orchestration.#{key}", options)}")
52
+ end
53
+
54
+ def random_local_port
55
+ socket = Socket.new(:INET, :STREAM, 0)
56
+ socket.bind(Addrinfo.tcp('127.0.0.1', 0))
57
+ port = socket.local_address.ip_port
58
+ socket.close
59
+ port
60
+ end
61
+
62
+ def print_environment
63
+ return unless File.exist?('.env')
52
64
 
53
- def self.random_local_port
54
- socket = Socket.new(:INET, :STREAM, 0)
55
- socket.bind(Addrinfo.tcp('127.0.0.1', 0))
56
- port = socket.local_address.ip_port
57
- socket.close
58
- port
65
+ $stderr.puts
66
+ warn("#{prefix} #{Paint['Loading environment from', :cyan]} #{Paint['.env', :green]}")
67
+ $stderr.puts
68
+ environment_variables.each do |variable, value|
69
+ terminal.print_variable(variable, value)
70
+ end
71
+ $stderr.puts
72
+ end
73
+
74
+ private
75
+
76
+ def terminal
77
+ @terminal ||= Terminal.new(Environment.new.settings)
78
+ end
79
+
80
+ def prefix
81
+ "#{Paint['[', :white]}#{Paint['orchestration', :cyan]}#{Paint[']', :white]}"
82
+ end
83
+
84
+ def environment_variables
85
+ File.readlines('.env').reject { |line| line.match(/^\s*#/) }
86
+ .select { |line| line.include?('=') }
87
+ .map do |line|
88
+ variable, _, value = line.partition('=')
89
+ [variable, value]
90
+ end
91
+ end
59
92
  end
60
93
  end
94
+
95
+ if ENV['RAILS_ENV'] == 'development' && !ENV.key?('ORCHESTRATION_DISABLE_ENV')
96
+ require 'dotenv-rails'
97
+ Dotenv::Railtie.load
98
+ Orchestration.print_environment
99
+ end
@@ -28,6 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.require_paths = ['lib']
29
29
 
30
30
  spec.add_runtime_dependency 'database_url', '~> 0.1.2'
31
+ spec.add_runtime_dependency 'dotenv-rails', '~> 2.8'
31
32
  spec.add_runtime_dependency 'erubis', '~> 2.7'
32
33
  spec.add_runtime_dependency 'i18n', '>= 0.5'
33
34
  spec.add_runtime_dependency 'paint', '~> 2.0'
@@ -35,6 +36,7 @@ Gem::Specification.new do |spec|
35
36
  spec.add_runtime_dependency 'thor', '~> 1.0'
36
37
 
37
38
  spec.add_development_dependency 'activerecord', '~> 6.0'
39
+ spec.add_development_dependency 'activerecord-postgis-adapter', '~> 7.1'
38
40
  spec.add_development_dependency 'bunny', '~> 2.12'
39
41
  spec.add_development_dependency 'devpack', '~> 0.3.2'
40
42
  spec.add_development_dependency 'mongoid', '~> 7.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orchestration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.8
4
+ version: 0.6.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bob Farrell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-18 00:00:00.000000000 Z
11
+ date: 2023-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: database_url
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.1.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: dotenv-rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.8'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.8'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: erubis
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +122,20 @@ dependencies:
108
122
  - - "~>"
109
123
  - !ruby/object:Gem::Version
110
124
  version: '6.0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: activerecord-postgis-adapter
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '7.1'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '7.1'
111
139
  - !ruby/object:Gem::Dependency
112
140
  name: bunny
113
141
  requirement: !ruby/object:Gem::Requirement