demotape 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -0
- data/CHANGELOG.md +9 -0
- data/Makefile +4 -2
- data/README.md +101 -10
- data/demotape.gemspec +1 -1
- data/demotape.y +224 -505
- data/demotape_new.y.backup +160 -0
- data/demotape_simple_test.y +32 -0
- data/editors/sublime-text/DemoTape.sublime-completions +4 -0
- data/editors/sublime-text/DemoTape.sublime-syntax +24 -2
- data/editors/vim/syntax/demotape.vim +16 -2
- data/editors/vscode/demotape.tmLanguage.json +31 -3
- data/lib/demo_tape/cli.rb +36 -0
- data/lib/demo_tape/command.rb +63 -103
- data/lib/demo_tape/exporter.rb +3 -0
- data/lib/demo_tape/formatter.rb +142 -0
- data/lib/demo_tape/lexer.rb +118 -34
- data/lib/demo_tape/parser/helpers.rb +363 -0
- data/lib/demo_tape/parser/rules.rb +396 -0
- data/lib/demo_tape/parser.rb +381 -592
- data/lib/demo_tape/runner.rb +82 -27
- data/lib/demo_tape/token.rb +86 -0
- data/lib/demo_tape/version.rb +1 -1
- data/lib/demo_tape.rb +5 -2
- metadata +10 -527
- data/examples/alt.mp4 +0 -0
- data/examples/alt.png +0 -0
- data/examples/alt.tape +0 -9
- data/examples/arrow.mp4 +0 -0
- data/examples/arrow.png +0 -0
- data/examples/arrow.tape +0 -7
- data/examples/backspace.mp4 +0 -0
- data/examples/backspace.png +0 -0
- data/examples/backspace.tape +0 -4
- data/examples/bash.mp4 +0 -0
- data/examples/bash.png +0 -0
- data/examples/bash.tape +0 -4
- data/examples/bg.jpg +0 -0
- data/examples/clear.mp4 +0 -0
- data/examples/clear.png +0 -0
- data/examples/clear.tape +0 -6
- data/examples/cli_ui_interactive_prompt.mp4 +0 -0
- data/examples/cli_ui_interactive_prompt.png +0 -0
- data/examples/cli_ui_interactive_prompt.tape +0 -16
- data/examples/cli_ui_nested_frames.mp4 +0 -0
- data/examples/cli_ui_nested_frames.png +0 -0
- data/examples/cli_ui_nested_frames.tape +0 -15
- data/examples/cli_ui_progress.mp4 +0 -0
- data/examples/cli_ui_progress.png +0 -0
- data/examples/cli_ui_progress.tape +0 -6
- data/examples/cli_ui_spinner.mp4 +0 -0
- data/examples/cli_ui_spinner.png +0 -0
- data/examples/cli_ui_spinner.tape +0 -6
- data/examples/cli_ui_status_widget.mp4 +0 -0
- data/examples/cli_ui_status_widget.png +0 -0
- data/examples/cli_ui_status_widget.tape +0 -6
- data/examples/cli_ui_symbols.mp4 +0 -0
- data/examples/cli_ui_symbols.png +0 -0
- data/examples/cli_ui_symbols.tape +0 -6
- data/examples/cli_ui_text_prompt.mp4 +0 -0
- data/examples/cli_ui_text_prompt.png +0 -0
- data/examples/cli_ui_text_prompt.tape +0 -10
- data/examples/clipboard.mp4 +0 -0
- data/examples/clipboard.png +0 -0
- data/examples/clipboard.tape +0 -5
- data/examples/ctrl.mp4 +0 -0
- data/examples/ctrl.png +0 -0
- data/examples/ctrl.tape +0 -5
- data/examples/ctrl_arrows.mp4 +0 -0
- data/examples/ctrl_arrows.png +0 -0
- data/examples/ctrl_arrows.tape +0 -14
- data/examples/demotape.mp4 +0 -0
- data/examples/demotape.png +0 -0
- data/examples/demotape.tape +0 -6
- data/examples/demotape.txt +0 -13
- data/examples/enter.mp4 +0 -0
- data/examples/enter.png +0 -0
- data/examples/enter.tape +0 -3
- data/examples/errors/include_itself.tape +0 -1
- data/examples/fastfetch.gif +0 -0
- data/examples/fastfetch.mp4 +0 -0
- data/examples/fastfetch.png +0 -0
- data/examples/fastfetch.tape +0 -11
- data/examples/fish.mp4 +0 -0
- data/examples/fish.png +0 -0
- data/examples/fish.tape +0 -4
- data/examples/format.mp4 +0 -0
- data/examples/format.png +0 -0
- data/examples/format.tape +0 -15
- data/examples/gh-cli.mp4 +0 -0
- data/examples/gh-cli.png +0 -0
- data/examples/gh-cli.tape +0 -13
- data/examples/gif_loop.gif +0 -0
- data/examples/gif_loop.png +0 -0
- data/examples/gif_loop.tape +0 -5
- data/examples/include.mp4 +0 -0
- data/examples/include.png +0 -0
- data/examples/include.tape +0 -1
- data/examples/include_with_set.mp4 +0 -0
- data/examples/include_with_set.png +0 -0
- data/examples/include_with_set.tape +0 -2
- data/examples/meta/cli.tape +0 -10
- data/examples/nerdfonts.mp4 +0 -0
- data/examples/nerdfonts.png +0 -0
- data/examples/nerdfonts.tape +0 -9
- data/examples/output.avi +0 -0
- data/examples/output.gif +0 -0
- data/examples/output.mov +0 -0
- data/examples/output.mp4 +0 -0
- data/examples/output.png +0 -0
- data/examples/output.tape +0 -9
- data/examples/output.webm +0 -0
- data/examples/products.json +0 -1803
- data/examples/screenshot.mp4 +0 -0
- data/examples/screenshot.png +0 -0
- data/examples/screenshot.tape +0 -9
- data/examples/script.rb +0 -3
- data/examples/set_cursor_bar.mp4 +0 -0
- data/examples/set_cursor_bar.png +0 -0
- data/examples/set_cursor_bar.tape +0 -5
- data/examples/set_cursor_blink.mp4 +0 -0
- data/examples/set_cursor_blink.png +0 -0
- data/examples/set_cursor_blink.tape +0 -4
- data/examples/set_cursor_underline.mp4 +0 -0
- data/examples/set_cursor_underline.png +0 -0
- data/examples/set_cursor_underline.tape +0 -5
- data/examples/set_dimensions.mp4 +0 -0
- data/examples/set_dimensions.png +0 -0
- data/examples/set_dimensions.tape +0 -5
- data/examples/set_font_family.mp4 +0 -0
- data/examples/set_font_family.png +0 -0
- data/examples/set_font_family.tape +0 -4
- data/examples/set_font_size.mp4 +0 -0
- data/examples/set_font_size.png +0 -0
- data/examples/set_font_size.tape +0 -4
- data/examples/set_line_height.mp4 +0 -0
- data/examples/set_line_height.png +0 -0
- data/examples/set_line_height.tape +0 -8
- data/examples/set_margin.mp4 +0 -0
- data/examples/set_margin.png +0 -0
- data/examples/set_margin.tape +0 -7
- data/examples/set_margin_with_border_radius.mp4 +0 -0
- data/examples/set_margin_with_border_radius.png +0 -0
- data/examples/set_margin_with_border_radius.tape +0 -8
- data/examples/set_margin_with_image.mp4 +0 -0
- data/examples/set_margin_with_image.png +0 -0
- data/examples/set_margin_with_image.tape +0 -7
- data/examples/set_padding.mp4 +0 -0
- data/examples/set_padding.png +0 -0
- data/examples/set_padding.tape +0 -7
- data/examples/set_theme.mp4 +0 -0
- data/examples/set_theme.png +0 -0
- data/examples/set_theme.tape +0 -9
- data/examples/set_theme_property.mp4 +0 -0
- data/examples/set_theme_property.png +0 -0
- data/examples/set_theme_property.tape +0 -10
- data/examples/set_typing_speed.mp4 +0 -0
- data/examples/set_typing_speed.png +0 -0
- data/examples/set_typing_speed.tape +0 -6
- data/examples/slides.mp4 +0 -0
- data/examples/slides.png +0 -0
- data/examples/slides.tape +0 -14
- data/examples/space.mp4 +0 -0
- data/examples/space.png +0 -0
- data/examples/space.tape +0 -3
- data/examples/stdin.mp4 +0 -0
- data/examples/stdin.png +0 -0
- data/examples/stdin.tape +0 -7
- data/examples/tab.mp4 +0 -0
- data/examples/tab.png +0 -0
- data/examples/tab.tape +0 -5
- data/examples/themes/3024_day.png +0 -0
- data/examples/themes/3024_night.png +0 -0
- data/examples/themes/aardvark_blue.png +0 -0
- data/examples/themes/abernathy.png +0 -0
- data/examples/themes/adventure.png +0 -0
- data/examples/themes/adventure_time.png +0 -0
- data/examples/themes/afterglow.png +0 -0
- data/examples/themes/alabaster.png +0 -0
- data/examples/themes/alien_blood.png +0 -0
- data/examples/themes/andromeda.png +0 -0
- data/examples/themes/apple_classic.png +0 -0
- data/examples/themes/apple_system_colors.png +0 -0
- data/examples/themes/arcoiris.png +0 -0
- data/examples/themes/argonaut.png +0 -0
- data/examples/themes/arthur.png +0 -0
- data/examples/themes/atelier_sulphurpool.png +0 -0
- data/examples/themes/atom.png +0 -0
- data/examples/themes/atom_one_light.png +0 -0
- data/examples/themes/aurora.png +0 -0
- data/examples/themes/ayu.png +0 -0
- data/examples/themes/ayu_light.png +0 -0
- data/examples/themes/ayu_mirage.png +0 -0
- data/examples/themes/banana_blueberry.png +0 -0
- data/examples/themes/batman.png +0 -0
- data/examples/themes/belafonte_day.png +0 -0
- data/examples/themes/belafonte_night.png +0 -0
- data/examples/themes/birds_of_paradise.png +0 -0
- data/examples/themes/blazer.png +0 -0
- data/examples/themes/blue_berry_pie.png +0 -0
- data/examples/themes/blue_dolphin.png +0 -0
- data/examples/themes/blue_matrix.png +0 -0
- data/examples/themes/bluloco_dark.png +0 -0
- data/examples/themes/bluloco_light.png +0 -0
- data/examples/themes/borland.png +0 -0
- data/examples/themes/breeze.png +0 -0
- data/examples/themes/bright_lights.png +0 -0
- data/examples/themes/broadcast.png +0 -0
- data/examples/themes/brogrammer.png +0 -0
- data/examples/themes/bubbles.png +0 -0
- data/examples/themes/builtin_dark.png +0 -0
- data/examples/themes/builtin_light.png +0 -0
- data/examples/themes/builtin_pastel_dark.png +0 -0
- data/examples/themes/builtin_solarized_dark.png +0 -0
- data/examples/themes/builtin_solarized_light.png +0 -0
- data/examples/themes/builtin_tango_dark.png +0 -0
- data/examples/themes/builtin_tango_light.png +0 -0
- data/examples/themes/c64.png +0 -0
- data/examples/themes/calamity.png +0 -0
- data/examples/themes/catppuccin_frappe.png +0 -0
- data/examples/themes/catppuccin_latte.png +0 -0
- data/examples/themes/catppuccin_macchiato.png +0 -0
- data/examples/themes/catppuccin_mocha.png +0 -0
- data/examples/themes/cga.png +0 -0
- data/examples/themes/chalk.png +0 -0
- data/examples/themes/chalkboard.png +0 -0
- data/examples/themes/challenger_deep.png +0 -0
- data/examples/themes/chester.png +0 -0
- data/examples/themes/ciapre.png +0 -0
- data/examples/themes/clrs.png +0 -0
- data/examples/themes/cobalt2.png +0 -0
- data/examples/themes/cobalt_neon.png +0 -0
- data/examples/themes/coffee_theme.png +0 -0
- data/examples/themes/contrast_light.png +0 -0
- data/examples/themes/coolnight.png +0 -0
- data/examples/themes/crayon_pony_fish.png +0 -0
- data/examples/themes/crystal_violet.png +0 -0
- data/examples/themes/cutie_pro.png +0 -0
- data/examples/themes/cyber_cube.png +0 -0
- data/examples/themes/cyber_punk2077.png +0 -0
- data/examples/themes/cyberdyne.png +0 -0
- data/examples/themes/cyberpunk.png +0 -0
- data/examples/themes/dark_pastel.png +0 -0
- data/examples/themes/dark_plus.png +0 -0
- data/examples/themes/darkermatrix.png +0 -0
- data/examples/themes/darkmatrix.png +0 -0
- data/examples/themes/darkside.png +0 -0
- data/examples/themes/dayfox.png +0 -0
- data/examples/themes/deep.png +0 -0
- data/examples/themes/desert.png +0 -0
- data/examples/themes/dimmed_monokai.png +0 -0
- data/examples/themes/django.png +0 -0
- data/examples/themes/django_reborn_again.png +0 -0
- data/examples/themes/django_smooth.png +0 -0
- data/examples/themes/doom_one.png +0 -0
- data/examples/themes/doom_peacock.png +0 -0
- data/examples/themes/dot_gov.png +0 -0
- data/examples/themes/dracula.png +0 -0
- data/examples/themes/dracula_plus.png +0 -0
- data/examples/themes/duckbones.png +0 -0
- data/examples/themes/duotone_dark.png +0 -0
- data/examples/themes/earthsong.png +0 -0
- data/examples/themes/elemental.png +0 -0
- data/examples/themes/elementary.png +0 -0
- data/examples/themes/encom.png +0 -0
- data/examples/themes/espresso.png +0 -0
- data/examples/themes/espresso_libre.png +0 -0
- data/examples/themes/everblush.png +0 -0
- data/examples/themes/fahrenheit.png +0 -0
- data/examples/themes/fairyfloss.png +0 -0
- data/examples/themes/farmhouse_dark.png +0 -0
- data/examples/themes/farmhouse_light.png +0 -0
- data/examples/themes/fideloper.png +0 -0
- data/examples/themes/firefly_traditional.png +0 -0
- data/examples/themes/firefox_dev.png +0 -0
- data/examples/themes/firewatch.png +0 -0
- data/examples/themes/fish_tank.png +0 -0
- data/examples/themes/flat.png +0 -0
- data/examples/themes/flatland.png +0 -0
- data/examples/themes/flexoki_dark.png +0 -0
- data/examples/themes/flexoki_light.png +0 -0
- data/examples/themes/floraverse.png +0 -0
- data/examples/themes/forest_blue.png +0 -0
- data/examples/themes/framer.png +0 -0
- data/examples/themes/front_end_delight.png +0 -0
- data/examples/themes/fun_forrest.png +0 -0
- data/examples/themes/galaxy.png +0 -0
- data/examples/themes/galizur.png +0 -0
- data/examples/themes/ganyu.png +0 -0
- data/examples/themes/git_hub_dark.png +0 -0
- data/examples/themes/github.png +0 -0
- data/examples/themes/glacier.png +0 -0
- data/examples/themes/glorious.png +0 -0
- data/examples/themes/grape.png +0 -0
- data/examples/themes/grass.png +0 -0
- data/examples/themes/grey_green.png +0 -0
- data/examples/themes/gruvbox_dark.png +0 -0
- data/examples/themes/gruvbox_dark_hard.png +0 -0
- data/examples/themes/gruvbox_light.png +0 -0
- data/examples/themes/guezwhoz.png +0 -0
- data/examples/themes/h4rithd.png +0 -0
- data/examples/themes/h4rithd_com.png +0 -0
- data/examples/themes/ha_x0_r_blue.png +0 -0
- data/examples/themes/ha_x0_r_gr33_n.png +0 -0
- data/examples/themes/ha_x0_r_r3_d.png +0 -0
- data/examples/themes/hacktober.png +0 -0
- data/examples/themes/hardcore.png +0 -0
- data/examples/themes/harper.png +0 -0
- data/examples/themes/highway.png +0 -0
- data/examples/themes/hipster_green.png +0 -0
- data/examples/themes/hivacruz.png +0 -0
- data/examples/themes/homebrew.png +0 -0
- data/examples/themes/hopscotch.png +0 -0
- data/examples/themes/hopscotch_256.png +0 -0
- data/examples/themes/horizon.png +0 -0
- data/examples/themes/hurtado.png +0 -0
- data/examples/themes/hybrid.png +0 -0
- data/examples/themes/hyper.png +0 -0
- data/examples/themes/ic_green_ppl.png +0 -0
- data/examples/themes/ic_orange_ppl.png +0 -0
- data/examples/themes/iceberg_dark.png +0 -0
- data/examples/themes/iceberg_light.png +0 -0
- data/examples/themes/idea.png +0 -0
- data/examples/themes/idle_toes.png +0 -0
- data/examples/themes/ir_black.png +0 -0
- data/examples/themes/iterm2_dark_background.png +0 -0
- data/examples/themes/iterm2_default.png +0 -0
- data/examples/themes/iterm2_light_background.png +0 -0
- data/examples/themes/iterm2_pastel_dark_background.png +0 -0
- data/examples/themes/iterm2_smoooooth.png +0 -0
- data/examples/themes/iterm2_solarized_dark.png +0 -0
- data/examples/themes/iterm2_solarized_light.png +0 -0
- data/examples/themes/iterm2_tango_dark.png +0 -0
- data/examples/themes/iterm2_tango_light.png +0 -0
- data/examples/themes/jackie_brown.png +0 -0
- data/examples/themes/japanesque.png +0 -0
- data/examples/themes/jellybeans.png +0 -0
- data/examples/themes/jet_brains_darcula.png +0 -0
- data/examples/themes/jubi.png +0 -0
- data/examples/themes/juicy_colors.png +0 -0
- data/examples/themes/kanagawa.png +0 -0
- data/examples/themes/kanagawabones.png +0 -0
- data/examples/themes/kibble.png +0 -0
- data/examples/themes/kolorit.png +0 -0
- data/examples/themes/konsolas.png +0 -0
- data/examples/themes/lab_fox.png +0 -0
- data/examples/themes/laser.png +0 -0
- data/examples/themes/later_this_evening.png +0 -0
- data/examples/themes/lavandula.png +0 -0
- data/examples/themes/liquid_carbon.png +0 -0
- data/examples/themes/liquid_carbon_transparent.png +0 -0
- data/examples/themes/liquid_carbon_transparent_inverse.png +0 -0
- data/examples/themes/lovelace.png +0 -0
- data/examples/themes/man_page.png +0 -0
- data/examples/themes/mariana.png +0 -0
- data/examples/themes/material.png +0 -0
- data/examples/themes/material_dark.png +0 -0
- data/examples/themes/material_darker.png +0 -0
- data/examples/themes/material_design_colors.png +0 -0
- data/examples/themes/material_ocean.png +0 -0
- data/examples/themes/mathias.png +0 -0
- data/examples/themes/matrix.png +0 -0
- data/examples/themes/medallion.png +0 -0
- data/examples/themes/mellifluous.png +0 -0
- data/examples/themes/midnight_in_mojave.png +0 -0
- data/examples/themes/mirage.png +0 -0
- data/examples/themes/misterioso.png +0 -0
- data/examples/themes/molokai.png +0 -0
- data/examples/themes/mona_lisa.png +0 -0
- data/examples/themes/monokai_cmder.png +0 -0
- data/examples/themes/monokai_pro.png +0 -0
- data/examples/themes/monokai_pro_filter_octagon.png +0 -0
- data/examples/themes/monokai_pro_filter_ristretto.png +0 -0
- data/examples/themes/monokai_remastered.png +0 -0
- data/examples/themes/monokai_soda.png +0 -0
- data/examples/themes/monokai_vivid.png +0 -0
- data/examples/themes/moonlight_ii.png +0 -0
- data/examples/themes/n0tch2k.png +0 -0
- data/examples/themes/neobones_dark.png +0 -0
- data/examples/themes/neobones_light.png +0 -0
- data/examples/themes/neon.png +0 -0
- data/examples/themes/neopolitan.png +0 -0
- data/examples/themes/neutron.png +0 -0
- data/examples/themes/night_city.png +0 -0
- data/examples/themes/night_lion_v1.png +0 -0
- data/examples/themes/night_lion_v2.png +0 -0
- data/examples/themes/night_owlish_light.png +0 -0
- data/examples/themes/nightfox.png +0 -0
- data/examples/themes/niji.png +0 -0
- data/examples/themes/nocturnal_winter.png +0 -0
- data/examples/themes/nord.png +0 -0
- data/examples/themes/nord_light.png +0 -0
- data/examples/themes/novel.png +0 -0
- data/examples/themes/nvim_dark.png +0 -0
- data/examples/themes/nvim_light.png +0 -0
- data/examples/themes/obsidian.png +0 -0
- data/examples/themes/ocean.png +0 -0
- data/examples/themes/oceanic_material.png +0 -0
- data/examples/themes/oceanic_next.png +0 -0
- data/examples/themes/ollie.png +0 -0
- data/examples/themes/one_dark.png +0 -0
- data/examples/themes/one_half_dark.png +0 -0
- data/examples/themes/one_half_light.png +0 -0
- data/examples/themes/one_star.png +0 -0
- data/examples/themes/operator_mono_dark.png +0 -0
- data/examples/themes/overnight_slumber.png +0 -0
- data/examples/themes/pale_night_hc.png +0 -0
- data/examples/themes/pandora.png +0 -0
- data/examples/themes/paraiso_dark.png +0 -0
- data/examples/themes/paul_millr.png +0 -0
- data/examples/themes/pencil_dark.png +0 -0
- data/examples/themes/pencil_light.png +0 -0
- data/examples/themes/peppermint.png +0 -0
- data/examples/themes/piatto_light.png +0 -0
- data/examples/themes/pnevma.png +0 -0
- data/examples/themes/popping_and_locking.png +0 -0
- data/examples/themes/primary.png +0 -0
- data/examples/themes/primer.png +0 -0
- data/examples/themes/pro.png +0 -0
- data/examples/themes/pro_light.png +0 -0
- data/examples/themes/purple_rain.png +0 -0
- data/examples/themes/purplepeter.png +0 -0
- data/examples/themes/qb64_super_dark_blue.png +0 -0
- data/examples/themes/rapture.png +0 -0
- data/examples/themes/raycast_dark.png +0 -0
- data/examples/themes/raycast_light.png +0 -0
- data/examples/themes/rebecca.png +0 -0
- data/examples/themes/red_alert.png +0 -0
- data/examples/themes/red_planet.png +0 -0
- data/examples/themes/red_sands.png +0 -0
- data/examples/themes/relaxed.png +0 -0
- data/examples/themes/retro.png +0 -0
- data/examples/themes/retrowave.png +0 -0
- data/examples/themes/rippedcasts.png +0 -0
- data/examples/themes/rose_pine.png +0 -0
- data/examples/themes/rose_pine_dawn.png +0 -0
- data/examples/themes/rose_pine_moon.png +0 -0
- data/examples/themes/rouge_2.png +0 -0
- data/examples/themes/royal.png +0 -0
- data/examples/themes/ryuuko.png +0 -0
- data/examples/themes/sakura.png +0 -0
- data/examples/themes/scarlet_protocol.png +0 -0
- data/examples/themes/sea_shells.png +0 -0
- data/examples/themes/seafoam_pastel.png +0 -0
- data/examples/themes/seoulbones_dark.png +0 -0
- data/examples/themes/seoulbones_light.png +0 -0
- data/examples/themes/serendipity_midnight.png +0 -0
- data/examples/themes/serendipity_morning.png +0 -0
- data/examples/themes/serendipity_sunset.png +0 -0
- data/examples/themes/seti.png +0 -0
- data/examples/themes/shades_of_purple.png +0 -0
- data/examples/themes/shaman.png +0 -0
- data/examples/themes/slate.png +0 -0
- data/examples/themes/sleepy_hollow.png +0 -0
- data/examples/themes/smyck.png +0 -0
- data/examples/themes/snazzy.png +0 -0
- data/examples/themes/soft_server.png +0 -0
- data/examples/themes/solarized_darcula.png +0 -0
- data/examples/themes/solarized_dark_higher_contrast.png +0 -0
- data/examples/themes/solarized_dark_patched.png +0 -0
- data/examples/themes/sonoran_gothic.png +0 -0
- data/examples/themes/sonoran_sunrise.png +0 -0
- data/examples/themes/space_gray.png +0 -0
- data/examples/themes/space_gray_eighties.png +0 -0
- data/examples/themes/space_gray_eighties_dull.png +0 -0
- data/examples/themes/spacedust.png +0 -0
- data/examples/themes/spiderman.png +0 -0
- data/examples/themes/spring.png +0 -0
- data/examples/themes/square.png +0 -0
- data/examples/themes/sublette.png +0 -0
- data/examples/themes/subliminal.png +0 -0
- data/examples/themes/sundried.png +0 -0
- data/examples/themes/symfonic.png +0 -0
- data/examples/themes/synthwave.png +0 -0
- data/examples/themes/synthwave_alpha.png +0 -0
- data/examples/themes/synthwave_everything.png +0 -0
- data/examples/themes/tango_adapted.png +0 -0
- data/examples/themes/tango_half_adapted.png +0 -0
- data/examples/themes/teerb.png +0 -0
- data/examples/themes/terafox.png +0 -0
- data/examples/themes/terminal_basic.png +0 -0
- data/examples/themes/thayer_bright.png +0 -0
- data/examples/themes/the_hulk.png +0 -0
- data/examples/themes/theme.tape +0 -13
- data/examples/themes/tinacious_design_dark.png +0 -0
- data/examples/themes/tinacious_design_light.png +0 -0
- data/examples/themes/tokyo_night.png +0 -0
- data/examples/themes/tokyo_night_light.png +0 -0
- data/examples/themes/tokyo_night_storm.png +0 -0
- data/examples/themes/tokyonight.png +0 -0
- data/examples/themes/tokyonight_day.png +0 -0
- data/examples/themes/tokyonight_storm.png +0 -0
- data/examples/themes/tomorrow.png +0 -0
- data/examples/themes/tomorrow_night.png +0 -0
- data/examples/themes/tomorrow_night_blue.png +0 -0
- data/examples/themes/tomorrow_night_bright.png +0 -0
- data/examples/themes/tomorrow_night_burns.png +0 -0
- data/examples/themes/tomorrow_night_eighties.png +0 -0
- data/examples/themes/toy_chest.png +0 -0
- data/examples/themes/treehouse.png +0 -0
- data/examples/themes/twilight.png +0 -0
- data/examples/themes/ubuntu.png +0 -0
- data/examples/themes/ultra_dark.png +0 -0
- data/examples/themes/ultra_violent.png +0 -0
- data/examples/themes/under_the_sea.png +0 -0
- data/examples/themes/unholy.png +0 -0
- data/examples/themes/unikitty.png +0 -0
- data/examples/themes/urple.png +0 -0
- data/examples/themes/vaughn.png +0 -0
- data/examples/themes/vesper.png +0 -0
- data/examples/themes/vibrant_ink.png +0 -0
- data/examples/themes/vimbones.png +0 -0
- data/examples/themes/violet_dark.png +0 -0
- data/examples/themes/violet_light.png +0 -0
- data/examples/themes/warm_neon.png +0 -0
- data/examples/themes/wez.png +0 -0
- data/examples/themes/whimsy.png +0 -0
- data/examples/themes/wild_cherry.png +0 -0
- data/examples/themes/wilmersdorf.png +0 -0
- data/examples/themes/wombat.png +0 -0
- data/examples/themes/wryan.png +0 -0
- data/examples/themes/zenbones.png +0 -0
- data/examples/themes/zenbones_dark.png +0 -0
- data/examples/themes/zenbones_light.png +0 -0
- data/examples/themes/zenburn.png +0 -0
- data/examples/themes/zenburned.png +0 -0
- data/examples/themes/zenwritten_dark.png +0 -0
- data/examples/themes/zenwritten_light.png +0 -0
- data/examples/themes/zeonica.png +0 -0
- data/examples/tmux.mp4 +0 -0
- data/examples/tmux.png +0 -0
- data/examples/tmux.tape +0 -28
- data/examples/type.mp4 +0 -0
- data/examples/type.png +0 -0
- data/examples/type.tape +0 -11
- data/examples/type_file.mp4 +0 -0
- data/examples/type_file.png +0 -0
- data/examples/type_file.tape +0 -23
- data/examples/variable_typing.mp4 +0 -0
- data/examples/variable_typing.png +0 -0
- data/examples/variable_typing.tape +0 -41
- data/examples/wait_until.mp4 +0 -0
- data/examples/wait_until.png +0 -0
- data/examples/wait_until.tape +0 -8
- data/examples/zsh.mp4 +0 -0
- data/examples/zsh.png +0 -0
- data/examples/zsh.tape +0 -4
data/lib/demo_tape/runner.rb
CHANGED
|
@@ -30,8 +30,11 @@ module DemoTape
|
|
|
30
30
|
@ttyd ||= TTYD.new(port: options.port, shell: options.shell)
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
-
def fail_with(
|
|
34
|
-
|
|
33
|
+
def fail_with(error)
|
|
34
|
+
error = error.message if error.respond_to?(:message)
|
|
35
|
+
|
|
36
|
+
thor.say_error "\nERROR: #{error}", :red
|
|
37
|
+
puts error.backtrace if error.respond_to?(:backtrace)
|
|
35
38
|
exit 1
|
|
36
39
|
end
|
|
37
40
|
|
|
@@ -65,7 +68,9 @@ module DemoTape
|
|
|
65
68
|
def commands
|
|
66
69
|
@commands ||= begin
|
|
67
70
|
debug "Parsing tape"
|
|
68
|
-
Parser.new
|
|
71
|
+
parser = Parser.new
|
|
72
|
+
tree = parser.parse(content, file: file_path)
|
|
73
|
+
parser.to_commands(tree)
|
|
69
74
|
end
|
|
70
75
|
end
|
|
71
76
|
|
|
@@ -73,10 +78,33 @@ module DemoTape
|
|
|
73
78
|
commands.select(&:meta?)
|
|
74
79
|
end
|
|
75
80
|
|
|
81
|
+
def groups
|
|
82
|
+
@groups ||=
|
|
83
|
+
commands
|
|
84
|
+
.select(&:group?)
|
|
85
|
+
.each_with_object({}) do |command, buffer|
|
|
86
|
+
buffer[command.args] = command
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
|
|
76
90
|
def executable_commands
|
|
77
91
|
commands.reject(&:meta?)
|
|
78
92
|
end
|
|
79
93
|
|
|
94
|
+
def resolve_group_expansions
|
|
95
|
+
@commands = commands.flat_map do |command|
|
|
96
|
+
next command unless command.group_invocation?
|
|
97
|
+
|
|
98
|
+
group = groups[command.type]
|
|
99
|
+
|
|
100
|
+
unless group
|
|
101
|
+
command.raise_error("Undefined group: #{command.type.inspect}")
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
group.children
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
80
108
|
def resolve_includes
|
|
81
109
|
nested_level = 0
|
|
82
110
|
|
|
@@ -87,7 +115,9 @@ module DemoTape
|
|
|
87
115
|
if command.type == "Include"
|
|
88
116
|
nested_level += 1
|
|
89
117
|
thor.say_status :command, command.to_formatted(thor)
|
|
90
|
-
Parser.new
|
|
118
|
+
parser = Parser.new
|
|
119
|
+
tree = parser.parse(File.read(command.args), file: command.args)
|
|
120
|
+
parser.to_commands(tree)
|
|
91
121
|
else
|
|
92
122
|
command
|
|
93
123
|
end
|
|
@@ -152,6 +182,7 @@ module DemoTape
|
|
|
152
182
|
end
|
|
153
183
|
|
|
154
184
|
resolve_screenshot_count
|
|
185
|
+
resolve_group_expansions
|
|
155
186
|
run_meta_commands
|
|
156
187
|
resolve_output_paths
|
|
157
188
|
setup_tmp_dir
|
|
@@ -170,7 +201,7 @@ module DemoTape
|
|
|
170
201
|
rescue StandardError => error
|
|
171
202
|
write_state(:keep_recording, false)
|
|
172
203
|
write_state(:paused, true)
|
|
173
|
-
fail_with error
|
|
204
|
+
fail_with error
|
|
174
205
|
ensure
|
|
175
206
|
FileUtils.rm_rf(tmp_dir)
|
|
176
207
|
ttyd.stop
|
|
@@ -321,6 +352,10 @@ module DemoTape
|
|
|
321
352
|
frame_count = read_state(:current_frame)
|
|
322
353
|
exporter = Exporter.new(tmp_dir:, frame_count:, options:, theme:)
|
|
323
354
|
|
|
355
|
+
if frame_count < 5
|
|
356
|
+
fail_with "Not enough frames captured to generate output video."
|
|
357
|
+
end
|
|
358
|
+
|
|
324
359
|
output_paths.each do |path|
|
|
325
360
|
if path.exist? && !options.overwrite
|
|
326
361
|
fail_with "Output file already exists: #{path}"
|
|
@@ -397,7 +432,7 @@ module DemoTape
|
|
|
397
432
|
end
|
|
398
433
|
|
|
399
434
|
run_wait_until(
|
|
400
|
-
Command.new("WaitUntil",
|
|
435
|
+
Command.new("WaitUntil", {pattern: /^::demotape:ready::$/})
|
|
401
436
|
)
|
|
402
437
|
run_clear(nil)
|
|
403
438
|
sleep 1
|
|
@@ -495,13 +530,6 @@ module DemoTape
|
|
|
495
530
|
end
|
|
496
531
|
|
|
497
532
|
def run_wait_until(command)
|
|
498
|
-
timeout = Duration.parse(command.options.fetch(:timeout, 15))
|
|
499
|
-
tick = 0.02
|
|
500
|
-
|
|
501
|
-
curr_line = read_state(:term_current_line)
|
|
502
|
-
offset = curr_line[:number].to_i
|
|
503
|
-
lines = []
|
|
504
|
-
|
|
505
533
|
spinner = Spinner.new(phrases: [
|
|
506
534
|
"Searching high and low…",
|
|
507
535
|
"Looking under every byte…",
|
|
@@ -510,6 +538,16 @@ module DemoTape
|
|
|
510
538
|
"Seeking the needle in the haystack…"
|
|
511
539
|
])
|
|
512
540
|
|
|
541
|
+
timeout = Duration.parse(command.options.fetch(:duration, 15))
|
|
542
|
+
pattern = command.args.fetch(:pattern)
|
|
543
|
+
tick = 0.02
|
|
544
|
+
|
|
545
|
+
curr_line = read_state(:term_current_line)
|
|
546
|
+
|
|
547
|
+
# @todo think what to do with offset and how to use it
|
|
548
|
+
_offset = curr_line[:number].to_i
|
|
549
|
+
lines = []
|
|
550
|
+
|
|
513
551
|
while timeout.positive?
|
|
514
552
|
session_mutex.synchronize do
|
|
515
553
|
script = <<~SCRIPT
|
|
@@ -517,7 +555,7 @@ module DemoTape
|
|
|
517
555
|
let linesCount = term.buffer.active.length;
|
|
518
556
|
let lines = [];
|
|
519
557
|
|
|
520
|
-
for (let lineNumber =
|
|
558
|
+
for (let lineNumber = 0; lineNumber < linesCount; lineNumber += 1) {
|
|
521
559
|
lines.push(term.buffer.active.getLine(lineNumber).translateToString().trimEnd());
|
|
522
560
|
}
|
|
523
561
|
|
|
@@ -528,7 +566,7 @@ module DemoTape
|
|
|
528
566
|
lines = session.evaluate_script(script)
|
|
529
567
|
end
|
|
530
568
|
|
|
531
|
-
matches = lines.grep(
|
|
569
|
+
matches = lines.grep(pattern)
|
|
532
570
|
|
|
533
571
|
if matches.any?
|
|
534
572
|
spinner.stop
|
|
@@ -540,12 +578,16 @@ module DemoTape
|
|
|
540
578
|
end
|
|
541
579
|
|
|
542
580
|
spinner.stop
|
|
543
|
-
|
|
581
|
+
screen = lines.reject(&:empty?)
|
|
582
|
+
screen = thor.set_color(screen.join("\n"), :red)
|
|
583
|
+
command.raise_error(
|
|
584
|
+
"Timeout waiting for pattern #{pattern.inspect}\n\n#{screen}"
|
|
585
|
+
)
|
|
544
586
|
end
|
|
545
587
|
|
|
546
588
|
def run_type(command)
|
|
547
589
|
speed = Duration.parse(
|
|
548
|
-
command.options.fetch(:
|
|
590
|
+
command.options.fetch(:duration, options.typing_speed)
|
|
549
591
|
)
|
|
550
592
|
|
|
551
593
|
text_size = command.args.chars.count
|
|
@@ -581,7 +623,7 @@ module DemoTape
|
|
|
581
623
|
"Just a quick wait…"
|
|
582
624
|
])
|
|
583
625
|
|
|
584
|
-
sleep(Duration.parse(command.
|
|
626
|
+
sleep(Duration.parse(command.options.fetch(:duration, 1)))
|
|
585
627
|
|
|
586
628
|
spinner.stop
|
|
587
629
|
end
|
|
@@ -595,7 +637,7 @@ module DemoTape
|
|
|
595
637
|
|
|
596
638
|
def run_type_key(command)
|
|
597
639
|
speed = Duration.parse(
|
|
598
|
-
command.options.fetch(:
|
|
640
|
+
command.options.fetch(:duration, options.typing_speed)
|
|
599
641
|
)
|
|
600
642
|
|
|
601
643
|
command.options.fetch(:count, 1).times do
|
|
@@ -639,13 +681,13 @@ module DemoTape
|
|
|
639
681
|
value = Spacing.new(*(Array(value) * 4).take(4).map(&:to_i))
|
|
640
682
|
end
|
|
641
683
|
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
684
|
+
# Theme is cached, so we just need to clear the
|
|
685
|
+
# cached value to force reload.
|
|
686
|
+
@theme = nil if name == :theme
|
|
687
|
+
|
|
688
|
+
if command.options[:option].start_with?("theme.")
|
|
689
|
+
attr_name = command.options[:option].sub("theme.", "").to_sym
|
|
690
|
+
theme[attr_name] = value
|
|
649
691
|
end
|
|
650
692
|
|
|
651
693
|
options[name] = value
|
|
@@ -661,7 +703,16 @@ module DemoTape
|
|
|
661
703
|
end
|
|
662
704
|
|
|
663
705
|
send_keys(:control, "l")
|
|
664
|
-
|
|
706
|
+
run_wait(Command.new("Wait", "", duration: 0.5))
|
|
707
|
+
write_state(:term_current_line, term_current_line)
|
|
708
|
+
end
|
|
709
|
+
|
|
710
|
+
def run_run(command)
|
|
711
|
+
run_type(Command.new("Type", command.args))
|
|
712
|
+
run_wait(Command.new("Wait", "", duration: options.run_enter_delay))
|
|
713
|
+
send_keys(:enter)
|
|
714
|
+
wait_duration = command.options.fetch(:duration, options.run_sleep)
|
|
715
|
+
run_wait(Command.new("Wait", "", duration: wait_duration))
|
|
665
716
|
end
|
|
666
717
|
|
|
667
718
|
def run_type_file(command)
|
|
@@ -674,6 +725,10 @@ module DemoTape
|
|
|
674
725
|
run_type(Command.new("Type", content, *command.options))
|
|
675
726
|
end
|
|
676
727
|
|
|
728
|
+
def run_group(*)
|
|
729
|
+
# do nothing
|
|
730
|
+
end
|
|
731
|
+
|
|
677
732
|
def run_screenshot(command)
|
|
678
733
|
exporter = Exporter.new(
|
|
679
734
|
tmp_dir:,
|
data/lib/demo_tape/token.rb
CHANGED
|
@@ -11,14 +11,100 @@ module DemoTape
|
|
|
11
11
|
@line = line
|
|
12
12
|
@column = column
|
|
13
13
|
end
|
|
14
|
+
|
|
15
|
+
def meta?
|
|
16
|
+
identifier?("Include") ||
|
|
17
|
+
identifier?("Output") ||
|
|
18
|
+
identifier?("Require") ||
|
|
19
|
+
identifier?("Set")
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def group?
|
|
23
|
+
identifier?("Group")
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def supports_block?
|
|
27
|
+
group?
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def regex?
|
|
31
|
+
is_a?(Token::Regex)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def keyword?(wanted = nil)
|
|
35
|
+
is_a?(Token::Keyword) && (wanted.nil? || value == wanted)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def string?
|
|
39
|
+
is_a?(Token::String)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def multiline_string?
|
|
43
|
+
is_a?(Token::MultilineString)
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def number?
|
|
47
|
+
is_a?(Token::Number)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def duration?
|
|
51
|
+
is_a?(Token::Duration)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def operator?(wanted = nil)
|
|
55
|
+
is_a?(Token::Operator) && (wanted.nil? || value == wanted)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def comma_operator?
|
|
59
|
+
operator?(",")
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def at_operator?
|
|
63
|
+
operator?("@")
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def plus_operator?
|
|
67
|
+
operator?("+")
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def around_space?
|
|
71
|
+
is_a?(Token::TrailingSpace) || is_a?(Token::LeadingSpace)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def space?
|
|
75
|
+
is_a?(Token::Space)
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def any_space?
|
|
79
|
+
around_space? || space?
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def comment?
|
|
83
|
+
is_a?(Token::Comment)
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def newline?
|
|
87
|
+
is_a?(Token::Newline)
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def identifier?(wanted = nil)
|
|
91
|
+
is_a?(Token::Identifier) && (wanted.nil? || value == wanted)
|
|
92
|
+
end
|
|
14
93
|
end
|
|
15
94
|
|
|
16
95
|
class Identifier < Base; end
|
|
17
96
|
class String < Base; end
|
|
97
|
+
class MultilineString < Base; end
|
|
18
98
|
class Number < Base; end
|
|
19
99
|
class Duration < Base; end
|
|
20
100
|
class Regex < Base; end
|
|
21
101
|
class TimeUnit < Base; end
|
|
22
102
|
class Operator < Base; end
|
|
103
|
+
class Space < Base; end
|
|
104
|
+
class LeadingSpace < Base; end
|
|
105
|
+
class TrailingSpace < Base; end
|
|
106
|
+
class Keyword < Base; end
|
|
107
|
+
class Comment < Base; end
|
|
108
|
+
class Newline < Base; end
|
|
23
109
|
end
|
|
24
110
|
end
|
data/lib/demo_tape/version.rb
CHANGED
data/lib/demo_tape.rb
CHANGED
|
@@ -13,18 +13,21 @@ module DemoTape
|
|
|
13
13
|
require "tty-spinner"
|
|
14
14
|
|
|
15
15
|
require_relative "demo_tape/version"
|
|
16
|
+
require_relative "demo_tape/command"
|
|
16
17
|
require_relative "demo_tape/spacing"
|
|
17
18
|
require_relative "demo_tape/bounds"
|
|
18
19
|
require_relative "demo_tape/token"
|
|
19
|
-
require_relative "demo_tape/
|
|
20
|
-
require_relative "demo_tape/
|
|
20
|
+
require_relative "demo_tape/parser/helpers"
|
|
21
|
+
require_relative "demo_tape/parser/rules"
|
|
21
22
|
require_relative "demo_tape/parser"
|
|
23
|
+
require_relative "demo_tape/lexer"
|
|
22
24
|
require_relative "demo_tape/runner"
|
|
23
25
|
require_relative "demo_tape/exporter"
|
|
24
26
|
require_relative "demo_tape/duration"
|
|
25
27
|
require_relative "demo_tape/theme"
|
|
26
28
|
require_relative "demo_tape/ttyd"
|
|
27
29
|
require_relative "demo_tape/spinner"
|
|
30
|
+
require_relative "demo_tape/formatter"
|
|
28
31
|
|
|
29
32
|
ParseError = Class.new(StandardError)
|
|
30
33
|
end
|