ae_easy-core 0.0.3
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 +7 -0
- data/.gitignore +10 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +57 -0
- data/LICENSE +21 -0
- data/README.md +16 -0
- data/Rakefile +22 -0
- data/ae_easy-core.gemspec +49 -0
- data/doc/AeEasy.html +117 -0
- data/doc/AeEasy/Core.html +1622 -0
- data/doc/AeEasy/Core/Config.html +311 -0
- data/doc/AeEasy/Core/Exception.html +117 -0
- data/doc/AeEasy/Core/Exception/OutdatedError.html +135 -0
- data/doc/AeEasy/Core/Helper.html +117 -0
- data/doc/AeEasy/Core/Helper/Cookie.html +1070 -0
- data/doc/AeEasy/Core/Mock.html +282 -0
- data/doc/AeEasy/Core/Mock/FakeDb.html +2316 -0
- data/doc/AeEasy/Core/Mock/FakeExecutor.html +2226 -0
- data/doc/AeEasy/Core/Mock/FakeParser.html +275 -0
- data/doc/AeEasy/Core/Mock/FakeSeeder.html +269 -0
- data/doc/AeEasy/Core/Plugin.html +117 -0
- data/doc/AeEasy/Core/Plugin/CollectionVault.html +299 -0
- data/doc/AeEasy/Core/Plugin/ConfigBehavior.html +541 -0
- data/doc/AeEasy/Core/Plugin/ContextIntegrator.html +445 -0
- data/doc/AeEasy/Core/Plugin/InitializeHook.html +220 -0
- data/doc/AeEasy/Core/Plugin/Parser.html +259 -0
- data/doc/AeEasy/Core/Plugin/ParserBehavior.html +420 -0
- data/doc/AeEasy/Core/Plugin/Seeder.html +635 -0
- data/doc/AeEasy/Core/Plugin/SeederBehavior.html +282 -0
- data/doc/AeEasy/Core/SmartCollection.html +1386 -0
- data/doc/_index.html +329 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +496 -0
- data/doc/file.README.html +91 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +91 -0
- data/doc/js/app.js +292 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +811 -0
- data/doc/top-level-namespace.html +110 -0
- data/lib/ae_easy/core.rb +241 -0
- data/lib/ae_easy/core/config.rb +25 -0
- data/lib/ae_easy/core/exception.rb +8 -0
- data/lib/ae_easy/core/exception/outdated_error.rb +9 -0
- data/lib/ae_easy/core/helper.rb +8 -0
- data/lib/ae_easy/core/helper/cookie.rb +209 -0
- data/lib/ae_easy/core/mock.rb +44 -0
- data/lib/ae_easy/core/mock/fake_db.rb +280 -0
- data/lib/ae_easy/core/mock/fake_executor.rb +207 -0
- data/lib/ae_easy/core/mock/fake_parser.rb +31 -0
- data/lib/ae_easy/core/mock/fake_seeder.rb +28 -0
- data/lib/ae_easy/core/plugin.rb +15 -0
- data/lib/ae_easy/core/plugin/collection_vault.rb +23 -0
- data/lib/ae_easy/core/plugin/config_behavior.rb +43 -0
- data/lib/ae_easy/core/plugin/context_integrator.rb +60 -0
- data/lib/ae_easy/core/plugin/initialize_hook.rb +17 -0
- data/lib/ae_easy/core/plugin/parser.rb +19 -0
- data/lib/ae_easy/core/plugin/parser_behavior.rb +39 -0
- data/lib/ae_easy/core/plugin/seeder.rb +34 -0
- data/lib/ae_easy/core/plugin/seeder_behavior.rb +21 -0
- data/lib/ae_easy/core/smart_collection.rb +236 -0
- data/lib/ae_easy/core/version.rb +6 -0
- metadata +225 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0e835d245a96db8cf376e35043d79061da77ca04f5ca1d4c0ca55773f2724cb8
|
4
|
+
data.tar.gz: 5f042a79f04e1322481a63e4fdfb8b0792a84aa4cc8a78f76cde3dea421abf51
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b32358e8ccaeb4c11a2dcc6747740f18837f76e1534dbdb11e0cc0eacddac3dd6a139b9408d4b575326ce427270f270d6b66171648ac3dd1cd8c08c4cccf8f2d
|
7
|
+
data.tar.gz: 07432ef4f149c9b3810c3c845d0af4dd9970ebf88b5e4e703fbd514ad45e3f37edd71bd61a4b4c177eea41f9ff1a0c7715c3a5ad26805630e079620966b097c3
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at parama@answersengine.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
ae_easy-core (0.0.3)
|
5
|
+
answersengine (>= 0.2.25)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
ansi (1.5.0)
|
11
|
+
answersengine (0.2.31)
|
12
|
+
httparty (~> 0.16.2)
|
13
|
+
nokogiri (~> 1.6, < 1.10)
|
14
|
+
thor (~> 0.20.3)
|
15
|
+
byebug (10.0.2)
|
16
|
+
docile (1.3.1)
|
17
|
+
hirb (0.7.3)
|
18
|
+
httparty (0.16.3)
|
19
|
+
mime-types (~> 3.0)
|
20
|
+
multi_xml (>= 0.5.2)
|
21
|
+
json (2.1.0)
|
22
|
+
mime-types (3.2.2)
|
23
|
+
mime-types-data (~> 3.2015)
|
24
|
+
mime-types-data (3.2018.0812)
|
25
|
+
mini_portile2 (2.4.0)
|
26
|
+
minitest (5.11.3)
|
27
|
+
multi_xml (0.6.0)
|
28
|
+
nokogiri (1.9.1)
|
29
|
+
mini_portile2 (~> 2.4.0)
|
30
|
+
rake (10.5.0)
|
31
|
+
simplecov (0.16.1)
|
32
|
+
docile (~> 1.1)
|
33
|
+
json (>= 1.8, < 3)
|
34
|
+
simplecov-html (~> 0.10.0)
|
35
|
+
simplecov-console (0.4.2)
|
36
|
+
ansi
|
37
|
+
hirb
|
38
|
+
simplecov
|
39
|
+
simplecov-html (0.10.2)
|
40
|
+
thor (0.20.3)
|
41
|
+
timecop (0.9.1)
|
42
|
+
|
43
|
+
PLATFORMS
|
44
|
+
ruby
|
45
|
+
|
46
|
+
DEPENDENCIES
|
47
|
+
ae_easy-core!
|
48
|
+
bundler (>= 1.16.3)
|
49
|
+
byebug
|
50
|
+
minitest (>= 5.11)
|
51
|
+
rake (>= 10.0)
|
52
|
+
simplecov (>= 0.16.1)
|
53
|
+
simplecov-console (>= 0.4.2)
|
54
|
+
timecop (>= 0.9.1)
|
55
|
+
|
56
|
+
BUNDLED WITH
|
57
|
+
1.17.3
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2019 AnswersEngine
|
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 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,
|
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 THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
[](http://rubydoc.org/gems/ae_easy-core/frames)
|
2
|
+
[](http://github.com/answersengine/ae_easy-core/releases)
|
3
|
+
[](#license)
|
4
|
+
|
5
|
+
# AeEasy core module
|
6
|
+
## Description
|
7
|
+
|
8
|
+
AeEasy core is part of AeEasy gem collection and allow advance AnswersEngine features possible by function as a base for other gems.
|
9
|
+
|
10
|
+
Install gem:
|
11
|
+
```gem install 'ae_easy-core'```
|
12
|
+
|
13
|
+
Require gem:
|
14
|
+
```require 'ae_easy-core'```
|
15
|
+
|
16
|
+
Documentation can be found [here](http://rubydoc.org/gems/ae_easy-core/frames).
|
data/Rakefile
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'benchmark'
|
2
|
+
require 'bundler/gem_tasks'
|
3
|
+
require 'rake/testtask'
|
4
|
+
|
5
|
+
Rake::TestTask.new do |t|
|
6
|
+
t.libs = ['lib', 'test']
|
7
|
+
t.warning = false
|
8
|
+
t.verbose = false
|
9
|
+
t.test_files = FileList['./test/**/*_test.rb']
|
10
|
+
end
|
11
|
+
|
12
|
+
desc 'Benchmark another task execution | usage example: benchmark[my_task, param1, param2]'
|
13
|
+
task :benchmark, [:task] do |task, args|
|
14
|
+
task_name = args[:task]
|
15
|
+
if task_name.nil?
|
16
|
+
puts "Should select a task."
|
17
|
+
exit 1
|
18
|
+
end
|
19
|
+
puts Benchmark.measure{ Rake::Task[task_name].invoke *args.extras }
|
20
|
+
end
|
21
|
+
|
22
|
+
task default: :test
|
@@ -0,0 +1,49 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "ae_easy/core/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "ae_easy-core"
|
8
|
+
spec.version = AeEasy::Core::VERSION
|
9
|
+
spec.authors = ["Eduardo Rosales"]
|
10
|
+
spec.email = ["eduardo@datahen.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{AnswersEngine Easy toolkit core module}
|
13
|
+
spec.description = %q{AnswersEngine Easy toolkit core module to support other complex modules.}
|
14
|
+
spec.homepage = "https://answersengine.com"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# spec.cert_chain = ['certs/ae_easy.pem']
|
18
|
+
# spec.signing_key = File.expand_path("~/.ssh/gems/gem-private_ae_easy.pem") if $0 =~ /gem\z/
|
19
|
+
|
20
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
21
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
22
|
+
if spec.respond_to?(:metadata)
|
23
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
24
|
+
|
25
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
26
|
+
spec.metadata["source_code_uri"] = "https://github.com/answersengine/ae_easy-core"
|
27
|
+
# spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
|
28
|
+
else
|
29
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
30
|
+
"public gem pushes."
|
31
|
+
end
|
32
|
+
|
33
|
+
# Specify which files should be added to the gem when it is released.
|
34
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
35
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
36
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
37
|
+
end
|
38
|
+
spec.require_paths = ["lib"]
|
39
|
+
spec.required_ruby_version = '>= 2.2.2'
|
40
|
+
|
41
|
+
spec.add_dependency 'answersengine', '>= 0.2.25'
|
42
|
+
spec.add_development_dependency 'bundler', '>= 1.16.3'
|
43
|
+
spec.add_development_dependency 'rake', '>= 10.0'
|
44
|
+
spec.add_development_dependency 'minitest', '>= 5.11'
|
45
|
+
spec.add_development_dependency 'simplecov', '>= 0.16.1'
|
46
|
+
spec.add_development_dependency 'simplecov-console', '>= 0.4.2'
|
47
|
+
spec.add_development_dependency 'timecop', '>= 0.9.1'
|
48
|
+
spec.add_development_dependency 'byebug', '>= 0'
|
49
|
+
end
|
data/doc/AeEasy.html
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Module: AeEasy
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.18
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "AeEasy";
|
19
|
+
relpath = '';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="_index.html">Index (A)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">AeEasy</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Module: AeEasy
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<dl>
|
80
|
+
<dt>Defined in:</dt>
|
81
|
+
<dd>lib/ae_easy/core.rb<span class="defines">,<br />
|
82
|
+
lib/ae_easy/core/mock.rb,<br /> lib/ae_easy/core/config.rb,<br /> lib/ae_easy/core/helper.rb,<br /> lib/ae_easy/core/plugin.rb,<br /> lib/ae_easy/core/version.rb,<br /> lib/ae_easy/core/exception.rb,<br /> lib/ae_easy/core/mock/fake_db.rb,<br /> lib/ae_easy/core/helper/cookie.rb,<br /> lib/ae_easy/core/plugin/parser.rb,<br /> lib/ae_easy/core/plugin/seeder.rb,<br /> lib/ae_easy/core/mock/fake_parser.rb,<br /> lib/ae_easy/core/mock/fake_seeder.rb,<br /> lib/ae_easy/core/smart_collection.rb,<br /> lib/ae_easy/core/mock/fake_executor.rb,<br /> lib/ae_easy/core/plugin/config_behavior.rb,<br /> lib/ae_easy/core/plugin/initialize_hook.rb,<br /> lib/ae_easy/core/plugin/parser_behavior.rb,<br /> lib/ae_easy/core/plugin/seeder_behavior.rb,<br /> lib/ae_easy/core/plugin/collection_vault.rb,<br /> lib/ae_easy/core/exception/outdated_error.rb,<br /> lib/ae_easy/core/plugin/context_integrator.rb</span>
|
83
|
+
</dd>
|
84
|
+
</dl>
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
<h2>Defined Under Namespace</h2>
|
89
|
+
<p class="children">
|
90
|
+
|
91
|
+
|
92
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="AeEasy/Core.html" title="AeEasy::Core (module)">Core</a></span>
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
</p>
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
</div>
|
108
|
+
|
109
|
+
<div id="footer">
|
110
|
+
Generated on Wed Feb 13 21:43:50 2019 by
|
111
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
112
|
+
0.9.18 (ruby-2.5.3).
|
113
|
+
</div>
|
114
|
+
|
115
|
+
</div>
|
116
|
+
</body>
|
117
|
+
</html>
|
@@ -0,0 +1,1622 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Module: AeEasy::Core
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.18
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "AeEasy::Core";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (C)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../AeEasy.html" title="AeEasy (module)">AeEasy</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Core</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Module: AeEasy::Core
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<dl>
|
80
|
+
<dt>Defined in:</dt>
|
81
|
+
<dd>lib/ae_easy/core.rb<span class="defines">,<br />
|
82
|
+
lib/ae_easy/core/mock.rb,<br /> lib/ae_easy/core/config.rb,<br /> lib/ae_easy/core/helper.rb,<br /> lib/ae_easy/core/plugin.rb,<br /> lib/ae_easy/core/version.rb,<br /> lib/ae_easy/core/exception.rb,<br /> lib/ae_easy/core/mock/fake_db.rb,<br /> lib/ae_easy/core/helper/cookie.rb,<br /> lib/ae_easy/core/plugin/parser.rb,<br /> lib/ae_easy/core/plugin/seeder.rb,<br /> lib/ae_easy/core/mock/fake_parser.rb,<br /> lib/ae_easy/core/mock/fake_seeder.rb,<br /> lib/ae_easy/core/smart_collection.rb,<br /> lib/ae_easy/core/mock/fake_executor.rb,<br /> lib/ae_easy/core/plugin/config_behavior.rb,<br /> lib/ae_easy/core/plugin/initialize_hook.rb,<br /> lib/ae_easy/core/plugin/parser_behavior.rb,<br /> lib/ae_easy/core/plugin/seeder_behavior.rb,<br /> lib/ae_easy/core/plugin/collection_vault.rb,<br /> lib/ae_easy/core/exception/outdated_error.rb,<br /> lib/ae_easy/core/plugin/context_integrator.rb</span>
|
83
|
+
</dd>
|
84
|
+
</dl>
|
85
|
+
|
86
|
+
</div>
|
87
|
+
|
88
|
+
<h2>Defined Under Namespace</h2>
|
89
|
+
<p class="children">
|
90
|
+
|
91
|
+
|
92
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Core/Exception.html" title="AeEasy::Core::Exception (module)">Exception</a></span>, <span class='object_link'><a href="Core/Helper.html" title="AeEasy::Core::Helper (module)">Helper</a></span>, <span class='object_link'><a href="Core/Mock.html" title="AeEasy::Core::Mock (module)">Mock</a></span>, <span class='object_link'><a href="Core/Plugin.html" title="AeEasy::Core::Plugin (module)">Plugin</a></span>
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="Core/Config.html" title="AeEasy::Core::Config (class)">Config</a></span>, <span class='object_link'><a href="Core/SmartCollection.html" title="AeEasy::Core::SmartCollection (class)">SmartCollection</a></span>
|
97
|
+
|
98
|
+
|
99
|
+
</p>
|
100
|
+
|
101
|
+
|
102
|
+
<h2>
|
103
|
+
Constant Summary
|
104
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
105
|
+
</h2>
|
106
|
+
|
107
|
+
<dl class="constants">
|
108
|
+
|
109
|
+
<dt id="VERSION-constant" class="">VERSION =
|
110
|
+
<div class="docstring">
|
111
|
+
<div class="discussion">
|
112
|
+
|
113
|
+
<p>Gem version</p>
|
114
|
+
|
115
|
+
|
116
|
+
</div>
|
117
|
+
</div>
|
118
|
+
<div class="tags">
|
119
|
+
|
120
|
+
|
121
|
+
</div>
|
122
|
+
</dt>
|
123
|
+
<dd><pre class="code"><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0.0.2</span><span class='tstring_end'>"</span></span></pre></dd>
|
124
|
+
|
125
|
+
</dl>
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
<h2>
|
136
|
+
Class Method Summary
|
137
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
138
|
+
</h2>
|
139
|
+
|
140
|
+
<ul class="summary">
|
141
|
+
|
142
|
+
<li class="public ">
|
143
|
+
<span class="summary_signature">
|
144
|
+
|
145
|
+
<a href="#all_scripts-class_method" title="all_scripts (class method)">.<strong>all_scripts</strong>(dir, opts = {}) {|path| ... } ⇒ Object </a>
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
</span>
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
<span class="summary_desc"><div class='inline'>
|
160
|
+
<p>Execute an action for all scripts within a directory.</p>
|
161
|
+
</div></span>
|
162
|
+
|
163
|
+
</li>
|
164
|
+
|
165
|
+
|
166
|
+
<li class="public ">
|
167
|
+
<span class="summary_signature">
|
168
|
+
|
169
|
+
<a href="#analyze_compatibility-class_method" title="analyze_compatibility (class method)">.<strong>analyze_compatibility</strong>(source, fragment) ⇒ Hash </a>
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
</span>
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
<span class="summary_desc"><div class='inline'>
|
184
|
+
<p>Generate a compatibility report from a source and a fragment as a hash.</p>
|
185
|
+
</div></span>
|
186
|
+
|
187
|
+
</li>
|
188
|
+
|
189
|
+
|
190
|
+
<li class="public ">
|
191
|
+
<span class="summary_signature">
|
192
|
+
|
193
|
+
<a href="#deep_clone-class_method" title="deep_clone (class method)">.<strong>deep_clone</strong>(hash, should_clone = false) ⇒ Hash </a>
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
</span>
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
<span class="summary_desc"><div class='inline'>
|
208
|
+
<p>Deep clone a hash while keeping it's values object references.</p>
|
209
|
+
</div></span>
|
210
|
+
|
211
|
+
</li>
|
212
|
+
|
213
|
+
|
214
|
+
<li class="public ">
|
215
|
+
<span class="summary_signature">
|
216
|
+
|
217
|
+
<a href="#deep_stringify_keys-class_method" title="deep_stringify_keys (class method)">.<strong>deep_stringify_keys</strong>(hash, should_clone = true) ⇒ Hash </a>
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
</span>
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
<span class="summary_desc"><div class='inline'>
|
232
|
+
<p>Deep stringify keys from a hash.</p>
|
233
|
+
</div></span>
|
234
|
+
|
235
|
+
</li>
|
236
|
+
|
237
|
+
|
238
|
+
<li class="public ">
|
239
|
+
<span class="summary_signature">
|
240
|
+
|
241
|
+
<a href="#deep_stringify_keys!-class_method" title="deep_stringify_keys! (class method)">.<strong>deep_stringify_keys!</strong>(hash) ⇒ Hash </a>
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
</span>
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
<span class="summary_desc"><div class='inline'>
|
256
|
+
<p>Deep stringify all keys on hash object.</p>
|
257
|
+
</div></span>
|
258
|
+
|
259
|
+
</li>
|
260
|
+
|
261
|
+
|
262
|
+
<li class="public ">
|
263
|
+
<span class="summary_signature">
|
264
|
+
|
265
|
+
<a href="#expose_to-class_method" title="expose_to (class method)">.<strong>expose_to</strong>(object, env) ⇒ Object </a>
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
</span>
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
<span class="summary_desc"><div class='inline'>
|
280
|
+
<p>Expose an environment into an object instance as methods.</p>
|
281
|
+
</div></span>
|
282
|
+
|
283
|
+
</li>
|
284
|
+
|
285
|
+
|
286
|
+
<li class="public ">
|
287
|
+
<span class="summary_signature">
|
288
|
+
|
289
|
+
<a href="#gem_root-class_method" title="gem_root (class method)">.<strong>gem_root</strong> ⇒ String </a>
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
</span>
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
<span class="summary_desc"><div class='inline'>
|
304
|
+
<p>Get AeEasy-core gem root directory path.</p>
|
305
|
+
</div></span>
|
306
|
+
|
307
|
+
</li>
|
308
|
+
|
309
|
+
|
310
|
+
<li class="public ">
|
311
|
+
<span class="summary_signature">
|
312
|
+
|
313
|
+
<a href="#instance_methods_from-class_method" title="instance_methods_from (class method)">.<strong>instance_methods_from</strong>(object) ⇒ Array </a>
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
</span>
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
|
327
|
+
<span class="summary_desc"><div class='inline'>
|
328
|
+
<p>Retrieve instance methods from an object.</p>
|
329
|
+
</div></span>
|
330
|
+
|
331
|
+
</li>
|
332
|
+
|
333
|
+
|
334
|
+
<li class="public ">
|
335
|
+
<span class="summary_signature">
|
336
|
+
|
337
|
+
<a href="#mock_instance_methods-class_method" title="mock_instance_methods (class method)">.<strong>mock_instance_methods</strong>(source, target) ⇒ Object </a>
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
</span>
|
342
|
+
|
343
|
+
|
344
|
+
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
|
349
|
+
|
350
|
+
|
351
|
+
<span class="summary_desc"><div class='inline'>
|
352
|
+
<p>Mock instances methods from the source into target object.</p>
|
353
|
+
</div></span>
|
354
|
+
|
355
|
+
</li>
|
356
|
+
|
357
|
+
|
358
|
+
<li class="public ">
|
359
|
+
<span class="summary_signature">
|
360
|
+
|
361
|
+
<a href="#require_all-class_method" title="require_all (class method)">.<strong>require_all</strong>(dir, opts = {}) ⇒ Object </a>
|
362
|
+
|
363
|
+
|
364
|
+
|
365
|
+
</span>
|
366
|
+
|
367
|
+
|
368
|
+
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
<span class="summary_desc"><div class='inline'>
|
376
|
+
<p>Require all scripts within a directory.</p>
|
377
|
+
</div></span>
|
378
|
+
|
379
|
+
</li>
|
380
|
+
|
381
|
+
|
382
|
+
<li class="public ">
|
383
|
+
<span class="summary_signature">
|
384
|
+
|
385
|
+
<a href="#require_relative_all-class_method" title="require_relative_all (class method)">.<strong>require_relative_all</strong>(dir, opts = {}) ⇒ Object </a>
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
</span>
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
|
398
|
+
|
399
|
+
<span class="summary_desc"><div class='inline'>
|
400
|
+
<p>Require all relative scripts paths within a directory.</p>
|
401
|
+
</div></span>
|
402
|
+
|
403
|
+
</li>
|
404
|
+
|
405
|
+
|
406
|
+
</ul>
|
407
|
+
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
<div id="class_method_details" class="method_details_list">
|
412
|
+
<h2>Class Method Details</h2>
|
413
|
+
|
414
|
+
|
415
|
+
<div class="method_details first">
|
416
|
+
<h3 class="signature first" id="all_scripts-class_method">
|
417
|
+
|
418
|
+
.<strong>all_scripts</strong>(dir, opts = {}) {|path| ... } ⇒ <tt>Object</tt>
|
419
|
+
|
420
|
+
|
421
|
+
|
422
|
+
|
423
|
+
|
424
|
+
</h3><div class="docstring">
|
425
|
+
<div class="discussion">
|
426
|
+
|
427
|
+
<p>Execute an action for all scripts within a directory.</p>
|
428
|
+
|
429
|
+
|
430
|
+
</div>
|
431
|
+
</div>
|
432
|
+
<div class="tags">
|
433
|
+
<p class="tag_title">Parameters:</p>
|
434
|
+
<ul class="param">
|
435
|
+
|
436
|
+
<li>
|
437
|
+
|
438
|
+
<span class='name'>dir</span>
|
439
|
+
|
440
|
+
|
441
|
+
<span class='type'>(<tt>String</tt>)</span>
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
—
|
446
|
+
<div class='inline'>
|
447
|
+
<p>Directory containing `.rb` scripts.</p>
|
448
|
+
</div>
|
449
|
+
|
450
|
+
</li>
|
451
|
+
|
452
|
+
<li>
|
453
|
+
|
454
|
+
<span class='name'>opts</span>
|
455
|
+
|
456
|
+
|
457
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
458
|
+
|
459
|
+
|
460
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
461
|
+
|
462
|
+
|
463
|
+
—
|
464
|
+
<div class='inline'>
|
465
|
+
<p>({}) Configuration options.</p>
|
466
|
+
</div>
|
467
|
+
|
468
|
+
</li>
|
469
|
+
|
470
|
+
</ul>
|
471
|
+
|
472
|
+
|
473
|
+
|
474
|
+
|
475
|
+
|
476
|
+
|
477
|
+
<p class="tag_title">Options Hash (<tt>opts</tt>):</p>
|
478
|
+
<ul class="option">
|
479
|
+
|
480
|
+
<li>
|
481
|
+
<span class="name">:except</span>
|
482
|
+
<span class="type">(<tt>Array</tt>)</span>
|
483
|
+
<span class="default">
|
484
|
+
|
485
|
+
— default:
|
486
|
+
<tt>nil</tt>
|
487
|
+
|
488
|
+
</span>
|
489
|
+
|
490
|
+
— <div class='inline'>
|
491
|
+
<p>Literal file collection excluded from process.</p>
|
492
|
+
</div>
|
493
|
+
|
494
|
+
</li>
|
495
|
+
|
496
|
+
</ul>
|
497
|
+
|
498
|
+
|
499
|
+
<p class="tag_title">Yield Parameters:</p>
|
500
|
+
<ul class="yieldparam">
|
501
|
+
|
502
|
+
<li>
|
503
|
+
|
504
|
+
<span class='name'>path</span>
|
505
|
+
|
506
|
+
|
507
|
+
<span class='type'>(<tt>String</tt>)</span>
|
508
|
+
|
509
|
+
|
510
|
+
|
511
|
+
—
|
512
|
+
<div class='inline'>
|
513
|
+
<p>Script file path.</p>
|
514
|
+
</div>
|
515
|
+
|
516
|
+
</li>
|
517
|
+
|
518
|
+
</ul>
|
519
|
+
|
520
|
+
</div><table class="source_code">
|
521
|
+
<tr>
|
522
|
+
<td>
|
523
|
+
<pre class="lines">
|
524
|
+
|
525
|
+
|
526
|
+
29
|
527
|
+
30
|
528
|
+
31
|
529
|
+
32
|
530
|
+
33
|
531
|
+
34</pre>
|
532
|
+
</td>
|
533
|
+
<td>
|
534
|
+
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line 29</span>
|
535
|
+
|
536
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_all_scripts'>all_scripts</span> <span class='id identifier rubyid_dir'>dir</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
537
|
+
<span class='id identifier rubyid_excluded_files'>excluded_files</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:except</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='id identifier rubyid_dir'>dir</span><span class='comma'>,</span> <span class='id identifier rubyid_f'>f</span><span class='rparen'>)</span><span class='rbrace'>}</span>
|
538
|
+
<span class='id identifier rubyid_files'>files</span> <span class='op'>=</span> <span class='const'>Dir</span><span class='lbracket'>[</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span><span class='lparen'>(</span><span class='id identifier rubyid_dir'>dir</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>*.rb</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='rbracket'>]</span> <span class='op'>-</span> <span class='id identifier rubyid_excluded_files'>excluded_files</span>
|
539
|
+
<span class='id identifier rubyid_block'>block</span> <span class='op'>||=</span> <span class='id identifier rubyid_proc'>proc</span><span class='lbrace'>{</span><span class='rbrace'>}</span>
|
540
|
+
<span class='id identifier rubyid_files'>files</span><span class='period'>.</span><span class='id identifier rubyid_sort'>sort</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
541
|
+
<span class='kw'>end</span></pre>
|
542
|
+
</td>
|
543
|
+
</tr>
|
544
|
+
</table>
|
545
|
+
</div>
|
546
|
+
|
547
|
+
<div class="method_details ">
|
548
|
+
<h3 class="signature " id="analyze_compatibility-class_method">
|
549
|
+
|
550
|
+
.<strong>analyze_compatibility</strong>(source, fragment) ⇒ <tt>Hash</tt>
|
551
|
+
|
552
|
+
|
553
|
+
|
554
|
+
|
555
|
+
|
556
|
+
</h3><div class="docstring">
|
557
|
+
<div class="discussion">
|
558
|
+
|
559
|
+
<p>Generate a compatibility report from a source and a fragment as a hash.</p>
|
560
|
+
|
561
|
+
|
562
|
+
</div>
|
563
|
+
</div>
|
564
|
+
<div class="tags">
|
565
|
+
|
566
|
+
<div class="examples">
|
567
|
+
<p class="tag_title">Examples:</p>
|
568
|
+
|
569
|
+
|
570
|
+
<p class="example_title"><div class='inline'>
|
571
|
+
<p>Analyze when uncompatible `fragment` because of `source` missing fields.</p>
|
572
|
+
</div></p>
|
573
|
+
|
574
|
+
<pre class="example code"><code><span class='const'><span class='object_link'><a href="../AeEasy.html" title="AeEasy (module)">AeEasy</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="AeEasy::Core (module)">Core</a></span></span><span class='period'>.</span><span class='id identifier rubyid_analyze_compatibility'>analyze_compatibility</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>3</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>5</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>6</span><span class='rbracket'>]</span>
|
575
|
+
<span class='comment'># => {missing: [6], new: [3,4,5], is_compatible: false}</span></code></pre>
|
576
|
+
|
577
|
+
|
578
|
+
<p class="example_title"><div class='inline'>
|
579
|
+
<p>Analyze when compatible.</p>
|
580
|
+
</div></p>
|
581
|
+
|
582
|
+
<pre class="example code"><code><span class='const'><span class='object_link'><a href="../AeEasy.html" title="AeEasy (module)">AeEasy</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="AeEasy::Core (module)">Core</a></span></span><span class='period'>.</span><span class='id identifier rubyid_analyze_compatibility'>analyze_compatibility</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>3</span><span class='comma'>,</span><span class='int'>4</span><span class='comma'>,</span><span class='int'>5</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='lbracket'>[</span><span class='int'>1</span><span class='comma'>,</span><span class='int'>2</span><span class='comma'>,</span><span class='int'>3</span><span class='rbracket'>]</span>
|
583
|
+
<span class='comment'># => {missing: [], new: [4,5], is_compatible: true}</span></code></pre>
|
584
|
+
|
585
|
+
</div>
|
586
|
+
<p class="tag_title">Parameters:</p>
|
587
|
+
<ul class="param">
|
588
|
+
|
589
|
+
<li>
|
590
|
+
|
591
|
+
<span class='name'>source</span>
|
592
|
+
|
593
|
+
|
594
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
595
|
+
|
596
|
+
|
597
|
+
|
598
|
+
—
|
599
|
+
<div class='inline'>
|
600
|
+
<p>Item collection to represent the universe.</p>
|
601
|
+
</div>
|
602
|
+
|
603
|
+
</li>
|
604
|
+
|
605
|
+
<li>
|
606
|
+
|
607
|
+
<span class='name'>fragment</span>
|
608
|
+
|
609
|
+
|
610
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
611
|
+
|
612
|
+
|
613
|
+
|
614
|
+
—
|
615
|
+
<div class='inline'>
|
616
|
+
<p>Item collection to compare againt <code>source</code>.</p>
|
617
|
+
</div>
|
618
|
+
|
619
|
+
</li>
|
620
|
+
|
621
|
+
</ul>
|
622
|
+
|
623
|
+
<p class="tag_title">Returns:</p>
|
624
|
+
<ul class="return">
|
625
|
+
|
626
|
+
<li>
|
627
|
+
|
628
|
+
|
629
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
630
|
+
|
631
|
+
|
632
|
+
|
633
|
+
—
|
634
|
+
<div class='inline'><ul><li>
|
635
|
+
<p>`:missing [Array]` (`[]`) Methods on `fragment` only.</p>
|
636
|
+
</li><li>
|
637
|
+
<p>`:new [Array]` (`[]`) Methods on `source` only.</p>
|
638
|
+
</li><li>
|
639
|
+
<p>`:is_compatible [Boolean]` true when all `fragment`'s methods are
|
640
|
+
present on `source`.</p>
|
641
|
+
</li></ul>
|
642
|
+
</div>
|
643
|
+
|
644
|
+
</li>
|
645
|
+
|
646
|
+
</ul>
|
647
|
+
|
648
|
+
</div><table class="source_code">
|
649
|
+
<tr>
|
650
|
+
<td>
|
651
|
+
<pre class="lines">
|
652
|
+
|
653
|
+
|
654
|
+
190
|
655
|
+
191
|
656
|
+
192
|
657
|
+
193
|
658
|
+
194
|
659
|
+
195
|
660
|
+
196
|
661
|
+
197</pre>
|
662
|
+
</td>
|
663
|
+
<td>
|
664
|
+
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line 190</span>
|
665
|
+
|
666
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_analyze_compatibility'>analyze_compatibility</span> <span class='id identifier rubyid_source'>source</span><span class='comma'>,</span> <span class='id identifier rubyid_fragment'>fragment</span>
|
667
|
+
<span class='id identifier rubyid_intersection'>intersection</span> <span class='op'>=</span> <span class='id identifier rubyid_source'>source</span> <span class='op'>&</span> <span class='id identifier rubyid_fragment'>fragment</span>
|
668
|
+
<span class='lbrace'>{</span>
|
669
|
+
<span class='label'>missing:</span> <span class='id identifier rubyid_fragment'>fragment</span> <span class='op'>-</span> <span class='id identifier rubyid_intersection'>intersection</span><span class='comma'>,</span>
|
670
|
+
<span class='label'>new:</span> <span class='id identifier rubyid_source'>source</span> <span class='op'>-</span> <span class='id identifier rubyid_intersection'>intersection</span><span class='comma'>,</span>
|
671
|
+
<span class='label'>is_compatible:</span> <span class='lparen'>(</span><span class='id identifier rubyid_intersection'>intersection</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span> <span class='op'>==</span> <span class='id identifier rubyid_fragment'>fragment</span><span class='period'>.</span><span class='id identifier rubyid_count'>count</span><span class='rparen'>)</span>
|
672
|
+
<span class='rbrace'>}</span>
|
673
|
+
<span class='kw'>end</span></pre>
|
674
|
+
</td>
|
675
|
+
</tr>
|
676
|
+
</table>
|
677
|
+
</div>
|
678
|
+
|
679
|
+
<div class="method_details ">
|
680
|
+
<h3 class="signature " id="deep_clone-class_method">
|
681
|
+
|
682
|
+
.<strong>deep_clone</strong>(hash, should_clone = false) ⇒ <tt>Hash</tt>
|
683
|
+
|
684
|
+
|
685
|
+
|
686
|
+
|
687
|
+
|
688
|
+
</h3><div class="docstring">
|
689
|
+
<div class="discussion">
|
690
|
+
|
691
|
+
<p>Deep clone a hash while keeping it's values object references.</p>
|
692
|
+
|
693
|
+
|
694
|
+
</div>
|
695
|
+
</div>
|
696
|
+
<div class="tags">
|
697
|
+
<p class="tag_title">Parameters:</p>
|
698
|
+
<ul class="param">
|
699
|
+
|
700
|
+
<li>
|
701
|
+
|
702
|
+
<span class='name'>hash</span>
|
703
|
+
|
704
|
+
|
705
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
706
|
+
|
707
|
+
|
708
|
+
|
709
|
+
—
|
710
|
+
<div class='inline'>
|
711
|
+
<p>Hash to clone.</p>
|
712
|
+
</div>
|
713
|
+
|
714
|
+
</li>
|
715
|
+
|
716
|
+
<li>
|
717
|
+
|
718
|
+
<span class='name'>should_clone</span>
|
719
|
+
|
720
|
+
|
721
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
722
|
+
|
723
|
+
|
724
|
+
<em class="default">(defaults to: <tt>false</tt>)</em>
|
725
|
+
|
726
|
+
|
727
|
+
—
|
728
|
+
<div class='inline'>
|
729
|
+
<p>(false) Clone values when true.</p>
|
730
|
+
</div>
|
731
|
+
|
732
|
+
</li>
|
733
|
+
|
734
|
+
</ul>
|
735
|
+
|
736
|
+
<p class="tag_title">Returns:</p>
|
737
|
+
<ul class="return">
|
738
|
+
|
739
|
+
<li>
|
740
|
+
|
741
|
+
|
742
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
743
|
+
|
744
|
+
|
745
|
+
|
746
|
+
—
|
747
|
+
<div class='inline'>
|
748
|
+
<p>Hash clone.</p>
|
749
|
+
</div>
|
750
|
+
|
751
|
+
</li>
|
752
|
+
|
753
|
+
</ul>
|
754
|
+
|
755
|
+
</div><table class="source_code">
|
756
|
+
<tr>
|
757
|
+
<td>
|
758
|
+
<pre class="lines">
|
759
|
+
|
760
|
+
|
761
|
+
231
|
762
|
+
232
|
763
|
+
233
|
764
|
+
234
|
765
|
+
235
|
766
|
+
236
|
767
|
+
237
|
768
|
+
238</pre>
|
769
|
+
</td>
|
770
|
+
<td>
|
771
|
+
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line 231</span>
|
772
|
+
|
773
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_deep_clone'>deep_clone</span> <span class='id identifier rubyid_hash'>hash</span><span class='comma'>,</span> <span class='id identifier rubyid_should_clone'>should_clone</span> <span class='op'>=</span> <span class='kw'>false</span>
|
774
|
+
<span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
775
|
+
<span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
|
776
|
+
<span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_deep_clone'>deep_clone</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_should_clone'>should_clone</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='lparen'>(</span><span class='id identifier rubyid_should_clone'>should_clone</span> <span class='op'>?</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_clone'>clone</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
|
777
|
+
<span class='id identifier rubyid_target'>target</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span>
|
778
|
+
<span class='kw'>end</span>
|
779
|
+
<span class='id identifier rubyid_target'>target</span>
|
780
|
+
<span class='kw'>end</span></pre>
|
781
|
+
</td>
|
782
|
+
</tr>
|
783
|
+
</table>
|
784
|
+
</div>
|
785
|
+
|
786
|
+
<div class="method_details ">
|
787
|
+
<h3 class="signature " id="deep_stringify_keys-class_method">
|
788
|
+
|
789
|
+
.<strong>deep_stringify_keys</strong>(hash, should_clone = true) ⇒ <tt>Hash</tt>
|
790
|
+
|
791
|
+
|
792
|
+
|
793
|
+
|
794
|
+
|
795
|
+
</h3><div class="docstring">
|
796
|
+
<div class="discussion">
|
797
|
+
|
798
|
+
<p>Deep stringify keys from a hash.</p>
|
799
|
+
|
800
|
+
|
801
|
+
</div>
|
802
|
+
</div>
|
803
|
+
<div class="tags">
|
804
|
+
<p class="tag_title">Parameters:</p>
|
805
|
+
<ul class="param">
|
806
|
+
|
807
|
+
<li>
|
808
|
+
|
809
|
+
<span class='name'>hash</span>
|
810
|
+
|
811
|
+
|
812
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
813
|
+
|
814
|
+
|
815
|
+
|
816
|
+
—
|
817
|
+
<div class='inline'>
|
818
|
+
<p>Source hash to stringify keys.</p>
|
819
|
+
</div>
|
820
|
+
|
821
|
+
</li>
|
822
|
+
|
823
|
+
<li>
|
824
|
+
|
825
|
+
<span class='name'>should_clone</span>
|
826
|
+
|
827
|
+
|
828
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
829
|
+
|
830
|
+
|
831
|
+
<em class="default">(defaults to: <tt>true</tt>)</em>
|
832
|
+
|
833
|
+
|
834
|
+
—
|
835
|
+
<div class='inline'>
|
836
|
+
<p>(true) Target a hash clone to avoid affecting the same hash object.</p>
|
837
|
+
</div>
|
838
|
+
|
839
|
+
</li>
|
840
|
+
|
841
|
+
</ul>
|
842
|
+
|
843
|
+
<p class="tag_title">Returns:</p>
|
844
|
+
<ul class="return">
|
845
|
+
|
846
|
+
<li>
|
847
|
+
|
848
|
+
|
849
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
850
|
+
|
851
|
+
|
852
|
+
|
853
|
+
</li>
|
854
|
+
|
855
|
+
</ul>
|
856
|
+
|
857
|
+
</div><table class="source_code">
|
858
|
+
<tr>
|
859
|
+
<td>
|
860
|
+
<pre class="lines">
|
861
|
+
|
862
|
+
|
863
|
+
205
|
864
|
+
206
|
865
|
+
207
|
866
|
+
208
|
867
|
+
209
|
868
|
+
210
|
869
|
+
211
|
870
|
+
212
|
871
|
+
213
|
872
|
+
214</pre>
|
873
|
+
</td>
|
874
|
+
<td>
|
875
|
+
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line 205</span>
|
876
|
+
|
877
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_deep_stringify_keys'>deep_stringify_keys</span> <span class='id identifier rubyid_hash'>hash</span><span class='comma'>,</span> <span class='id identifier rubyid_should_clone'>should_clone</span> <span class='op'>=</span> <span class='kw'>true</span>
|
878
|
+
<span class='id identifier rubyid_pair_collection'>pair_collection</span> <span class='op'>=</span> <span class='id identifier rubyid_hash'>hash</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_k'>k</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='op'>|</span> <span class='lbracket'>[</span><span class='id identifier rubyid_k'>k</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='comma'>,</span><span class='id identifier rubyid_v'>v</span><span class='rbracket'>]</span><span class='rbrace'>}</span>
|
879
|
+
<span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='id identifier rubyid_should_clone'>should_clone</span> <span class='op'>?</span> <span class='lbrace'>{</span><span class='rbrace'>}</span> <span class='op'>:</span> <span class='id identifier rubyid_hash'>hash</span>
|
880
|
+
<span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_clear'>clear</span>
|
881
|
+
<span class='id identifier rubyid_pair_collection'>pair_collection</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_pair'>pair</span><span class='op'>|</span>
|
882
|
+
<span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span> <span class='op'>=</span> <span class='id identifier rubyid_pair'>pair</span>
|
883
|
+
<span class='id identifier rubyid_target'>target</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='id identifier rubyid_deep_stringify_keys'>deep_stringify_keys</span><span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span><span class='comma'>,</span> <span class='id identifier rubyid_should_clone'>should_clone</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='id identifier rubyid_value'>value</span>
|
884
|
+
<span class='kw'>end</span>
|
885
|
+
<span class='id identifier rubyid_target'>target</span>
|
886
|
+
<span class='kw'>end</span></pre>
|
887
|
+
</td>
|
888
|
+
</tr>
|
889
|
+
</table>
|
890
|
+
</div>
|
891
|
+
|
892
|
+
<div class="method_details ">
|
893
|
+
<h3 class="signature " id="deep_stringify_keys!-class_method">
|
894
|
+
|
895
|
+
.<strong>deep_stringify_keys!</strong>(hash) ⇒ <tt>Hash</tt>
|
896
|
+
|
897
|
+
|
898
|
+
|
899
|
+
|
900
|
+
|
901
|
+
</h3><div class="docstring">
|
902
|
+
<div class="discussion">
|
903
|
+
|
904
|
+
<p>Deep stringify all keys on hash object.</p>
|
905
|
+
|
906
|
+
|
907
|
+
</div>
|
908
|
+
</div>
|
909
|
+
<div class="tags">
|
910
|
+
<p class="tag_title">Parameters:</p>
|
911
|
+
<ul class="param">
|
912
|
+
|
913
|
+
<li>
|
914
|
+
|
915
|
+
<span class='name'>hash</span>
|
916
|
+
|
917
|
+
|
918
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
919
|
+
|
920
|
+
|
921
|
+
|
922
|
+
—
|
923
|
+
<div class='inline'>
|
924
|
+
<p>Hash to stringify keys.</p>
|
925
|
+
</div>
|
926
|
+
|
927
|
+
</li>
|
928
|
+
|
929
|
+
</ul>
|
930
|
+
|
931
|
+
<p class="tag_title">Returns:</p>
|
932
|
+
<ul class="return">
|
933
|
+
|
934
|
+
<li>
|
935
|
+
|
936
|
+
|
937
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
938
|
+
|
939
|
+
|
940
|
+
|
941
|
+
</li>
|
942
|
+
|
943
|
+
</ul>
|
944
|
+
|
945
|
+
</div><table class="source_code">
|
946
|
+
<tr>
|
947
|
+
<td>
|
948
|
+
<pre class="lines">
|
949
|
+
|
950
|
+
|
951
|
+
221
|
952
|
+
222
|
953
|
+
223</pre>
|
954
|
+
</td>
|
955
|
+
<td>
|
956
|
+
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line 221</span>
|
957
|
+
|
958
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_deep_stringify_keys!'>deep_stringify_keys!</span> <span class='id identifier rubyid_hash'>hash</span>
|
959
|
+
<span class='id identifier rubyid_deep_stringify_keys'>deep_stringify_keys</span> <span class='id identifier rubyid_hash'>hash</span><span class='comma'>,</span> <span class='kw'>false</span>
|
960
|
+
<span class='kw'>end</span></pre>
|
961
|
+
</td>
|
962
|
+
</tr>
|
963
|
+
</table>
|
964
|
+
</div>
|
965
|
+
|
966
|
+
<div class="method_details ">
|
967
|
+
<h3 class="signature " id="expose_to-class_method">
|
968
|
+
|
969
|
+
.<strong>expose_to</strong>(object, env) ⇒ <tt>Object</tt>
|
970
|
+
|
971
|
+
|
972
|
+
|
973
|
+
|
974
|
+
|
975
|
+
</h3><div class="docstring">
|
976
|
+
<div class="discussion">
|
977
|
+
|
978
|
+
<p>Expose an environment into an object instance as methods.</p>
|
979
|
+
|
980
|
+
|
981
|
+
</div>
|
982
|
+
</div>
|
983
|
+
<div class="tags">
|
984
|
+
|
985
|
+
<div class="examples">
|
986
|
+
<p class="tag_title">Examples:</p>
|
987
|
+
|
988
|
+
|
989
|
+
<pre class="example code"><code><span class='kw'>class</span> <span class='const'>Foo</span>
|
990
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_hello_person'>hello_person</span>
|
991
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Hello person!</span><span class='tstring_end'>'</span></span>
|
992
|
+
<span class='kw'>end</span>
|
993
|
+
<span class='kw'>end</span>
|
994
|
+
|
995
|
+
<span class='id identifier rubyid_env'>env</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
996
|
+
<span class='label'>hello_world:</span> <span class='id identifier rubyid_lambda'>lambda</span><span class='lbrace'>{</span><span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Hello world!</span><span class='tstring_end'>'</span></span><span class='rbrace'>}</span><span class='comma'>,</span>
|
997
|
+
<span class='label'>hello_sky:</span> <span class='id identifier rubyid_proc'>proc</span><span class='lbrace'>{</span><span class='kw'>return</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Hello sky!</span><span class='tstring_end'>'</span></span><span class='rbrace'>}</span>
|
998
|
+
<span class='rbrace'>}</span>
|
999
|
+
<span class='id identifier rubyid_my_object'>my_object</span> <span class='op'>=</span> <span class='const'>Foo</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
1000
|
+
<span class='const'><span class='object_link'><a href="../AeEasy.html" title="AeEasy (module)">AeEasy</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="AeEasy::Core (module)">Core</a></span></span><span class='period'>.</span><span class='id identifier rubyid_expose_to'>expose_to</span> <span class='id identifier rubyid_my_object'>my_object</span><span class='comma'>,</span> <span class='id identifier rubyid_env'>env</span>
|
1001
|
+
|
1002
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_my_object'>my_object</span><span class='period'>.</span><span class='id identifier rubyid_hello_world'>hello_world</span>
|
1003
|
+
<span class='comment'># => 'Hello world!'
|
1004
|
+
</span><span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_my_object'>my_object</span><span class='period'>.</span><span class='id identifier rubyid_hello_sky'>hello_sky</span>
|
1005
|
+
<span class='comment'># => 'Hello sky!'
|
1006
|
+
</span><span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_my_object'>my_object</span><span class='period'>.</span><span class='id identifier rubyid_hello_person'>hello_person</span>
|
1007
|
+
<span class='comment'># => 'Hello person!'</span></code></pre>
|
1008
|
+
|
1009
|
+
</div>
|
1010
|
+
<p class="tag_title">Parameters:</p>
|
1011
|
+
<ul class="param">
|
1012
|
+
|
1013
|
+
<li>
|
1014
|
+
|
1015
|
+
<span class='name'>object</span>
|
1016
|
+
|
1017
|
+
|
1018
|
+
<span class='type'></span>
|
1019
|
+
|
1020
|
+
|
1021
|
+
|
1022
|
+
—
|
1023
|
+
<div class='inline'>
|
1024
|
+
<p>Object instance to expose env into.</p>
|
1025
|
+
</div>
|
1026
|
+
|
1027
|
+
</li>
|
1028
|
+
|
1029
|
+
<li>
|
1030
|
+
|
1031
|
+
<span class='name'>env</span>
|
1032
|
+
|
1033
|
+
|
1034
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
1035
|
+
|
1036
|
+
|
1037
|
+
|
1038
|
+
—
|
1039
|
+
<div class='inline'>
|
1040
|
+
<p>Hash with methods name as keys and blocks as actions.</p>
|
1041
|
+
</div>
|
1042
|
+
|
1043
|
+
</li>
|
1044
|
+
|
1045
|
+
</ul>
|
1046
|
+
|
1047
|
+
<p class="tag_title">Returns:</p>
|
1048
|
+
<ul class="return">
|
1049
|
+
|
1050
|
+
<li>
|
1051
|
+
|
1052
|
+
|
1053
|
+
<span class='type'></span>
|
1054
|
+
|
1055
|
+
|
1056
|
+
|
1057
|
+
|
1058
|
+
<div class='inline'>
|
1059
|
+
<p>`object`</p>
|
1060
|
+
</div>
|
1061
|
+
|
1062
|
+
</li>
|
1063
|
+
|
1064
|
+
</ul>
|
1065
|
+
|
1066
|
+
</div><table class="source_code">
|
1067
|
+
<tr>
|
1068
|
+
<td>
|
1069
|
+
<pre class="lines">
|
1070
|
+
|
1071
|
+
|
1072
|
+
91
|
1073
|
+
92
|
1074
|
+
93
|
1075
|
+
94
|
1076
|
+
95
|
1077
|
+
96
|
1078
|
+
97</pre>
|
1079
|
+
</td>
|
1080
|
+
<td>
|
1081
|
+
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line 91</span>
|
1082
|
+
|
1083
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_expose_to'>expose_to</span> <span class='id identifier rubyid_object'>object</span><span class='comma'>,</span> <span class='id identifier rubyid_env'>env</span>
|
1084
|
+
<span class='id identifier rubyid_metaclass'>metaclass</span> <span class='op'>=</span> <span class='kw'>class</span> <span class='op'><<</span> <span class='id identifier rubyid_object'>object</span><span class='semicolon'>;</span> <span class='kw'>self</span><span class='semicolon'>;</span> <span class='kw'>end</span>
|
1085
|
+
<span class='id identifier rubyid_env'>env</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span><span class='op'>|</span>
|
1086
|
+
<span class='id identifier rubyid_metaclass'>metaclass</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='symbol'>:define_method</span><span class='comma'>,</span> <span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
1087
|
+
<span class='kw'>end</span>
|
1088
|
+
<span class='id identifier rubyid_object'>object</span>
|
1089
|
+
<span class='kw'>end</span></pre>
|
1090
|
+
</td>
|
1091
|
+
</tr>
|
1092
|
+
</table>
|
1093
|
+
</div>
|
1094
|
+
|
1095
|
+
<div class="method_details ">
|
1096
|
+
<h3 class="signature " id="gem_root-class_method">
|
1097
|
+
|
1098
|
+
.<strong>gem_root</strong> ⇒ <tt>String</tt>
|
1099
|
+
|
1100
|
+
|
1101
|
+
|
1102
|
+
|
1103
|
+
|
1104
|
+
</h3><div class="docstring">
|
1105
|
+
<div class="discussion">
|
1106
|
+
|
1107
|
+
<p>Get AeEasy-core gem root directory path.</p>
|
1108
|
+
|
1109
|
+
|
1110
|
+
</div>
|
1111
|
+
</div>
|
1112
|
+
<div class="tags">
|
1113
|
+
|
1114
|
+
<p class="tag_title">Returns:</p>
|
1115
|
+
<ul class="return">
|
1116
|
+
|
1117
|
+
<li>
|
1118
|
+
|
1119
|
+
|
1120
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1121
|
+
|
1122
|
+
|
1123
|
+
|
1124
|
+
</li>
|
1125
|
+
|
1126
|
+
</ul>
|
1127
|
+
|
1128
|
+
</div><table class="source_code">
|
1129
|
+
<tr>
|
1130
|
+
<td>
|
1131
|
+
<pre class="lines">
|
1132
|
+
|
1133
|
+
|
1134
|
+
18
|
1135
|
+
19
|
1136
|
+
20</pre>
|
1137
|
+
</td>
|
1138
|
+
<td>
|
1139
|
+
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line 18</span>
|
1140
|
+
|
1141
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_gem_root'>gem_root</span>
|
1142
|
+
<span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_expand_path'>expand_path</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span><span class='lparen'>(</span><span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_dirname'>dirname</span><span class='lparen'>(</span><span class='kw'>__FILE__</span><span class='rparen'>)</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>../..</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
1143
|
+
<span class='kw'>end</span></pre>
|
1144
|
+
</td>
|
1145
|
+
</tr>
|
1146
|
+
</table>
|
1147
|
+
</div>
|
1148
|
+
|
1149
|
+
<div class="method_details ">
|
1150
|
+
<h3 class="signature " id="instance_methods_from-class_method">
|
1151
|
+
|
1152
|
+
.<strong>instance_methods_from</strong>(object) ⇒ <tt>Array</tt>
|
1153
|
+
|
1154
|
+
|
1155
|
+
|
1156
|
+
|
1157
|
+
|
1158
|
+
</h3><div class="docstring">
|
1159
|
+
<div class="discussion">
|
1160
|
+
|
1161
|
+
<p>Retrieve instance methods from an object.</p>
|
1162
|
+
|
1163
|
+
|
1164
|
+
</div>
|
1165
|
+
</div>
|
1166
|
+
<div class="tags">
|
1167
|
+
|
1168
|
+
<div class="examples">
|
1169
|
+
<p class="tag_title">Examples:</p>
|
1170
|
+
|
1171
|
+
|
1172
|
+
<pre class="example code"><code><span class='kw'>class</span> <span class='const'>Foo</span>
|
1173
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_hello_world'>hello_world</span>
|
1174
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Hello world!</span><span class='tstring_end'>'</span></span>
|
1175
|
+
<span class='kw'>end</span>
|
1176
|
+
|
1177
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_hello_person'>hello_person</span>
|
1178
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Hello person!</span><span class='tstring_end'>'</span></span>
|
1179
|
+
<span class='kw'>end</span>
|
1180
|
+
<span class='kw'>end</span>
|
1181
|
+
|
1182
|
+
<span class='id identifier rubyid_my_object'>my_object</span> <span class='op'>=</span> <span class='const'>Foo</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
1183
|
+
<span class='const'><span class='object_link'><a href="../AeEasy.html" title="AeEasy (module)">AeEasy</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="AeEasy::Core (module)">Core</a></span></span><span class='period'>.</span><span class='id identifier rubyid_instance_methods_from'>instance_methods_from</span> <span class='id identifier rubyid_my_object'>my_object</span>
|
1184
|
+
<span class='comment'># => [:hello_world, :hello_person]</span></code></pre>
|
1185
|
+
|
1186
|
+
</div>
|
1187
|
+
<p class="tag_title">Parameters:</p>
|
1188
|
+
<ul class="param">
|
1189
|
+
|
1190
|
+
<li>
|
1191
|
+
|
1192
|
+
<span class='name'>object</span>
|
1193
|
+
|
1194
|
+
|
1195
|
+
<span class='type'></span>
|
1196
|
+
|
1197
|
+
|
1198
|
+
|
1199
|
+
—
|
1200
|
+
<div class='inline'>
|
1201
|
+
<p>Object with instance methods.</p>
|
1202
|
+
</div>
|
1203
|
+
|
1204
|
+
</li>
|
1205
|
+
|
1206
|
+
</ul>
|
1207
|
+
|
1208
|
+
<p class="tag_title">Returns:</p>
|
1209
|
+
<ul class="return">
|
1210
|
+
|
1211
|
+
<li>
|
1212
|
+
|
1213
|
+
|
1214
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
1215
|
+
|
1216
|
+
|
1217
|
+
|
1218
|
+
</li>
|
1219
|
+
|
1220
|
+
</ul>
|
1221
|
+
|
1222
|
+
</div><table class="source_code">
|
1223
|
+
<tr>
|
1224
|
+
<td>
|
1225
|
+
<pre class="lines">
|
1226
|
+
|
1227
|
+
|
1228
|
+
119
|
1229
|
+
120
|
1230
|
+
121</pre>
|
1231
|
+
</td>
|
1232
|
+
<td>
|
1233
|
+
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line 119</span>
|
1234
|
+
|
1235
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_instance_methods_from'>instance_methods_from</span> <span class='id identifier rubyid_object'>object</span>
|
1236
|
+
<span class='id identifier rubyid_object'>object</span><span class='period'>.</span><span class='id identifier rubyid_methods'>methods</span><span class='lparen'>(</span><span class='kw'>false</span><span class='rparen'>)</span> <span class='op'>-</span> <span class='const'>Object</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='period'>.</span><span class='id identifier rubyid_methods'>methods</span><span class='lparen'>(</span><span class='kw'>false</span><span class='rparen'>)</span>
|
1237
|
+
<span class='kw'>end</span></pre>
|
1238
|
+
</td>
|
1239
|
+
</tr>
|
1240
|
+
</table>
|
1241
|
+
</div>
|
1242
|
+
|
1243
|
+
<div class="method_details ">
|
1244
|
+
<h3 class="signature " id="mock_instance_methods-class_method">
|
1245
|
+
|
1246
|
+
.<strong>mock_instance_methods</strong>(source, target) ⇒ <tt>Object</tt>
|
1247
|
+
|
1248
|
+
|
1249
|
+
|
1250
|
+
|
1251
|
+
|
1252
|
+
</h3><div class="docstring">
|
1253
|
+
<div class="discussion">
|
1254
|
+
|
1255
|
+
<p>Mock instances methods from the source into target object.</p>
|
1256
|
+
|
1257
|
+
|
1258
|
+
</div>
|
1259
|
+
</div>
|
1260
|
+
<div class="tags">
|
1261
|
+
|
1262
|
+
<div class="examples">
|
1263
|
+
<p class="tag_title">Examples:</p>
|
1264
|
+
|
1265
|
+
|
1266
|
+
<pre class="example code"><code><span class='kw'>class</span> <span class='const'>Boo</span>
|
1267
|
+
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:message</span>
|
1268
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
|
1269
|
+
<span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Hello world!</span><span class='tstring_end'>'</span></span>
|
1270
|
+
<span class='kw'>end</span>
|
1271
|
+
|
1272
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_hello_world'>hello_world</span>
|
1273
|
+
<span class='id identifier rubyid_message'>message</span>
|
1274
|
+
<span class='kw'>end</span>
|
1275
|
+
<span class='kw'>end</span>
|
1276
|
+
|
1277
|
+
<span class='kw'>class</span> <span class='const'>Foo</span>
|
1278
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_hello_person'>hello_person</span>
|
1279
|
+
<span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Hello person!</span><span class='tstring_end'>'</span></span>
|
1280
|
+
<span class='kw'>end</span>
|
1281
|
+
<span class='kw'>end</span>
|
1282
|
+
|
1283
|
+
<span class='id identifier rubyid_source'>source</span> <span class='op'>=</span> <span class='const'>Boo</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
1284
|
+
<span class='id identifier rubyid_target'>target</span> <span class='op'>=</span> <span class='const'>Foo</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
1285
|
+
<span class='const'><span class='object_link'><a href="../AeEasy.html" title="AeEasy (module)">AeEasy</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="" title="AeEasy::Core (module)">Core</a></span></span><span class='period'>.</span><span class='id identifier rubyid_mock_instance_methods'>mock_instance_methods</span> <span class='id identifier rubyid_source'>source</span> <span class='id identifier rubyid_target'>target</span>
|
1286
|
+
|
1287
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_hello_world'>hello_world</span>
|
1288
|
+
<span class='comment'># => 'Hello world!'
|
1289
|
+
</span><span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_hello_person'>hello_person</span>
|
1290
|
+
<span class='comment'># => 'Hello person!'
|
1291
|
+
</span>
|
1292
|
+
<span class='id identifier rubyid_source'>source</span><span class='period'>.</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Hello world again!</span><span class='tstring_end'>'</span></span>
|
1293
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_hello_world'>hello_world</span>
|
1294
|
+
<span class='comment'># => 'Hello world again!'</span></code></pre>
|
1295
|
+
|
1296
|
+
</div>
|
1297
|
+
<p class="tag_title">Parameters:</p>
|
1298
|
+
<ul class="param">
|
1299
|
+
|
1300
|
+
<li>
|
1301
|
+
|
1302
|
+
<span class='name'>source</span>
|
1303
|
+
|
1304
|
+
|
1305
|
+
<span class='type'></span>
|
1306
|
+
|
1307
|
+
|
1308
|
+
|
1309
|
+
—
|
1310
|
+
<div class='inline'>
|
1311
|
+
<p>Object with instance methods to mock.</p>
|
1312
|
+
</div>
|
1313
|
+
|
1314
|
+
</li>
|
1315
|
+
|
1316
|
+
<li>
|
1317
|
+
|
1318
|
+
<span class='name'>target</span>
|
1319
|
+
|
1320
|
+
|
1321
|
+
<span class='type'></span>
|
1322
|
+
|
1323
|
+
|
1324
|
+
|
1325
|
+
—
|
1326
|
+
<div class='inline'>
|
1327
|
+
<p>Object instance to mock methods into.</p>
|
1328
|
+
</div>
|
1329
|
+
|
1330
|
+
</li>
|
1331
|
+
|
1332
|
+
</ul>
|
1333
|
+
|
1334
|
+
|
1335
|
+
</div><table class="source_code">
|
1336
|
+
<tr>
|
1337
|
+
<td>
|
1338
|
+
<pre class="lines">
|
1339
|
+
|
1340
|
+
|
1341
|
+
158
|
1342
|
+
159
|
1343
|
+
160
|
1344
|
+
161
|
1345
|
+
162
|
1346
|
+
163
|
1347
|
+
164
|
1348
|
+
165
|
1349
|
+
166
|
1350
|
+
167
|
1351
|
+
168
|
1352
|
+
169
|
1353
|
+
170
|
1354
|
+
171</pre>
|
1355
|
+
</td>
|
1356
|
+
<td>
|
1357
|
+
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line 158</span>
|
1358
|
+
|
1359
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_mock_instance_methods'>mock_instance_methods</span> <span class='id identifier rubyid_source'>source</span><span class='comma'>,</span> <span class='id identifier rubyid_target'>target</span>
|
1360
|
+
<span class='comment'># Get instance unique methods
|
1361
|
+
</span> <span class='id identifier rubyid_method_list'>method_list</span> <span class='op'>=</span> <span class='id identifier rubyid_instance_methods_from'>instance_methods_from</span> <span class='id identifier rubyid_source'>source</span>
|
1362
|
+
<span class='id identifier rubyid_method_list'>method_list</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='symbol'>:context_binding</span> <span class='kw'>if</span> <span class='id identifier rubyid_method_list'>method_list</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='symbol'>:context_binding</span>
|
1363
|
+
|
1364
|
+
<span class='comment'># Build env reflecting source unique methods
|
1365
|
+
</span> <span class='id identifier rubyid_env'>env</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
1366
|
+
<span class='id identifier rubyid_method_list'>method_list</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_method'>method</span><span class='op'>|</span>
|
1367
|
+
<span class='id identifier rubyid_env'>env</span><span class='lbracket'>[</span><span class='id identifier rubyid_method'>method</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_lambda'>lambda</span><span class='lbrace'>{</span><span class='op'>|</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='op'>|</span><span class='id identifier rubyid_source'>source</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span><span class='rbrace'>}</span>
|
1368
|
+
<span class='kw'>end</span>
|
1369
|
+
|
1370
|
+
<span class='comment'># Mock source unique methods into target
|
1371
|
+
</span> <span class='id identifier rubyid_expose_to'>expose_to</span> <span class='id identifier rubyid_target'>target</span><span class='comma'>,</span> <span class='id identifier rubyid_env'>env</span>
|
1372
|
+
<span class='kw'>end</span></pre>
|
1373
|
+
</td>
|
1374
|
+
</tr>
|
1375
|
+
</table>
|
1376
|
+
</div>
|
1377
|
+
|
1378
|
+
<div class="method_details ">
|
1379
|
+
<h3 class="signature " id="require_all-class_method">
|
1380
|
+
|
1381
|
+
.<strong>require_all</strong>(dir, opts = {}) ⇒ <tt>Object</tt>
|
1382
|
+
|
1383
|
+
|
1384
|
+
|
1385
|
+
|
1386
|
+
|
1387
|
+
</h3><div class="docstring">
|
1388
|
+
<div class="discussion">
|
1389
|
+
|
1390
|
+
<p>Require all scripts within a directory.</p>
|
1391
|
+
|
1392
|
+
|
1393
|
+
</div>
|
1394
|
+
</div>
|
1395
|
+
<div class="tags">
|
1396
|
+
<p class="tag_title">Parameters:</p>
|
1397
|
+
<ul class="param">
|
1398
|
+
|
1399
|
+
<li>
|
1400
|
+
|
1401
|
+
<span class='name'>dir</span>
|
1402
|
+
|
1403
|
+
|
1404
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1405
|
+
|
1406
|
+
|
1407
|
+
|
1408
|
+
—
|
1409
|
+
<div class='inline'>
|
1410
|
+
<p>Directory containing `.rb` scripts.</p>
|
1411
|
+
</div>
|
1412
|
+
|
1413
|
+
</li>
|
1414
|
+
|
1415
|
+
<li>
|
1416
|
+
|
1417
|
+
<span class='name'>opts</span>
|
1418
|
+
|
1419
|
+
|
1420
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1421
|
+
|
1422
|
+
|
1423
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
1424
|
+
|
1425
|
+
|
1426
|
+
—
|
1427
|
+
<div class='inline'>
|
1428
|
+
<p>({}) Configuration options.</p>
|
1429
|
+
</div>
|
1430
|
+
|
1431
|
+
</li>
|
1432
|
+
|
1433
|
+
</ul>
|
1434
|
+
|
1435
|
+
|
1436
|
+
|
1437
|
+
|
1438
|
+
|
1439
|
+
|
1440
|
+
<p class="tag_title">Options Hash (<tt>opts</tt>):</p>
|
1441
|
+
<ul class="option">
|
1442
|
+
|
1443
|
+
<li>
|
1444
|
+
<span class="name">:except</span>
|
1445
|
+
<span class="type">(<tt>Array</tt>)</span>
|
1446
|
+
<span class="default">
|
1447
|
+
|
1448
|
+
— default:
|
1449
|
+
<tt>nil</tt>
|
1450
|
+
|
1451
|
+
</span>
|
1452
|
+
|
1453
|
+
— <div class='inline'>
|
1454
|
+
<p>Literal file collection excluded from process.</p>
|
1455
|
+
</div>
|
1456
|
+
|
1457
|
+
</li>
|
1458
|
+
|
1459
|
+
</ul>
|
1460
|
+
|
1461
|
+
|
1462
|
+
|
1463
|
+
</div><table class="source_code">
|
1464
|
+
<tr>
|
1465
|
+
<td>
|
1466
|
+
<pre class="lines">
|
1467
|
+
|
1468
|
+
|
1469
|
+
41
|
1470
|
+
42
|
1471
|
+
43
|
1472
|
+
44
|
1473
|
+
45
|
1474
|
+
46
|
1475
|
+
47
|
1476
|
+
48
|
1477
|
+
49
|
1478
|
+
50
|
1479
|
+
51</pre>
|
1480
|
+
</td>
|
1481
|
+
<td>
|
1482
|
+
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line 41</span>
|
1483
|
+
|
1484
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_require_all'>require_all</span> <span class='id identifier rubyid_dir'>dir</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
1485
|
+
<span class='id identifier rubyid_real_dir'>real_dir</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
1486
|
+
<span class='id identifier rubyid_real_except'>real_except</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
1487
|
+
<span class='gvar'>$LOAD_PATH</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_load_path'>load_path</span><span class='op'>|</span>
|
1488
|
+
<span class='id identifier rubyid_real_dir'>real_dir</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span> <span class='id identifier rubyid_load_path'>load_path</span><span class='comma'>,</span> <span class='id identifier rubyid_dir'>dir</span>
|
1489
|
+
<span class='kw'>next</span> <span class='kw'>unless</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_directory?'>directory?</span> <span class='id identifier rubyid_real_dir'>real_dir</span>
|
1490
|
+
<span class='id identifier rubyid_real_except'>real_except</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:except</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_f'>f</span><span class='embexpr_end'>}</span><span class='tstring_content'>.rb</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span>
|
1491
|
+
<span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span> <span class='label'>except:</span> <span class='id identifier rubyid_real_except'>real_except</span>
|
1492
|
+
<span class='id identifier rubyid_all_scripts'>all_scripts</span><span class='lparen'>(</span><span class='id identifier rubyid_real_dir'>real_dir</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_file'>file</span><span class='op'>|</span> <span class='id identifier rubyid_require'>require</span> <span class='id identifier rubyid_file'>file</span><span class='rbrace'>}</span>
|
1493
|
+
<span class='kw'>end</span>
|
1494
|
+
<span class='kw'>end</span></pre>
|
1495
|
+
</td>
|
1496
|
+
</tr>
|
1497
|
+
</table>
|
1498
|
+
</div>
|
1499
|
+
|
1500
|
+
<div class="method_details ">
|
1501
|
+
<h3 class="signature " id="require_relative_all-class_method">
|
1502
|
+
|
1503
|
+
.<strong>require_relative_all</strong>(dir, opts = {}) ⇒ <tt>Object</tt>
|
1504
|
+
|
1505
|
+
|
1506
|
+
|
1507
|
+
|
1508
|
+
|
1509
|
+
</h3><div class="docstring">
|
1510
|
+
<div class="discussion">
|
1511
|
+
|
1512
|
+
<p>Require all relative scripts paths within a directory.</p>
|
1513
|
+
|
1514
|
+
|
1515
|
+
</div>
|
1516
|
+
</div>
|
1517
|
+
<div class="tags">
|
1518
|
+
<p class="tag_title">Parameters:</p>
|
1519
|
+
<ul class="param">
|
1520
|
+
|
1521
|
+
<li>
|
1522
|
+
|
1523
|
+
<span class='name'>dir</span>
|
1524
|
+
|
1525
|
+
|
1526
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1527
|
+
|
1528
|
+
|
1529
|
+
|
1530
|
+
—
|
1531
|
+
<div class='inline'>
|
1532
|
+
<p>Directory containing `.rb` scripts.</p>
|
1533
|
+
</div>
|
1534
|
+
|
1535
|
+
</li>
|
1536
|
+
|
1537
|
+
<li>
|
1538
|
+
|
1539
|
+
<span class='name'>opts</span>
|
1540
|
+
|
1541
|
+
|
1542
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
1543
|
+
|
1544
|
+
|
1545
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
1546
|
+
|
1547
|
+
|
1548
|
+
—
|
1549
|
+
<div class='inline'>
|
1550
|
+
<p>({}) Configuration options.</p>
|
1551
|
+
</div>
|
1552
|
+
|
1553
|
+
</li>
|
1554
|
+
|
1555
|
+
</ul>
|
1556
|
+
|
1557
|
+
|
1558
|
+
|
1559
|
+
|
1560
|
+
|
1561
|
+
|
1562
|
+
<p class="tag_title">Options Hash (<tt>opts</tt>):</p>
|
1563
|
+
<ul class="option">
|
1564
|
+
|
1565
|
+
<li>
|
1566
|
+
<span class="name">:except</span>
|
1567
|
+
<span class="type">(<tt>Array</tt>)</span>
|
1568
|
+
<span class="default">
|
1569
|
+
|
1570
|
+
— default:
|
1571
|
+
<tt>nil</tt>
|
1572
|
+
|
1573
|
+
</span>
|
1574
|
+
|
1575
|
+
— <div class='inline'>
|
1576
|
+
<p>Literal file collection excluded from process.</p>
|
1577
|
+
</div>
|
1578
|
+
|
1579
|
+
</li>
|
1580
|
+
|
1581
|
+
</ul>
|
1582
|
+
|
1583
|
+
|
1584
|
+
|
1585
|
+
</div><table class="source_code">
|
1586
|
+
<tr>
|
1587
|
+
<td>
|
1588
|
+
<pre class="lines">
|
1589
|
+
|
1590
|
+
|
1591
|
+
58
|
1592
|
+
59
|
1593
|
+
60
|
1594
|
+
61
|
1595
|
+
62</pre>
|
1596
|
+
</td>
|
1597
|
+
<td>
|
1598
|
+
<pre class="code"><span class="info file"># File 'lib/ae_easy/core.rb', line 58</span>
|
1599
|
+
|
1600
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_require_relative_all'>require_relative_all</span> <span class='id identifier rubyid_dir'>dir</span><span class='comma'>,</span> <span class='id identifier rubyid_opts'>opts</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
1601
|
+
<span class='id identifier rubyid_real_except'>real_except</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_opts'>opts</span><span class='lbracket'>[</span><span class='symbol'>:except</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_f'>f</span><span class='op'>|</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_f'>f</span><span class='embexpr_end'>}</span><span class='tstring_content'>.rb</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span>
|
1602
|
+
<span class='id identifier rubyid_options'>options</span> <span class='op'>=</span> <span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_merge'>merge</span> <span class='label'>except:</span> <span class='id identifier rubyid_real_except'>real_except</span>
|
1603
|
+
<span class='id identifier rubyid_all_scripts'>all_scripts</span><span class='lparen'>(</span><span class='id identifier rubyid_dir'>dir</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_file'>file</span><span class='op'>|</span> <span class='id identifier rubyid_require'>require</span> <span class='id identifier rubyid_file'>file</span><span class='rbrace'>}</span>
|
1604
|
+
<span class='kw'>end</span></pre>
|
1605
|
+
</td>
|
1606
|
+
</tr>
|
1607
|
+
</table>
|
1608
|
+
</div>
|
1609
|
+
|
1610
|
+
</div>
|
1611
|
+
|
1612
|
+
</div>
|
1613
|
+
|
1614
|
+
<div id="footer">
|
1615
|
+
Generated on Wed Feb 13 21:43:50 2019 by
|
1616
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1617
|
+
0.9.18 (ruby-2.5.3).
|
1618
|
+
</div>
|
1619
|
+
|
1620
|
+
</div>
|
1621
|
+
</body>
|
1622
|
+
</html>
|