import.rb 0.1.0 → 0.1.1
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 +4 -4
- data/README.md +24 -7
- data/import.rb.gemspec +2 -2
- data/lib/import.rb +1 -3
- data/lib/version.rb +1 -1
- metadata +56 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 48db16938ffa3703803957ea942a10f840017d52
|
4
|
+
data.tar.gz: 96fdb9d4a627ccbfd9f8fb9a32dc6622f552892b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92c7eed7a96e4875b9547d144273722f02f9ee0997da6794be29905b3a872fce26a0a5d5643a38415d8565b5ca2e559803b92a81120e6eb2deca49df01004d17
|
7
|
+
data.tar.gz: 83c672d5e01fde571ac39e7a5837a8c8c78cdebc40235645f37144f8abf13e80659e9f76b04d055d88196d61f8c1786586186f19e2754cbde295e9b1afb5a062
|
data/README.md
CHANGED
@@ -1,15 +1,14 @@
|
|
1
|
-
#
|
1
|
+
# import.rb
|
2
2
|
|
3
|
-
|
3
|
+
Instead of `Kernel.require`.
|
4
4
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
5
|
|
7
6
|
## Installation
|
8
7
|
|
9
8
|
Add this line to your application's Gemfile:
|
10
9
|
|
11
10
|
```ruby
|
12
|
-
gem 'import
|
11
|
+
gem 'import.rb'
|
13
12
|
```
|
14
13
|
|
15
14
|
And then execute:
|
@@ -18,11 +17,29 @@ And then execute:
|
|
18
17
|
|
19
18
|
Or install it yourself as:
|
20
19
|
|
21
|
-
$ gem install import
|
20
|
+
$ gem install import.rb
|
22
21
|
|
23
22
|
## Usage
|
24
23
|
|
25
|
-
|
24
|
+
- cat.rb
|
25
|
+
|
26
|
+
```ruby
|
27
|
+
class Cat
|
28
|
+
def meow
|
29
|
+
puts 'meow meow'
|
30
|
+
end
|
31
|
+
end
|
32
|
+
```
|
33
|
+
|
34
|
+
- main.rb
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
require 'import'
|
38
|
+
cat = import('./cat')::Cat
|
39
|
+
cat.new.meow # => meow meow
|
40
|
+
|
41
|
+
# Cat # => uninitialized constant Cat (NameError)
|
42
|
+
```
|
26
43
|
|
27
44
|
## Development
|
28
45
|
|
@@ -32,5 +49,5 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
49
|
|
33
50
|
## Contributing
|
34
51
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
52
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/pocke/import.rb .
|
36
53
|
|
data/import.rb.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Masataka Kuwabara"]
|
10
10
|
spec.email = ["p.ck.t22@gmail.com"]
|
11
11
|
|
12
|
-
spec.summary = "Instead of require
|
13
|
-
spec.description =
|
12
|
+
spec.summary = "Instead of Kernel.require"
|
13
|
+
spec.description = File.read('./README.md')
|
14
14
|
spec.homepage = "https://github.com/pocke/import.rb"
|
15
15
|
spec.license = 'CC0-1.0'
|
16
16
|
|
data/lib/import.rb
CHANGED
@@ -18,10 +18,8 @@ exist_file = -> (path, fname = nil) {
|
|
18
18
|
}
|
19
19
|
|
20
20
|
# @param [String] feature
|
21
|
-
# @return [
|
21
|
+
# @return [String|nil]
|
22
22
|
find_file = -> (feature) {
|
23
|
-
# TODO: relative path
|
24
|
-
|
25
23
|
# absolute path
|
26
24
|
if feature[0] == '/'
|
27
25
|
full_path = exist_file.(feature)
|
data/lib/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
VERSION = '0.1.
|
1
|
+
VERSION = '0.1.1'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: import.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masataka Kuwabara
|
@@ -38,7 +38,60 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
-
description:
|
41
|
+
description: |+
|
42
|
+
# import.rb
|
43
|
+
|
44
|
+
Instead of `Kernel.require`.
|
45
|
+
|
46
|
+
|
47
|
+
## Installation
|
48
|
+
|
49
|
+
Add this line to your application's Gemfile:
|
50
|
+
|
51
|
+
```ruby
|
52
|
+
gem 'import.rb'
|
53
|
+
```
|
54
|
+
|
55
|
+
And then execute:
|
56
|
+
|
57
|
+
$ bundle
|
58
|
+
|
59
|
+
Or install it yourself as:
|
60
|
+
|
61
|
+
$ gem install import.rb
|
62
|
+
|
63
|
+
## Usage
|
64
|
+
|
65
|
+
- cat.rb
|
66
|
+
|
67
|
+
```ruby
|
68
|
+
class Cat
|
69
|
+
def meow
|
70
|
+
puts 'meow meow'
|
71
|
+
end
|
72
|
+
end
|
73
|
+
```
|
74
|
+
|
75
|
+
- main.rb
|
76
|
+
|
77
|
+
```ruby
|
78
|
+
require 'import'
|
79
|
+
cat = import('./cat')::Cat
|
80
|
+
cat.new.meow # => meow meow
|
81
|
+
|
82
|
+
# Cat # => uninitialized constant Cat (NameError)
|
83
|
+
```
|
84
|
+
|
85
|
+
## Development
|
86
|
+
|
87
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
88
|
+
|
89
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
90
|
+
|
91
|
+
## Contributing
|
92
|
+
|
93
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/pocke/import.rb .
|
94
|
+
|
42
95
|
email:
|
43
96
|
- p.ck.t22@gmail.com
|
44
97
|
executables: []
|
@@ -77,5 +130,5 @@ rubyforge_project:
|
|
77
130
|
rubygems_version: 2.4.5.1
|
78
131
|
signing_key:
|
79
132
|
specification_version: 4
|
80
|
-
summary: Instead of require
|
133
|
+
summary: Instead of Kernel.require
|
81
134
|
test_files: []
|