What's the best way to list the dependencies of Merb :: Slices?

I am creating a list of slices in my Merb application, for example:

Merb :: Slices.each_slice do | slice |

I would like to get a list of dependencies for each of these snippets, any idea how to access it?

I am still reading the merb code, a solution may come soon;)

+1


source to share


3 answers


Unable to get a list of dependencies for a specific slice.

The next solution is to parse the init.rb slice



Something interesting found in the quest, the global list of dependencies:

Merb :: BootLoader :: Dependencies.dependencies

+1


source


I haven't used fragments yet, but in my opinion they are like a mini merb app, so wouldn't every fragment be /config/dependencies.rb

? Perhaps it is analyzed in the program and available somewhere.

There may be something in the documents .



Also, here are the methods available in the Merb constant (from which you get things like environment). There's one called dependencies, which returns an array (which is empty when I run merb -i

in the application).

>> Merb.methods.sort
=> ["<", "<=", "<=>", "==", "===", "=~", ">", ">=", "JSON", "__caller_info__", "__caller_lines__", "__id__", "__profile__", "__send__", "abstract_method", "adapter", "adapter=", "add_generators", "add_mime_type", "add_rakefiles", "ancestors", "args_and_options", "assigns", "at_exit", "at_exit_procs", "autoload", "autoload?", "available_accepts", "available_mime_types", "b64encode", "blank?", "bundled?", "class", "class_eval", "class_variable_defined?", "class_variables", "clone", "config", "const_defined?", "const_get", "const_missing", "const_set", "constants", "context", "debugger", "decode64", "decode_b", "deep_clone", "deferred_actions", "dependencies", "dependency", "describe", "dir_for", "disable", "disabled?", "disabled_components", "disabled_components=", "display", "dup", "encode64", "encoded_hash", "enforce!", "enum_for", "env", "env?", "environment", "environment=", "environment_info", "environment_info=", "eql?", "equal?", "exception", "exiting", "exiting=", "extend", "extract_options_from_args!", "fatal!", "find_const", "forking_environment?", "framework_root", "freeze", "frozen?", "full_const_get", "full_const_set", "generators", "given", "glob_for", "hash", "id", "in?", "include?", "included_modules", "inline", "inspect", "instance_eval", "instance_method", "instance_methods", "instance_of?", "instance_variable_defined?", "instance_variable_get", "instance_variable_set", "instance_variables", "is_a?", "is_haml?", "j", "jj", "kind_of?", "klass_hashes", "klass_hashes=", "load_config", "load_dependencies", "load_dependency", "load_paths", "load_paths=", "log_path", "log_stream", "logger", "make_module", "merb", "merge_env", "meta_class", "method", "method_defined?", "methods", "mime_transform_method", "module_eval", "modules", "name", "nil?", "object_id", "on_jruby?", "on_windows?", "options", "orm", "orm=", "orm_generator_scope", "present?", "print_colorized_backtrace", "private_class_method", "private_instance_methods", "private_method_defined?", "private_methods", "protected_instance_methods", "protected_method_defined?", "protected_methods", "public_class_method", "public_instance_methods", "public_method_defined?", "public_methods", "push_path", "quacks_like?", "rakefiles", "reload", "remove_mime_type", "remove_paths", "rescue_require", "reset_logger!", "respond_to?", "restart_environment", "root", "root=", "root_path", "send", "share_as", "share_examples_for", "shared_examples_for", "should", "should_not", "singleton_methods", "start", "start_environment", "started", "started=", "started?", "taguri", "taguri=", "taint", "tainted?", "template_engine", "template_engine=", "test_framework", "test_framework=", "test_framework_generator_scope", "testing?", "to_a", "to_enum", "to_json", "to_s", "to_yaml", "to_yaml_properties", "to_yaml_style", "track_dependency", "trap", "try_dup", "type", "untaint", "use_orm", "use_template_engine", "use_test", "use_testing_framework", "yaml_as", "yaml_tag_class_name", "yaml_tag_read_class"]

      

0


source


In theory, your piece should be collected like a gem. This way, you can pull dependencies directly from the gem itself.

0


source







All Articles