Skip to content

Commit 4e8f7f3

Browse files
committed
Reduce Ruby warnings
Problem === sassc-ruby displays warnings on load the gem if `-w` options is passed to ruby interpreter. ```console $ ruby -w -rsassc -e '' /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/2.7.0/gems/ffi-1.11.1/lib/ffi/library.rb:275: warning: method redefined; discarding old version /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/2.7.0/gems/ffi-1.11.1/lib/ffi/library.rb:275: warning: method redefined; discarding old version /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/2.7.0/gems/ffi-1.11.1/lib/ffi/library.rb:275: warning: method redefined; discarding old _make_data_context /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/2.7.0/gems/ffi-1.11.1/lib/ffi/library.rb:275: warning: method redefined; discarding old _make_data_context /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/2.7.0/gems/ffi-1.11.1/lib/ffi/library.rb:275: warning: method redefined; discarding old _context_get_included_files /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/2.7.0/gems/ffi-1.11.1/lib/ffi/library.rb:275: warning: method redefined; discarding old _context_get_included_files /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/2.7.0/gems/ffi-1.11.1/lib/ffi/library.rb:275: warning: method redefined; discarding old list_get_length /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/2.7.0/gems/ffi-1.11.1/lib/ffi/library.rb:275: warning: method redefined; discarding old list_get_length /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/2.7.0/gems/ffi-1.11.1/lib/ffi/library.rb:275: warning: method redefined; discarding old list_get_value /home/pocke/.rbenv/versions/trunk/lib/ruby/gems/2.7.0/gems/ffi-1.11.1/lib/ffi/library.rb:275: warning: method redefined; discarding old list_get_value ``` This pull request suppresses the warnings. Note === sassc-ruby has other warnings in test code, but this pull request does not suppress the warnings. Because they does not affect users. If you'd like to see the warning, you can execute `rake test` with `RUBYOPT=-w` environment variable.
1 parent 266c904 commit 4e8f7f3

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

lib/sassc/native.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module Native
4242

4343
# Remove the redundant "sass_" from the beginning of every method name
4444
def self.attach_function(*args)
45-
super if args.size != 3
45+
return super if args.size != 3
4646

4747
if args[0] =~ /^sass_/
4848
args.unshift args[0].to_s.sub(/^sass_/, "")

lib/sassc/native/native_functions_api.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,6 @@ def self.string_get_type(native_value)
9898
attach_function "sass_color_set_#{color_channel}".to_sym, [:sass_value_ptr, :double], :void
9999
end
100100

101-
# ADDAPI size_t ADDCALL sass_list_get_length(const union Sass_Value* v)
102-
# ADDAPI union Sass_Value* ADDCALL sass_list_get_value (const union Sass_Value* v, size_t i);
103-
attach_function :sass_list_get_length, [:sass_value_ptr], :size_t
104-
attach_function :sass_list_get_value, [:sass_value_ptr, :size_t], :sass_value_ptr
105-
106101
# ADDAPI char* ADDCALL sass_error_get_message (const union Sass_Value* v);
107102
# ADDAPI void ADDCALL sass_error_set_message (union Sass_Value* v, char* msg);
108103
attach_function :sass_error_get_message, [:sass_value_ptr], :string

0 commit comments

Comments
 (0)