File tree 3 files changed +23
-3
lines changed
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)
72
72
command << "-p" if poll
73
73
end
74
74
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
75
83
end
76
84
end
77
85
end
Original file line number Diff line number Diff line change 1
1
namespace :tailwindcss do
2
2
desc "Build your Tailwind CSS"
3
3
task :build do |_ , args |
4
- debug = args . extras . include? ( "debug" )
4
+ debug = Tailwindcss :: Commands . debug_option ( args . extras )
5
5
command = Tailwindcss ::Commands . compile_command ( debug : debug )
6
6
puts command . inspect if args . extras . include? ( "verbose" )
7
7
system ( *command , exception : true )
8
8
end
9
9
10
10
desc "Watch and build your Tailwind CSS on file changes"
11
11
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 )
14
14
command = Tailwindcss ::Commands . watch_command ( debug : debug , poll : poll )
15
15
puts command . inspect if args . extras . include? ( "verbose" )
16
16
system ( *command )
Original file line number Diff line number Diff line change @@ -84,4 +84,16 @@ def mock_exe_directory(platform)
84
84
end
85
85
end
86
86
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
87
99
end
You can’t perform that action at this time.
0 commit comments