File tree Expand file tree Collapse file tree 3 files changed +23
-3
lines changed
Expand file tree Collapse file tree 3 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,14 @@ def watch_command(poll: false, **kwargs)
7272 command << "-p" if poll
7373 end
7474 end
75+
76+ def debug_option ( rake_task_args_extras )
77+ rake_task_args_extras . include? ( "debug" )
78+ end
79+
80+ def poll_option ( rake_task_args_extras )
81+ rake_task_args_extras . include? ( "poll" )
82+ end
7583 end
7684 end
7785end
Original file line number Diff line number Diff line change 11namespace :tailwindcss do
22 desc "Build your Tailwind CSS"
33 task :build do |_ , args |
4- debug = args . extras . include? ( "debug" )
4+ debug = Tailwindcss :: Commands . debug_option ( args . extras )
55 command = Tailwindcss ::Commands . compile_command ( debug : debug )
66 puts command . inspect if args . extras . include? ( "verbose" )
77 system ( *command , exception : true )
88 end
99
1010 desc "Watch and build your Tailwind CSS on file changes"
1111 task :watch do |_ , args |
12- debug = args . extras . include? ( "debug" )
13- poll = args . extras . include? ( "poll" )
12+ debug = Tailwindcss :: Commands . debug_option ( args . extras )
13+ poll = Tailwindcss :: Commands . poll_option ( args . extras )
1414 command = Tailwindcss ::Commands . watch_command ( debug : debug , poll : poll )
1515 puts command . inspect if args . extras . include? ( "verbose" )
1616 system ( *command )
Original file line number Diff line number Diff line change @@ -84,4 +84,16 @@ def mock_exe_directory(platform)
8484 end
8585 end
8686 end
87+
88+ test ".debug_option" do
89+ refute ( Tailwindcss ::Commands . debug_option ( [ ] ) )
90+ assert ( Tailwindcss ::Commands . debug_option ( [ "debug" ] ) )
91+ refute ( Tailwindcss ::Commands . debug_option ( [ "poll" ] ) )
92+ end
93+
94+ test ".poll_option" do
95+ refute ( Tailwindcss ::Commands . poll_option ( [ ] ) )
96+ refute ( Tailwindcss ::Commands . poll_option ( [ "debug" ] ) )
97+ assert ( Tailwindcss ::Commands . poll_option ( [ "poll" ] ) )
98+ end
8799end
You can’t perform that action at this time.
0 commit comments