gem_path 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d7c18fb1a4ec1a5997d15a5f3d4cca087b841c51
4
+ data.tar.gz: 9ed25c546de1f7ecfc507945ecd286bec2155701
5
+ SHA512:
6
+ metadata.gz: 3563f3983206cf6d1bce779ca862e12349f8c2acef5e4db59802097836df2c9a6f1b8670b1fda8e0eaec2ac452f684b67112a57cdb49c26c262d9658a7996be0
7
+ data.tar.gz: 773e1878ac4e02178dfeeb626a0a95b5b0837cad3d2e1569e39b6ef6c8a0cfff7f91e628e5fa36e85d764bf46a76db972d8e5c4ae5bd91db53bef919ee66a93e
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+
11
+ # rspec failure tracking
12
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,4 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.4.1
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in gem_path.gemspec
6
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Juanito Fatas
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all 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,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,32 @@
1
+ # GemPath
2
+
3
+ Find where a gem is located.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile then run `bundle`:
8
+
9
+ ```ruby
10
+ gem "gem_path"
11
+ ```
12
+
13
+ Or install it yourself as:
14
+
15
+ ```
16
+ $ gem install gem_path
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ```ruby
22
+ GemPath.find("rails")
23
+ # => path/to/rails/gem/in/your/system
24
+ ```
25
+
26
+ ## License, Contributor's Guidelines
27
+
28
+ - MIT license
29
+ - [Moya Contributors Guidelines][moya] which TLDR: means we give out push access easily and often.
30
+
31
+ [mit]: https://opensource.org/licenses/MIT
32
+ [moya]: https://github.com/Moya/contributors
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "gem_path"
5
+
6
+ require "pry"
7
+ Pry.start
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "gem_path/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "gem_path"
8
+ spec.version = GemPath::VERSION
9
+ spec.authors = ["Juanito Fatas"]
10
+ spec.email = ["juanito-fatas@cookpad.jp"]
11
+
12
+ spec.summary = %q{Find where a gem is located.}
13
+ spec.description = spec.summary
14
+ spec.homepage = "https://github.com/JuanitoFatas/gem_path"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ f.match(%r{^(test|spec|features)/})
19
+ end
20
+ spec.bindir = "exe"
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ spec.require_paths = ["lib"]
23
+
24
+ spec.add_development_dependency "pry"
25
+ spec.add_development_dependency "rspec", "~> 3.0"
26
+ end
@@ -0,0 +1,32 @@
1
+ require "gem_path/version"
2
+
3
+ class GemPath
4
+ GemNotFound = Class.new(RuntimeError)
5
+
6
+ def self.find(name)
7
+ new(name).find
8
+ end
9
+
10
+ def initialize(name)
11
+ @name = name
12
+ end
13
+
14
+ def find
15
+ if gem_exists?
16
+ gemspec.gem_dir
17
+ else
18
+ raise GemNotFound, "Couldn't find gem directory for '#{name}'"
19
+ end
20
+ end
21
+
22
+ private
23
+ attr_reader :name
24
+
25
+ def gem_exists?
26
+ !Gem::Specification.find_all_by_name(name).empty?
27
+ end
28
+
29
+ def gemspec
30
+ @_gemspec ||= Gem::Specification.find_by_name(name)
31
+ end
32
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class GemPath
4
+ VERSION = "1.0.0"
5
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gem_path
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Juanito Fatas
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-09-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pry
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.0'
41
+ description: Find where a gem is located.
42
+ email:
43
+ - juanito-fatas@cookpad.jp
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - ".rspec"
50
+ - ".travis.yml"
51
+ - Gemfile
52
+ - LICENSE.txt
53
+ - README.md
54
+ - Rakefile
55
+ - bin/hack
56
+ - gem_path.gemspec
57
+ - lib/gem_path.rb
58
+ - lib/gem_path/version.rb
59
+ homepage: https://github.com/JuanitoFatas/gem_path
60
+ licenses:
61
+ - MIT
62
+ metadata: {}
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubyforge_project:
79
+ rubygems_version: 2.6.12
80
+ signing_key:
81
+ specification_version: 4
82
+ summary: Find where a gem is located.
83
+ test_files: []