mkbrut 0.5.0 → 0.7.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: 232eed36ec0bbda9d4e20f06396c788220e39ec645fccb29eafd8af32529f8d9
4
- data.tar.gz: 87039bccf6f8ffd4a7f37499f1b9a6a5072c45d172a60b9a4f918048851a7282
3
+ metadata.gz: 1b20c910d831533825bfcf557c48c83a784f88edae4388474e8d57ea679761cf
4
+ data.tar.gz: 4cd73cdd32849d7326b9c00dd106ff7cf5261b460ed51f2bf008972a6f99984b
5
5
  SHA512:
6
- metadata.gz: 49a861539c7f6c9858b15529e824f066ecd63ea67cf089f4719c4d102dab10d8018182ae15a9454441c49b76e2ef902d9f347d1282b38aba664b3dd381bd83c8
7
- data.tar.gz: 70d7a71119c9ec72105e84803e7124b1ec7c7105b40bb2bd6975466ff1fb7834f8569867729523dfd64b069a46421951d5370979bfb8c1a0b6e59eb58e821bf6
6
+ metadata.gz: 66ebd800640401590ba490e0535d0ebffdf98a8da432d77621fabc1cd4334d368720e48478a14a6d482438cb7f07e4e6da6cc268591dcebaf9766c46cdb5d910
7
+ data.tar.gz: 9ce26f09d58918526e05d3dd8de1229cb0927c4f2281fba916afc59ad61369aa1ea8ec66c2c860087a86696084d246e89a78c79460a77f412c28318140455783
@@ -1,3 +1,3 @@
1
1
  module MKBrut
2
- VERSION = "0.5.0"
2
+ VERSION = "0.7.0"
3
3
  end
data/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "author": "Irrelevant",
6
6
  "license": "Irrelevant",
7
7
  "devDependencies": {
8
- "brut-css": "~0.0.1",
9
- "brut-js": "~0.0.21"
8
+ "brut-css": "~0.5.0",
9
+ "brut-js": "~0.5.0"
10
10
  }
11
11
  }
@@ -1,4 +1,5 @@
1
- web: PORT=6502 bin/run
2
- css: bin/watch-and-build-assets css
3
- js: bin/watch-and-build-assets js
4
- images: bin/watch-and-build-assets images
1
+ web: PORT=6502 bin/run
2
+ css: bin/watch-and-build-assets css
3
+ js: bin/watch-and-build-assets js
4
+ images: bin/watch-and-build-assets images
5
+ startup_message: PORT=6502 bin/startup-message
@@ -1,3 +1,2 @@
1
1
  @import "brut-css/dist/brut.css";
2
2
  @import "svgs.css";
3
- @import "fonts.css";
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "pathname"
4
+ require "yaml"
5
+ require "optparse"
6
+
7
+ option_parser = OptionParser.new do |opts|
8
+ opts.banner = "Usage: bin/startup-message\n\n Outputs a message about where the dev server is running\n\nENVIRONMENT VARIABLES\n\n PORT - the port configured for bin/run"
9
+ end
10
+ option_parser.parse!
11
+
12
+ docker_compose_file = Pathname.new(__FILE__).dirname / ".." / "docker-compose.dx.yml"
13
+
14
+ port_config = nil
15
+ error = nil
16
+
17
+ if docker_compose_file.exist?
18
+ docker_compose = YAML.load_file(docker_compose_file)
19
+
20
+ docker_port = begin
21
+ ENV.fetch("PORT")
22
+ rescue KeyError
23
+ $stderr.puts "ERROR: The PORT environment variable is not set."
24
+ $stderr.puts " Please set it to the port your app is running on."
25
+ exit 1
26
+ end
27
+
28
+ ports_config = docker_compose.dig("services", "app", "ports")
29
+ error = nil
30
+ if ports_config
31
+ port_config = ports_config.detect { |port_mapping|
32
+ host_port, container_port = port_mapping.split(":")
33
+ container_port.to_s == docker_port
34
+ }
35
+ if !port_config
36
+ error = "#{docker_compose_file} does not expose the port #{docker_port} for the 'app' service."
37
+ end
38
+ else
39
+ error = "#{docker_compose_file} does not contain a 'ports' section for the 'app' service."
40
+ end
41
+ else
42
+ error = "#{docker_compose_file} does not exist. This is assumed to be in placefor your dev environment"
43
+ end
44
+ if !error
45
+ sleep 2 # allow all other initial output from bin/dev to happen first
46
+
47
+ host_port = port_config.split(":")[0]
48
+
49
+ url = "http://localhost:#{host_port}"
50
+
51
+ $stdout.puts "Your app is now running at"
52
+ $stdout.puts
53
+ $stdout.puts " #{url}"
54
+ $stdout.puts
55
+ $stdout.flush # ensure this output happens immediately
56
+ else
57
+ $stderr.puts "WARN: #{$0} could not figure out what port the app is exposed on"
58
+ $stderr.puts
59
+ $stderr.puts " #{error}"
60
+ $stderr.puts
61
+ $stderr.puts " This won't stop your app from running, but it does mean"
62
+ $stderr.puts " there is some issue with your dev environment"
63
+ $stderr.flush # ensure this error output happens immediately
64
+ end
65
+ sleep
@@ -2,3 +2,7 @@
2
2
  # This file is not checked into version control, so you
3
3
  # are safe to export EDITOR=vim and avoid any guff from
4
4
  # co-workers.
5
+
6
+ # Sets up a multi-line prompt since the working directory
7
+ # may be very deep. Customize or change at your leisure.
8
+ PS1='\[\e[35m\]docker-container\[\e[0m\] - \[\e[37m\]\w\n\[\e[0m\]> '
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mkbrut
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Copeland
@@ -135,6 +135,7 @@ files:
135
135
  - templates/Base/bin/run
136
136
  - templates/Base/bin/scaffold
137
137
  - templates/Base/bin/setup
138
+ - templates/Base/bin/startup-message
138
139
  - templates/Base/bin/test
139
140
  - templates/Base/bin/test-server
140
141
  - templates/Base/bin/watch-and-build-assets
@@ -203,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
204
  - !ruby/object:Gem::Version
204
205
  version: '0'
205
206
  requirements: []
206
- rubygems_version: 3.6.9
207
+ rubygems_version: 3.7.1
207
208
  specification_version: 4
208
209
  summary: Create a new Brut App
209
210
  test_files: []