rails-blocks-cli 0.1.2 → 0.1.4

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rails_blocks/cli.rb +13 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63dd443055d6116deb6a9945e9aa025d6cee699603ac48278dc56d541c567e58
4
- data.tar.gz: f8f4993d4a4b63083b8644040e02bf35653cefcbb04ce9f03d319ef3820dacde
3
+ metadata.gz: 968eedc1f9c0ab74b6eea46839b1cc3fd797cbbad8e9e435fd941a9583ed80a6
4
+ data.tar.gz: 2d4eeeeec278e666cdf0dfac50b0e8dc48ebf2907c09b53b189106511b83c95c
5
5
  SHA512:
6
- metadata.gz: ae54a971c219716f16a227a27185078bc00dd33e94a6eb5d858a4e665e653b9ea921485cb3b334e36610d324fa300d8eb691bb50eb89a53d1b0fa18327b53fd6
7
- data.tar.gz: 397f72909bbd30ad2e94991e59c34a25ac4e3d3f409062a3dbac3044af7bfb7ada4f22f54c0e6bab7236b446744d09c633bda996def8cecfa07c4d39ccba17af
6
+ metadata.gz: 9f1340ade753c2ddbcf80a6722cb077b20205306f79f9d790188dd52d81b178e31f49e9d6f8968c23ec0f39384dab7b32fd4d5a20c5172816c8442b370d42bad
7
+ data.tar.gz: e47e078588bf254704e7e59714429c87162f966f1adcaa8ff161bd2808f58b70a46da1e7853864e51cc22b2014a9fb9bfd6730b3c432f16edf758dbcba69adbd
@@ -109,6 +109,7 @@ module RailsBlocks
109
109
  abort "Usage: rails-blocks install COMPONENT [--as erb_template|view_component|partial] [--path PATH] [--stimulus-path PATH] [--dry-run] [--force]" if slug.to_s.empty?
110
110
 
111
111
  component = find_component(slug)
112
+ installation_prerequisite_notice
112
113
  install_component(component, implementation, dry_run: dry_run)
113
114
  end
114
115
 
@@ -116,6 +117,8 @@ module RailsBlocks
116
117
  selected_components = components.select { |component| include_component?(component) }
117
118
  abort "No components matched the selected filters." if selected_components.empty?
118
119
 
120
+ installation_prerequisite_notice
121
+
119
122
  failures = []
120
123
 
121
124
  selected_components.each do |component|
@@ -283,8 +286,8 @@ module RailsBlocks
283
286
  download(response["url"], auth: true)
284
287
  end
285
288
 
286
- def stimulus_package_data
287
- type = component_filter == :pro ? "pro" : "free"
289
+ def stimulus_package_data(type: nil)
290
+ type ||= component_filter == :pro ? "pro" : "free"
288
291
  if type == "free"
289
292
  stimulus_artifact = registry["stimulus_controllers"]
290
293
  return download(stimulus_artifact["package_url"]) if stimulus_artifact&.dig("package_url")
@@ -297,7 +300,7 @@ module RailsBlocks
297
300
  if component["stimulus_package_url"]
298
301
  download(component["stimulus_package_url"])
299
302
  else
300
- stimulus_package_data
303
+ stimulus_package_data(type: component["pro"] ? "pro" : "free")
301
304
  end
302
305
  end
303
306
 
@@ -361,6 +364,13 @@ module RailsBlocks
361
364
  puts " Markdown: #{markdown_docs_url(component)}"
362
365
  end
363
366
 
367
+ def installation_prerequisite_notice
368
+ return if ENV["RAILS_BLOCKS_HIDE_INSTALL_NOTICE"] == "1"
369
+
370
+ puts muted("Before installing components, make sure your app has completed the setup steps: https://railsblocks.com/docs/installation")
371
+ puts
372
+ end
373
+
364
374
  def web_docs_url(component)
365
375
  component["docs_url"] || "https://railsblocks.com/docs/#{component['slug'].tr('_', '-')}"
366
376
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-blocks-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rails Blocks