stylish 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +7 -10
- data/ARCHITECTURE.md +96 -0
- data/Gemfile +8 -0
- data/README.md +25 -29
- data/Rakefile +24 -0
- data/bin/stylish +33 -0
- data/lib/stylish.rb +36 -1
- data/lib/stylish/configuration.rb +37 -0
- data/lib/stylish/core_ext.rb +20 -0
- data/lib/stylish/developer.rb +13 -0
- data/lib/stylish/developer/config.rb +19 -0
- data/lib/stylish/developer/environment.rb +75 -0
- data/lib/stylish/developer/listing.rb +85 -0
- data/lib/stylish/developer/model_delegator.rb +51 -0
- data/lib/stylish/developer/modification.rb +139 -0
- data/lib/stylish/developer/path.rb +168 -0
- data/lib/stylish/developer/route.rb +97 -0
- data/lib/stylish/developer/server.rb +40 -0
- data/lib/stylish/engine.rb +12 -0
- data/lib/stylish/fs.rb +59 -0
- data/lib/stylish/manifest.rb +100 -0
- data/lib/stylish/models.rb +119 -0
- data/lib/stylish/models/component.rb +19 -0
- data/lib/stylish/models/layout.rb +19 -0
- data/lib/stylish/models/library.rb +134 -0
- data/lib/stylish/models/package.rb +156 -0
- data/lib/stylish/models/script.rb +10 -0
- data/lib/stylish/models/stylesheet.rb +9 -0
- data/lib/stylish/models/template.rb +9 -0
- data/lib/stylish/models/theme.rb +8 -0
- data/lib/stylish/util.rb +20 -0
- data/lib/stylish/version.rb +1 -1
- data/library/config.json +4 -0
- data/library/second-theme/manifest.json +8 -0
- data/library/second-theme/manifest.yml +6 -0
- data/library/second-theme/templates/footers/footer-01.html +3 -0
- data/library/second-theme/templates/footers/footer-02.html +3 -0
- data/library/second-theme/templates/headers/header-01.html +3 -0
- data/library/second-theme/templates/headers/header-02.html +3 -0
- data/library/second-theme/templates/landing-page-blocks/landing-page-block-01.html +3 -0
- data/library/second-theme/templates/landing-page-blocks/landing-page-block-02.html +3 -0
- data/library/test-theme/components/footers/footer-01.json +5 -0
- data/library/test-theme/components/footers/footer-02.json +5 -0
- data/library/test-theme/components/headers/header-01.json +5 -0
- data/library/test-theme/components/headers/header-02.json +5 -0
- data/library/test-theme/components/landing-page-blocks/landing-page-01.json +5 -0
- data/library/test-theme/components/landing-page-blocks/landing-page-02.json +5 -0
- data/library/test-theme/manifest.json +8 -0
- data/library/test-theme/manifest.yml +6 -0
- data/library/test-theme/pages/page-01.json +11 -0
- data/library/test-theme/templates/footers/footer-01.html +3 -0
- data/library/test-theme/templates/footers/footer-02.html +3 -0
- data/library/test-theme/templates/headers/header-01.html +3 -0
- data/library/test-theme/templates/headers/header-02.html +3 -0
- data/library/test-theme/templates/landing-page-blocks/landing-page-block-01.html +3 -0
- data/library/test-theme/templates/landing-page-blocks/landing-page-block-02.html +3 -0
- data/library/test-theme/templates/layouts/standard-layout.html +10 -0
- data/spec/acceptance/listing_assets_spec.rb +20 -0
- data/spec/acceptance/model_browsing_spec.rb +21 -0
- data/spec/acceptance/model_creation_spec.rb +16 -0
- data/spec/acceptance/model_deleting_spec.rb +10 -0
- data/spec/acceptance/model_updating_spec.rb +12 -0
- data/spec/acceptance/modifying_assets_spec.rb +50 -0
- data/spec/acceptance/server_info_spec.rb +10 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/images/.keep +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/javascripts/test.coffee +4 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/assets/stylesheets/test.css.scss +6 -0
- data/spec/dummy/app/assets/stylesheets/writable/existing.scss.css +0 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/controllers/concerns/.keep +0 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/mailers/.keep +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +30 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +82 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/assets.rb +8 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/migrate/20140822065900_create_books.rb +11 -0
- data/spec/dummy/db/migrate/20140822065916_create_authors.rb +9 -0
- data/spec/dummy/db/migrate/20140824215902_create_users.rb +10 -0
- data/spec/dummy/db/migrate/20140826193259_create_libraries.rb +10 -0
- data/spec/dummy/db/schema.rb +37 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/lib/assets/.keep +0 -0
- data/spec/dummy/log/.keep +0 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/fixtures/config.json +3 -0
- data/spec/fixtures/test-theme/components/footers/footer-01.json +5 -0
- data/spec/fixtures/test-theme/components/footers/footer-02.json +5 -0
- data/spec/fixtures/test-theme/components/headers/header-01.json +5 -0
- data/spec/fixtures/test-theme/components/headers/header-02.json +5 -0
- data/spec/fixtures/test-theme/components/landing-page-blocks/landing-page-01.json +5 -0
- data/spec/fixtures/test-theme/components/landing-page-blocks/landing-page-02.json +5 -0
- data/spec/fixtures/test-theme/manifest.json +8 -0
- data/spec/fixtures/test-theme/manifest.yml +6 -0
- data/spec/fixtures/test-theme/pages/page-01.json +11 -0
- data/spec/fixtures/test-theme/templates/footers/footer-01.html +3 -0
- data/spec/fixtures/test-theme/templates/footers/footer-02.html +3 -0
- data/spec/fixtures/test-theme/templates/headers/header-01.html +3 -0
- data/spec/fixtures/test-theme/templates/headers/header-02.html +3 -0
- data/spec/fixtures/test-theme/templates/landing-page-blocks/landing-page-block-01.html +3 -0
- data/spec/fixtures/test-theme/templates/landing-page-blocks/landing-page-block-02.html +3 -0
- data/spec/fixtures/test-theme/templates/layouts/standard-01.html +9 -0
- data/spec/lib/stylish/configuration_spec.rb +8 -0
- data/spec/lib/stylish/developer/path_spec.rb +36 -0
- data/spec/lib/stylish/developer/route_spec.rb +5 -0
- data/spec/lib/stylish/manifest_spec.rb +48 -0
- data/spec/lib/stylish/models/library_spec.rb +38 -0
- data/spec/lib/stylish/models/package_spec.rb +35 -0
- data/spec/lib/stylish/models_spec.rb +12 -0
- data/spec/spec_helper.rb +38 -0
- data/spec/support/json_helper.rb +7 -0
- data/spec/test.css.scss +6 -0
- data/stylish.gemspec +17 -2
- data/support/editor-app/.gitignore +2 -0
- data/support/editor-app/development/bower.json +9 -0
- data/support/editor-app/development/package.json +28 -0
- data/support/editor-app/development/semantic/components/accordion.css +257 -0
- data/support/editor-app/development/semantic/components/accordion.js +558 -0
- data/support/editor-app/development/semantic/components/accordion.min.css +11 -0
- data/support/editor-app/development/semantic/components/accordion.min.js +11 -0
- data/support/editor-app/development/semantic/components/ad.css +277 -0
- data/support/editor-app/development/semantic/components/ad.min.css +11 -0
- data/support/editor-app/development/semantic/components/api.js +851 -0
- data/support/editor-app/development/semantic/components/api.min.js +11 -0
- data/support/editor-app/development/semantic/components/breadcrumb.css +125 -0
- data/support/editor-app/development/semantic/components/breadcrumb.min.css +11 -0
- data/support/editor-app/development/semantic/components/button.css +2391 -0
- data/support/editor-app/development/semantic/components/button.min.css +11 -0
- data/support/editor-app/development/semantic/components/card.css +758 -0
- data/support/editor-app/development/semantic/components/card.min.css +11 -0
- data/support/editor-app/development/semantic/components/checkbox.css +514 -0
- data/support/editor-app/development/semantic/components/checkbox.js +507 -0
- data/support/editor-app/development/semantic/components/checkbox.min.css +11 -0
- data/support/editor-app/development/semantic/components/checkbox.min.js +11 -0
- data/support/editor-app/development/semantic/components/comment.css +260 -0
- data/support/editor-app/development/semantic/components/comment.min.css +11 -0
- data/support/editor-app/development/semantic/components/dimmer.css +187 -0
- data/support/editor-app/development/semantic/components/dimmer.js +627 -0
- data/support/editor-app/development/semantic/components/dimmer.min.css +11 -0
- data/support/editor-app/development/semantic/components/dimmer.min.js +11 -0
- data/support/editor-app/development/semantic/components/divider.css +244 -0
- data/support/editor-app/development/semantic/components/divider.min.css +11 -0
- data/support/editor-app/development/semantic/components/dropdown.css +1085 -0
- data/support/editor-app/development/semantic/components/dropdown.js +1757 -0
- data/support/editor-app/development/semantic/components/dropdown.min.css +11 -0
- data/support/editor-app/development/semantic/components/dropdown.min.js +11 -0
- data/support/editor-app/development/semantic/components/feed.css +277 -0
- data/support/editor-app/development/semantic/components/feed.min.css +11 -0
- data/support/editor-app/development/semantic/components/flag.css +1017 -0
- data/support/editor-app/development/semantic/components/flag.min.css +11 -0
- data/support/editor-app/development/semantic/components/form.css +875 -0
- data/support/editor-app/development/semantic/components/form.js +1039 -0
- data/support/editor-app/development/semantic/components/form.min.css +11 -0
- data/support/editor-app/development/semantic/components/form.min.js +11 -0
- data/support/editor-app/development/semantic/components/grid.css +1816 -0
- data/support/editor-app/development/semantic/components/grid.min.css +11 -0
- data/support/editor-app/development/semantic/components/header.css +572 -0
- data/support/editor-app/development/semantic/components/header.min.css +11 -0
- data/support/editor-app/development/semantic/components/icon.css +2127 -0
- data/support/editor-app/development/semantic/components/icon.min.css +11 -0
- data/support/editor-app/development/semantic/components/image.css +275 -0
- data/support/editor-app/development/semantic/components/image.min.css +11 -0
- data/support/editor-app/development/semantic/components/input.css +455 -0
- data/support/editor-app/development/semantic/components/input.min.css +11 -0
- data/support/editor-app/development/semantic/components/item.css +458 -0
- data/support/editor-app/development/semantic/components/item.min.css +11 -0
- data/support/editor-app/development/semantic/components/label.css +930 -0
- data/support/editor-app/development/semantic/components/label.min.css +11 -0
- data/support/editor-app/development/semantic/components/list.css +879 -0
- data/support/editor-app/development/semantic/components/list.min.css +11 -0
- data/support/editor-app/development/semantic/components/loader.css +279 -0
- data/support/editor-app/development/semantic/components/loader.min.css +11 -0
- data/support/editor-app/development/semantic/components/menu.css +1596 -0
- data/support/editor-app/development/semantic/components/menu.min.css +11 -0
- data/support/editor-app/development/semantic/components/message.css +422 -0
- data/support/editor-app/development/semantic/components/message.min.css +11 -0
- data/support/editor-app/development/semantic/components/modal.css +431 -0
- data/support/editor-app/development/semantic/components/modal.js +860 -0
- data/support/editor-app/development/semantic/components/modal.min.css +11 -0
- data/support/editor-app/development/semantic/components/modal.min.js +11 -0
- data/support/editor-app/development/semantic/components/nag.css +149 -0
- data/support/editor-app/development/semantic/components/nag.js +477 -0
- data/support/editor-app/development/semantic/components/nag.min.css +11 -0
- data/support/editor-app/development/semantic/components/nag.min.js +11 -0
- data/support/editor-app/development/semantic/components/popup.css +294 -0
- data/support/editor-app/development/semantic/components/popup.js +1187 -0
- data/support/editor-app/development/semantic/components/popup.min.css +11 -0
- data/support/editor-app/development/semantic/components/popup.min.js +11 -0
- data/support/editor-app/development/semantic/components/progress.css +449 -0
- data/support/editor-app/development/semantic/components/progress.js +785 -0
- data/support/editor-app/development/semantic/components/progress.min.css +11 -0
- data/support/editor-app/development/semantic/components/progress.min.js +11 -0
- data/support/editor-app/development/semantic/components/rail.css +125 -0
- data/support/editor-app/development/semantic/components/rail.min.css +11 -0
- data/support/editor-app/development/semantic/components/rating.css +262 -0
- data/support/editor-app/development/semantic/components/rating.js +451 -0
- data/support/editor-app/development/semantic/components/rating.min.css +11 -0
- data/support/editor-app/development/semantic/components/rating.min.js +11 -0
- data/support/editor-app/development/semantic/components/reset.css +430 -0
- data/support/editor-app/development/semantic/components/reset.min.css +11 -0
- data/support/editor-app/development/semantic/components/reveal.css +294 -0
- data/support/editor-app/development/semantic/components/reveal.min.css +11 -0
- data/support/editor-app/development/semantic/components/search.css +330 -0
- data/support/editor-app/development/semantic/components/search.js +1055 -0
- data/support/editor-app/development/semantic/components/search.min.css +11 -0
- data/support/editor-app/development/semantic/components/search.min.js +11 -0
- data/support/editor-app/development/semantic/components/segment.css +590 -0
- data/support/editor-app/development/semantic/components/segment.min.css +11 -0
- data/support/editor-app/development/semantic/components/shape.css +155 -0
- data/support/editor-app/development/semantic/components/shape.js +830 -0
- data/support/editor-app/development/semantic/components/shape.min.css +11 -0
- data/support/editor-app/development/semantic/components/shape.min.js +11 -0
- data/support/editor-app/development/semantic/components/sidebar.css +621 -0
- data/support/editor-app/development/semantic/components/sidebar.js +1084 -0
- data/support/editor-app/development/semantic/components/sidebar.min.css +11 -0
- data/support/editor-app/development/semantic/components/sidebar.min.js +11 -0
- data/support/editor-app/development/semantic/components/site.css +147 -0
- data/support/editor-app/development/semantic/components/site.js +487 -0
- data/support/editor-app/development/semantic/components/site.min.css +11 -0
- data/support/editor-app/development/semantic/components/site.min.js +11 -0
- data/support/editor-app/development/semantic/components/state.js +690 -0
- data/support/editor-app/development/semantic/components/state.min.js +11 -0
- data/support/editor-app/development/semantic/components/statistic.css +410 -0
- data/support/editor-app/development/semantic/components/statistic.min.css +11 -0
- data/support/editor-app/development/semantic/components/step.css +433 -0
- data/support/editor-app/development/semantic/components/step.min.css +11 -0
- data/support/editor-app/development/semantic/components/sticky.css +80 -0
- data/support/editor-app/development/semantic/components/sticky.js +775 -0
- data/support/editor-app/development/semantic/components/sticky.min.css +11 -0
- data/support/editor-app/development/semantic/components/sticky.min.js +11 -0
- data/support/editor-app/development/semantic/components/tab.css +93 -0
- data/support/editor-app/development/semantic/components/tab.js +787 -0
- data/support/editor-app/development/semantic/components/tab.min.css +11 -0
- data/support/editor-app/development/semantic/components/tab.min.js +11 -0
- data/support/editor-app/development/semantic/components/table.css +999 -0
- data/support/editor-app/development/semantic/components/table.min.css +11 -0
- data/support/editor-app/development/semantic/components/transition.css +2152 -0
- data/support/editor-app/development/semantic/components/transition.js +936 -0
- data/support/editor-app/development/semantic/components/transition.min.css +11 -0
- data/support/editor-app/development/semantic/components/transition.min.js +11 -0
- data/support/editor-app/development/semantic/components/video.css +126 -0
- data/support/editor-app/development/semantic/components/video.js +540 -0
- data/support/editor-app/development/semantic/components/video.min.css +11 -0
- data/support/editor-app/development/semantic/components/video.min.js +11 -0
- data/support/editor-app/development/semantic/components/visibility.js +970 -0
- data/support/editor-app/development/semantic/components/visibility.min.js +11 -0
- data/support/editor-app/development/semantic/semantic.css +31768 -0
- data/support/editor-app/development/semantic/semantic.js +18317 -0
- data/support/editor-app/development/semantic/semantic.min.css +11 -0
- data/support/editor-app/development/semantic/semantic.min.js +17 -0
- data/support/editor-app/development/semantic/themes/basic/assets/fonts/icons.eot +0 -0
- data/support/editor-app/development/semantic/themes/basic/assets/fonts/icons.svg +450 -0
- data/support/editor-app/development/semantic/themes/basic/assets/fonts/icons.ttf +0 -0
- data/support/editor-app/development/semantic/themes/basic/assets/fonts/icons.woff +0 -0
- data/support/editor-app/development/semantic/themes/default/assets/fonts/icons.eot +0 -0
- data/support/editor-app/development/semantic/themes/default/assets/fonts/icons.otf +0 -0
- data/support/editor-app/development/semantic/themes/default/assets/fonts/icons.svg +504 -0
- data/support/editor-app/development/semantic/themes/default/assets/fonts/icons.ttf +0 -0
- data/support/editor-app/development/semantic/themes/default/assets/fonts/icons.woff +0 -0
- data/support/editor-app/development/semantic/themes/default/assets/images/flags.png +0 -0
- data/support/editor-app/development/src/apis/index.coffee +35 -0
- data/support/editor-app/development/src/components/editor.cjsx +58 -0
- data/support/editor-app/development/src/components/editor_drawer.cjsx +7 -0
- data/support/editor-app/development/src/components/header.cjsx +12 -0
- data/support/editor-app/development/src/components/index.coffee +9 -0
- data/support/editor-app/development/src/components/menus/icon_grid.cjsx +0 -0
- data/support/editor-app/development/src/components/sidebar.cjsx +24 -0
- data/support/editor-app/development/src/components/tiled_grid.cjsx +35 -0
- data/support/editor-app/development/src/index.cjsx +82 -0
- data/support/editor-app/development/src/lib/util.coffee +48 -0
- data/support/editor-app/development/src/pages/home.cjsx +46 -0
- data/support/editor-app/development/src/pages/index.coffee +6 -0
- data/support/editor-app/development/src/pages/package_details.cjsx +55 -0
- data/support/editor-app/development/src/registry.coffee +35 -0
- data/support/editor-app/development/src/styles/components/tiled_grid.css.scss +5 -0
- data/support/editor-app/development/src/styles/index.css.scss +240 -0
- data/support/editor-app/development/src/sugar.cjsx +126 -0
- data/support/editor-app/development/webpack.config.js +53 -0
- data/support/editor-app/dist/base.css +0 -0
- data/support/editor-app/dist/toolit.js +62 -0
- data/support/editor-app/dist/toolkit.js +44573 -0
- data/support/editor-app/index.html +50 -0
- data/support/editor-app/package.json +15 -0
- data/support/editor-app/semantic/components/accordion.css +257 -0
- data/support/editor-app/semantic/components/accordion.js +558 -0
- data/support/editor-app/semantic/components/accordion.min.css +11 -0
- data/support/editor-app/semantic/components/accordion.min.js +11 -0
- data/support/editor-app/semantic/components/ad.css +277 -0
- data/support/editor-app/semantic/components/ad.min.css +11 -0
- data/support/editor-app/semantic/components/api.js +851 -0
- data/support/editor-app/semantic/components/api.min.js +11 -0
- data/support/editor-app/semantic/components/breadcrumb.css +125 -0
- data/support/editor-app/semantic/components/breadcrumb.min.css +11 -0
- data/support/editor-app/semantic/components/button.css +2391 -0
- data/support/editor-app/semantic/components/button.min.css +11 -0
- data/support/editor-app/semantic/components/card.css +758 -0
- data/support/editor-app/semantic/components/card.min.css +11 -0
- data/support/editor-app/semantic/components/checkbox.css +514 -0
- data/support/editor-app/semantic/components/checkbox.js +507 -0
- data/support/editor-app/semantic/components/checkbox.min.css +11 -0
- data/support/editor-app/semantic/components/checkbox.min.js +11 -0
- data/support/editor-app/semantic/components/comment.css +260 -0
- data/support/editor-app/semantic/components/comment.min.css +11 -0
- data/support/editor-app/semantic/components/dimmer.css +187 -0
- data/support/editor-app/semantic/components/dimmer.js +627 -0
- data/support/editor-app/semantic/components/dimmer.min.css +11 -0
- data/support/editor-app/semantic/components/dimmer.min.js +11 -0
- data/support/editor-app/semantic/components/divider.css +244 -0
- data/support/editor-app/semantic/components/divider.min.css +11 -0
- data/support/editor-app/semantic/components/dropdown.css +1085 -0
- data/support/editor-app/semantic/components/dropdown.js +1757 -0
- data/support/editor-app/semantic/components/dropdown.min.css +11 -0
- data/support/editor-app/semantic/components/dropdown.min.js +11 -0
- data/support/editor-app/semantic/components/feed.css +277 -0
- data/support/editor-app/semantic/components/feed.min.css +11 -0
- data/support/editor-app/semantic/components/flag.css +1017 -0
- data/support/editor-app/semantic/components/flag.min.css +11 -0
- data/support/editor-app/semantic/components/form.css +875 -0
- data/support/editor-app/semantic/components/form.js +1039 -0
- data/support/editor-app/semantic/components/form.min.css +11 -0
- data/support/editor-app/semantic/components/form.min.js +11 -0
- data/support/editor-app/semantic/components/grid.css +1816 -0
- data/support/editor-app/semantic/components/grid.min.css +11 -0
- data/support/editor-app/semantic/components/header.css +572 -0
- data/support/editor-app/semantic/components/header.min.css +11 -0
- data/support/editor-app/semantic/components/icon.css +2127 -0
- data/support/editor-app/semantic/components/icon.min.css +11 -0
- data/support/editor-app/semantic/components/image.css +275 -0
- data/support/editor-app/semantic/components/image.min.css +11 -0
- data/support/editor-app/semantic/components/input.css +455 -0
- data/support/editor-app/semantic/components/input.min.css +11 -0
- data/support/editor-app/semantic/components/item.css +458 -0
- data/support/editor-app/semantic/components/item.min.css +11 -0
- data/support/editor-app/semantic/components/label.css +930 -0
- data/support/editor-app/semantic/components/label.min.css +11 -0
- data/support/editor-app/semantic/components/list.css +879 -0
- data/support/editor-app/semantic/components/list.min.css +11 -0
- data/support/editor-app/semantic/components/loader.css +279 -0
- data/support/editor-app/semantic/components/loader.min.css +11 -0
- data/support/editor-app/semantic/components/menu.css +1596 -0
- data/support/editor-app/semantic/components/menu.min.css +11 -0
- data/support/editor-app/semantic/components/message.css +422 -0
- data/support/editor-app/semantic/components/message.min.css +11 -0
- data/support/editor-app/semantic/components/modal.css +431 -0
- data/support/editor-app/semantic/components/modal.js +860 -0
- data/support/editor-app/semantic/components/modal.min.css +11 -0
- data/support/editor-app/semantic/components/modal.min.js +11 -0
- data/support/editor-app/semantic/components/nag.css +149 -0
- data/support/editor-app/semantic/components/nag.js +477 -0
- data/support/editor-app/semantic/components/nag.min.css +11 -0
- data/support/editor-app/semantic/components/nag.min.js +11 -0
- data/support/editor-app/semantic/components/popup.css +294 -0
- data/support/editor-app/semantic/components/popup.js +1187 -0
- data/support/editor-app/semantic/components/popup.min.css +11 -0
- data/support/editor-app/semantic/components/popup.min.js +11 -0
- data/support/editor-app/semantic/components/progress.css +449 -0
- data/support/editor-app/semantic/components/progress.js +785 -0
- data/support/editor-app/semantic/components/progress.min.css +11 -0
- data/support/editor-app/semantic/components/progress.min.js +11 -0
- data/support/editor-app/semantic/components/rail.css +125 -0
- data/support/editor-app/semantic/components/rail.min.css +11 -0
- data/support/editor-app/semantic/components/rating.css +262 -0
- data/support/editor-app/semantic/components/rating.js +451 -0
- data/support/editor-app/semantic/components/rating.min.css +11 -0
- data/support/editor-app/semantic/components/rating.min.js +11 -0
- data/support/editor-app/semantic/components/reset.css +430 -0
- data/support/editor-app/semantic/components/reset.min.css +11 -0
- data/support/editor-app/semantic/components/reveal.css +294 -0
- data/support/editor-app/semantic/components/reveal.min.css +11 -0
- data/support/editor-app/semantic/components/search.css +330 -0
- data/support/editor-app/semantic/components/search.js +1055 -0
- data/support/editor-app/semantic/components/search.min.css +11 -0
- data/support/editor-app/semantic/components/search.min.js +11 -0
- data/support/editor-app/semantic/components/segment.css +590 -0
- data/support/editor-app/semantic/components/segment.min.css +11 -0
- data/support/editor-app/semantic/components/shape.css +155 -0
- data/support/editor-app/semantic/components/shape.js +830 -0
- data/support/editor-app/semantic/components/shape.min.css +11 -0
- data/support/editor-app/semantic/components/shape.min.js +11 -0
- data/support/editor-app/semantic/components/sidebar.css +621 -0
- data/support/editor-app/semantic/components/sidebar.js +1084 -0
- data/support/editor-app/semantic/components/sidebar.min.css +11 -0
- data/support/editor-app/semantic/components/sidebar.min.js +11 -0
- data/support/editor-app/semantic/components/site.css +147 -0
- data/support/editor-app/semantic/components/site.js +487 -0
- data/support/editor-app/semantic/components/site.min.css +11 -0
- data/support/editor-app/semantic/components/site.min.js +11 -0
- data/support/editor-app/semantic/components/state.js +690 -0
- data/support/editor-app/semantic/components/state.min.js +11 -0
- data/support/editor-app/semantic/components/statistic.css +410 -0
- data/support/editor-app/semantic/components/statistic.min.css +11 -0
- data/support/editor-app/semantic/components/step.css +433 -0
- data/support/editor-app/semantic/components/step.min.css +11 -0
- data/support/editor-app/semantic/components/sticky.css +80 -0
- data/support/editor-app/semantic/components/sticky.js +775 -0
- data/support/editor-app/semantic/components/sticky.min.css +11 -0
- data/support/editor-app/semantic/components/sticky.min.js +11 -0
- data/support/editor-app/semantic/components/tab.css +93 -0
- data/support/editor-app/semantic/components/tab.js +787 -0
- data/support/editor-app/semantic/components/tab.min.css +11 -0
- data/support/editor-app/semantic/components/tab.min.js +11 -0
- data/support/editor-app/semantic/components/table.css +999 -0
- data/support/editor-app/semantic/components/table.min.css +11 -0
- data/support/editor-app/semantic/components/transition.css +2152 -0
- data/support/editor-app/semantic/components/transition.js +936 -0
- data/support/editor-app/semantic/components/transition.min.css +11 -0
- data/support/editor-app/semantic/components/transition.min.js +11 -0
- data/support/editor-app/semantic/components/video.css +126 -0
- data/support/editor-app/semantic/components/video.js +540 -0
- data/support/editor-app/semantic/components/video.min.css +11 -0
- data/support/editor-app/semantic/components/video.min.js +11 -0
- data/support/editor-app/semantic/components/visibility.js +970 -0
- data/support/editor-app/semantic/components/visibility.min.js +11 -0
- data/support/editor-app/semantic/semantic.css +31768 -0
- data/support/editor-app/semantic/semantic.js +18317 -0
- data/support/editor-app/semantic/semantic.min.css +11 -0
- data/support/editor-app/semantic/semantic.min.js +17 -0
- data/support/editor-app/semantic/themes/basic/assets/fonts/icons.eot +0 -0
- data/support/editor-app/semantic/themes/basic/assets/fonts/icons.svg +450 -0
- data/support/editor-app/semantic/themes/basic/assets/fonts/icons.ttf +0 -0
- data/support/editor-app/semantic/themes/basic/assets/fonts/icons.woff +0 -0
- data/support/editor-app/semantic/themes/default/assets/fonts/icons.eot +0 -0
- data/support/editor-app/semantic/themes/default/assets/fonts/icons.otf +0 -0
- data/support/editor-app/semantic/themes/default/assets/fonts/icons.svg +504 -0
- data/support/editor-app/semantic/themes/default/assets/fonts/icons.ttf +0 -0
- data/support/editor-app/semantic/themes/default/assets/fonts/icons.woff +0 -0
- data/support/editor-app/semantic/themes/default/assets/images/flags.png +0 -0
- data/support/editor-app/vendor/jquery.js +8829 -0
- data/support/library-server/Gemfile +0 -0
- data/support/library-server/config.ru +4 -0
- metadata +740 -7
@@ -0,0 +1,85 @@
|
|
1
|
+
module Stylish
|
2
|
+
module Developer
|
3
|
+
class Listing
|
4
|
+
attr_reader :request_path, :request_type
|
5
|
+
|
6
|
+
def initialize(request_path, request_type="list")
|
7
|
+
@request_path = request_path
|
8
|
+
@requst_type = request_type
|
9
|
+
end
|
10
|
+
|
11
|
+
def response_code
|
12
|
+
case
|
13
|
+
when expanded_path.exist? && expanded_path.directory?
|
14
|
+
200
|
15
|
+
when !expanded_path.exist?
|
16
|
+
404
|
17
|
+
when !expanded_path.directory?
|
18
|
+
400
|
19
|
+
else
|
20
|
+
500
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def response
|
25
|
+
root = Stylish::Developer.config.root
|
26
|
+
prefix = Stylish::Developer.config.base_url
|
27
|
+
|
28
|
+
walk = lambda do |path_node|
|
29
|
+
relative = path_node.relative_path_from(root)
|
30
|
+
|
31
|
+
if path_node.file?
|
32
|
+
{
|
33
|
+
is_file: true,
|
34
|
+
path: relative.to_s,
|
35
|
+
urls: {
|
36
|
+
content: "#{ prefix }/content/#{ relative }",
|
37
|
+
compiled: "#{ prefix }/compiled/#{ relative }",
|
38
|
+
meta: "#{ prefix }/meta/#{ relative }"
|
39
|
+
}
|
40
|
+
}
|
41
|
+
else
|
42
|
+
{
|
43
|
+
path: relative.to_s,
|
44
|
+
is_folder: true,
|
45
|
+
children: path_node.children.map {|c| walk.call(c) },
|
46
|
+
urls: {
|
47
|
+
list: "#{ prefix }/list/#{ relative }"
|
48
|
+
}
|
49
|
+
}
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
{
|
55
|
+
path: expanded_path.relative_path_from(root).to_s,
|
56
|
+
children: expanded_path.children.map {|n| walk.call(n) },
|
57
|
+
is_folder: true
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
def expanded_path
|
62
|
+
Pathname(request_path).expand_path(Stylish::Developer.config.root)
|
63
|
+
end
|
64
|
+
|
65
|
+
def response_headers
|
66
|
+
{
|
67
|
+
"Content-Length" => "#{content_length}",
|
68
|
+
"Content-Type" => "application/json"
|
69
|
+
}
|
70
|
+
end
|
71
|
+
|
72
|
+
def response_body
|
73
|
+
response.to_json
|
74
|
+
end
|
75
|
+
|
76
|
+
def content_length
|
77
|
+
Rack::Utils.bytesize(response_body)
|
78
|
+
end
|
79
|
+
|
80
|
+
def to_rack_response
|
81
|
+
[response_code, response_headers, [response_body]]
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module Stylish
|
2
|
+
module Developer
|
3
|
+
class ModelDelegator
|
4
|
+
attr_reader :path, :action, :request, :library, :prefix, :parts, :path_args
|
5
|
+
|
6
|
+
attr_accessor :code
|
7
|
+
|
8
|
+
def initialize(path, action, prefix, options)
|
9
|
+
@path = path
|
10
|
+
@action = action
|
11
|
+
@request = options.fetch(:request, nil)
|
12
|
+
@path_args = options.fetch(:path_args, [])
|
13
|
+
@prefix = prefix
|
14
|
+
@library = library || Stylish::Developer.config.library
|
15
|
+
@code = 200
|
16
|
+
@parts = path.split("/")
|
17
|
+
end
|
18
|
+
|
19
|
+
def response_body
|
20
|
+
case
|
21
|
+
when prefix == "packages" && action == "browse"
|
22
|
+
library.packages.map(&:to_hash)
|
23
|
+
when prefix == "packages" && action == "show"
|
24
|
+
slug = parts.first
|
25
|
+
package = library.find_package(slug)
|
26
|
+
package.to_hash(true)
|
27
|
+
when %w(layouts components pages).include?(prefix)
|
28
|
+
slug = parts.first
|
29
|
+
package = library.find_package(slug)
|
30
|
+
resp = package.handle_request(prefix, action, parts, request: request, params: request.params.to_mash)
|
31
|
+
|
32
|
+
resp
|
33
|
+
else
|
34
|
+
self.code = 400
|
35
|
+
|
36
|
+
{
|
37
|
+
error: "invalid request",
|
38
|
+
path: path,
|
39
|
+
action: action,
|
40
|
+
prefix: prefix,
|
41
|
+
request: request.path
|
42
|
+
}
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def to_rack_response
|
47
|
+
[code, {"Content-Type"=>"application/json"}, [response_body.to_json] ]
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,139 @@
|
|
1
|
+
module Stylish
|
2
|
+
module Developer
|
3
|
+
|
4
|
+
# Handles a request to modify an asset that belongs to
|
5
|
+
# a Stylish package.
|
6
|
+
class Modification
|
7
|
+
attr_reader :actual_path,
|
8
|
+
:request,
|
9
|
+
:request_type
|
10
|
+
|
11
|
+
attr_accessor :code, :body, :headers
|
12
|
+
|
13
|
+
def initialize(actual_path, request_type, request)
|
14
|
+
@actual_path = actual_path
|
15
|
+
@request_type = request_type
|
16
|
+
@request = request
|
17
|
+
|
18
|
+
@code = nil
|
19
|
+
@headers = {}
|
20
|
+
@body = {}
|
21
|
+
end
|
22
|
+
|
23
|
+
def current_root
|
24
|
+
Stylish::Developer.server.root
|
25
|
+
end
|
26
|
+
|
27
|
+
def file
|
28
|
+
current_root.join(actual_path)
|
29
|
+
end
|
30
|
+
|
31
|
+
def file_exists?
|
32
|
+
file && file.exist?
|
33
|
+
end
|
34
|
+
|
35
|
+
def file_exist?
|
36
|
+
file_exists?
|
37
|
+
end
|
38
|
+
|
39
|
+
def file_writable?
|
40
|
+
file && file.writable?
|
41
|
+
end
|
42
|
+
|
43
|
+
def update?
|
44
|
+
request_type == "update"
|
45
|
+
end
|
46
|
+
|
47
|
+
def delete?
|
48
|
+
request_type == "delete"
|
49
|
+
end
|
50
|
+
|
51
|
+
def create?
|
52
|
+
request_type == "create"
|
53
|
+
end
|
54
|
+
|
55
|
+
def has_errors?
|
56
|
+
body.key?(:errors) && !body[:errors].empty?
|
57
|
+
end
|
58
|
+
|
59
|
+
def add_error(message)
|
60
|
+
self.code = 500
|
61
|
+
|
62
|
+
binding.pry
|
63
|
+
|
64
|
+
body[:errors] ||= []
|
65
|
+
body[:errors] << message
|
66
|
+
end
|
67
|
+
|
68
|
+
def handle
|
69
|
+
return if @handled
|
70
|
+
|
71
|
+
if file_exists? && file_writable?
|
72
|
+
handle_existing_file_modification
|
73
|
+
elsif file_exist? && !file_writable?
|
74
|
+
handle_access_denied_error
|
75
|
+
else
|
76
|
+
handle_non_existing_file_modification
|
77
|
+
end
|
78
|
+
|
79
|
+
@handled = true
|
80
|
+
end
|
81
|
+
|
82
|
+
def handle_access_denied_error
|
83
|
+
add_error("Can not access file at #{ actual_path }. File not writable")
|
84
|
+
end
|
85
|
+
|
86
|
+
def handle_existing_file_modification
|
87
|
+
if create?
|
88
|
+
add_error("Can not create file at #{ actual_path }. Already exists")
|
89
|
+
elsif update?
|
90
|
+
file.open("w") {|fh| fh.write(contents) }
|
91
|
+
load_path_meta
|
92
|
+
elsif delete?
|
93
|
+
path = file.to_s
|
94
|
+
file.unlink if file.file?
|
95
|
+
file.rmdir if file.directory?
|
96
|
+
self.code = 200
|
97
|
+
self.body = {status: "deleted", path: path}
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
def contents
|
102
|
+
request.params['contents']
|
103
|
+
end
|
104
|
+
|
105
|
+
def handle_non_existing_file_modification
|
106
|
+
if update? || delete?
|
107
|
+
add_error("Can not perform #{ request_type } on #{ actual_path }. File not found")
|
108
|
+
elsif create?
|
109
|
+
FileUtils.mkdir_p(File.dirname(file))
|
110
|
+
|
111
|
+
file.open("w+") {|fh| fh.write(contents) }
|
112
|
+
load_path_meta
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
def load_path_meta
|
117
|
+
@meta_path = Stylish::Developer::Path.new(actual_path, "meta")
|
118
|
+
end
|
119
|
+
|
120
|
+
def body_contents
|
121
|
+
@body = @body.to_json if @body.is_a?(Hash)
|
122
|
+
@body = @body.first if @body.is_a?(Array)
|
123
|
+
@body.to_s
|
124
|
+
end
|
125
|
+
|
126
|
+
def to_rack_response
|
127
|
+
handle
|
128
|
+
|
129
|
+
return @meta_path.to_rack_response if @meta_path
|
130
|
+
|
131
|
+
[
|
132
|
+
code,
|
133
|
+
headers,
|
134
|
+
[body_contents]
|
135
|
+
]
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
@@ -0,0 +1,168 @@
|
|
1
|
+
module Stylish
|
2
|
+
module Developer
|
3
|
+
class Path
|
4
|
+
attr_reader :request_path, :request_type
|
5
|
+
|
6
|
+
def initialize(request_path, request_type="content")
|
7
|
+
@request_path = request_path.to_s
|
8
|
+
@request_type = request_type
|
9
|
+
end
|
10
|
+
|
11
|
+
def asset
|
12
|
+
@asset ||= begin
|
13
|
+
parts = request_path.split('/')
|
14
|
+
|
15
|
+
found = !!(sprockets.find_asset(request_path))
|
16
|
+
|
17
|
+
until found || parts.empty?
|
18
|
+
test = parts.join('/')
|
19
|
+
found = !!!(sprockets.find_asset(test).nil?)
|
20
|
+
parts.shift unless found
|
21
|
+
end
|
22
|
+
|
23
|
+
sprockets.find_asset Array(parts).join('/')
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def exists_under_root?
|
28
|
+
expanded_path.exist?
|
29
|
+
end
|
30
|
+
|
31
|
+
def sprockets
|
32
|
+
self.class.sprockets
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.sprockets
|
36
|
+
@sprockets ||= Stylish::Developer.config.environment
|
37
|
+
end
|
38
|
+
|
39
|
+
def expanded_path
|
40
|
+
Pathname(request_path).expand_path(Stylish::Developer.config.root)
|
41
|
+
end
|
42
|
+
|
43
|
+
def asset_exists?
|
44
|
+
expanded_path.exist?
|
45
|
+
end
|
46
|
+
|
47
|
+
def sprockets_asset
|
48
|
+
sprockets.find_asset(asset)
|
49
|
+
end
|
50
|
+
|
51
|
+
def meta?
|
52
|
+
request_type == "meta"
|
53
|
+
end
|
54
|
+
|
55
|
+
def content?
|
56
|
+
request_type == "content"
|
57
|
+
end
|
58
|
+
|
59
|
+
def compiled?
|
60
|
+
request_type == "compiled"
|
61
|
+
end
|
62
|
+
|
63
|
+
def response_headers
|
64
|
+
{
|
65
|
+
"Content-Length" => "#{Rack::Utils.bytesize(response_body)}",
|
66
|
+
"Content-Type" => content_type
|
67
|
+
}
|
68
|
+
end
|
69
|
+
|
70
|
+
def response_body
|
71
|
+
@response_body ||= begin
|
72
|
+
case
|
73
|
+
when not_found?
|
74
|
+
{
|
75
|
+
status: 404,
|
76
|
+
message: "Not Found"
|
77
|
+
}.to_json
|
78
|
+
when content?
|
79
|
+
asset.pathname.read
|
80
|
+
when compiled?
|
81
|
+
asset.to_s
|
82
|
+
when meta?
|
83
|
+
meta.to_json
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def raw_asset_content
|
89
|
+
begin
|
90
|
+
asset.pathname.read
|
91
|
+
rescue => exception
|
92
|
+
"Error reading asset content:\n\n#{exception.message}"
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def compiled_asset_content
|
97
|
+
begin
|
98
|
+
asset.to_s
|
99
|
+
rescue => exception
|
100
|
+
"Error compiling asset content:\n\n#{ exception.message }"
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
def extension
|
105
|
+
File.extname(asset.logical_path)
|
106
|
+
end
|
107
|
+
|
108
|
+
def content_type
|
109
|
+
asset.content_type
|
110
|
+
end
|
111
|
+
|
112
|
+
def relative_pathname
|
113
|
+
Pathname(asset.pathname.relative_path_from(Stylish::Developer.config.root))
|
114
|
+
end
|
115
|
+
|
116
|
+
def prefix
|
117
|
+
Stylish::Developer.config.base_url
|
118
|
+
end
|
119
|
+
|
120
|
+
def meta
|
121
|
+
{
|
122
|
+
logical_path: asset.logical_path,
|
123
|
+
mtime: asset.mtime.to_i.to_s,
|
124
|
+
digest: asset.digest,
|
125
|
+
pathname: relative_pathname.to_s,
|
126
|
+
size: asset.bytesize.to_s,
|
127
|
+
urls: {
|
128
|
+
meta_url: "#{ prefix }/meta/#{relative_pathname}",
|
129
|
+
compiled_url: "#{ prefix }/compiled/#{relative_pathname}",
|
130
|
+
content_url: "#{ prefix }/content/#{relative_pathname}"
|
131
|
+
},
|
132
|
+
dependencies: asset.dependencies.map do |dependency|
|
133
|
+
dependency.logical_path
|
134
|
+
end
|
135
|
+
}
|
136
|
+
end
|
137
|
+
|
138
|
+
def status_code
|
139
|
+
@status_code ||= begin
|
140
|
+
case
|
141
|
+
when exists_under_root?
|
142
|
+
200
|
143
|
+
when !exists_under_root?
|
144
|
+
404
|
145
|
+
else
|
146
|
+
500
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
def to_rack_response
|
152
|
+
[status_code, response_headers, [response_body]]
|
153
|
+
end
|
154
|
+
|
155
|
+
def not_found?
|
156
|
+
status_code == 404
|
157
|
+
end
|
158
|
+
|
159
|
+
def error?
|
160
|
+
status_code == 500
|
161
|
+
end
|
162
|
+
|
163
|
+
def success?
|
164
|
+
status_code == 200 || status_code == 304
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
module Stylish
|
2
|
+
module Developer
|
3
|
+
# The Route class is responsible for routing requests to the API
|
4
|
+
# to their appropriate handler.
|
5
|
+
class Route
|
6
|
+
def self.request(env)
|
7
|
+
new(env)
|
8
|
+
end
|
9
|
+
|
10
|
+
attr_reader :env
|
11
|
+
|
12
|
+
def initialize(env)
|
13
|
+
@env = env
|
14
|
+
end
|
15
|
+
|
16
|
+
def request
|
17
|
+
@request ||= Rack::Request.new(env)
|
18
|
+
end
|
19
|
+
|
20
|
+
def prefix
|
21
|
+
Stylish::Developer.config.base_url
|
22
|
+
end
|
23
|
+
|
24
|
+
def respond
|
25
|
+
data = case
|
26
|
+
|
27
|
+
when %w{meta content compiled}.include?(request_type)
|
28
|
+
path_handler.to_rack_response()
|
29
|
+
|
30
|
+
when request_type == "list"
|
31
|
+
listing_handler.to_rack_response()
|
32
|
+
|
33
|
+
when request_type == "models"
|
34
|
+
models_handler.to_rack_response()
|
35
|
+
|
36
|
+
when request_type == "info"
|
37
|
+
info_handler_rack_response
|
38
|
+
|
39
|
+
when %w(create update delete).include?(request_type)
|
40
|
+
modification_handler.to_rack_response()
|
41
|
+
|
42
|
+
else
|
43
|
+
[404, {}, ['Not found']]
|
44
|
+
end
|
45
|
+
|
46
|
+
status, headers, body = data
|
47
|
+
|
48
|
+
[status, headers, body]
|
49
|
+
end
|
50
|
+
|
51
|
+
def info_handler_rack_response
|
52
|
+
body = {
|
53
|
+
root: Stylish::Developer.server.root.to_s,
|
54
|
+
sprockets_paths: Stylish::Developer.server.sprockets.paths,
|
55
|
+
library: Stylish::Developer.config.library.as_json
|
56
|
+
}.to_json
|
57
|
+
|
58
|
+
headers = {
|
59
|
+
"Content-Type" => "application/json"
|
60
|
+
}
|
61
|
+
|
62
|
+
[200, headers, [body]]
|
63
|
+
end
|
64
|
+
|
65
|
+
def models_handler
|
66
|
+
path_args = actual_path.split("/")
|
67
|
+
parts = path_args.dup
|
68
|
+
action = parts.shift
|
69
|
+
prefix = parts.shift
|
70
|
+
path = parts.join("/")
|
71
|
+
|
72
|
+
@models_handler ||= Stylish::Developer::ModelDelegator.new(path, action, prefix, request: request, path_args: path_args)
|
73
|
+
end
|
74
|
+
|
75
|
+
def modification_handler
|
76
|
+
@modification_handler ||= Stylish::Developer::Modification.new(actual_path, request_type, request)
|
77
|
+
end
|
78
|
+
|
79
|
+
def listing_handler
|
80
|
+
@listing_handler ||= Stylish::Developer::Listing.new(actual_path, request_type)
|
81
|
+
end
|
82
|
+
|
83
|
+
def path_handler
|
84
|
+
@path_handler ||= Stylish::Developer::Path.new(actual_path, request_type)
|
85
|
+
end
|
86
|
+
|
87
|
+
def actual_path
|
88
|
+
request.path[/^#{ prefix }\/(\w+)\/(.+)$/, 2]
|
89
|
+
end
|
90
|
+
|
91
|
+
def request_type
|
92
|
+
return "info" if request.path.match(/^#{prefix}\/info$/)
|
93
|
+
request.path[/^#{ prefix }\/(\w+)\/(.+)$/, 1]
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|