marty 0.5.12
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/MIT-LICENSE +20 -0
- data/README.md +84 -0
- data/Rakefile +29 -0
- data/app/assets/javascripts/marty/application.js +15 -0
- data/app/assets/stylesheets/marty/application.css +13 -0
- data/app/components/marty/api_auth_view.rb +32 -0
- data/app/components/marty/auth_app.rb +55 -0
- data/app/components/marty/auth_app.rb~ +51 -0
- data/app/components/marty/auth_app/javascripts/auth_app.js +91 -0
- data/app/components/marty/auth_app/javascripts/auth_app.js~ +91 -0
- data/app/components/marty/cm_form_panel.rb~ +5 -0
- data/app/components/marty/cm_grid_panel.rb~ +35 -0
- data/app/components/marty/data_import_view.rb~ +142 -0
- data/app/components/marty/extras/layout.rb +46 -0
- data/app/components/marty/extras/layout.rb~ +46 -0
- data/app/components/marty/extras/misc.rb +18 -0
- data/app/components/marty/form.rb +6 -0
- data/app/components/marty/grid.rb +45 -0
- data/app/components/marty/grid_append_only.rb +12 -0
- data/app/components/marty/import_type_view.rb +53 -0
- data/app/components/marty/live_search_grid_panel.rb +46 -0
- data/app/components/marty/live_search_grid_panel.rb~ +49 -0
- data/app/components/marty/main_auth_app.rb +269 -0
- data/app/components/marty/main_auth_app.rb~ +238 -0
- data/app/components/marty/mcfly_grid_panel.rb +62 -0
- data/app/components/marty/mcfly_grid_panel.rb~ +80 -0
- data/app/components/marty/new_posting_form.rb +46 -0
- data/app/components/marty/new_posting_form.rb~ +46 -0
- data/app/components/marty/new_posting_window.rb +21 -0
- data/app/components/marty/new_posting_window.rb~ +21 -0
- data/app/components/marty/panel.rb +12 -0
- data/app/components/marty/pivot_grid.rb +52 -0
- data/app/components/marty/pivot_grid/endpoints.rb +45 -0
- data/app/components/marty/pivot_grid/javascripts/extensions.js +150 -0
- data/app/components/marty/pivot_grid/javascripts/pivot_grid.js +86 -0
- data/app/components/marty/pivot_grid/services.rb +44 -0
- data/app/components/marty/posting_grid.rb +139 -0
- data/app/components/marty/posting_grid.rb~ +140 -0
- data/app/components/marty/posting_window.rb +27 -0
- data/app/components/marty/promise_view.rb +177 -0
- data/app/components/marty/promise_view.rb~ +157 -0
- data/app/components/marty/promise_view/stylesheets/promise_view.css +26 -0
- data/app/components/marty/promise_view/stylesheets/promise_view.css~ +15 -0
- data/app/components/marty/report_form.rb +225 -0
- data/app/components/marty/report_form.rb~ +217 -0
- data/app/components/marty/report_select.rb +145 -0
- data/app/components/marty/report_select.rb~ +133 -0
- data/app/components/marty/reporting.rb +39 -0
- data/app/components/marty/reporting.rb~ +39 -0
- data/app/components/marty/script_detail.rb~ +430 -0
- data/app/components/marty/script_form.rb +233 -0
- data/app/components/marty/script_form.rb~ +233 -0
- data/app/components/marty/script_form/javascripts/Ext.ux.form.field.CodeMirror.js +698 -0
- data/app/components/marty/script_form/javascripts/Ext.ux.form.field.CodeMirror.js~ +909 -0
- data/app/components/marty/script_form/javascripts/codemirror.js +3130 -0
- data/app/components/marty/script_form/javascripts/mode/clike/clike.js +284 -0
- data/app/components/marty/script_form/javascripts/mode/clike/index.html +102 -0
- data/app/components/marty/script_form/javascripts/mode/clike/scala.html +766 -0
- data/app/components/marty/script_form/javascripts/mode/clojure/clojure.js +206 -0
- data/app/components/marty/script_form/javascripts/mode/clojure/index.html +67 -0
- data/app/components/marty/script_form/javascripts/mode/coffeescript/LICENSE +22 -0
- data/app/components/marty/script_form/javascripts/mode/coffeescript/coffeescript.js +346 -0
- data/app/components/marty/script_form/javascripts/mode/coffeescript/index.html +728 -0
- data/app/components/marty/script_form/javascripts/mode/commonlisp/commonlisp.js +101 -0
- data/app/components/marty/script_form/javascripts/mode/commonlisp/index.html +165 -0
- data/app/components/marty/script_form/javascripts/mode/css/css.js +448 -0
- data/app/components/marty/script_form/javascripts/mode/css/index.html +58 -0
- data/app/components/marty/script_form/javascripts/mode/css/test.js +501 -0
- data/app/components/marty/script_form/javascripts/mode/delorean/delorean.js +189 -0
- data/app/components/marty/script_form/javascripts/mode/diff/diff.js +32 -0
- data/app/components/marty/script_form/javascripts/mode/diff/index.html +105 -0
- data/app/components/marty/script_form/javascripts/mode/ecl/ecl.js +203 -0
- data/app/components/marty/script_form/javascripts/mode/ecl/index.html +42 -0
- data/app/components/marty/script_form/javascripts/mode/erlang/erlang.js +463 -0
- data/app/components/marty/script_form/javascripts/mode/erlang/index.html +63 -0
- data/app/components/marty/script_form/javascripts/mode/gfm/gfm.js +150 -0
- data/app/components/marty/script_form/javascripts/mode/gfm/index.html +48 -0
- data/app/components/marty/script_form/javascripts/mode/go/go.js +170 -0
- data/app/components/marty/script_form/javascripts/mode/go/index.html +73 -0
- data/app/components/marty/script_form/javascripts/mode/groovy/groovy.js +210 -0
- data/app/components/marty/script_form/javascripts/mode/groovy/index.html +72 -0
- data/app/components/marty/script_form/javascripts/mode/haskell/haskell.js +242 -0
- data/app/components/marty/script_form/javascripts/mode/haskell/index.html +61 -0
- data/app/components/marty/script_form/javascripts/mode/haxe/haxe.js +429 -0
- data/app/components/marty/script_form/javascripts/mode/haxe/index.html +91 -0
- data/app/components/marty/script_form/javascripts/mode/htmlembedded/htmlembedded.js +72 -0
- data/app/components/marty/script_form/javascripts/mode/htmlembedded/index.html +50 -0
- data/app/components/marty/script_form/javascripts/mode/htmlmixed/htmlmixed.js +84 -0
- data/app/components/marty/script_form/javascripts/mode/htmlmixed/index.html +52 -0
- data/app/components/marty/script_form/javascripts/mode/javascript/index.html +78 -0
- data/app/components/marty/script_form/javascripts/mode/javascript/javascript.js +361 -0
- data/app/components/marty/script_form/javascripts/mode/jinja2/index.html +38 -0
- data/app/components/marty/script_form/javascripts/mode/jinja2/jinja2.js +42 -0
- data/app/components/marty/script_form/javascripts/mode/less/index.html +740 -0
- data/app/components/marty/script_form/javascripts/mode/less/less.js +266 -0
- data/app/components/marty/script_form/javascripts/mode/lua/index.html +73 -0
- data/app/components/marty/script_form/javascripts/mode/lua/lua.js +140 -0
- data/app/components/marty/script_form/javascripts/mode/markdown/index.html +343 -0
- data/app/components/marty/script_form/javascripts/mode/markdown/markdown.js +382 -0
- data/app/components/marty/script_form/javascripts/mode/markdown/test.js +1084 -0
- data/app/components/marty/script_form/javascripts/mode/mysql/index.html +42 -0
- data/app/components/marty/script_form/javascripts/mode/mysql/mysql.js +186 -0
- data/app/components/marty/script_form/javascripts/mode/ntriples/index.html +33 -0
- data/app/components/marty/script_form/javascripts/mode/ntriples/ntriples.js +172 -0
- data/app/components/marty/script_form/javascripts/mode/ocaml/index.html +130 -0
- data/app/components/marty/script_form/javascripts/mode/ocaml/ocaml.js +114 -0
- data/app/components/marty/script_form/javascripts/mode/pascal/LICENSE +7 -0
- data/app/components/marty/script_form/javascripts/mode/pascal/index.html +49 -0
- data/app/components/marty/script_form/javascripts/mode/pascal/pascal.js +94 -0
- data/app/components/marty/script_form/javascripts/mode/perl/LICENSE +19 -0
- data/app/components/marty/script_form/javascripts/mode/perl/index.html +63 -0
- data/app/components/marty/script_form/javascripts/mode/perl/perl.js +816 -0
- data/app/components/marty/script_form/javascripts/mode/php/index.html +49 -0
- data/app/components/marty/script_form/javascripts/mode/php/php.js +148 -0
- data/app/components/marty/script_form/javascripts/mode/pig/index.html +43 -0
- data/app/components/marty/script_form/javascripts/mode/pig/pig.js +172 -0
- data/app/components/marty/script_form/javascripts/mode/plsql/index.html +63 -0
- data/app/components/marty/script_form/javascripts/mode/plsql/plsql.js +217 -0
- data/app/components/marty/script_form/javascripts/mode/properties/index.html +41 -0
- data/app/components/marty/script_form/javascripts/mode/properties/properties.js +63 -0
- data/app/components/marty/script_form/javascripts/mode/python/LICENSE.txt +21 -0
- data/app/components/marty/script_form/javascripts/mode/python/index.html +123 -0
- data/app/components/marty/script_form/javascripts/mode/python/python.js +338 -0
- data/app/components/marty/script_form/javascripts/mode/r/LICENSE +24 -0
- data/app/components/marty/script_form/javascripts/mode/r/index.html +74 -0
- data/app/components/marty/script_form/javascripts/mode/r/r.js +141 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/changes/changes.js +19 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/changes/index.html +54 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/spec/index.html +100 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/spec/spec.css +5 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/spec/spec.js +66 -0
- data/app/components/marty/script_form/javascripts/mode/rst/index.html +526 -0
- data/app/components/marty/script_form/javascripts/mode/rst/rst.js +326 -0
- data/app/components/marty/script_form/javascripts/mode/ruby/LICENSE +24 -0
- data/app/components/marty/script_form/javascripts/mode/ruby/index.html +172 -0
- data/app/components/marty/script_form/javascripts/mode/ruby/ruby.js +195 -0
- data/app/components/marty/script_form/javascripts/mode/rust/index.html +49 -0
- data/app/components/marty/script_form/javascripts/mode/rust/rust.js +432 -0
- data/app/components/marty/script_form/javascripts/mode/scheme/index.html +65 -0
- data/app/components/marty/script_form/javascripts/mode/scheme/scheme.js +230 -0
- data/app/components/marty/script_form/javascripts/mode/shell/index.html +50 -0
- data/app/components/marty/script_form/javascripts/mode/shell/shell.js +118 -0
- data/app/components/marty/script_form/javascripts/mode/sieve/LICENSE +23 -0
- data/app/components/marty/script_form/javascripts/mode/sieve/index.html +81 -0
- data/app/components/marty/script_form/javascripts/mode/sieve/sieve.js +156 -0
- data/app/components/marty/script_form/javascripts/mode/smalltalk/index.html +56 -0
- data/app/components/marty/script_form/javascripts/mode/smalltalk/smalltalk.js +139 -0
- data/app/components/marty/script_form/javascripts/mode/smarty/index.html +83 -0
- data/app/components/marty/script_form/javascripts/mode/smarty/smarty.js +148 -0
- data/app/components/marty/script_form/javascripts/mode/sparql/index.html +41 -0
- data/app/components/marty/script_form/javascripts/mode/sparql/sparql.js +143 -0
- data/app/components/marty/script_form/javascripts/mode/stex/index.html +98 -0
- data/app/components/marty/script_form/javascripts/mode/stex/stex.js +182 -0
- data/app/components/marty/script_form/javascripts/mode/stex/test.js +343 -0
- data/app/components/marty/script_form/javascripts/mode/tiddlywiki/index.html +141 -0
- data/app/components/marty/script_form/javascripts/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/app/components/marty/script_form/javascripts/mode/tiddlywiki/tiddlywiki.js +384 -0
- data/app/components/marty/script_form/javascripts/mode/tiki/index.html +83 -0
- data/app/components/marty/script_form/javascripts/mode/tiki/tiki.css +26 -0
- data/app/components/marty/script_form/javascripts/mode/tiki/tiki.js +309 -0
- data/app/components/marty/script_form/javascripts/mode/vb/LICENSE.txt +21 -0
- data/app/components/marty/script_form/javascripts/mode/vb/index.html +89 -0
- data/app/components/marty/script_form/javascripts/mode/vb/vb.js +260 -0
- data/app/components/marty/script_form/javascripts/mode/vbscript/index.html +43 -0
- data/app/components/marty/script_form/javascripts/mode/vbscript/vbscript.js +26 -0
- data/app/components/marty/script_form/javascripts/mode/velocity/index.html +104 -0
- data/app/components/marty/script_form/javascripts/mode/velocity/velocity.js +146 -0
- data/app/components/marty/script_form/javascripts/mode/verilog/index.html +211 -0
- data/app/components/marty/script_form/javascripts/mode/verilog/verilog.js +194 -0
- data/app/components/marty/script_form/javascripts/mode/xml/index.html +45 -0
- data/app/components/marty/script_form/javascripts/mode/xml/xml.js +318 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/LICENSE +20 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/index.html +223 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/index.html +27 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testBase.js +42 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testEmptySequenceKeyword.js +16 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testMultiAttr.js +16 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testNamespaces.js +91 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testProcessingInstructions.js +16 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testQuotes.js +19 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/xquery.js +451 -0
- data/app/components/marty/script_form/javascripts/mode/yaml/index.html +68 -0
- data/app/components/marty/script_form/javascripts/mode/yaml/yaml.js +95 -0
- data/app/components/marty/script_form/javascripts/util/closetag.js +164 -0
- data/app/components/marty/script_form/javascripts/util/dialog.css +27 -0
- data/app/components/marty/script_form/javascripts/util/dialog.js +70 -0
- data/app/components/marty/script_form/javascripts/util/foldcode.js +196 -0
- data/app/components/marty/script_form/javascripts/util/formatting.js +193 -0
- data/app/components/marty/script_form/javascripts/util/javascript-hint.js +134 -0
- data/app/components/marty/script_form/javascripts/util/loadmode.js +51 -0
- data/app/components/marty/script_form/javascripts/util/match-highlighter.js +44 -0
- data/app/components/marty/script_form/javascripts/util/multiplex.js +77 -0
- data/app/components/marty/script_form/javascripts/util/overlay.js +54 -0
- data/app/components/marty/script_form/javascripts/util/pig-hint.js +123 -0
- data/app/components/marty/script_form/javascripts/util/runmode-standalone.js +90 -0
- data/app/components/marty/script_form/javascripts/util/runmode.js +53 -0
- data/app/components/marty/script_form/javascripts/util/search.js +118 -0
- data/app/components/marty/script_form/javascripts/util/searchcursor.js +119 -0
- data/app/components/marty/script_form/javascripts/util/simple-hint.css +16 -0
- data/app/components/marty/script_form/javascripts/util/simple-hint.js +97 -0
- data/app/components/marty/script_form/javascripts/util/xml-hint.js +137 -0
- data/app/components/marty/script_form/stylesheets/codemirror.css +172 -0
- data/app/components/marty/script_form/stylesheets/delorean.css +10 -0
- data/app/components/marty/script_form/stylesheets/theme/ambiance.css +81 -0
- data/app/components/marty/script_form/stylesheets/theme/blackboard.css +25 -0
- data/app/components/marty/script_form/stylesheets/theme/cobalt.css +18 -0
- data/app/components/marty/script_form/stylesheets/theme/eclipse.css +25 -0
- data/app/components/marty/script_form/stylesheets/theme/elegant.css +10 -0
- data/app/components/marty/script_form/stylesheets/theme/erlang-dark.css +21 -0
- data/app/components/marty/script_form/stylesheets/theme/lesser-dark.css +44 -0
- data/app/components/marty/script_form/stylesheets/theme/monokai.css +28 -0
- data/app/components/marty/script_form/stylesheets/theme/neat.css +9 -0
- data/app/components/marty/script_form/stylesheets/theme/night.css +21 -0
- data/app/components/marty/script_form/stylesheets/theme/rubyblue.css +21 -0
- data/app/components/marty/script_form/stylesheets/theme/vibrant-ink.css +27 -0
- data/app/components/marty/script_form/stylesheets/theme/xq-dark.css +46 -0
- data/app/components/marty/script_grid.rb +104 -0
- data/app/components/marty/script_grid.rb~ +99 -0
- data/app/components/marty/script_tester.rb +114 -0
- data/app/components/marty/script_tester.rb~ +213 -0
- data/app/components/marty/scripting.rb +132 -0
- data/app/components/marty/scripting.rb~ +124 -0
- data/app/components/marty/select_report.rb~ +143 -0
- data/app/components/marty/simple_app.rb +97 -0
- data/app/components/marty/simple_app.rb~ +101 -0
- data/app/components/marty/simple_app/javascripts/simple_app.js +50 -0
- data/app/components/marty/simple_app/javascripts/statusbar_ext.js +8 -0
- data/app/components/marty/tag_grid.rb +83 -0
- data/app/components/marty/tag_grid.rb~ +89 -0
- data/app/components/marty/tree_panel.rb~ +256 -0
- data/app/components/marty/tree_panel/javascripts/tree_panel.js~ +317 -0
- data/app/components/marty/user_pivot.rb +128 -0
- data/app/components/marty/user_view.rb +181 -0
- data/app/components/marty/user_view.rb~ +188 -0
- data/app/controllers/marty/application_controller.rb +124 -0
- data/app/controllers/marty/application_controller.rb~ +133 -0
- data/app/controllers/marty/components_controller.rb +41 -0
- data/app/controllers/marty/components_controller.rb~ +37 -0
- data/app/controllers/marty/job_controller.rb +28 -0
- data/app/controllers/marty/job_controller.rb~ +28 -0
- data/app/controllers/marty/rpc_controller.rb +64 -0
- data/app/controllers/marty/rpc_controller.rb~ +61 -0
- data/app/helpers/marty/application_helper.rb +4 -0
- data/app/helpers/marty/script_set.rb +57 -0
- data/app/helpers/marty/script_set.rb~ +59 -0
- data/app/models/marty/api_auth.rb +44 -0
- data/app/models/marty/api_auth.rb~ +48 -0
- data/app/models/marty/base.rb +4 -0
- data/app/models/marty/data_change.rb +179 -0
- data/app/models/marty/data_change.rb~ +141 -0
- data/app/models/marty/enum.rb +22 -0
- data/app/models/marty/enum.rb~ +16 -0
- data/app/models/marty/import_type.rb +44 -0
- data/app/models/marty/import_type.rb~ +48 -0
- data/app/models/marty/poop.rb~ +169 -0
- data/app/models/marty/posting.rb +101 -0
- data/app/models/marty/posting.rb~ +86 -0
- data/app/models/marty/posting_type.rb +12 -0
- data/app/models/marty/posting_type.rb~ +21 -0
- data/app/models/marty/promise.rb +252 -0
- data/app/models/marty/promise.rb~ +196 -0
- data/app/models/marty/role.rb +6 -0
- data/app/models/marty/role.rb~ +10 -0
- data/app/models/marty/script.rb +144 -0
- data/app/models/marty/script.rb~ +62 -0
- data/app/models/marty/tag.rb +96 -0
- data/app/models/marty/tag.rb~ +91 -0
- data/app/models/marty/token.rb +30 -0
- data/app/models/marty/user.rb +146 -0
- data/app/models/marty/user.rb~ +148 -0
- data/app/models/marty/user_role.rb +7 -0
- data/app/models/marty/user_role.rb~ +13 -0
- data/app/views/layouts/marty/application.html.erb +12 -0
- data/app/views/layouts/marty/application.html.erb~ +11 -0
- data/config/locales/en.yml +134 -0
- data/config/routes.rb +6 -0
- data/config/routes.rb~ +10 -0
- data/db/migrate/001_create_marty_scripts.rb +14 -0
- data/db/migrate/003_create_marty_users.rb +12 -0
- data/db/migrate/004_create_marty_roles.rb +7 -0
- data/db/migrate/005_create_marty_user_roles.rb +14 -0
- data/db/migrate/006_create_marty_tokens.rb +14 -0
- data/db/migrate/008_create_marty_posting_types.rb +7 -0
- data/db/migrate/019_create_marty_postings.rb +18 -0
- data/db/migrate/019_create_marty_postings.rb~ +19 -0
- data/db/migrate/068_create_marty_import_types.rb +12 -0
- data/db/migrate/069_create_marty_import_synonyms.rb +15 -0
- data/db/migrate/070_create_versions.rb +18 -0
- data/db/migrate/071_add_object_changes_column_to_versions.rb +9 -0
- data/db/migrate/072_add_validation_function_to_import_types.rb +6 -0
- data/db/migrate/073_add_preprocess_function_to_import_types.rb +5 -0
- data/db/migrate/090_create_delayed_jobs.rb +22 -0
- data/db/migrate/091_create_marty_promises.rb +36 -0
- data/db/migrate/095_create_marty_tags.rb +14 -0
- data/db/migrate/095_create_marty_tags.rb~ +19 -0
- data/db/migrate/096_add_user_roles_to_import_types.rb +11 -0
- data/db/migrate/097_drop_versions.rb +9 -0
- data/db/migrate/098_create_marty_api_auths.rb +20 -0
- data/db/seeds.rb +48 -0
- data/lib/marty.rb +18 -0
- data/lib/marty.rb~ +13 -0
- data/lib/marty/content_handler.rb +97 -0
- data/lib/marty/content_handler.rb~ +93 -0
- data/lib/marty/data_conversion.rb +298 -0
- data/lib/marty/data_exporter.rb +150 -0
- data/lib/marty/data_exporter.rb~ +137 -0
- data/lib/marty/data_importer.rb +122 -0
- data/lib/marty/data_importer.rb~ +114 -0
- data/lib/marty/data_row_processor.rb~ +206 -0
- data/lib/marty/drop_folder_hook.rb~ +17 -0
- data/lib/marty/engine.rb +10 -0
- data/lib/marty/folder_hook.rb~ +9 -0
- data/lib/marty/lazy_column_loader.rb +57 -0
- data/lib/marty/lazy_column_loader.rb~ +47 -0
- data/lib/marty/mcfly_query.rb +189 -0
- data/lib/marty/mcfly_query.rb~ +188 -0
- data/lib/marty/migrations.rb +108 -0
- data/lib/marty/migrations.rb~ +65 -0
- data/lib/marty/monkey.rb +163 -0
- data/lib/marty/monkey.rb~ +160 -0
- data/lib/marty/permissions.rb +64 -0
- data/lib/marty/permissions.rb~ +69 -0
- data/lib/marty/promise.rb~ +41 -0
- data/lib/marty/promise_job.rb +123 -0
- data/lib/marty/promise_job.rb~ +121 -0
- data/lib/marty/promise_proxy.rb +94 -0
- data/lib/marty/promise_proxy.rb~ +69 -0
- data/lib/marty/railtie.rb +5 -0
- data/lib/marty/relation.rb +39 -0
- data/lib/marty/util.rb +110 -0
- data/lib/marty/util.rb~ +80 -0
- data/lib/marty/version.rb +3 -0
- data/lib/marty/version.rb~ +3 -0
- data/lib/marty/xl.rb +527 -0
- data/lib/marty/xl.rb~ +526 -0
- data/lib/pyxll/README.txt +19 -0
- data/lib/pyxll/README.txt~ +16 -0
- data/lib/pyxll/gemini.py +155 -0
- data/lib/pyxll/gemini.py~ +110 -0
- data/lib/pyxll/pyxll.cfg +12 -0
- data/lib/pyxll/pyxll.cfg~ +12 -0
- data/lib/pyxll/sample.xlsx +0 -0
- data/lib/tasks/marty_tasks.rake +37 -0
- metadata +517 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
class Marty::ComponentsController < Marty::ApplicationController
|
|
2
|
+
# This is useful for individual component testing. Note that the
|
|
3
|
+
# appropriate route needs to be defined.
|
|
4
|
+
# <base_url>/components/<ComponentCamelCaseName>
|
|
5
|
+
def index
|
|
6
|
+
component = params[:component]
|
|
7
|
+
|
|
8
|
+
return redirect_to root_path unless component
|
|
9
|
+
|
|
10
|
+
format, req_disposition, title =
|
|
11
|
+
params[:format], params[:disposition], params[:reptitle]
|
|
12
|
+
|
|
13
|
+
if format && Marty::ContentHandler::GEN_FORMATS.member?(format)
|
|
14
|
+
klass = component.constantize
|
|
15
|
+
|
|
16
|
+
raise "bad component" unless klass < Netzke::Base
|
|
17
|
+
|
|
18
|
+
inst = klass.new
|
|
19
|
+
return unless inst.respond_to?(:export_content)
|
|
20
|
+
|
|
21
|
+
title ||= component
|
|
22
|
+
|
|
23
|
+
res, type, disposition, filename =
|
|
24
|
+
inst.export_content(format, title, params)
|
|
25
|
+
|
|
26
|
+
return send_data(res,
|
|
27
|
+
type: type,
|
|
28
|
+
filename: filename,
|
|
29
|
+
disposition: req_disposition || disposition,
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
cname = component.gsub("::", "_").underscore
|
|
34
|
+
render layout: true,
|
|
35
|
+
inline: "<%= netzke :#{cname}, class_name: '#{component}', height: 650 %>"
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
class Marty::JobController < ActionController::Base
|
|
2
|
+
def download
|
|
3
|
+
job_id = params["job_id"]
|
|
4
|
+
|
|
5
|
+
promise = Marty::Promise.find_by_id(job_id)
|
|
6
|
+
|
|
7
|
+
if promise
|
|
8
|
+
format = promise.cformat
|
|
9
|
+
# somewhat hacky: if result has "result" key, it's used as the
|
|
10
|
+
# content.
|
|
11
|
+
data = promise.result["result"] || promise.result
|
|
12
|
+
title = promise.title
|
|
13
|
+
else
|
|
14
|
+
format = "json"
|
|
15
|
+
data = {error: "Job not found: #{job_id}"}
|
|
16
|
+
title = "error"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
res, type, disposition, filename =
|
|
20
|
+
Marty::ContentHandler.export(data, format, title)
|
|
21
|
+
|
|
22
|
+
send_data(res,
|
|
23
|
+
type: type,
|
|
24
|
+
filename: filename,
|
|
25
|
+
disposition: disposition,
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
class Marty::JobController < ActionController::Base
|
|
2
|
+
def download
|
|
3
|
+
job_id = params["job_id"]
|
|
4
|
+
|
|
5
|
+
promise = Marty::Promise.find_by_id(job_id)
|
|
6
|
+
|
|
7
|
+
if promise
|
|
8
|
+
format = promise.cformat
|
|
9
|
+
# somewhat hacky: if result has "result" key, it's used as the
|
|
10
|
+
# content.
|
|
11
|
+
data = promise.result["result"] || promise.result
|
|
12
|
+
title = promise.title
|
|
13
|
+
else
|
|
14
|
+
format = "json"
|
|
15
|
+
data = {error: "Job not found: #{job_id}"}
|
|
16
|
+
title = "error"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
res, type, disposition, filename =
|
|
20
|
+
Marty::ContentHandler.export(data, format, title)
|
|
21
|
+
|
|
22
|
+
send_data(res,
|
|
23
|
+
type: type,
|
|
24
|
+
filename: filename,
|
|
25
|
+
disposition: disposition,
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
class Marty::RpcController < ActionController::Base
|
|
2
|
+
respond_to :json, :csv
|
|
3
|
+
|
|
4
|
+
def evaluate
|
|
5
|
+
res = do_eval(params["script"],
|
|
6
|
+
params["tag"],
|
|
7
|
+
params["node"],
|
|
8
|
+
params["attrs"] || "[]",
|
|
9
|
+
params["params"] || "{}",
|
|
10
|
+
params["api_key"] || nil,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
respond_to do |format|
|
|
14
|
+
format.json { send_data res.to_json }
|
|
15
|
+
format.csv {
|
|
16
|
+
# SEMI-HACKY: strip outer list if there's only one element.
|
|
17
|
+
res = res[0] if res.is_a?(Array) && res.length==1
|
|
18
|
+
send_data Marty::DataExporter.to_csv(res)
|
|
19
|
+
}
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
private
|
|
25
|
+
|
|
26
|
+
def do_eval(sname, tag, node, attrs, params, api_key)
|
|
27
|
+
return {error: "Bad attrs"} unless attrs.is_a?(String)
|
|
28
|
+
|
|
29
|
+
begin
|
|
30
|
+
attrs = ActiveSupport::JSON.decode(attrs)
|
|
31
|
+
rescue MultiJson::DecodeError
|
|
32
|
+
return {error: "Malformed attrs"}
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
return {error: "Malformed attrs"} unless
|
|
36
|
+
attrs.is_a?(Array) && attrs.all? {|x| x.is_a? String}
|
|
37
|
+
|
|
38
|
+
return {error: "Bad params"} unless params.is_a?(String)
|
|
39
|
+
|
|
40
|
+
begin
|
|
41
|
+
params = ActiveSupport::JSON.decode(params)
|
|
42
|
+
rescue MultiJson::DecodeError
|
|
43
|
+
return {error: "Malformed params"}
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
return {error: "Malformed params"} unless params.is_a?(Hash)
|
|
47
|
+
|
|
48
|
+
return {error: "Permission denied" } unless
|
|
49
|
+
Marty::ApiAuth.authorized?(sname, api_key)
|
|
50
|
+
|
|
51
|
+
begin
|
|
52
|
+
engine = Marty::ScriptSet.new(tag).get_engine(sname)
|
|
53
|
+
rescue => e
|
|
54
|
+
return {error: "Can't get engine: #{sname || 'nil'} with tag: " +
|
|
55
|
+
"#{tag || 'nil'}; message: #{e.message}"}
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
begin
|
|
59
|
+
engine.evaluate_attrs(node, attrs, params)
|
|
60
|
+
rescue => exc
|
|
61
|
+
Delorean::Engine.grok_runtime_exception(exc)
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
class Marty::RpcController < ActionController::Base
|
|
2
|
+
respond_to :json, :csv
|
|
3
|
+
|
|
4
|
+
def evaluate
|
|
5
|
+
res = do_eval(params["script"],
|
|
6
|
+
params["version"],
|
|
7
|
+
params["node"],
|
|
8
|
+
params["attrs"] || "[]",
|
|
9
|
+
params["params"] || "{}",
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
respond_to do |format|
|
|
13
|
+
format.json { send_data res.to_json }
|
|
14
|
+
format.csv {
|
|
15
|
+
# SEMI-HACKY: strip outer list if there's only one element.
|
|
16
|
+
res = res[0] if res.is_a?(Array) && res.length==1
|
|
17
|
+
send_data Marty::DataExporter.to_csv(res)
|
|
18
|
+
}
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
private
|
|
24
|
+
|
|
25
|
+
def do_eval(sname, version, node, attrs, params)
|
|
26
|
+
return {error: "Bad attrs"} if !attrs.is_a?(String)
|
|
27
|
+
|
|
28
|
+
begin
|
|
29
|
+
attrs = ActiveSupport::JSON.decode(attrs)
|
|
30
|
+
rescue MultiJson::DecodeError
|
|
31
|
+
return {error: "Malformed attrs"}
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
return {error: "Malformed attrs"} unless
|
|
35
|
+
attrs.is_a?(Array) && attrs.all? {|x| x.is_a? String}
|
|
36
|
+
|
|
37
|
+
return {error: "Bad params"} if !params.is_a?(String)
|
|
38
|
+
|
|
39
|
+
begin
|
|
40
|
+
params = ActiveSupport::JSON.decode(params)
|
|
41
|
+
rescue MultiJson::DecodeError
|
|
42
|
+
return {error: "Malformed params"}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
return {error: "Malformed params"} unless
|
|
46
|
+
params.is_a?(Hash)
|
|
47
|
+
|
|
48
|
+
script = Marty::Script.find_script(sname, version)
|
|
49
|
+
|
|
50
|
+
return {error: "Can't find #{sname} version #{version}"} unless script
|
|
51
|
+
|
|
52
|
+
engine = Marty::ScriptSet.get_engine(script)
|
|
53
|
+
|
|
54
|
+
begin
|
|
55
|
+
engine.evaluate_attrs(node, attrs, params)
|
|
56
|
+
rescue => exc
|
|
57
|
+
Delorean::Engine.grok_runtime_exception(exc)
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
class Marty::ScriptSet < Delorean::AbstractContainer
|
|
2
|
+
# ScriptSet acts as a process-wide cache for Delorean
|
|
3
|
+
# engines. FIXME: rewrite as Singleton.
|
|
4
|
+
|
|
5
|
+
attr_reader :tag
|
|
6
|
+
|
|
7
|
+
def self.clear_cache
|
|
8
|
+
@@engines, @@dengines, @@dengines_dt = {}, {}, nil
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
clear_cache
|
|
12
|
+
|
|
13
|
+
def initialize(tag=nil)
|
|
14
|
+
@tag = Marty::Tag.map_to_tag(tag)
|
|
15
|
+
super()
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def parse_check(sname, body)
|
|
19
|
+
engine = Delorean::Engine.new(sname, self)
|
|
20
|
+
engine.parse(body)
|
|
21
|
+
engine
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def get_engine(sname)
|
|
25
|
+
raise "bad sname #{sname}" unless sname.is_a?(String)
|
|
26
|
+
|
|
27
|
+
if tag.isdev?
|
|
28
|
+
# FIXME: there are race conditions here if a script changes in
|
|
29
|
+
# the middle of a DEV import sequence. But, DEV imports are
|
|
30
|
+
# hacky/rare anyway. So, don't bother for now.
|
|
31
|
+
|
|
32
|
+
max_dt = Marty::Script.
|
|
33
|
+
order("created_dt DESC").limit(1).pluck(:created_dt).first
|
|
34
|
+
|
|
35
|
+
@@dengines_dt ||= max_dt
|
|
36
|
+
|
|
37
|
+
# reset dengine cache if a script has changed
|
|
38
|
+
@@dengines = {} if max_dt > @@dengines_dt
|
|
39
|
+
|
|
40
|
+
engine = @@dengines[sname]
|
|
41
|
+
|
|
42
|
+
return engine if engine
|
|
43
|
+
|
|
44
|
+
script = Marty::Script.find_script(sname, tag) || raise("No such script")
|
|
45
|
+
|
|
46
|
+
@@dengines[sname] = parse_check(sname, script.body)
|
|
47
|
+
else
|
|
48
|
+
engine = @@engines[[tag.id, sname]]
|
|
49
|
+
|
|
50
|
+
return engine if engine
|
|
51
|
+
|
|
52
|
+
script = Marty::Script.find_script(sname, tag) || raise("No such script")
|
|
53
|
+
|
|
54
|
+
@@engines[[tag.id, sname]] = parse_check(sname, script.body)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
class Marty::ScriptSet < Delorean::AbstractContainer
|
|
2
|
+
# ScriptSet acts as a process-wide cache for Delorean
|
|
3
|
+
# engines. FIXME: rewrite as Singleton.
|
|
4
|
+
|
|
5
|
+
@@engines, @@dengines, @@dengines_dt = {}, {}, nil
|
|
6
|
+
|
|
7
|
+
attr_reader :tag
|
|
8
|
+
|
|
9
|
+
def self.clear_cache
|
|
10
|
+
@@engines, @@dengines, @@dengines_dt = {}, {}, nil
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def initialize(tag=nil)
|
|
14
|
+
@tag = Marty::Tag.map_to_tag(tag)
|
|
15
|
+
super()
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def parse_check(sname, body)
|
|
19
|
+
engine = Delorean::Engine.new(sname, self)
|
|
20
|
+
engine.parse(body)
|
|
21
|
+
engine
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def get_engine(sname)
|
|
25
|
+
raise "bad sname #{sname}" unless sname.is_a?(String)
|
|
26
|
+
|
|
27
|
+
script = Marty::Script.find_script(sname, tag)
|
|
28
|
+
|
|
29
|
+
raise "No such script" unless script
|
|
30
|
+
|
|
31
|
+
if tag.isdev?
|
|
32
|
+
# FIXME: there are race conditions here if a script changes in
|
|
33
|
+
# the middle of a DEV import sequence. But, DEV imports are
|
|
34
|
+
# hacky/rare anyway. So, don't bother for now.
|
|
35
|
+
|
|
36
|
+
max_dt = Marty::Script.
|
|
37
|
+
where("created_dt <> 'infinity'").
|
|
38
|
+
order("created_dt DESC").limit(1).pluck(:created_dt).first
|
|
39
|
+
|
|
40
|
+
@@dengines_dt ||= max_dt
|
|
41
|
+
|
|
42
|
+
# reset dengine cache if a script has changed
|
|
43
|
+
@@dengines = {} if max_dt > @@dengines_dt
|
|
44
|
+
|
|
45
|
+
engine = @@dengines[sname]
|
|
46
|
+
|
|
47
|
+
return engine if engine
|
|
48
|
+
|
|
49
|
+
@@dengines[sname] = engine = parse_check(sname, script.body)
|
|
50
|
+
else
|
|
51
|
+
engine = @@engines[[tag.id, sname]]
|
|
52
|
+
|
|
53
|
+
return engine if engine
|
|
54
|
+
|
|
55
|
+
@@engines[[tag.id, sname]] = engine = parse_check(sname, script.body)
|
|
56
|
+
end
|
|
57
|
+
engine
|
|
58
|
+
end
|
|
59
|
+
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
require 'mcfly'
|
|
2
|
+
|
|
3
|
+
class Marty::ApiAuth < Marty::Base
|
|
4
|
+
has_mcfly
|
|
5
|
+
|
|
6
|
+
KEY_SIZE = 19
|
|
7
|
+
|
|
8
|
+
def self.generate_key
|
|
9
|
+
SecureRandom.hex(KEY_SIZE)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
class ApiAuthValidator < ActiveModel::Validator
|
|
13
|
+
def validate(api)
|
|
14
|
+
api.errors[:base] =
|
|
15
|
+
"API Key length must be #{KEY_SIZE*2}" if
|
|
16
|
+
api.api_key && api.api_key.length != KEY_SIZE*2
|
|
17
|
+
|
|
18
|
+
api.errors[:base] =
|
|
19
|
+
"Script Name must reference a valid script" if
|
|
20
|
+
Marty::Script.find_script(api.script_name, nil).nil?
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
before_validation do
|
|
25
|
+
self.api_key = Marty::ApiAuth.generate_key if
|
|
26
|
+
self.api_key.nil? || self.api_key.length == 0
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
validates_presence_of :app_name, :api_key, :script_name
|
|
30
|
+
|
|
31
|
+
validates_with ApiAuthValidator
|
|
32
|
+
|
|
33
|
+
mcfly_validates_uniqueness_of :api_key, scope: [:script_name]
|
|
34
|
+
validates_uniqueness_of :app_name, scope: [:script_name,
|
|
35
|
+
:obsoleted_dt]
|
|
36
|
+
|
|
37
|
+
def self.authorized?(script_name, api_key)
|
|
38
|
+
is_secured = where(script_name: script_name,
|
|
39
|
+
obsoleted_dt: 'infinity').exists?
|
|
40
|
+
!is_secured || where(api_key: api_key,
|
|
41
|
+
script_name: script_name,
|
|
42
|
+
obsoleted_dt: 'infinity').exists?
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
require 'mcfly'
|
|
2
|
+
|
|
3
|
+
class Marty::ApiAuth < Marty::Base
|
|
4
|
+
has_mcfly
|
|
5
|
+
|
|
6
|
+
KEY_SIZE = 19
|
|
7
|
+
|
|
8
|
+
def self.generate_key
|
|
9
|
+
SecureRandom.hex(KEY_SIZE)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
class ApiAuthValidator < ActiveModel::Validator
|
|
13
|
+
def validate(api)
|
|
14
|
+
api.errors[:base] =
|
|
15
|
+
"API Key length must be #{KEY_SIZE*2}" if
|
|
16
|
+
api.api_key && api.api_key.length != KEY_SIZE*2
|
|
17
|
+
|
|
18
|
+
api.errors[:base] =
|
|
19
|
+
"Script Name must reference a valid script" if
|
|
20
|
+
Marty::Script.find_script(api.script_name, nil).nil?
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
before_validation do
|
|
25
|
+
self.api_key = Marty::ApiAuth.generate_key if
|
|
26
|
+
self.api_key.nil? || self.api_key.length == 0
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
<<<<<<< HEAD
|
|
30
|
+
# attr_accessible :app_name, :api_key, :script_name
|
|
31
|
+
=======
|
|
32
|
+
>>>>>>> master
|
|
33
|
+
validates_presence_of :app_name, :api_key, :script_name
|
|
34
|
+
|
|
35
|
+
validates_with ApiAuthValidator
|
|
36
|
+
|
|
37
|
+
mcfly_validates_uniqueness_of :api_key, scope: [:script_name]
|
|
38
|
+
validates_uniqueness_of :app_name, scope: [:script_name,
|
|
39
|
+
:obsoleted_dt]
|
|
40
|
+
|
|
41
|
+
def self.authorized?(script_name, api_key)
|
|
42
|
+
is_secured = where(script_name: script_name,
|
|
43
|
+
obsoleted_dt: 'infinity').exists?
|
|
44
|
+
!is_secured || where(api_key: api_key,
|
|
45
|
+
script_name: script_name,
|
|
46
|
+
obsoleted_dt: 'infinity').exists?
|
|
47
|
+
end
|
|
48
|
+
end
|