Skip to content
This repository has been archived by the owner on Jul 20, 2021. It is now read-only.

Commit

Permalink
new experimental check: gems that contain a DLL but platform is set t…
Browse files Browse the repository at this point in the history
…o ruby

* gems containing DLLs are procompiled extensions that target windows.
  The plaform should be set to a win32 variant
  • Loading branch information
yob committed Dec 30, 2010
1 parent 9fdc46f commit 8621a93
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
1 change: 0 additions & 1 deletion README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ Full source is on github at https://github.com/yob/gem-lint

== Ideas for new checks

* look for gems containing DLLs with platform ruby
* improved handling of compiled extensions
* files entry in spec not matching actual files in data

Expand Down
35 changes: 35 additions & 0 deletions lib/gem_lint/strategies/ruby_platform_with_dll_strategy.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module GemLint
module Strategies
class RubyPlatformWithDllStrategy < AbstractStrategy

def description
"contains a DLL for windows, but platform is set to ruby"
end

def tag
:"ruby-platform-with-dll"
end

def level
:warning
end

def fail?
contains_dll? && spec.platform == "ruby"
end

private

def contains_dll?
spec.files.any? { |file|
file.downcase[-4,4] == ".dll"
}
end

def spec
@spec ||= YAML.load(File.read(@metadata_path))
end

end
end
end

0 comments on commit 8621a93

Please sign in to comment.