roda-vite 0.3.0 → 0.4.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: baacd4f5b199ed697cc5ac19f952b61c2c3852048a44e41d3f644299dbdbd509
4
- data.tar.gz: 281aeea9ef2e4ecc85cf8c0bf36156e53cb9ac5f51ed6ac4396ed054c9b719c8
3
+ metadata.gz: 6864daee0925a1e81ab534655fa8d1ed70d539be7cbd8e528672960a32c1f099
4
+ data.tar.gz: ed4f38b88404153306f3286f912374bcd776c46d88f7ba157ff9539b3c95094a
5
5
  SHA512:
6
- metadata.gz: 7e8e77a7503276004f2390c290b3d19fd09e06d2d6ad8ad4aa937b32bb7bc0547a32537ab261bb102e313fcb540d1bf96cf39ac71964b9e631cd3be512f5981e
7
- data.tar.gz: b06a90e6a2125f7fbe058265de17de952e9a2514d498ae8979e7fef0df2989c0c647e7d328d296a94668c0d2f1bd1e5731ff9b206665a5bf51de294f7ed51b5e
6
+ metadata.gz: 2f28f886399c794f6780895f781b34ea93702e932b893d8686a63789b61394c4fbffd38af5055551429be51e947c1d951dfd45dfa1939bd648468767e2110be9
7
+ data.tar.gz: 5e31e65cd17862fc47a309e54c50989095ca35fb83116a2a6e4c9d665fc89cc5bd6ccd8feca7b88d87f5975e4e4027063f843c891d77c5acf8d1131a23dbeb40
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module RodaVite
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -21,9 +21,14 @@ module ViteRoda::Installation
21
21
  # super
22
22
  # end
23
23
 
24
- def call(package_manager: nil, **)
24
+ # Add additional options
25
+ def self.prepended(base)
26
+ base.option :force, type: :flag, aliases: ['-f'], desc: "Force installation, skip checking that 'plugin :vite' was added."
27
+ end
28
+
29
+ def call(package_manager: nil, **options)
25
30
 
26
- ensure_roda_plugin_added
31
+ ensure_roda_plugin_added unless options[:force]
27
32
 
28
33
  ENV["VITE_RUBY_PACKAGE_MANAGER"] ||= package_manager if package_manager
29
34
 
@@ -67,10 +72,8 @@ module ViteRoda::Installation
67
72
  # Internal: Ensures the Vite plugin is loaded in app.rb, or [app_name].rb
68
73
  # This check is skipped if the -f or --force flag is passed
69
74
  def ensure_roda_plugin_added
70
- return if ARGV.any? { |flag| ['-f', '--force'].include? flag }
71
-
72
- unless line_with_prefix_exists? root.join('app.rb'), 'plugin :vite' ||
73
- line_with_prefix_exists? root.join("#{app_name}.rb"), 'plugin :vite'
75
+ unless line_with_prefix_exists?(root.join('app.rb'), 'plugin :vite') ||
76
+ line_with_prefix_exists?(root.join("#{app_name}.rb"), 'plugin :vite')
74
77
  abort "Add plugin :vite to your Roda app (found in app.rb or #{app_name}.rb) before installing, or pass -f to force."
75
78
  end
76
79
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roda-vite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Avi Sternlieb