Skip to content

Commit

Permalink
Adds bin/namespacer for local testing
Browse files Browse the repository at this point in the history
  • Loading branch information
bougyman committed Apr 11, 2024
1 parent bdf6191 commit e95f09a
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
namespacer (0.1.0)
namespacer-rb (0.1.3)
parser (~> 3)
tty-command (~> 0.10)
unparser (~> 0.6)
Expand Down Expand Up @@ -70,7 +70,7 @@ PLATFORMS

DEPENDENCIES
minitest (~> 5.16)
namespacer!
namespacer-rb!
pry-byebug
rake (~> 13.0)
rubocop (~> 1.21)
Expand Down
27 changes: 27 additions & 0 deletions bin/namespacer
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'namespacer' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)

bundle_binstub = File.expand_path('bundle', __dir__)

if File.file?(bundle_binstub)
if File.read(bundle_binstub, 300).include?('This file was generated by Bundler')
load(bundle_binstub)
else
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
end
end

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('namespacer-rb', 'namespacer')
5 changes: 5 additions & 0 deletions exe/namespacer
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ parser = OptionParser.new do |opts|

opts.on('-i', '--in-place', 'Modify files in-place') { |_| options.in_place = true }

opts.on('-V', '--version', 'Print version') do
puts "namespacer #{Rubyists::Namespacer::VERSION}"
exit
end

opts.on('-v', '--verbose', 'Verbose output') do
options.verbose = true
end
Expand Down

0 comments on commit e95f09a

Please sign in to comment.