hanamismith 0.49.0 → 0.49.1

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
  SHA256:
3
- metadata.gz: 10fe7dd2d05906100558c794fb23524c86585ac2a9350933d79927ed72bf4034
4
- data.tar.gz: aa155e6a53d45842e1ad20c235507a09f2a07f0782c34bfcd0d58d6c35e0d680
3
+ metadata.gz: f7ca049a274e49896527f571dd75fb145928c5e28f655127e37eca3503c91c30
4
+ data.tar.gz: 781e27aaaed6edbc65bc166c21f0ee1c0d13b3252a658550e435cbfce67cbe42
5
5
  SHA512:
6
- metadata.gz: 3f2a8607f93b2369ae2702f4db91b6111bb4e3191ece92f8b3f7cc6998604ad4007c269978aabd5eed2fec6cb7bba4036fcf59477a48f92bb3ef821a31ebc896
7
- data.tar.gz: 02bd71d9f19edb7d2dcf0c7becc7a797e41604bc7366178eb647f85186f4445de6437050b1af58a15c352d79e0813f0d169aa9d34b53fb165354e3b26b1bc85a
6
+ metadata.gz: 84d651bc213b4496c67d270458f5a937020e9e6a751c6a9b8f138632cea85ea335a38ed5f24d5646e3114ad4cc0fdef6cf9118ec28c802c6e540096c99f718b9
7
+ data.tar.gz: 26b68ddb5ceb1a88f9f804e84f56be9dbe6515f677a7e69b3ad02b06654a4b01a27c1acae8a134ad4893a3d085981756c08a86e066cdbeb525f3be2501a9a716
checksums.yaml.gz.sig CHANGED
Binary file
data/hanamismith.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "hanamismith"
5
- spec.version = "0.49.0"
5
+ spec.version = "0.49.1"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://alchemists.io/projects/hanamismith"
@@ -1,18 +1,54 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "dry/monads"
4
+ require "refinements/pathname"
3
5
  require "refinements/struct"
4
6
 
5
7
  module Hanamismith
6
8
  module Builders
7
9
  # Builds project skeleton for Node.
8
10
  class Node < Rubysmith::Builders::Abstract
11
+ include Dry::Monads[:result]
12
+
9
13
  using Refinements::Struct
14
+ using Refinements::Pathname
15
+
16
+ def initialize(executor: Open3, **)
17
+ @executor = executor
18
+ super(**)
19
+ end
10
20
 
11
21
  def call
22
+ build_version
12
23
  builder.call(settings.merge(template_path: "%project_name%/package.json.erb")).render
13
- builder.call(settings.merge(template_path: "%project_name%/.node-version.erb")).render
14
24
  true
15
25
  end
26
+
27
+ private
28
+
29
+ attr_reader :executor
30
+
31
+ def build_version
32
+ case load_version
33
+ in Success(text) then version_path.make_ancestors.write text.delete_prefix("v")
34
+ in Failure(message) then log_error message
35
+ else log_error "Shell failure. Is your environment configured properly?"
36
+ end
37
+ end
38
+
39
+ def load_version
40
+ executor.capture3("node", "--version").then do |stdout, _stderr, status|
41
+ return Success stdout if status.success?
42
+
43
+ Failure "Unable to obtain version for #{version_path.inspect}."
44
+ end
45
+ rescue Errno::ENOENT
46
+ Failure "Unable to find Node. Is Node installed?"
47
+ end
48
+
49
+ def version_path = settings.project_root.join ".node-version"
50
+
51
+ def log_error(message) = logger.error { message }
16
52
  end
17
53
  end
18
54
  end
@@ -25,8 +25,11 @@ module Hanamismith
25
25
  puts "Installing packages..."
26
26
  Runner.call "npm install"
27
27
 
28
- puts "Configurating databases..."
29
- Runner.call "bin/hanami db prepare"
28
+ puts "Configuring databases..."
29
+ Runner.call "hanami db prepare"
30
+
31
+ puts "Compiling assets..."
32
+ Runner.call "hanami assets compile"
30
33
  CONTENT
31
34
  end
32
35
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanamismith
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.49.0
4
+ version: 0.49.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -35,7 +35,7 @@ cert_chain:
35
35
  3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
36
36
  gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
37
37
  -----END CERTIFICATE-----
38
- date: 2024-11-09 00:00:00.000000000 Z
38
+ date: 2024-11-15 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: cogger
@@ -276,7 +276,6 @@ files:
276
276
  - lib/hanamismith/import.rb
277
277
  - lib/hanamismith/templates/%project_name%/.circleci/config.yml.erb
278
278
  - lib/hanamismith/templates/%project_name%/.github/workflows/ci.yml.erb
279
- - lib/hanamismith/templates/%project_name%/.node-version.erb
280
279
  - lib/hanamismith/templates/%project_name%/Guardfile.erb
281
280
  - lib/hanamismith/templates/%project_name%/Procfile.dev.erb
282
281
  - lib/hanamismith/templates/%project_name%/Procfile.erb
metadata.gz.sig CHANGED
Binary file