ro_commands 0.0.3 → 0.0.4
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 +37 -0
- data/Rakefile +4 -14
- data/bin/ro +2 -31
- data/bin/ro_client +2 -5
- data/bin/ro_server +2 -5
- data/bin/rubyscripts +6 -0
- data/{lib/ro_commands/core_ext/symbol.rb → config/boot.rb} +0 -0
- data/config/rorc.rb +66 -3
- data/lib/bash_builder.rb +18 -9
- data/lib/bash_builder_helper.rb +3 -3
- data/lib/bash_debug.rb +4 -2
- data/lib/bash_templates/crawler.sh +1 -0
- data/lib/bash_templates/file.sh +1 -1
- data/lib/bash_templates/git.sh +3 -0
- data/lib/{ro_commands/core_ext/thor.rb → bash_templates/grep.sh} +0 -0
- data/lib/bash_templates/misc.sh +25 -8
- data/{test/dummy/public/favicon.ico → lib/bash_templates/mysql.sh} +0 -0
- data/lib/bash_templates/process.sh +0 -0
- data/lib/bash_templates/rails.sh +10 -0
- data/lib/bash_templates/ruby.sh +2 -1
- data/lib/bash_templates/rubymine_idea.sh +38 -9
- data/lib/bash_templates/shortcuts.sh +12 -1
- data/lib/bash_templates/video.sh +2 -3
- data/lib/builder_templates/set_envs.erb +2 -1
- data/lib/builder_templates/working_project_bash.erb +3 -0
- data/lib/deps.rb +13 -0
- data/lib/deps_methods.rb +114 -0
- data/lib/drb/client.rb +7 -28
- data/lib/drb/server.rb +13 -27
- data/lib/dsl/ro_file.rb +23 -0
- data/lib/guard_helpers/base_helper.rb +91 -0
- data/lib/guard_helpers/basic_helper.rb +132 -0
- data/lib/guard_helpers/erb_helper.rb +52 -0
- data/lib/guard_helpers/gem_helper.rb +41 -0
- data/lib/guard_helpers/initd_helper.rb +126 -0
- data/lib/guard_helpers/md_helper.rb +44 -0
- data/lib/guard_helpers/mid_mod_class_methods_helper.rb +45 -0
- data/lib/rails_builder_helper.rb +10 -12
- data/lib/ro_cells.rb +3 -0
- data/lib/ro_cells/base.rb +6 -0
- data/lib/ro_cells/gem.rb +29 -0
- data/lib/ro_commands.rb +3 -10
- data/lib/ro_commands/base.rb +49 -25
- data/lib/ro_commands/crawler.rb +53 -0
- data/lib/ro_commands/file_actions.rb +45 -1
- data/lib/ro_commands/gem.rb +16 -0
- data/lib/ro_commands/generate.rb +13 -1
- data/lib/ro_commands/generators/base_generator.rb +40 -14
- data/lib/ro_commands/generators/ex.rb +18 -16
- data/lib/ro_commands/generators/rails_generator.rb +37 -0
- data/lib/ro_commands/generators/rails_new_app.rb +23 -0
- data/lib/ro_commands/generators/rails_templates/Gemfile.erb +57 -0
- data/lib/ro_commands/generators/rails_templates/rodebug.erb +23 -0
- data/lib/ro_commands/generators/rails_templates/try.erb +1 -0
- data/lib/ro_commands/generators/rodebug.rb +37 -0
- data/lib/ro_commands/generators/spec_file.rb +49 -27
- data/lib/ro_commands/generators/templates/ex.erb +1 -28
- data/lib/ro_commands/generators/templates/spec.erb +0 -3
- data/lib/ro_commands/info.rb +5 -3
- data/lib/ro_commands/init.rb +40 -0
- data/lib/ro_commands/misc.rb +9 -0
- data/lib/ro_commands/navigate.rb +52 -28
- data/lib/ro_commands/processes.rb +1 -1
- data/lib/ro_commands/rails.rb +51 -34
- data/lib/ro_commands/refactor.rb +2 -0
- data/lib/ro_commands/ro_gist.rb +39 -0
- data/lib/ro_commands/shortcuts.rb +63 -14
- data/lib/ro_commands/templates/Gemfile.tt +1 -0
- data/lib/ro_commands/try.rb +2 -2
- data/lib/ro_commands/typography.rb +12 -0
- data/lib/ro_commands/version.rb +2 -2
- data/lib/ro_commands/video.rb +6 -0
- data/lib/ro_commands/zeus_templates/custom_plan.rb +11 -16
- data/lib/ro_commands/zeus_templates/zeus.json +10 -6
- data/lib/ro_commands_bin.rb +34 -0
- data/lib/ro_core_ext.rb +6 -0
- data/lib/ro_core_ext/array.rb +22 -0
- data/lib/ro_core_ext/hash.rb +21 -0
- data/lib/ro_core_ext/misc_helper.rb +16 -0
- data/lib/ro_core_ext/module_misc.rb +70 -0
- data/lib/ro_core_ext/object.rb +11 -0
- data/lib/ro_core_ext/pry.rb +10 -0
- data/lib/ro_core_ext/string.rb +37 -0
- data/lib/ro_core_ext/symbol.rb +0 -0
- data/lib/ro_core_ext/thor.rb +0 -0
- data/lib/ro_default.rb +8 -0
- data/lib/ro_file.rb +71 -0
- data/lib/ro_helpers.rb +5 -0
- data/lib/ro_helpers/all_ro_commands.rb +4 -0
- data/lib/ro_helpers/all_ro_commands_files.rb +42 -0
- data/lib/ro_helpers/bash.rb +100 -0
- data/lib/{ro_commands → ro_helpers}/hook.rb +1 -1
- data/lib/ro_helpers/out.rb +154 -0
- data/lib/ro_helpers/ro_bin_helper.rb +107 -0
- data/lib/{ro_commands → ro_helpers}/ro_helper.rb +1 -1
- data/lib/ro_misc/exec.rb +16 -0
- data/lib/ro_rails_helpers.rb +6 -0
- data/lib/ro_rails_helpers/handler.rb +33 -0
- data/lib/ro_rspec_helpers.rb +7 -0
- data/lib/ro_rspec_helpers/deps.rb +4 -0
- data/lib/ro_rspec_helpers/ro_faker.rb +116 -0
- data/lib/ro_rspec_helpers/ro_spec_helper.rb +48 -0
- data/lib/ro_rspec_helpers/run_in.rb +7 -0
- data/lib/ro_rspec_helpers/spec_matchers.rb +30 -0
- data/lib/set_envs_helper.rb +17 -8
- data/ro_commands.sh +221 -158
- data/spec/bin_spec.rb +13 -0
- data/spec/fixtures/Gemfile +58 -0
- data/spec/fixtures/Gemfile.lock +236 -0
- data/spec/fixtures/bash/try1 +0 -0
- data/spec/fixtures/bash/try2 +0 -0
- data/spec/fixtures/basic_helper/Guardfile +0 -0
- data/spec/fixtures/basic_helper/lib/guard_helpers/no1_guard_helper.rb +5 -0
- data/spec/fixtures/basic_helper/lib/guard_helpers/no2_guard_helper.rb +5 -0
- data/spec/fixtures/basic_helper/lib/guard_helpers/no3_guard_helper.rb +5 -0
- data/spec/fixtures/deps/lib/dir/f.rb +0 -0
- data/spec/fixtures/deps/lib/dir/f2.rb +0 -0
- data/spec/fixtures/deps_methods/lib/path/to/file.rb +7 -0
- data/spec/fixtures/deps_methods/lib/ro_commands/cmd.rb +6 -0
- data/spec/fixtures/file_actions/loli +0 -0
- data/spec/fixtures/file_actions/lolicon.rb +0 -0
- data/spec/fixtures/for_git/tmp/rspec_guard_result +1 -0
- data/spec/fixtures/for_method_backup/version.rb +3 -0
- data/spec/fixtures/for_methods/version.rb +0 -0
- data/spec/fixtures/for_process/config.ru +11 -0
- data/spec/fixtures/for_process/tmp/rspec_guard_result +1 -0
- data/spec/fixtures/for_rails/Gemfile +58 -0
- data/spec/fixtures/for_rails/Gemfile.lock +236 -0
- data/{test/dummy → spec/fixtures/for_rails}/README.rdoc +0 -0
- data/spec/fixtures/for_rails/Rakefile +6 -0
- data/{test/dummy → spec/fixtures/for_rails}/app/assets/javascripts/application.js +3 -0
- data/spec/fixtures/for_rails/app/assets/javascripts/articles.js.coffee +3 -0
- data/spec/fixtures/for_rails/app/assets/javascripts/comments.js.coffee +3 -0
- data/spec/fixtures/for_rails/app/assets/javascripts/users.js.coffee +3 -0
- data/{test/dummy → spec/fixtures/for_rails}/app/assets/stylesheets/application.css +0 -0
- data/spec/fixtures/for_rails/app/assets/stylesheets/articles.css.scss +3 -0
- data/spec/fixtures/for_rails/app/assets/stylesheets/comments.css.scss +3 -0
- data/spec/fixtures/for_rails/app/assets/stylesheets/scaffolds.css.scss +69 -0
- data/spec/fixtures/for_rails/app/assets/stylesheets/users.css.scss +3 -0
- data/{test/dummy → spec/fixtures/for_rails}/app/controllers/application_controller.rb +0 -0
- data/spec/fixtures/for_rails/app/controllers/articles_controller.rb +74 -0
- data/spec/fixtures/for_rails/app/controllers/comments_controller.rb +74 -0
- data/spec/fixtures/for_rails/app/controllers/users_controller.rb +74 -0
- data/{test/dummy → spec/fixtures/for_rails}/app/helpers/application_helper.rb +0 -0
- data/spec/fixtures/for_rails/app/helpers/articles_helper.rb +2 -0
- data/spec/fixtures/for_rails/app/helpers/comments_helper.rb +2 -0
- data/spec/fixtures/for_rails/app/helpers/users_helper.rb +2 -0
- data/spec/fixtures/for_rails/app/models/article.rb +2 -0
- data/spec/fixtures/for_rails/app/models/comment.rb +2 -0
- data/spec/fixtures/for_rails/app/models/user.rb +2 -0
- data/spec/fixtures/for_rails/app/views/articles/_form.html.erb +29 -0
- data/spec/fixtures/for_rails/app/views/articles/edit.html.erb +6 -0
- data/spec/fixtures/for_rails/app/views/articles/index.html.erb +31 -0
- data/spec/fixtures/for_rails/app/views/articles/index.json.jbuilder +4 -0
- data/spec/fixtures/for_rails/app/views/articles/new.html.erb +5 -0
- data/spec/fixtures/for_rails/app/views/articles/show.html.erb +19 -0
- data/spec/fixtures/for_rails/app/views/articles/show.json.jbuilder +1 -0
- data/spec/fixtures/for_rails/app/views/comments/_form.html.erb +29 -0
- data/spec/fixtures/for_rails/app/views/comments/edit.html.erb +6 -0
- data/spec/fixtures/for_rails/app/views/comments/index.html.erb +31 -0
- data/spec/fixtures/for_rails/app/views/comments/index.json.jbuilder +4 -0
- data/spec/fixtures/for_rails/app/views/comments/new.html.erb +5 -0
- data/spec/fixtures/for_rails/app/views/comments/show.html.erb +19 -0
- data/spec/fixtures/for_rails/app/views/comments/show.json.jbuilder +1 -0
- data/spec/fixtures/for_rails/app/views/layouts/application.html.erb +14 -0
- data/spec/fixtures/for_rails/app/views/users/_form.html.erb +25 -0
- data/spec/fixtures/for_rails/app/views/users/edit.html.erb +6 -0
- data/spec/fixtures/for_rails/app/views/users/index.html.erb +29 -0
- data/spec/fixtures/for_rails/app/views/users/index.json.jbuilder +4 -0
- data/spec/fixtures/for_rails/app/views/users/new.html.erb +5 -0
- data/spec/fixtures/for_rails/app/views/users/show.html.erb +14 -0
- data/spec/fixtures/for_rails/app/views/users/show.json.jbuilder +1 -0
- data/{test/dummy → spec/fixtures/for_rails}/bin/bundle +0 -0
- data/{test/dummy → spec/fixtures/for_rails}/bin/rails +0 -0
- data/{test/dummy → spec/fixtures/for_rails}/bin/rake +0 -0
- data/{test/dummy → spec/fixtures/for_rails}/config.ru +0 -0
- data/spec/fixtures/for_rails/config/application.rb +23 -0
- data/spec/fixtures/for_rails/config/boot.rb +4 -0
- data/spec/fixtures/for_rails/config/database.yml +39 -0
- data/spec/fixtures/for_rails/config/environment.rb +5 -0
- data/{test/dummy → spec/fixtures/for_rails}/config/environments/development.rb +1 -1
- data/{test/dummy → spec/fixtures/for_rails}/config/environments/production.rb +1 -1
- data/{test/dummy → spec/fixtures/for_rails}/config/environments/test.rb +1 -1
- data/{test/dummy → spec/fixtures/for_rails}/config/initializers/backtrace_silencers.rb +0 -0
- data/{test/dummy → spec/fixtures/for_rails}/config/initializers/filter_parameter_logging.rb +0 -0
- data/{test/dummy → spec/fixtures/for_rails}/config/initializers/inflections.rb +0 -0
- data/{test/dummy → spec/fixtures/for_rails}/config/initializers/mime_types.rb +0 -0
- data/{test/dummy → spec/fixtures/for_rails}/config/initializers/secret_token.rb +2 -2
- data/spec/fixtures/for_rails/config/initializers/session_store.rb +3 -0
- data/{test/dummy → spec/fixtures/for_rails}/config/initializers/wrap_parameters.rb +0 -0
- data/{test/dummy → spec/fixtures/for_rails}/config/locales/en.yml +0 -0
- data/spec/fixtures/for_rails/config/routes.rb +62 -0
- data/spec/fixtures/for_rails/db/migrate/20131208083747_create_articles.rb +11 -0
- data/spec/fixtures/for_rails/db/migrate/20131208083756_create_comments.rb +11 -0
- data/spec/fixtures/for_rails/db/migrate/20131208083835_create_users.rb +10 -0
- data/spec/fixtures/for_rails/db/seeds.rb +7 -0
- data/{test/dummy → spec/fixtures/for_rails}/public/404.html +0 -0
- data/{test/dummy → spec/fixtures/for_rails}/public/422.html +0 -0
- data/{test/dummy → spec/fixtures/for_rails}/public/500.html +0 -0
- data/spec/fixtures/for_rails/public/favicon.ico +0 -0
- data/spec/fixtures/for_rails/public/robots.txt +5 -0
- data/spec/fixtures/for_rails/test/test_helper.rb +15 -0
- data/spec/fixtures/generator/update_spec_tree/backup/Gemfile +45 -0
- data/spec/fixtures/generator/update_spec_tree/backup/Gemfile.lock +119 -0
- data/spec/fixtures/generator/update_spec_tree/backup/README.rdoc +28 -0
- data/{test/dummy → spec/fixtures/generator/update_spec_tree/backup}/Rakefile +1 -1
- data/spec/fixtures/generator/update_spec_tree/backup/app/assets/javascripts/application.js +16 -0
- data/spec/fixtures/generator/update_spec_tree/backup/app/assets/stylesheets/application.css +13 -0
- data/spec/fixtures/generator/update_spec_tree/backup/app/controllers/application_controller.rb +5 -0
- data/spec/fixtures/generator/update_spec_tree/backup/app/helpers/application_helper.rb +2 -0
- data/{test/dummy → spec/fixtures/generator/update_spec_tree/backup}/app/views/layouts/application.html.erb +1 -1
- data/spec/fixtures/generator/update_spec_tree/backup/bin/bundle +3 -0
- data/spec/fixtures/generator/update_spec_tree/backup/bin/rails +4 -0
- data/spec/fixtures/generator/update_spec_tree/backup/bin/rake +4 -0
- data/spec/fixtures/generator/update_spec_tree/backup/config.ru +4 -0
- data/{test/dummy → spec/fixtures/generator/update_spec_tree/backup}/config/application.rb +4 -4
- data/spec/fixtures/generator/update_spec_tree/backup/config/boot.rb +4 -0
- data/{test/dummy → spec/fixtures/generator/update_spec_tree/backup}/config/database.yml +0 -0
- data/{test/dummy → spec/fixtures/generator/update_spec_tree/backup}/config/environment.rb +1 -1
- data/spec/fixtures/generator/update_spec_tree/backup/config/environments/development.rb +29 -0
- data/spec/fixtures/generator/update_spec_tree/backup/config/environments/production.rb +80 -0
- data/spec/fixtures/generator/update_spec_tree/backup/config/environments/test.rb +36 -0
- data/spec/fixtures/generator/update_spec_tree/backup/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/fixtures/generator/update_spec_tree/backup/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/fixtures/generator/update_spec_tree/backup/config/initializers/inflections.rb +16 -0
- data/spec/fixtures/generator/update_spec_tree/backup/config/initializers/mime_types.rb +5 -0
- data/spec/fixtures/generator/update_spec_tree/backup/config/initializers/secret_token.rb +12 -0
- data/spec/fixtures/generator/update_spec_tree/backup/config/initializers/session_store.rb +3 -0
- data/spec/fixtures/generator/update_spec_tree/backup/config/initializers/wrap_parameters.rb +14 -0
- data/spec/fixtures/generator/update_spec_tree/backup/config/locales/en.yml +23 -0
- data/{test/dummy → spec/fixtures/generator/update_spec_tree/backup}/config/routes.rb +1 -1
- data/spec/fixtures/generator/update_spec_tree/backup/db/seeds.rb +7 -0
- data/spec/fixtures/generator/update_spec_tree/backup/lib/assets/try1.rb +11 -0
- data/spec/fixtures/generator/update_spec_tree/backup/lib/tasks/try2.rb +11 -0
- data/spec/fixtures/generator/update_spec_tree/backup/lib/try.rb +19 -0
- data/spec/fixtures/generator/update_spec_tree/backup/public/404.html +58 -0
- data/spec/fixtures/generator/update_spec_tree/backup/public/422.html +58 -0
- data/spec/fixtures/generator/update_spec_tree/backup/public/500.html +57 -0
- data/spec/fixtures/generator/update_spec_tree/backup/public/favicon.ico +0 -0
- data/spec/fixtures/generator/update_spec_tree/backup/public/robots.txt +5 -0
- data/spec/fixtures/generator/update_spec_tree/backup/spec/spec_helper.rb +17 -0
- data/spec/fixtures/generator/update_spec_tree/backup/test/test_helper.rb +15 -0
- data/spec/fixtures/generator/update_spec_tree/try/Gemfile +45 -0
- data/spec/fixtures/generator/update_spec_tree/try/Gemfile.lock +119 -0
- data/spec/fixtures/generator/update_spec_tree/try/README.rdoc +28 -0
- data/spec/fixtures/generator/update_spec_tree/try/Rakefile +6 -0
- data/spec/fixtures/generator/update_spec_tree/try/app/assets/javascripts/application.js +16 -0
- data/spec/fixtures/generator/update_spec_tree/try/app/assets/stylesheets/application.css +13 -0
- data/spec/fixtures/generator/update_spec_tree/try/app/controllers/application_controller.rb +5 -0
- data/spec/fixtures/generator/update_spec_tree/try/app/helpers/application_helper.rb +2 -0
- data/spec/fixtures/generator/update_spec_tree/try/app/views/layouts/application.html.erb +14 -0
- data/spec/fixtures/generator/update_spec_tree/try/bin/bundle +3 -0
- data/spec/fixtures/generator/update_spec_tree/try/bin/rails +4 -0
- data/spec/fixtures/generator/update_spec_tree/try/bin/rake +4 -0
- data/spec/fixtures/generator/update_spec_tree/try/config.ru +4 -0
- data/spec/fixtures/generator/update_spec_tree/try/config/application.rb +23 -0
- data/spec/fixtures/generator/update_spec_tree/try/config/boot.rb +4 -0
- data/spec/fixtures/generator/update_spec_tree/try/config/database.yml +25 -0
- data/spec/fixtures/generator/update_spec_tree/try/config/environment.rb +5 -0
- data/spec/fixtures/generator/update_spec_tree/try/config/environments/development.rb +29 -0
- data/spec/fixtures/generator/update_spec_tree/try/config/environments/production.rb +80 -0
- data/spec/fixtures/generator/update_spec_tree/try/config/environments/test.rb +36 -0
- data/spec/fixtures/generator/update_spec_tree/try/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/fixtures/generator/update_spec_tree/try/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/fixtures/generator/update_spec_tree/try/config/initializers/inflections.rb +16 -0
- data/spec/fixtures/generator/update_spec_tree/try/config/initializers/mime_types.rb +5 -0
- data/spec/fixtures/generator/update_spec_tree/try/config/initializers/secret_token.rb +12 -0
- data/spec/fixtures/generator/update_spec_tree/try/config/initializers/session_store.rb +3 -0
- data/spec/fixtures/generator/update_spec_tree/try/config/initializers/wrap_parameters.rb +14 -0
- data/spec/fixtures/generator/update_spec_tree/try/config/locales/en.yml +23 -0
- data/spec/fixtures/generator/update_spec_tree/try/config/routes.rb +56 -0
- data/spec/fixtures/generator/update_spec_tree/try/db/seeds.rb +7 -0
- data/spec/fixtures/generator/update_spec_tree/try/lib/assets/try1.rb +11 -0
- data/spec/fixtures/generator/update_spec_tree/try/lib/tasks/try2.rb +11 -0
- data/spec/fixtures/generator/update_spec_tree/try/lib/try.rb +19 -0
- data/spec/fixtures/generator/update_spec_tree/try/log/development.log +0 -0
- data/spec/fixtures/generator/update_spec_tree/try/public/404.html +58 -0
- data/spec/fixtures/generator/update_spec_tree/try/public/422.html +58 -0
- data/spec/fixtures/generator/update_spec_tree/try/public/500.html +57 -0
- data/spec/fixtures/generator/update_spec_tree/try/public/favicon.ico +0 -0
- data/spec/fixtures/generator/update_spec_tree/try/public/robots.txt +5 -0
- data/spec/fixtures/generator/update_spec_tree/try/spec/spec_helper.rb +17 -0
- data/spec/fixtures/generator/update_spec_tree/try/test/test_helper.rb +15 -0
- data/spec/fixtures/generators/lib/guard_helpers/ro_helper.rb +0 -0
- data/spec/fixtures/generators/spec/lib/guard_helpers/ro_helper_spec.rb +2 -0
- data/spec/fixtures/handler/error_page.html +1 -0
- data/spec/fixtures/handler/result.html +1 -0
- data/spec/fixtures/lib/element/backup.rb +0 -0
- data/spec/fixtures/navigate/faker_ro_commands/lib/ro_generators/a_generator.rb +0 -0
- data/spec/fixtures/navigate/faker_ro_commands/lib/typography/a_file.rb +0 -0
- data/spec/fixtures/rails_navigate/app/controllers/one_controller.rb +0 -0
- data/spec/fixtures/rails_navigate/app/controllers/two_controller.rb +0 -0
- data/spec/fixtures/rails_navigate/app/decorators/two_decorator.rb +0 -0
- data/spec/fixtures/rails_navigate/app/models/two_model.rb +0 -0
- data/spec/fixtures/rails_navigate/lib/path/to/file.rb +0 -0
- data/spec/fixtures/rails_navigate/lib/path/to/file2.rb +0 -0
- data/spec/fixtures/rails_new_app/try_create_rails/Gemfile +57 -0
- data/spec/fixtures/rails_new_app/try_create_rails/README.rdoc +28 -0
- data/spec/fixtures/rails_new_app/try_create_rails/Rakefile +6 -0
- data/spec/fixtures/rails_new_app/try_create_rails/app/assets/javascripts/application.js +16 -0
- data/spec/fixtures/rails_new_app/try_create_rails/app/assets/stylesheets/application.css +13 -0
- data/spec/fixtures/rails_new_app/try_create_rails/app/controllers/application_controller.rb +5 -0
- data/spec/fixtures/rails_new_app/try_create_rails/app/helpers/application_helper.rb +2 -0
- data/spec/fixtures/rails_new_app/try_create_rails/app/views/layouts/application.html.erb +14 -0
- data/spec/fixtures/rails_new_app/try_create_rails/bin/bundle +3 -0
- data/spec/fixtures/rails_new_app/try_create_rails/bin/rails +4 -0
- data/spec/fixtures/rails_new_app/try_create_rails/bin/rake +4 -0
- data/spec/fixtures/rails_new_app/try_create_rails/config.ru +4 -0
- data/spec/fixtures/rails_new_app/try_create_rails/config/application.rb +23 -0
- data/spec/fixtures/rails_new_app/try_create_rails/config/boot.rb +4 -0
- data/spec/fixtures/rails_new_app/try_create_rails/config/database.yml +39 -0
- data/spec/fixtures/rails_new_app/try_create_rails/config/environment.rb +5 -0
- data/spec/fixtures/rails_new_app/try_create_rails/config/environments/development.rb +29 -0
- data/spec/fixtures/rails_new_app/try_create_rails/config/environments/production.rb +80 -0
- data/spec/fixtures/rails_new_app/try_create_rails/config/environments/test.rb +36 -0
- data/spec/fixtures/rails_new_app/try_create_rails/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/fixtures/rails_new_app/try_create_rails/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/fixtures/rails_new_app/try_create_rails/config/initializers/inflections.rb +16 -0
- data/spec/fixtures/rails_new_app/try_create_rails/config/initializers/mime_types.rb +5 -0
- data/spec/fixtures/rails_new_app/try_create_rails/config/initializers/secret_token.rb +12 -0
- data/spec/fixtures/rails_new_app/try_create_rails/config/initializers/session_store.rb +3 -0
- data/spec/fixtures/rails_new_app/try_create_rails/config/initializers/wrap_parameters.rb +14 -0
- data/spec/fixtures/rails_new_app/try_create_rails/config/locales/en.yml +23 -0
- data/spec/fixtures/rails_new_app/try_create_rails/config/routes.rb +56 -0
- data/spec/fixtures/rails_new_app/try_create_rails/db/seeds.rb +7 -0
- data/spec/fixtures/rails_new_app/try_create_rails/public/404.html +58 -0
- data/spec/fixtures/rails_new_app/try_create_rails/public/422.html +58 -0
- data/spec/fixtures/rails_new_app/try_create_rails/public/500.html +57 -0
- data/spec/fixtures/rails_new_app/try_create_rails/public/favicon.ico +0 -0
- data/spec/fixtures/rails_new_app/try_create_rails/public/robots.txt +5 -0
- data/spec/fixtures/rails_new_app/try_create_rails/test/test_helper.rb +15 -0
- data/spec/fixtures/ro_bin_helper/gem1/lib/ro_commands/cmd1.rb +0 -0
- data/spec/fixtures/ro_bin_helper/gem1/lib/ro_commands/cmd2.rb +0 -0
- data/spec/fixtures/ro_bin_helper/gem2/lib/ro_commands/cmd1.rb +0 -0
- data/spec/fixtures/ro_bin_helper/gem2/lib/ro_commands/cmd2.rb +0 -0
- data/spec/fixtures/ro_commands_bin/lib/ro_commands/outside_ro_command.rb +5 -0
- data/spec/fixtures/ro_gist/ex/ex3.rb +0 -0
- data/spec/fixtures/ro_gist/ex/ex3_spec.rb +0 -0
- data/spec/fixtures/rodebug/config/routes.rb +6 -0
- data/spec/fixtures/spec/spec_helper.rb +20 -0
- data/spec/fixtures/tmp/rspec_guard_result +5 -0
- data/spec/fixtures/try_create_rails/Gemfile +58 -0
- data/spec/fixtures/try_create_rails/README.rdoc +28 -0
- data/spec/fixtures/try_create_rails/Rakefile +6 -0
- data/spec/fixtures/try_create_rails/app/assets/javascripts/application.js +16 -0
- data/spec/fixtures/try_create_rails/app/assets/stylesheets/application.css +13 -0
- data/spec/fixtures/try_create_rails/app/controllers/application_controller.rb +5 -0
- data/spec/fixtures/try_create_rails/app/helpers/application_helper.rb +2 -0
- data/spec/fixtures/try_create_rails/app/views/layouts/application.html.erb +14 -0
- data/spec/fixtures/try_create_rails/bin/bundle +3 -0
- data/spec/fixtures/try_create_rails/bin/rails +4 -0
- data/spec/fixtures/try_create_rails/bin/rake +4 -0
- data/spec/fixtures/try_create_rails/config.ru +4 -0
- data/spec/fixtures/try_create_rails/config/application.rb +23 -0
- data/spec/fixtures/try_create_rails/config/boot.rb +4 -0
- data/spec/fixtures/try_create_rails/config/database.yml +39 -0
- data/spec/fixtures/try_create_rails/config/environment.rb +5 -0
- data/spec/fixtures/try_create_rails/config/environments/development.rb +29 -0
- data/spec/fixtures/try_create_rails/config/environments/production.rb +80 -0
- data/spec/fixtures/try_create_rails/config/environments/test.rb +36 -0
- data/spec/fixtures/try_create_rails/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/fixtures/try_create_rails/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/fixtures/try_create_rails/config/initializers/inflections.rb +16 -0
- data/spec/fixtures/try_create_rails/config/initializers/mime_types.rb +5 -0
- data/spec/fixtures/try_create_rails/config/initializers/secret_token.rb +12 -0
- data/spec/fixtures/try_create_rails/config/initializers/session_store.rb +3 -0
- data/spec/fixtures/try_create_rails/config/initializers/wrap_parameters.rb +14 -0
- data/spec/fixtures/try_create_rails/config/locales/en.yml +23 -0
- data/spec/fixtures/try_create_rails/config/routes.rb +56 -0
- data/spec/fixtures/try_create_rails/db/seeds.rb +7 -0
- data/spec/fixtures/try_create_rails/public/404.html +58 -0
- data/spec/fixtures/try_create_rails/public/422.html +58 -0
- data/spec/fixtures/try_create_rails/public/500.html +57 -0
- data/spec/fixtures/try_create_rails/public/favicon.ico +0 -0
- data/spec/fixtures/try_create_rails/public/robots.txt +5 -0
- data/spec/fixtures/try_create_rails/test/test_helper.rb +15 -0
- data/spec/lib/all_spec.rb +36 -0
- data/spec/lib/bash_builder_spec.rb +75 -0
- data/spec/lib/bash_debug_spec.rb +24 -0
- data/spec/lib/core_ext/misc_helper_spec.rb +20 -0
- data/spec/lib/core_ext/module_misc_spec.rb +38 -0
- data/spec/lib/deps_methods_spec.rb +52 -0
- data/spec/lib/deps_spec.rb +27 -0
- data/spec/lib/guard_helpers/base_helper_spec.rb +56 -0
- data/spec/lib/guard_helpers/basic_helper_spec.rb +44 -0
- data/spec/lib/guard_helpers/gem_helper_spec.rb +14 -0
- data/spec/lib/guard_helpers/mid_mod_class_method_helper_spec.rb +35 -0
- data/spec/lib/ro_cells/gem_spec.rb +25 -0
- data/spec/lib/ro_commands/base_config_spec.rb +0 -0
- data/spec/lib/ro_commands/base_spec.rb +45 -0
- data/spec/lib/ro_commands/dsl/file_spec.rb +0 -0
- data/spec/lib/ro_commands/env/base_config_spec.rb +0 -0
- data/spec/lib/ro_commands/env/ro_proc_spec.rb +0 -0
- data/spec/lib/ro_commands/env/ro_process_spec.rb +0 -0
- data/spec/lib/ro_commands/file_actions_spec.rb +31 -0
- data/spec/lib/ro_commands/generate_spec.rb +7 -0
- data/spec/lib/ro_commands/generators/base_generator_spec.rb +2 -0
- data/spec/lib/ro_commands/generators/ex_spec.rb +33 -0
- data/spec/lib/ro_commands/generators/lib_spec.rb +2 -0
- data/spec/lib/ro_commands/generators/rails_generator_spec.rb +22 -0
- data/spec/lib/ro_commands/generators/rails_new_app_spec.rb +20 -0
- data/spec/lib/ro_commands/generators/rodebug_spec.rb +17 -0
- data/spec/lib/ro_commands/generators/spec_file_spec.rb +69 -0
- data/spec/lib/ro_commands/git_flow_spec.rb +19 -0
- data/spec/lib/ro_commands/git_spec.rb +0 -0
- data/spec/lib/ro_commands/misc_spec.rb +35 -0
- data/spec/lib/ro_commands/navigate_spec.rb +46 -0
- data/spec/lib/ro_commands/out_spec.rb +23 -0
- data/spec/lib/ro_commands/process_spec.rb +0 -0
- data/spec/lib/ro_commands/processes_spec.rb +0 -0
- data/spec/lib/ro_commands/rails_spec.rb +83 -0
- data/spec/lib/ro_commands/refactor_spec.rb +52 -0
- data/spec/lib/ro_commands/ro_gist_spec.rb +23 -0
- data/spec/lib/ro_commands/ro_helper_spec.rb +32 -0
- data/spec/lib/ro_commands/rubymine_spec.rb +0 -0
- data/spec/lib/ro_commands/version_spec.rb +0 -0
- data/spec/lib/ro_commands/zeus_spec.rb +12 -0
- data/spec/lib/ro_commands_bin_spec.rb +21 -0
- data/spec/lib/ro_commands_spec.rb +1 -0
- data/spec/lib/ro_core_ext/array_spec.rb +11 -0
- data/spec/lib/ro_core_ext/hash_spec.rb +12 -0
- data/spec/lib/ro_core_ext/object_spec.rb +12 -0
- data/spec/lib/ro_core_ext/string_spec.rb +10 -0
- data/spec/lib/ro_file_spec.rb +27 -0
- data/spec/lib/ro_helpers/all_ro_commands_spec.rb +9 -0
- data/spec/lib/ro_helpers/bash_spec.rb +40 -0
- data/spec/lib/ro_helpers/ro_bin_helper_spec.rb +23 -0
- data/spec/lib/ro_rails_helpers/handler_spec.rb +23 -0
- data/spec/lib/ro_rspec_helpers/ro_faker_spec.rb +14 -0
- data/spec/lib/ro_rspec_helpers/spec_helpers_spec.rb +5 -0
- data/spec/lib/ro_rspec_helpers_spec.rb +8 -0
- data/spec/lib/shortcuts_spec.rb +8 -0
- data/spec/lib/tasks/roro_commands_tasks_spec.rb +2 -0
- data/spec/lib/try_spec.rb +0 -0
- data/spec/lib/typography/test/typography_test_spec.rb +2 -0
- data/spec/ro_faker_templates/error_page.erb +1 -0
- data/spec/ro_faker_templates/outside_ro_commands.tt +5 -0
- data/spec/ro_faker_templates/rails4/Gemfile +58 -0
- data/spec/ro_faker_templates/rails4/Gemfile.lock +236 -0
- data/spec/ro_faker_templates/rails4/README.rdoc +28 -0
- data/spec/ro_faker_templates/rails4/Rakefile +6 -0
- data/spec/ro_faker_templates/rails4/app/assets/javascripts/application.js +16 -0
- data/spec/ro_faker_templates/rails4/app/assets/javascripts/articles.js.coffee +3 -0
- data/spec/ro_faker_templates/rails4/app/assets/javascripts/comments.js.coffee +3 -0
- data/spec/ro_faker_templates/rails4/app/assets/javascripts/users.js.coffee +3 -0
- data/spec/ro_faker_templates/rails4/app/assets/stylesheets/application.css +13 -0
- data/spec/ro_faker_templates/rails4/app/assets/stylesheets/articles.css.scss +3 -0
- data/spec/ro_faker_templates/rails4/app/assets/stylesheets/comments.css.scss +3 -0
- data/spec/ro_faker_templates/rails4/app/assets/stylesheets/scaffolds.css.scss +69 -0
- data/spec/ro_faker_templates/rails4/app/assets/stylesheets/users.css.scss +3 -0
- data/spec/ro_faker_templates/rails4/app/controllers/application_controller.rb +5 -0
- data/spec/ro_faker_templates/rails4/app/controllers/articles_controller.rb +74 -0
- data/spec/ro_faker_templates/rails4/app/controllers/comments_controller.rb +74 -0
- data/spec/ro_faker_templates/rails4/app/controllers/users_controller.rb +74 -0
- data/spec/ro_faker_templates/rails4/app/helpers/application_helper.rb +2 -0
- data/spec/ro_faker_templates/rails4/app/helpers/articles_helper.rb +2 -0
- data/spec/ro_faker_templates/rails4/app/helpers/comments_helper.rb +2 -0
- data/spec/ro_faker_templates/rails4/app/helpers/users_helper.rb +2 -0
- data/spec/ro_faker_templates/rails4/app/models/article.rb +2 -0
- data/spec/ro_faker_templates/rails4/app/models/comment.rb +2 -0
- data/spec/ro_faker_templates/rails4/app/models/user.rb +2 -0
- data/spec/ro_faker_templates/rails4/app/views/articles/_form.html.erb +29 -0
- data/spec/ro_faker_templates/rails4/app/views/articles/edit.html.erb +6 -0
- data/spec/ro_faker_templates/rails4/app/views/articles/index.html.erb +31 -0
- data/spec/ro_faker_templates/rails4/app/views/articles/index.json.jbuilder +4 -0
- data/spec/ro_faker_templates/rails4/app/views/articles/new.html.erb +5 -0
- data/spec/ro_faker_templates/rails4/app/views/articles/show.html.erb +19 -0
- data/spec/ro_faker_templates/rails4/app/views/articles/show.json.jbuilder +1 -0
- data/spec/ro_faker_templates/rails4/app/views/comments/_form.html.erb +29 -0
- data/spec/ro_faker_templates/rails4/app/views/comments/edit.html.erb +6 -0
- data/spec/ro_faker_templates/rails4/app/views/comments/index.html.erb +31 -0
- data/spec/ro_faker_templates/rails4/app/views/comments/index.json.jbuilder +4 -0
- data/spec/ro_faker_templates/rails4/app/views/comments/new.html.erb +5 -0
- data/spec/ro_faker_templates/rails4/app/views/comments/show.html.erb +19 -0
- data/spec/ro_faker_templates/rails4/app/views/comments/show.json.jbuilder +1 -0
- data/spec/ro_faker_templates/rails4/app/views/layouts/application.html.erb +14 -0
- data/spec/ro_faker_templates/rails4/app/views/users/_form.html.erb +25 -0
- data/spec/ro_faker_templates/rails4/app/views/users/edit.html.erb +6 -0
- data/spec/ro_faker_templates/rails4/app/views/users/index.html.erb +29 -0
- data/spec/ro_faker_templates/rails4/app/views/users/index.json.jbuilder +4 -0
- data/spec/ro_faker_templates/rails4/app/views/users/new.html.erb +5 -0
- data/spec/ro_faker_templates/rails4/app/views/users/show.html.erb +14 -0
- data/spec/ro_faker_templates/rails4/app/views/users/show.json.jbuilder +1 -0
- data/spec/ro_faker_templates/rails4/bin/bundle +3 -0
- data/spec/ro_faker_templates/rails4/bin/rails +4 -0
- data/spec/ro_faker_templates/rails4/bin/rake +4 -0
- data/spec/ro_faker_templates/rails4/config.ru +4 -0
- data/spec/ro_faker_templates/rails4/config/application.rb +23 -0
- data/spec/ro_faker_templates/rails4/config/boot.rb +4 -0
- data/spec/ro_faker_templates/rails4/config/database.yml +39 -0
- data/spec/ro_faker_templates/rails4/config/environment.rb +5 -0
- data/spec/ro_faker_templates/rails4/config/environments/development.rb +29 -0
- data/spec/ro_faker_templates/rails4/config/environments/production.rb +80 -0
- data/spec/ro_faker_templates/rails4/config/environments/test.rb +36 -0
- data/spec/ro_faker_templates/rails4/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/ro_faker_templates/rails4/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/ro_faker_templates/rails4/config/initializers/inflections.rb +16 -0
- data/spec/ro_faker_templates/rails4/config/initializers/mime_types.rb +5 -0
- data/spec/ro_faker_templates/rails4/config/initializers/secret_token.rb +12 -0
- data/spec/ro_faker_templates/rails4/config/initializers/session_store.rb +3 -0
- data/spec/ro_faker_templates/rails4/config/initializers/wrap_parameters.rb +14 -0
- data/spec/ro_faker_templates/rails4/config/locales/en.yml +23 -0
- data/spec/ro_faker_templates/rails4/config/routes.rb +62 -0
- data/spec/ro_faker_templates/rails4/db/migrate/20131208083747_create_articles.rb +11 -0
- data/spec/ro_faker_templates/rails4/db/migrate/20131208083756_create_comments.rb +11 -0
- data/spec/ro_faker_templates/rails4/db/migrate/20131208083835_create_users.rb +10 -0
- data/spec/ro_faker_templates/rails4/db/seeds.rb +7 -0
- data/spec/ro_faker_templates/rails4/public/404.html +58 -0
- data/spec/ro_faker_templates/rails4/public/422.html +58 -0
- data/spec/ro_faker_templates/rails4/public/500.html +57 -0
- data/spec/ro_faker_templates/rails4/public/favicon.ico +0 -0
- data/spec/ro_faker_templates/rails4/public/robots.txt +5 -0
- data/spec/ro_faker_templates/rails4/test/test_helper.rb +15 -0
- data/spec/ro_faker_templates/routes.erb +3 -0
- data/spec/spec_helper.rb +40 -0
- metadata +1001 -84
- data/README.rdoc +0 -3
- data/lib/ro_commands/core_ext/hash.rb +0 -5
- data/lib/ro_commands/core_ext/string.rb +0 -18
- data/lib/ro_commands/dsl/ro_file.rb +0 -24
- data/lib/ro_commands/helpers/all.rb +0 -8
- data/lib/ro_commands/helpers/all_files.rb +0 -21
- data/lib/ro_commands/helpers/bash.rb +0 -59
- data/lib/ro_commands/helpers/out.rb +0 -88
- data/test/dummy/config/boot.rb +0 -5
- data/test/dummy/config/initializers/session_store.rb +0 -3
- data/test/roro_commands_test.rb +0 -7
- data/test/test_helper.rb +0 -15
|
@@ -1 +1,12 @@
|
|
|
1
|
-
alias work="ro shortcuts work"
|
|
1
|
+
alias work="bundle exec ro shortcuts work"
|
|
2
|
+
|
|
3
|
+
alias e=rerun_debug
|
|
4
|
+
#function rerun_debug() {
|
|
5
|
+
# eval $(xdotool getmouselocation --shell)
|
|
6
|
+
# xdotool key F10
|
|
7
|
+
# xdotool mousemove 14 558
|
|
8
|
+
# xdotool click 1
|
|
9
|
+
# xdotool click 1
|
|
10
|
+
# xdotool key --delay 200 ctrl+F5
|
|
11
|
+
# xdotool mousemove $X $Y
|
|
12
|
+
#}
|
data/lib/bash_templates/video.sh
CHANGED
|
@@ -5,6 +5,7 @@ learn="$HOME/Dropbox/learn"
|
|
|
5
5
|
ruby_projects="$HOME/Dropbox/ruby-projects"
|
|
6
6
|
js_java_projects="$HOME/Dropbox/js-java-projects"
|
|
7
7
|
work_project="$ruby_projects/ro_partner"
|
|
8
|
-
|
|
8
|
+
RUBYMINE_HOME="~/Dropbox/RubyMine"
|
|
9
|
+
alias ro="<%= ro %>"
|
|
9
10
|
alias ro_client="<%= ro_client %>"
|
|
10
11
|
alias ro_server="<%= ro_server %>"
|
data/lib/deps.rb
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require File.expand_path('../../config/rorc', __FILE__)
|
|
2
|
+
|
|
3
|
+
require "ro_helpers/out"
|
|
4
|
+
|
|
5
|
+
require 'find'
|
|
6
|
+
require 'fileutils'
|
|
7
|
+
require 'ro_helpers/out'
|
|
8
|
+
require 'active_support/core_ext'
|
|
9
|
+
require_relative 'deps_methods'
|
|
10
|
+
|
|
11
|
+
module Deps
|
|
12
|
+
include DepsMethods
|
|
13
|
+
end
|
data/lib/deps_methods.rb
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
require File.expand_path('../../config/rorc', __FILE__)
|
|
2
|
+
|
|
3
|
+
module DepsMethods
|
|
4
|
+
|
|
5
|
+
class << self
|
|
6
|
+
def included(base)
|
|
7
|
+
base.extend(ClassMethods)
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
module ClassMethods
|
|
12
|
+
|
|
13
|
+
def project_lib
|
|
14
|
+
@project_lib = lib || RoCommands.lib
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def lib
|
|
18
|
+
if defined? root
|
|
19
|
+
File.join(root, 'lib')
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def spec
|
|
24
|
+
if defined? root
|
|
25
|
+
File.join(root, 'spec')
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def fix
|
|
30
|
+
if defined? spec
|
|
31
|
+
File.join(spec, 'fixtures')
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def use_capistrano
|
|
36
|
+
require 'capistrano/all'
|
|
37
|
+
require 'capistrano/setup'
|
|
38
|
+
require 'capistrano/deploy'
|
|
39
|
+
require 'sshkit/dsl'
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def require_all_in_lib(*args)
|
|
43
|
+
opts = args.extract_options!
|
|
44
|
+
opts[:ignore] ||= %r{(.+)\.rb\(deprecated\)$}
|
|
45
|
+
::Find.find(project_lib) do |p|
|
|
46
|
+
unless p.match(opts[:ignore])
|
|
47
|
+
if test(?f, p) and p.match(%r{(.+)\.rb})
|
|
48
|
+
Out.table("require", "#{p} file:#{File.basename __FILE__} line:#{__LINE__}")
|
|
49
|
+
require p
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def require_and_include_all_guard_helpers
|
|
56
|
+
::Find.find(File.join(project_lib, "guard_helpers")) do |p|
|
|
57
|
+
if p.match(%r{(.+)\.rb$})
|
|
58
|
+
require p
|
|
59
|
+
basename = File.basename(p).gsub(%r{\.\w+$}, "")
|
|
60
|
+
::Guard::Build.send :include, ::GuardHelpers.const_get(:"#{basename.camelize}")
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def require_all(dir)
|
|
67
|
+
require_or_autoload_all(dir) do |p|
|
|
68
|
+
require_file(p)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def require_or_autoload_all(dir)
|
|
73
|
+
ds = ::Find.find(project_lib).select do |p|
|
|
74
|
+
test(?d, p)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
d = ds.grep(%r{#{dir}$}).compact.first
|
|
78
|
+
if d
|
|
79
|
+
::Find.find(d) do |p|
|
|
80
|
+
if test(?f, p) and p.match(%r{\.rb$})
|
|
81
|
+
yield p
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def autoload_all(dir)
|
|
88
|
+
require_or_autoload_all(dir) do |p|
|
|
89
|
+
full_namespace, autoload_name = to_constance(p)
|
|
90
|
+
full_namespace.autoload autoload_name, p
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def path_to_constance_name_for_autoload(path)
|
|
95
|
+
path_in_lib = path.gsub(%r{^.*lib/}, "").gsub(%r{\.\w*$}, '')
|
|
96
|
+
result = path_in_lib.split("\/").map(&:camelize)
|
|
97
|
+
autoload_name = result.last.to_sym
|
|
98
|
+
full_namespace = Object
|
|
99
|
+
result[0..-2].each do |namespace|
|
|
100
|
+
full_namespace = full_namespace.const_get(namespace.to_sym)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
return full_namespace, autoload_name
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
alias_method :to_constance, :path_to_constance_name_for_autoload
|
|
107
|
+
|
|
108
|
+
def require_file(p)
|
|
109
|
+
basename = File.basename(p).gsub(%r{\.\w+$}, "")
|
|
110
|
+
Out.table "require", " #{basename} ", "file:#{File.basename __FILE__} line:#{__LINE__}"
|
|
111
|
+
require p
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
data/lib/drb/client.rb
CHANGED
|
@@ -1,32 +1,11 @@
|
|
|
1
|
-
require
|
|
2
|
-
|
|
3
|
-
require "ro_commands/helpers/all_files"
|
|
4
|
-
require "ro_commands/helpers/out"
|
|
5
|
-
require "ro_commands/core_ext/string"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
item = ARGV.shift
|
|
9
|
-
DRb.start_service
|
|
10
|
-
file = RoCommands.file_map.keys.grep(%r{#{item}}).first
|
|
1
|
+
require File.expand_path('../../../config/rorc', __FILE__)
|
|
11
2
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if ARGV.length == 0
|
|
17
|
-
#drb_obj = DRbObject.new_with_uri("druby://localhost:#{port}")
|
|
18
|
-
#drb_obj.start
|
|
19
|
-
else
|
|
20
|
-
#Out.out "ARGV:#{ARGV} file:#{File.basename __FILE__} line:#{__LINE__}", "red"
|
|
21
|
-
meth = ARGV.shift
|
|
22
|
-
args = ARGV
|
|
23
|
-
|
|
24
|
-
#Out.out "starting #{File.basename(file.to_s).gsub(%r{\.rb}, "")}"
|
|
25
|
-
drb_obj = DRbObject.new_with_uri("druby://localhost:#{port}")
|
|
3
|
+
require "drb"
|
|
4
|
+
require 'ro_helpers/out'
|
|
5
|
+
require 'ro_helpers/all_ro_commands_files'
|
|
6
|
+
require 'ro_core_ext/string'
|
|
26
7
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
Out.out(r)
|
|
30
|
-
end
|
|
8
|
+
::RoBinHelper.set_ro_commands_file_map ::RoCommands.root, 233
|
|
9
|
+
::RoBinHelper.use_drb_method
|
|
31
10
|
|
|
32
11
|
|
data/lib/drb/server.rb
CHANGED
|
@@ -1,34 +1,20 @@
|
|
|
1
|
-
require
|
|
1
|
+
require File.expand_path('../../../config/rorc', __FILE__)
|
|
2
|
+
|
|
3
|
+
require 'ro_helpers/out'
|
|
4
|
+
|
|
5
|
+
require "active_support/core_ext"
|
|
2
6
|
require "drb"
|
|
3
7
|
require "ro_commands"
|
|
4
|
-
require "
|
|
5
|
-
require "
|
|
6
|
-
require "
|
|
7
|
-
require "
|
|
8
|
-
|
|
8
|
+
require "ro_core_ext/thor"
|
|
9
|
+
require "ro_core_ext/string"
|
|
10
|
+
require "ro_helpers/all_ro_commands"
|
|
11
|
+
require "ro_helpers/out"
|
|
12
|
+
|
|
13
|
+
::RoBinHelper.set_ro_commands_file_map ::RoCommands.root, 233
|
|
14
|
+
::RoBinHelper.require_all_ro_commands
|
|
9
15
|
|
|
10
16
|
Out.out "starting service"
|
|
11
17
|
DRb::DRbServer.make_config(verbose: true)
|
|
12
|
-
#Out.out "RoCommands.file_map:#{RoCommands.file_map} file:#{File.basename __FILE__} line:#{__LINE__}"
|
|
13
|
-
RoCommands.file_map.each do |file, port|
|
|
14
|
-
basename = File.basename(file.to_s).gsub(%r{\.rb}, "")
|
|
15
|
-
klass_name = basename.to_s.camelize
|
|
16
|
-
|
|
17
|
-
Out.out "#{RoCommands.const_get(klass_name.to_sym)} defining methods"
|
|
18
|
-
RoCommands.const_get(klass_name.to_sym).class_eval do
|
|
19
|
-
RoCommands.const_get(klass_name.to_sym).meths.each do |m|
|
|
20
|
-
desc usage("drb_#{m}"), ""
|
|
21
|
-
define_method("drb_#{m}".to_sym) do |*args|
|
|
22
|
-
Out.reset
|
|
23
|
-
send(m.to_sym, *args)
|
|
24
|
-
#Out.out "Out.msgs:#{Out.msgs} file:#{File.basename __FILE__} line:#{__LINE__}"
|
|
25
|
-
handle_drb_out
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
18
|
|
|
30
|
-
|
|
31
|
-
puts "#{RoCommands.const_get(klass_name.to_sym)} at #{url}"
|
|
32
|
-
DRb.start_service(url, RoCommands.const_get(klass_name.to_sym))
|
|
33
|
-
end
|
|
19
|
+
::RoBinHelper.define_drb_method_and_start_service()
|
|
34
20
|
|
data/lib/dsl/ro_file.rb
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require 'find'
|
|
2
|
+
|
|
3
|
+
module DSL
|
|
4
|
+
module RoFile
|
|
5
|
+
def dir?(path)
|
|
6
|
+
test(?d, path)
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def file?(path)
|
|
10
|
+
test(?f, path)
|
|
11
|
+
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def find(path)
|
|
15
|
+
Find.find(path).to_a
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def size(path)
|
|
19
|
+
s = test(?s, path)
|
|
20
|
+
s ||= 0
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
require File.expand_path('../../../config/rorc', __FILE__)
|
|
2
|
+
|
|
3
|
+
require "ro_helpers/out"
|
|
4
|
+
require "guard"
|
|
5
|
+
require "guard/guard"
|
|
6
|
+
require "pry"
|
|
7
|
+
require "find"
|
|
8
|
+
require "active_support"
|
|
9
|
+
require "ro_default"
|
|
10
|
+
require "ro_file"
|
|
11
|
+
require 'config/rorc'
|
|
12
|
+
require 'ro_core_ext/pry'
|
|
13
|
+
|
|
14
|
+
if File.exist?(File.join(Dir.pwd, 'config/environment.rb'))
|
|
15
|
+
require File.join(Dir.pwd, "config/environment")
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
if File.exist?(File.join(Dir.pwd, 'config/rorc_spec.rb'))
|
|
19
|
+
require File.join(Dir.pwd, "config/rorc")
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
require_relative 'mid_mod_class_methods_helper'
|
|
23
|
+
|
|
24
|
+
module GuardHelpers
|
|
25
|
+
|
|
26
|
+
module BaseHelper
|
|
27
|
+
class << self
|
|
28
|
+
def included(base)
|
|
29
|
+
base.extend(ClassMethods)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def start
|
|
34
|
+
super if defined? super
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def run_on_modifications(paths)
|
|
39
|
+
@paths = paths
|
|
40
|
+
Out.table "paths:", "#{paths}", "file:#{File.basename __FILE__} line:#{__LINE__}"
|
|
41
|
+
super if defined? super
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
def paths
|
|
45
|
+
@paths.flatten! if @paths.respond_to?(:flatten!)
|
|
46
|
+
@paths.uniq! if @paths.respond_to?(:uniq!)
|
|
47
|
+
@paths ||= []
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def handle_all_paths(file)
|
|
51
|
+
ps = paths.flatten.grep file
|
|
52
|
+
unless ps.empty?
|
|
53
|
+
yield
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def handle_each_path(file)
|
|
58
|
+
ps = paths.flatten.grep file
|
|
59
|
+
unless ps.empty?
|
|
60
|
+
ps.each do |p|
|
|
61
|
+
yield p
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
module ClassMethods
|
|
68
|
+
def included(base)
|
|
69
|
+
super
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def append_features(mod)
|
|
73
|
+
super
|
|
74
|
+
mid_mod = self
|
|
75
|
+
|
|
76
|
+
#mid_mod::ClassMethods.class_eval do
|
|
77
|
+
# include ::GuardHelpers::MidModClassMethodsHelper
|
|
78
|
+
#end
|
|
79
|
+
mod.class_eval do
|
|
80
|
+
include mid_mod.const_get(:ClassMethods)
|
|
81
|
+
extend mid_mod.const_get(:ClassMethods)
|
|
82
|
+
|
|
83
|
+
::Pry::CommandSet.class_eval do
|
|
84
|
+
include mid_mod.const_get(:ClassMethods)
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
require_relative 'base_helper'
|
|
2
|
+
require 'ro_commands/generate'
|
|
3
|
+
require 'bash_builder'
|
|
4
|
+
|
|
5
|
+
module GuardHelpers
|
|
6
|
+
module BasicHelper
|
|
7
|
+
include BaseHelper
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def start
|
|
11
|
+
super if defined? super
|
|
12
|
+
|
|
13
|
+
commands = Pry::CommandSet.new do
|
|
14
|
+
pry_cmd "rspec", "rake rspec" do |*args|
|
|
15
|
+
guard_bash "bundle exec rake spec"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
pry_cmd "install", "install gem" do |*args|
|
|
19
|
+
|
|
20
|
+
bash_build
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
pry_cmd "nimabi", "try command" do |*args|
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
pry_cmd "ex", "generate a ex" do |*args|
|
|
27
|
+
::RoCommands::Generate.new.ex
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
pry_cmd "spec", "generate a lib" do |name|
|
|
31
|
+
::RoCommands::Generate.new.spec_file(name)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
pry_cmd "rbm", "rubymine file" do |path|
|
|
35
|
+
bash "rubymine #{path}"
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
pry_cmd "libspec", "" do |*args|
|
|
39
|
+
::RoCommands::Shortcuts.new.lib_spec
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
pry_cmd "reset", "reset guard" do |*args|
|
|
43
|
+
system "bundle exec guard "
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
Pry::Commands.import commands
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def run_on_modifications(paths)
|
|
51
|
+
super if defined? super
|
|
52
|
+
handle_each_path(%r{Guardfile}) do
|
|
53
|
+
guard_reset
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
handle_each_path(%r{^lib/guard_helpers/(.+)\.rb}) do
|
|
57
|
+
guard_reset
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
include ::GuardHelpers::BaseHelper
|
|
63
|
+
|
|
64
|
+
module ClassMethods
|
|
65
|
+
|
|
66
|
+
def require_include_all_guard_helpers(guardfile_path)
|
|
67
|
+
paths = File.expand_path('../lib/guard_helpers/**', guardfile_path)
|
|
68
|
+
Dir[paths].each do |path|
|
|
69
|
+
require path
|
|
70
|
+
guard_helper_module_name = File.basename(path).gsub(%r{\.\w+$}, "").camelize
|
|
71
|
+
guard_helper_module = ::GuardHelpers.const_get(:"#{guard_helper_module_name}")
|
|
72
|
+
self.send(:include, guard_helper_module)
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def create_open_file(dir, ext="rb")
|
|
77
|
+
::Pry::Commands.pry_cmd dir, "create a #{dir}/(.+).#{ext}" do |name|
|
|
78
|
+
file = File.join(dir, "#{name}.#{ext}")
|
|
79
|
+
#Out.out "Dir.pwd:#{Dir.pwd} ","","file:#{File.basename __FILE__} line:#{__LINE__}", "green"
|
|
80
|
+
unless File.exist?(file)
|
|
81
|
+
dirname = File.dirname(file)
|
|
82
|
+
FileUtils.mkpath dirname
|
|
83
|
+
FileUtils.touch(file)
|
|
84
|
+
FileUtils.chmod(755, file)
|
|
85
|
+
end
|
|
86
|
+
bash "#{::RoDefault.editor} #{file}"
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def guard_reset
|
|
91
|
+
Kernel.system "bundle exec guard "
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def file_read(file)
|
|
95
|
+
File.read(file)
|
|
96
|
+
notify "read #{file}"
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
def file_write (file, ctn)
|
|
100
|
+
File.write(file, ctn)
|
|
101
|
+
notify "writing #{file} success"
|
|
102
|
+
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
def write_bashrc
|
|
106
|
+
ctn = File.read('bashrc.erb')
|
|
107
|
+
result = ERB.new(ctn).result(binding)
|
|
108
|
+
bashrc = File.join(ENV['HOME'], '.bashrc')
|
|
109
|
+
Out.out("writing to #{bashrc}")
|
|
110
|
+
File.write(bashrc, result)
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
def bash_build
|
|
114
|
+
notify "bash build"
|
|
115
|
+
BashBuilder.build
|
|
116
|
+
|
|
117
|
+
write_bashrc
|
|
118
|
+
Out.out "rake install file:#{::File.basename __FILE__} line:#{__LINE__}", "green"
|
|
119
|
+
unless ::RoFile.change_recently?("pkg", 3)
|
|
120
|
+
bashs "rake install"
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def notify(msg, image="success")
|
|
126
|
+
Out.out msg
|
|
127
|
+
::Guard::Notifier.notify msg, image: image
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
|