ext_check 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e4e4cb2409a60bf310a0f265557ae286ed9ad44c
4
+ data.tar.gz: 242f05f3cf1c83a21b8e8ed4bfd7f4eb57cbaf64
5
+ SHA512:
6
+ metadata.gz: 1951ac4f4290657133f9080ac49ec7549c3c38f6a8c6c0bea643c0db4571b3842c24f61411bc4b191c5c2089c37ca21396d4c101b091dce92accd2e82cf52dd4
7
+ data.tar.gz: 9c4d1661950fd415094317703a125eee591e594bb737fc0896078dda6d68a07e7da18c89774f245fb6df7d4d4a7e4e0fa596bb454466eb5695fd11a6b884d1b3
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Dimitar Kostov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,44 @@
1
+ # ext_check
2
+
3
+ ext_check provides simple rake task for rails project that will check for used gems with C extensions
4
+
5
+ ## Installation
6
+
7
+ In your rails project Gemfile:
8
+
9
+ gem 'ext_check'
10
+
11
+ ## Usage
12
+
13
+ $ rake ext_check
14
+
15
+
16
+ ### Meta
17
+
18
+ * Author - Dimitar Kostov
19
+ * Email - mitko.kostov@gmail.com
20
+ * Blog - <http://mytrile.github.io>
21
+ * Twitter - [mytrile](https://twitter.com/mytrile)
22
+
23
+ ## License
24
+
25
+ The MIT License (MIT)
26
+
27
+ Copyright (c) 2015 Dimitar Kostov
28
+
29
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
30
+ this software and associated documentation files (the "Software"), to deal in
31
+ the Software without restriction, including without limitation the rights to
32
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
33
+ the Software, and to permit persons to whom the Software is furnished to do so,
34
+ subject to the following conditions:
35
+
36
+ The above copyright notice and this permission notice shall be included in all
37
+ copies or substantial portions of the Software.
38
+
39
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
40
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
41
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
42
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
43
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
44
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/ext_check.gemspec ADDED
@@ -0,0 +1,12 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "ext_check"
3
+ s.version = "0.1.0"
4
+ s.licenses = ['MIT']
5
+ s.authors = ["Dimitar Kostov"]
6
+ s.description = %q{ExtCheck provides rails task for checking for C extensions}
7
+ s.summary = %q{Provides rails task for checking for C extensions}
8
+ s.email = ["mitko.kostov@gmail.com"]
9
+ s.homepage = "http://github.com/mytrile/ext_check"
10
+ s.files = `git ls-files`.split("\n")
11
+ s.require_paths = ["lib"]
12
+ end
data/lib/ext_check.rb ADDED
@@ -0,0 +1,3 @@
1
+ module ExtCheck
2
+ require 'ext_check/railtie' if defined?(Rails)
3
+ end
@@ -0,0 +1,10 @@
1
+ require 'ext_check'
2
+ require 'rails'
3
+
4
+ module ExtCheck
5
+ class Railtie < Rails::Railtie
6
+ rake_tasks do
7
+ load "tasks/ext_check.rake"
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,39 @@
1
+ require 'find'
2
+ require 'bundler'
3
+
4
+ desc 'Check for C extensions used in the projects'
5
+ task :ext_check do
6
+ check_gems
7
+ end
8
+
9
+
10
+ private
11
+
12
+ def check_gems
13
+ gems_including_c_extension = []
14
+
15
+ get_gem_list.each do |gem_name|
16
+ gems_including_c_extension << gem_name if has_c_extension?(gem_name)
17
+ end
18
+
19
+ if gems_including_c_extension.any?
20
+ puts ""
21
+ puts "Gems with C extensions:"
22
+ puts ""
23
+ puts gems_including_c_extension
24
+ else
25
+ puts "There are no gems with C extensions"
26
+ end
27
+ end
28
+
29
+ def get_gem_list
30
+ Bundler.load.specs.map { |spec| spec.name }
31
+ end
32
+
33
+ def has_c_extension?(gem_name)
34
+ Find.find(get_gem_path(gem_name)).select { |p| /extconf.rb\z/ =~ p }.any?
35
+ end
36
+
37
+ def get_gem_path(gem_name)
38
+ Bundler.rubygems.find_name(gem_name).first.full_gem_path
39
+ end
metadata ADDED
@@ -0,0 +1,50 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ext_check
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Dimitar Kostov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-07-22 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: ExtCheck provides rails task for checking for C extensions
14
+ email:
15
+ - mitko.kostov@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - LICENSE
21
+ - README.md
22
+ - ext_check.gemspec
23
+ - lib/ext_check.rb
24
+ - lib/ext_check/railtie.rb
25
+ - lib/tasks/ext_check.rake
26
+ homepage: http://github.com/mytrile/ext_check
27
+ licenses:
28
+ - MIT
29
+ metadata: {}
30
+ post_install_message:
31
+ rdoc_options: []
32
+ require_paths:
33
+ - lib
34
+ required_ruby_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ required_rubygems_version: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ requirements: []
45
+ rubyforge_project:
46
+ rubygems_version: 2.4.8
47
+ signing_key:
48
+ specification_version: 4
49
+ summary: Provides rails task for checking for C extensions
50
+ test_files: []