TokiCLI 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/CHANGELOG.md +7 -0
- data/README.md +56 -10
- data/TokiCLI.gemspec +5 -2
- data/lib/API/dbapi.rb +104 -67
- data/lib/API/helpers.rb +47 -3
- data/lib/TokiCLI/app.rb +88 -12
- data/lib/TokiCLI/version.rb +1 -1
- data/lib/TokiCLI/view.rb +5 -1
- data/lib/TokiServer/Gemfile +6 -0
- data/lib/TokiServer/README.md +37 -0
- data/lib/TokiServer/bower.json +8 -0
- data/lib/TokiServer/bower_components/fastclick/.bower.json +23 -0
- data/lib/TokiServer/bower_components/fastclick/LICENSE +22 -0
- data/lib/TokiServer/bower_components/fastclick/README.md +133 -0
- data/lib/TokiServer/bower_components/fastclick/bower.json +13 -0
- data/lib/TokiServer/bower_components/fastclick/lib/fastclick.js +790 -0
- data/lib/TokiServer/bower_components/foundation/.bower.json +30 -0
- data/lib/TokiServer/bower_components/foundation/bower.json +20 -0
- data/lib/TokiServer/bower_components/foundation/css/foundation.css +4860 -0
- data/lib/TokiServer/bower_components/foundation/css/normalize.css +320 -0
- data/lib/TokiServer/bower_components/foundation/js/foundation.js +5543 -0
- data/lib/TokiServer/bower_components/foundation/js/foundation.min.js +3 -0
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.abide.js +299 -0
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.accordion.js +59 -0
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.alert.js +43 -0
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.clearing.js +534 -0
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.dropdown.js +311 -0
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.equalizer.js +74 -0
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.interchange.js +331 -0
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.joyride.js +843 -0
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.js +611 -0
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.magellan.js +178 -0
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.offcanvas.js +108 -0
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.orbit.js +610 -0
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.reveal.js +437 -0
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.slider.js +199 -0
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.tab.js +167 -0
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.tooltip.js +298 -0
- data/lib/TokiServer/bower_components/foundation/js/foundation/foundation.topbar.js +425 -0
- data/lib/TokiServer/bower_components/foundation/js/vendor/fastclick.js +9 -0
- data/lib/TokiServer/bower_components/foundation/js/vendor/jquery.cookie.js +8 -0
- data/lib/TokiServer/bower_components/foundation/js/vendor/jquery.js +26 -0
- data/lib/TokiServer/bower_components/foundation/js/vendor/modernizr.js +8 -0
- data/lib/TokiServer/bower_components/foundation/js/vendor/placeholder.js +2 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation.scss +45 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/_functions.scss +101 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/_settings.scss +1289 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_accordion.scss +53 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_alert-boxes.scss +126 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_block-grid.scss +132 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_breadcrumbs.scss +127 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_button-groups.scss +108 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_buttons.scss +222 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_clearing.scss +247 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_dropdown-buttons.scss +129 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_dropdown.scss +248 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_flex-video.scss +51 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_forms.scss +498 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_global.scss +429 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_grid.scss +260 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_inline-lists.scss +57 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_joyride.scss +220 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_keystrokes.scss +61 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_labels.scss +104 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_magellan.scss +34 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_offcanvas.scss +355 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_orbit.scss +423 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_pagination.scss +150 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_panels.scss +90 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_pricing-tables.scss +150 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_progress-bars.scss +79 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_range-slider.scss +148 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_reveal-new.scss +0 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_reveal.scss +216 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_side-nav.scss +115 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_split-buttons.scss +191 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_sub-nav.scss +125 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_switch.scss +294 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_tables.scss +129 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_tabs.scss +109 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_thumbs.scss +68 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_tooltips.scss +140 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_top-bar.scss +644 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_type.scss +511 -0
- data/lib/TokiServer/bower_components/foundation/scss/foundation/components/_visibility.scss +408 -0
- data/lib/TokiServer/bower_components/foundation/scss/normalize.scss +425 -0
- data/lib/TokiServer/bower_components/jquery-placeholder/.bower.json +17 -0
- data/lib/TokiServer/bower_components/jquery-placeholder/.gitattributes +1 -0
- data/lib/TokiServer/bower_components/jquery-placeholder/.gitignore +1 -0
- data/lib/TokiServer/bower_components/jquery-placeholder/LICENSE-MIT.txt +20 -0
- data/lib/TokiServer/bower_components/jquery-placeholder/README.md +76 -0
- data/lib/TokiServer/bower_components/jquery-placeholder/bower.json +5 -0
- data/lib/TokiServer/bower_components/jquery-placeholder/demo.html +55 -0
- data/lib/TokiServer/bower_components/jquery-placeholder/jquery.placeholder.js +185 -0
- data/lib/TokiServer/bower_components/jquery-placeholder/tests/index.html +32 -0
- data/lib/TokiServer/bower_components/jquery-placeholder/tests/tests.js +134 -0
- data/lib/TokiServer/bower_components/jquery.cookie/.bower.json +28 -0
- data/lib/TokiServer/bower_components/jquery.cookie/jquery.cookie.js +117 -0
- data/lib/TokiServer/bower_components/jquery/.bower.json +37 -0
- data/lib/TokiServer/bower_components/jquery/MIT-LICENSE.txt +21 -0
- data/lib/TokiServer/bower_components/jquery/bower.json +27 -0
- data/lib/TokiServer/bower_components/jquery/dist/jquery.js +9190 -0
- data/lib/TokiServer/bower_components/jquery/dist/jquery.min.js +5 -0
- data/lib/TokiServer/bower_components/jquery/dist/jquery.min.map +1 -0
- data/lib/TokiServer/bower_components/jquery/src/ajax.js +806 -0
- data/lib/TokiServer/bower_components/jquery/src/ajax/jsonp.js +89 -0
- data/lib/TokiServer/bower_components/jquery/src/ajax/load.js +75 -0
- data/lib/TokiServer/bower_components/jquery/src/ajax/parseJSON.js +13 -0
- data/lib/TokiServer/bower_components/jquery/src/ajax/parseXML.js +28 -0
- data/lib/TokiServer/bower_components/jquery/src/ajax/script.js +64 -0
- data/lib/TokiServer/bower_components/jquery/src/ajax/var/nonce.js +5 -0
- data/lib/TokiServer/bower_components/jquery/src/ajax/var/rquery.js +3 -0
- data/lib/TokiServer/bower_components/jquery/src/ajax/xhr.js +135 -0
- data/lib/TokiServer/bower_components/jquery/src/attributes.js +11 -0
- data/lib/TokiServer/bower_components/jquery/src/attributes/attr.js +143 -0
- data/lib/TokiServer/bower_components/jquery/src/attributes/classes.js +158 -0
- data/lib/TokiServer/bower_components/jquery/src/attributes/prop.js +96 -0
- data/lib/TokiServer/bower_components/jquery/src/attributes/support.js +35 -0
- data/lib/TokiServer/bower_components/jquery/src/attributes/val.js +163 -0
- data/lib/TokiServer/bower_components/jquery/src/callbacks.js +205 -0
- data/lib/TokiServer/bower_components/jquery/src/core.js +498 -0
- data/lib/TokiServer/bower_components/jquery/src/core/access.js +60 -0
- data/lib/TokiServer/bower_components/jquery/src/core/init.js +123 -0
- data/lib/TokiServer/bower_components/jquery/src/core/parseHTML.js +39 -0
- data/lib/TokiServer/bower_components/jquery/src/core/ready.js +97 -0
- data/lib/TokiServer/bower_components/jquery/src/core/var/rsingleTag.js +4 -0
- data/lib/TokiServer/bower_components/jquery/src/css.js +451 -0
- data/lib/TokiServer/bower_components/jquery/src/css/addGetHookIf.js +24 -0
- data/lib/TokiServer/bower_components/jquery/src/css/curCSS.js +57 -0
- data/lib/TokiServer/bower_components/jquery/src/css/defaultDisplay.js +70 -0
- data/lib/TokiServer/bower_components/jquery/src/css/hiddenVisibleSelectors.js +15 -0
- data/lib/TokiServer/bower_components/jquery/src/css/support.js +91 -0
- data/lib/TokiServer/bower_components/jquery/src/css/swap.js +28 -0
- data/lib/TokiServer/bower_components/jquery/src/css/var/cssExpand.js +3 -0
- data/lib/TokiServer/bower_components/jquery/src/css/var/getStyles.js +5 -0
- data/lib/TokiServer/bower_components/jquery/src/css/var/isHidden.js +13 -0
- data/lib/TokiServer/bower_components/jquery/src/css/var/rmargin.js +3 -0
- data/lib/TokiServer/bower_components/jquery/src/css/var/rnumnonpx.js +5 -0
- data/lib/TokiServer/bower_components/jquery/src/data.js +179 -0
- data/lib/TokiServer/bower_components/jquery/src/data/Data.js +181 -0
- data/lib/TokiServer/bower_components/jquery/src/data/accepts.js +20 -0
- data/lib/TokiServer/bower_components/jquery/src/data/var/data_priv.js +5 -0
- data/lib/TokiServer/bower_components/jquery/src/data/var/data_user.js +5 -0
- data/lib/TokiServer/bower_components/jquery/src/deferred.js +149 -0
- data/lib/TokiServer/bower_components/jquery/src/deprecated.js +13 -0
- data/lib/TokiServer/bower_components/jquery/src/dimensions.js +50 -0
- data/lib/TokiServer/bower_components/jquery/src/effects.js +649 -0
- data/lib/TokiServer/bower_components/jquery/src/effects/Tween.js +114 -0
- data/lib/TokiServer/bower_components/jquery/src/effects/animatedSelector.js +13 -0
- data/lib/TokiServer/bower_components/jquery/src/event.js +868 -0
- data/lib/TokiServer/bower_components/jquery/src/event/alias.js +39 -0
- data/lib/TokiServer/bower_components/jquery/src/event/support.js +9 -0
- data/lib/TokiServer/bower_components/jquery/src/exports/amd.js +24 -0
- data/lib/TokiServer/bower_components/jquery/src/exports/global.js +32 -0
- data/lib/TokiServer/bower_components/jquery/src/intro.js +44 -0
- data/lib/TokiServer/bower_components/jquery/src/jquery.js +36 -0
- data/lib/TokiServer/bower_components/jquery/src/manipulation.js +582 -0
- data/lib/TokiServer/bower_components/jquery/src/manipulation/_evalUrl.js +18 -0
- data/lib/TokiServer/bower_components/jquery/src/manipulation/support.js +31 -0
- data/lib/TokiServer/bower_components/jquery/src/manipulation/var/rcheckableType.js +3 -0
- data/lib/TokiServer/bower_components/jquery/src/offset.js +204 -0
- data/lib/TokiServer/bower_components/jquery/src/outro.js +1 -0
- data/lib/TokiServer/bower_components/jquery/src/queue.js +142 -0
- data/lib/TokiServer/bower_components/jquery/src/queue/delay.js +22 -0
- data/lib/TokiServer/bower_components/jquery/src/selector-native.js +172 -0
- data/lib/TokiServer/bower_components/jquery/src/selector-sizzle.js +14 -0
- data/lib/TokiServer/bower_components/jquery/src/selector.js +1 -0
- data/lib/TokiServer/bower_components/jquery/src/serialize.js +111 -0
- data/lib/TokiServer/bower_components/jquery/src/sizzle/dist/sizzle.js +2044 -0
- data/lib/TokiServer/bower_components/jquery/src/sizzle/dist/sizzle.min.js +3 -0
- data/lib/TokiServer/bower_components/jquery/src/sizzle/dist/sizzle.min.map +1 -0
- data/lib/TokiServer/bower_components/jquery/src/traversing.js +200 -0
- data/lib/TokiServer/bower_components/jquery/src/traversing/findFilter.js +100 -0
- data/lib/TokiServer/bower_components/jquery/src/traversing/var/rneedsContext.js +6 -0
- data/lib/TokiServer/bower_components/jquery/src/var/arr.js +3 -0
- data/lib/TokiServer/bower_components/jquery/src/var/class2type.js +4 -0
- data/lib/TokiServer/bower_components/jquery/src/var/concat.js +5 -0
- data/lib/TokiServer/bower_components/jquery/src/var/hasOwn.js +5 -0
- data/lib/TokiServer/bower_components/jquery/src/var/indexOf.js +5 -0
- data/lib/TokiServer/bower_components/jquery/src/var/pnum.js +3 -0
- data/lib/TokiServer/bower_components/jquery/src/var/push.js +5 -0
- data/lib/TokiServer/bower_components/jquery/src/var/rnotwhite.js +3 -0
- data/lib/TokiServer/bower_components/jquery/src/var/slice.js +5 -0
- data/lib/TokiServer/bower_components/jquery/src/var/strundefined.js +3 -0
- data/lib/TokiServer/bower_components/jquery/src/var/support.js +4 -0
- data/lib/TokiServer/bower_components/jquery/src/var/toString.js +5 -0
- data/lib/TokiServer/bower_components/jquery/src/wrap.js +78 -0
- data/lib/TokiServer/bower_components/modernizr/.bower.json +14 -0
- data/lib/TokiServer/bower_components/modernizr/.editorconfig +10 -0
- data/lib/TokiServer/bower_components/modernizr/.gitignore +2 -0
- data/lib/TokiServer/bower_components/modernizr/.travis.yml +6 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/a-download.js +8 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/audio-audiodata-api.js +4 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/audio-webaudio-api.js +4 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/battery-api.js +8 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/battery-level.js +11 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/blob-constructor.js +10 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/canvas-todataurl-type.js +28 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/contenteditable.js +9 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/contentsecuritypolicy.js +10 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/contextmenu.js +11 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/cookies.js +15 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/cors.js +3 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-backgroundposition-shorthand.js +19 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-backgroundposition-xy.js +15 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-backgroundrepeat.js +31 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-backgroundsizecover.js +10 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-boxsizing.js +9 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-calc.js +12 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-cubicbezierrange.js +8 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-displayrunin.js +18 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-displaytable.js +27 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-filters.js +7 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-hyphens.js +205 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-lastchild.js +11 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-mask.js +12 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-mediaqueries.js +3 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-objectfit.js +6 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-overflow-scrolling.js +9 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-pointerevents.js +25 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-positionsticky.js +13 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-regions.js +55 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-remunit.js +19 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-resize.js +8 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-scrollbars.js +19 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-shapes.js +4 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-subpixelfont.js +23 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-supports.js +6 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-userselect.js +10 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-vhunit.js +14 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-vmaxunit.js +14 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-vminunit.js +14 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/css-vwunit.js +14 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/custom-protocol-handler.js +10 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/dart.js +6 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/dataview-api.js +4 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/dom-classlist.js +4 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/dom-createElement-attrs.js +11 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/dom-dataset.js +9 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/dom-microdata.js +4 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/elem-datalist.js +12 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/elem-details.js +25 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/elem-output.js +4 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/elem-progress-meter.js +11 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/elem-ruby.js +53 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/elem-time.js +4 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/elem-track.js +11 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/emoji.js +11 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/es5-strictmode.js +7 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/event-deviceorientation-motion.js +11 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/exif-orientation.js +32 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/file-api.js +12 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/file-filesystem.js +9 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/forms-fileinput.js +13 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/forms-formattribute.js +29 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/forms-inputnumber-l10n.js +32 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/forms-placeholder.js +10 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/forms-speechinput.js +19 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/forms-validation.js +62 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/fullscreen-api.js +10 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/gamepad.js +12 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/getusermedia.js +5 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/ie8compat.js +12 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/iframe-sandbox.js +5 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/iframe-seamless.js +5 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/iframe-srcdoc.js +5 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/img-apng.js +26 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/img-webp.js +20 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/json.js +7 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/lists-reversed.js +6 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/mathml.js +23 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/network-connection.js +22 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/network-eventsource.js +5 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/network-xhr2.js +13 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/notification.js +10 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/performance.js +5 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/pointerlock-api.js +4 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/quota-management-api.js +11 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/requestanimationframe.js +7 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/script-async.js +3 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/script-defer.js +3 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/style-scoped.js +6 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/svg-filters.js +13 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/unicode.js +32 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/url-data-uri.js +26 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/userdata.js +7 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/vibration.js +4 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/web-intents.js +6 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/webgl-extensions.js +42 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/websockets-binary.js +20 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/window-framed.js +8 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/workers-blobworkers.js +66 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/workers-dataworkers.js +34 -0
- data/lib/TokiServer/bower_components/modernizr/feature-detects/workers-sharedworkers.js +3 -0
- data/lib/TokiServer/bower_components/modernizr/grunt.js +69 -0
- data/lib/TokiServer/bower_components/modernizr/media/Modernizr 2 Logo.ai +292 -1
- data/lib/TokiServer/bower_components/modernizr/media/Modernizr 2 Logo.eps +0 -0
- data/lib/TokiServer/bower_components/modernizr/media/Modernizr 2 Logo.pdf +292 -1
- data/lib/TokiServer/bower_components/modernizr/media/Modernizr 2 Logo.png +0 -0
- data/lib/TokiServer/bower_components/modernizr/media/Modernizr 2 Logo.svg +35 -0
- data/lib/TokiServer/bower_components/modernizr/modernizr.js +1406 -0
- data/lib/TokiServer/bower_components/modernizr/readme.md +28 -0
- data/lib/TokiServer/bower_components/modernizr/test/basic.html +65 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse.html +1451 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/Windsong-webfont.eot +0 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/Windsong-webfont.otf +0 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/Windsong-webfont.svg +147 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/Windsong-webfont.ttf +0 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/Windsong-webfont.woff +0 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/alpha.png +0 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/apng_test.png +0 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/before-after.png +0 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/form_validation.html +15 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/ga.js +43 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/green5x5.png +0 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/hashchange.html +16 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/jquery.min.js +18 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/mathml.html +120 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/mathml_ref.png +0 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/modernizr-1.7.min.js +2 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/png_alpha_result.png +0 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/pushstate.html +40 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/red30x30.png +0 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/ruby.png +0 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/stroked-text.png +0 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/style.css +168 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/svg-html-blur.png +0 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/svg-img.svg +5 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/svg-img.svg.1 +5 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/svg_blur.png +0 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/table.png +0 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/text-shadow1.png +0 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/text-shadow2.png +0 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/windsong_font.png +0 -0
- data/lib/TokiServer/bower_components/modernizr/test/caniuse_files/xhtml.html +14 -0
- data/lib/TokiServer/bower_components/modernizr/test/index.html +104 -0
- data/lib/TokiServer/bower_components/modernizr/test/js/basic.html +65 -0
- data/lib/TokiServer/bower_components/modernizr/test/js/dumpdata.js +75 -0
- data/lib/TokiServer/bower_components/modernizr/test/js/lib/detect-global.js +153 -0
- data/lib/TokiServer/bower_components/modernizr/test/js/lib/jquery-1.7b2.js +9279 -0
- data/lib/TokiServer/bower_components/modernizr/test/js/lib/jsonselect.js +279 -0
- data/lib/TokiServer/bower_components/modernizr/test/js/lib/polyfills.js +96 -0
- data/lib/TokiServer/bower_components/modernizr/test/js/lib/uaparser.js +215 -0
- data/lib/TokiServer/bower_components/modernizr/test/js/setup.js +44 -0
- data/lib/TokiServer/bower_components/modernizr/test/js/unit-caniuse.js +191 -0
- data/lib/TokiServer/bower_components/modernizr/test/js/unit.js +669 -0
- data/lib/TokiServer/bower_components/modernizr/test/qunit/qunit.css +231 -0
- data/lib/TokiServer/bower_components/modernizr/test/qunit/qunit.js +1932 -0
- data/lib/TokiServer/bower_components/modernizr/test/qunit/run-qunit.js +72 -0
- data/lib/TokiServer/config.rb +25 -0
- data/lib/TokiServer/humans.txt +8 -0
- data/lib/TokiServer/itunesicon.rb +60 -0
- data/lib/TokiServer/js/app.js +3 -0
- data/lib/TokiServer/public/stylesheets/app.css +8094 -0
- data/lib/TokiServer/robots.txt +4 -0
- data/lib/TokiServer/scss/_settings.scss +1240 -0
- data/lib/TokiServer/scss/app.scss +102 -0
- data/lib/TokiServer/tokiserver.rb +377 -0
- data/lib/TokiServer/views/apps_total.erb +28 -0
- data/lib/TokiServer/views/error.erb +25 -0
- data/lib/TokiServer/views/index.erb +191 -0
- data/lib/TokiServer/views/layout.erb +20 -0
- data/lib/TokiServer/views/name_log.erb +50 -0
- data/lib/TokiServer/views/name_split.erb +37 -0
- data/lib/TokiServer/views/name_total.erb +34 -0
- metadata +416 -4
@@ -0,0 +1,102 @@
|
|
1
|
+
@import "settings";
|
2
|
+
@import "foundation";
|
3
|
+
|
4
|
+
$bg: #000;
|
5
|
+
$red: #e74c3c;
|
6
|
+
$blue: #3498db;
|
7
|
+
$green: #1abc9c;
|
8
|
+
$grey: #95a5a6;
|
9
|
+
|
10
|
+
body {
|
11
|
+
background-color: $bg;
|
12
|
+
font-family: 'Helvetica Neue', sans-serif;
|
13
|
+
-webkit-font-smoothing: antialiased;
|
14
|
+
-moz-osx-font-smoothing: grayscale;
|
15
|
+
font-weight: normal;
|
16
|
+
font-style: normal;
|
17
|
+
}
|
18
|
+
|
19
|
+
.header {
|
20
|
+
margin-top: 1em;
|
21
|
+
}
|
22
|
+
|
23
|
+
.time {
|
24
|
+
text-align: center;
|
25
|
+
}
|
26
|
+
|
27
|
+
h1, h2 {
|
28
|
+
font-family: 'Roboto Slab', serif;
|
29
|
+
-webkit-font-smoothing: antialiased;
|
30
|
+
-moz-osx-font-smoothing: grayscale;
|
31
|
+
font-weight: normal;
|
32
|
+
font-style: normal;
|
33
|
+
}
|
34
|
+
|
35
|
+
h1.logo {
|
36
|
+
text-align: center;
|
37
|
+
color: $red;
|
38
|
+
padding: .1em 1em;
|
39
|
+
border-bottom: 1px solid $red;
|
40
|
+
margin-bottom: 1.5em;
|
41
|
+
}
|
42
|
+
|
43
|
+
h1.title {
|
44
|
+
text-align: center;
|
45
|
+
color: $blue;
|
46
|
+
padding: .1em 1em;
|
47
|
+
border-bottom: 1px solid $blue;
|
48
|
+
}
|
49
|
+
|
50
|
+
.name {
|
51
|
+
color: $blue;
|
52
|
+
}
|
53
|
+
|
54
|
+
h4.bundle {
|
55
|
+
color: $grey;
|
56
|
+
margin-bottom: 1em;
|
57
|
+
}
|
58
|
+
|
59
|
+
h4.seconds {
|
60
|
+
color: $red;
|
61
|
+
margin-top: 2em;
|
62
|
+
}
|
63
|
+
|
64
|
+
h5.list {
|
65
|
+
color: $blue;
|
66
|
+
}
|
67
|
+
|
68
|
+
h5.endpoint a {
|
69
|
+
color: $red;
|
70
|
+
}
|
71
|
+
|
72
|
+
.log {
|
73
|
+
text-align: center;
|
74
|
+
}
|
75
|
+
|
76
|
+
.start {
|
77
|
+
color: $blue;
|
78
|
+
}
|
79
|
+
|
80
|
+
.duration {
|
81
|
+
color: $red;
|
82
|
+
}
|
83
|
+
|
84
|
+
h3.back {
|
85
|
+
a {
|
86
|
+
color: $blue;
|
87
|
+
padding: .5em;
|
88
|
+
border-bottom: 1px solid $red;
|
89
|
+
}
|
90
|
+
text-align: center;
|
91
|
+
margin-top: 3em;
|
92
|
+
}
|
93
|
+
|
94
|
+
.hero {
|
95
|
+
h1, p {
|
96
|
+
color: #888;
|
97
|
+
}
|
98
|
+
}
|
99
|
+
|
100
|
+
img.icon {
|
101
|
+
margin-top: 3em;
|
102
|
+
}
|
@@ -0,0 +1,377 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# encoding: utf-8
|
3
|
+
|
4
|
+
require "sinatra"
|
5
|
+
require "sinatra/assetpack"
|
6
|
+
require_relative "itunesicon"
|
7
|
+
|
8
|
+
class TokiServer < Sinatra::Application
|
9
|
+
|
10
|
+
set :server, %w[thin webrick]
|
11
|
+
set :port, 4567
|
12
|
+
set :root, File.dirname(__FILE__)
|
13
|
+
|
14
|
+
assets do
|
15
|
+
serve '/js', :from => 'js'
|
16
|
+
serve '/bower_components', :from => 'bower_components'
|
17
|
+
|
18
|
+
js :modernizr, [
|
19
|
+
'/bower_components/modernizr/modernizr.js',
|
20
|
+
]
|
21
|
+
|
22
|
+
js :libs, [
|
23
|
+
'/bower_components/jquery/dist/jquery.js',
|
24
|
+
'/bower_components/foundation/js/foundation.js'
|
25
|
+
]
|
26
|
+
|
27
|
+
js :application, [
|
28
|
+
'/js/app.js'
|
29
|
+
]
|
30
|
+
|
31
|
+
js_compression :jsmin
|
32
|
+
end
|
33
|
+
|
34
|
+
tk = TokiCLI::DBAPI.new
|
35
|
+
itunesgrabber = ItunesIcon.new
|
36
|
+
|
37
|
+
get '/' do
|
38
|
+
erb :index
|
39
|
+
end
|
40
|
+
|
41
|
+
get '/api/?' do
|
42
|
+
endpoints = %w{apps/total apps/top apps/top/NUMBER apps/day/DATE apps/before/DATE apps/since/DATE apps/range/DATE1/DATE2 find/APP_NAME/log bundle/BUNDLE_ID/log find/APP_NAME/total bundle/BUNDLE_ID/total find/APP_NAME/before/DATE bundle/BUNDLE_ID/before/DATE find/APP_NAME/since/DATE bundle/BUNDLE_ID/since/DATE find/APP_NAME/range/DATE1/DATE2 bundle/BUNDLE_ID/range/DATE1/DATE2 find/APP_NAME/split/DATE bundle/BUNDLE_ID/split/DATE}
|
43
|
+
api_endpoints = endpoints.map {|url| "api/#{url}"}
|
44
|
+
content_type :json
|
45
|
+
{
|
46
|
+
meta: {code: 200, message: 'Welcome to the Toki API!'},
|
47
|
+
data: {
|
48
|
+
api_endpoints: api_endpoints,
|
49
|
+
web_endpoints: endpoints
|
50
|
+
}
|
51
|
+
}.to_json
|
52
|
+
end
|
53
|
+
|
54
|
+
get '/apps/total/?' do
|
55
|
+
resp = JSON.parse tk.apps_total
|
56
|
+
title = 'Totals'
|
57
|
+
erb :apps_total, locals: {tk: tk, title: title, resp: resp}
|
58
|
+
end
|
59
|
+
|
60
|
+
get '/api/apps/total/?' do
|
61
|
+
content_type :json
|
62
|
+
tk.apps_total
|
63
|
+
end
|
64
|
+
|
65
|
+
get '/apps/top/?' do
|
66
|
+
resp = JSON.parse tk.apps_top
|
67
|
+
top resp, tk
|
68
|
+
end
|
69
|
+
|
70
|
+
get '/api/apps/top/?' do
|
71
|
+
content_type :json
|
72
|
+
tk.apps_top
|
73
|
+
end
|
74
|
+
|
75
|
+
get '/apps/top/:number/?' do
|
76
|
+
number = params[:number].to_i
|
77
|
+
resp = JSON.parse tk.apps_top number
|
78
|
+
top resp, tk
|
79
|
+
end
|
80
|
+
|
81
|
+
get '/api/apps/top/:number/?' do
|
82
|
+
number = params[:number].to_i
|
83
|
+
content_type :json
|
84
|
+
tk.apps_top number
|
85
|
+
end
|
86
|
+
|
87
|
+
def top resp, tk
|
88
|
+
if resp['meta']['code'] == 200
|
89
|
+
title = 'Top'
|
90
|
+
erb :apps_total, locals: {tk: tk, title: title, resp: resp}
|
91
|
+
else
|
92
|
+
erb :error, locals: {resp: resp, message: 'No data for this request'}
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
get '/apps/before/:day/?' do
|
97
|
+
day = params[:day]
|
98
|
+
resp = JSON.parse tk.apps_before day
|
99
|
+
title = "Before #{day}"
|
100
|
+
if resp['meta']['code'] == 200
|
101
|
+
erb :apps_total, locals: {tk: tk, title: title, resp: resp}
|
102
|
+
else
|
103
|
+
erb :error, locals: {resp: resp, message: 'No data for this request'}
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
get '/api/apps/before/:day/?' do
|
108
|
+
day = params[:day]
|
109
|
+
content_type :json
|
110
|
+
tk.apps_before day
|
111
|
+
end
|
112
|
+
|
113
|
+
get '/apps/since/:day/?' do
|
114
|
+
day = params[:day]
|
115
|
+
resp = JSON.parse tk.apps_since day
|
116
|
+
title = "Since #{day}"
|
117
|
+
if resp['meta']['code'] == 200
|
118
|
+
erb :apps_total, locals: {tk: tk, title: title, resp: resp}
|
119
|
+
else
|
120
|
+
erb :error, locals: {resp: resp, message: 'No data for this request'}
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
get '/api/apps/since/:day/?' do
|
125
|
+
day = params[:day]
|
126
|
+
content_type :json
|
127
|
+
tk.apps_since day
|
128
|
+
end
|
129
|
+
|
130
|
+
get '/apps/day/:day/?' do
|
131
|
+
day = params[:day]
|
132
|
+
resp = JSON.parse tk.apps_day day
|
133
|
+
if resp['meta']['code'] == 200
|
134
|
+
erb :apps_total, locals: {tk: tk, title: day, resp: resp}
|
135
|
+
else
|
136
|
+
erb :error, locals: {resp: resp, message: 'No data for this request'}
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
get '/api/apps/day/:day/?' do
|
141
|
+
day = params[:day]
|
142
|
+
content_type :json
|
143
|
+
tk.apps_day day
|
144
|
+
end
|
145
|
+
|
146
|
+
get '/apps/range/:day1/:day2/?' do
|
147
|
+
day1, day2 = params[:day1], params[:day2]
|
148
|
+
begin
|
149
|
+
d1, d2 = Time.parse(day1), Time.parse(day2)
|
150
|
+
rescue ArgumentError => e
|
151
|
+
redirect '/'
|
152
|
+
end
|
153
|
+
if d1 > d2
|
154
|
+
title = "#{day2} #{day1}"
|
155
|
+
resp = JSON.parse tk.apps_range day2, day1
|
156
|
+
else
|
157
|
+
title = "#{day1} #{day2}"
|
158
|
+
resp = JSON.parse tk.apps_range day1, day2
|
159
|
+
end
|
160
|
+
if resp['meta']['code'] == 200
|
161
|
+
erb :apps_total, locals: {tk: tk, title: title, resp: resp}
|
162
|
+
else
|
163
|
+
erb :error, locals: {resp: resp, message: 'No data for this request'}
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
get '/api/apps/range/:day1/:day2/?' do
|
168
|
+
day1, day2 = params[:day1], params[:day2]
|
169
|
+
content_type :json
|
170
|
+
tk.apps_range day1, day2
|
171
|
+
end
|
172
|
+
|
173
|
+
get '/find/:name/total/?' do
|
174
|
+
name = params[:name]
|
175
|
+
resp = JSON.parse tk.name_total(name)
|
176
|
+
if resp['meta']['code'] == 200
|
177
|
+
#@icon_url = itunesgrabber.grab_big(name)
|
178
|
+
erb :name_total, locals: {tk: tk, title: basic_title, resp: resp}
|
179
|
+
else
|
180
|
+
erb :error, locals: {resp: resp, message: "Unable to find '#{name}'"}
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
get '/api/find/:name/total/?' do
|
185
|
+
name = params[:name]
|
186
|
+
content_type :json
|
187
|
+
tk.name_total name
|
188
|
+
end
|
189
|
+
|
190
|
+
get '/bundle/:bundle/total/?' do
|
191
|
+
bundle = params[:bundle]
|
192
|
+
resp = JSON.parse tk.bundle_total bundle
|
193
|
+
erb :name_total, locals: {tk: tk, title: basic_title, resp: resp}
|
194
|
+
end
|
195
|
+
|
196
|
+
get '/api/bundle/:bundle/total/?' do
|
197
|
+
bundle = params[:bundle]
|
198
|
+
content_type :json
|
199
|
+
tk.bundle_total bundle
|
200
|
+
end
|
201
|
+
|
202
|
+
get '/find/:name/since/:day/?' do
|
203
|
+
name, day = params[:name], params[:day]
|
204
|
+
resp = JSON.parse tk.name_total_since name, day
|
205
|
+
if resp['meta']['code'] == 200
|
206
|
+
#@icon_url = itunesgrabber.grab_big(name)
|
207
|
+
erb :name_total, locals: {tk: tk, title: basic_title, resp: resp}
|
208
|
+
else
|
209
|
+
erb :error, locals: {resp: resp, message: "Unable to find '#{name}'"}
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
get '/api/find/:name/since/:day/?' do
|
214
|
+
name, day = params[:name], params[:day]
|
215
|
+
content_type :json
|
216
|
+
tk.name_total_since name, day
|
217
|
+
end
|
218
|
+
|
219
|
+
get '/bundle/:name/since/:day/?' do
|
220
|
+
name, day = params[:name], params[:day]
|
221
|
+
resp = JSON.parse tk.bundle_total_since name, day
|
222
|
+
erb :name_total, locals: {tk: tk, title: basic_title, resp: resp}
|
223
|
+
end
|
224
|
+
|
225
|
+
get '/api/bundle/:name/since/:day/?' do
|
226
|
+
name, day = params[:name], params[:day]
|
227
|
+
content_type :json
|
228
|
+
tk.bundle_total_since name, day
|
229
|
+
end
|
230
|
+
|
231
|
+
get '/find/:name/before/:day/?' do
|
232
|
+
name, day = params[:name], params[:day]
|
233
|
+
resp = JSON.parse tk.name_total_before name, day
|
234
|
+
if resp['meta']['code'] == 200
|
235
|
+
#@icon_url = itunesgrabber.grab_big(name)
|
236
|
+
erb :name_total, locals: {tk: tk, title: basic_title, resp: resp}
|
237
|
+
else
|
238
|
+
erb :error, locals: {resp: resp, message: "Unable to find '#{name}'"}
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
get '/api/find/:name/before/:day/?' do
|
243
|
+
name, day = params[:name], params[:day]
|
244
|
+
content_type :json
|
245
|
+
tk.name_total_before name, day
|
246
|
+
end
|
247
|
+
|
248
|
+
get '/bundle/:name/before/:day/?' do
|
249
|
+
name, day = params[:name], params[:day]
|
250
|
+
resp = JSON.parse tk.bundle_total_before name, day
|
251
|
+
erb :name_total, locals: {tk: tk, title: basic_title, resp: resp}
|
252
|
+
end
|
253
|
+
|
254
|
+
get '/api/bundle/:name/before/:day/?' do
|
255
|
+
name, day = params[:name], params[:day]
|
256
|
+
content_type :json
|
257
|
+
tk.bundle_total_before name, day
|
258
|
+
end
|
259
|
+
|
260
|
+
get '/find/:name/range/:day1/:day2/?' do
|
261
|
+
name, day1, day2 = params[:name], params[:day1], params[:day2]
|
262
|
+
if Time.parse(day1) > Time.parse(day2)
|
263
|
+
title = "#{day2} #{day1}"
|
264
|
+
resp = JSON.parse tk.name_total_range name, day2, day1
|
265
|
+
else
|
266
|
+
title = "#{day1} #{day2}"
|
267
|
+
resp = JSON.parse tk.name_total_range name, day1, day2
|
268
|
+
end
|
269
|
+
if resp['meta']['code'] == 200
|
270
|
+
#@icon_url = itunesgrabber.grab_big(name)
|
271
|
+
erb :name_total, locals: {tk: tk, title: title, resp: resp}
|
272
|
+
else
|
273
|
+
erb :error, locals: {resp: resp, message: "Unable to find '#{name}'"}
|
274
|
+
end
|
275
|
+
end
|
276
|
+
|
277
|
+
get '/api/find/:name/range/:day1/:day2/?' do
|
278
|
+
name, day1, day2 = params[:name], params[:day1], params[:day2]
|
279
|
+
content_type :json
|
280
|
+
tk.name_total_range name, day1, day2
|
281
|
+
end
|
282
|
+
|
283
|
+
get '/bundle/:name/range/:day1/:day2/?' do
|
284
|
+
name, day1, day2 = params[:name], params[:day1], params[:day2]
|
285
|
+
if Time.parse(day1) > Time.parse(day2)
|
286
|
+
title = "#{day2} #{day1}"
|
287
|
+
resp = JSON.parse tk.bundle_total_range name, day2, day1
|
288
|
+
else
|
289
|
+
title = "#{day1} #{day2}"
|
290
|
+
resp = JSON.parse tk.bundle_total_range name, day1, day2
|
291
|
+
end
|
292
|
+
erb :name_total, locals: {tk: tk, title: basic_title, resp: resp}
|
293
|
+
end
|
294
|
+
|
295
|
+
get '/api/bundle/:name/range/:day1/:day2/?' do
|
296
|
+
name, day1, day2 = params[:name], params[:day1], params[:day2]
|
297
|
+
content_type :json
|
298
|
+
tk.bundle_total_range name, day1, day2
|
299
|
+
end
|
300
|
+
|
301
|
+
get '/find/:name/split/:day/?' do
|
302
|
+
name, day = params[:name], params[:day]
|
303
|
+
resp = JSON.parse tk.name_total_split name, day
|
304
|
+
if resp['meta']['code'] == 200
|
305
|
+
#@icon_url = itunesgrabber.grab_big(name)
|
306
|
+
erb :name_split, locals: {tk: tk, title: day, resp: resp}
|
307
|
+
else
|
308
|
+
erb :error, locals: {resp: resp, message: "Unable to find '#{name}'"}
|
309
|
+
end
|
310
|
+
end
|
311
|
+
|
312
|
+
get '/api/find/:name/split/:day/?' do
|
313
|
+
name, day = params[:name], params[:day]
|
314
|
+
content_type :json
|
315
|
+
tk.name_total_split name, day
|
316
|
+
end
|
317
|
+
|
318
|
+
get '/bundle/:name/split/:day/?' do
|
319
|
+
name, day = params[:name], params[:day]
|
320
|
+
resp = JSON.parse tk.bundle_total_split name, day
|
321
|
+
erb :name_split, locals: {tk: tk, title: day, resp: resp}
|
322
|
+
end
|
323
|
+
|
324
|
+
get '/api/bundle/:name/split/:day/?' do
|
325
|
+
name, day = params[:name], params[:day]
|
326
|
+
content_type :json
|
327
|
+
tk.bundle_total_split name, day
|
328
|
+
end
|
329
|
+
|
330
|
+
get '/bundle/:name/log/?' do
|
331
|
+
name = params[:name]
|
332
|
+
resp = sort_log JSON.parse(tk.bundle_log(name))
|
333
|
+
erb :name_log, locals: {tk: tk, title: 'Log', resp: resp}
|
334
|
+
end
|
335
|
+
|
336
|
+
get '/api/bundle/:name/log/?' do
|
337
|
+
name = params[:name]
|
338
|
+
content_type :json
|
339
|
+
tk.bundle_log name
|
340
|
+
end
|
341
|
+
|
342
|
+
get '/find/:name/log/?' do
|
343
|
+
name = params[:name]
|
344
|
+
resp = sort_log JSON.parse(tk.name_log(name))
|
345
|
+
if resp['meta']['code'] == 200
|
346
|
+
#@icon_url = itunesgrabber.grab_big(name)
|
347
|
+
erb :name_log, locals: {tk: tk, title: 'Log', resp: resp}
|
348
|
+
else
|
349
|
+
erb :error, locals: {resp: resp, message: "Unable to find '#{name}'"}
|
350
|
+
end
|
351
|
+
end
|
352
|
+
|
353
|
+
get '/api/find/:name/log/?' do
|
354
|
+
name = params[:name]
|
355
|
+
content_type :json
|
356
|
+
tk.name_log name
|
357
|
+
end
|
358
|
+
|
359
|
+
def sort_log resp
|
360
|
+
bucket, net = [], {}
|
361
|
+
resp['data']['log'].each do |id, content|
|
362
|
+
bucket << [id, content]
|
363
|
+
end
|
364
|
+
bucket.sort_by! {|id, content| content['start']}
|
365
|
+
bucket.each do |id, content|
|
366
|
+
net[id] = content
|
367
|
+
end
|
368
|
+
resp['data']['log'] = net
|
369
|
+
resp
|
370
|
+
end
|
371
|
+
|
372
|
+
def basic_title
|
373
|
+
"Total"
|
374
|
+
end
|
375
|
+
|
376
|
+
end
|
377
|
+
|