wassup 0.1.0 → 0.2.1

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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +3 -0
  3. data/.gitignore +4 -0
  4. data/README.md +45 -5
  5. data/bin/wassup +8 -1
  6. data/docs/.gitignore +20 -0
  7. data/docs/README.md +41 -0
  8. data/docs/babel.config.js +3 -0
  9. data/docs/blog/2021-12-09-welcome/index.md +8 -0
  10. data/docs/blog/authors.yml +5 -0
  11. data/docs/docs/Supfile-basics/_category_.json +4 -0
  12. data/docs/docs/Supfile-basics/understanding-the-supfile.md +50 -0
  13. data/docs/docs/intro.md +54 -0
  14. data/docs/docusaurus.config.js +110 -0
  15. data/docs/package-lock.json +21196 -0
  16. data/docs/package.json +43 -0
  17. data/docs/sidebars.js +31 -0
  18. data/docs/src/components/HomepageFeatures.module.css +10 -0
  19. data/docs/src/components/HomepageFeatures.tsx +60 -0
  20. data/docs/src/css/custom.css +28 -0
  21. data/docs/src/pages/index.module.css +36 -0
  22. data/docs/src/pages/index.tsx +39 -0
  23. data/docs/src/pages/markdown-page.md +7 -0
  24. data/docs/static/.nojekyll +0 -0
  25. data/docs/static/img/demo-supfile.png +0 -0
  26. data/docs/static/img/favicon.ico +0 -0
  27. data/docs/static/img/logo.svg +27 -0
  28. data/docs/static/img/tutorial/docsVersionDropdown.png +0 -0
  29. data/docs/static/img/tutorial/localeDropdown.png +0 -0
  30. data/docs/static/img/tutorial-intro-starter-screenshot.png +0 -0
  31. data/docs/static/img/undraw_docusaurus_mountain.svg +170 -0
  32. data/docs/static/img/undraw_docusaurus_react.svg +169 -0
  33. data/docs/static/img/undraw_docusaurus_tree.svg +1 -0
  34. data/docs/static/img/wassup-long.png +0 -0
  35. data/docs/static/img/wassup-screenshot.png +0 -0
  36. data/docs/static/img/wassup.png +0 -0
  37. data/docs/static/video/wassup-demo.mov +0 -0
  38. data/docs/tsconfig.json +7 -0
  39. data/examples/basic/Supfile +28 -0
  40. data/examples/debug/Supfile +116 -0
  41. data/examples/josh-fastlane/README.md +14 -0
  42. data/examples/josh-fastlane/Supfile +59 -35
  43. data/examples/josh-fastlane/demo.png +0 -0
  44. data/examples/starter/Supfile +44 -0
  45. data/lib/wassup/app.rb +82 -9
  46. data/lib/wassup/color.rb +76 -0
  47. data/lib/wassup/pane.rb +255 -82
  48. data/lib/wassup/pane_builder.rb +74 -3
  49. data/lib/wassup/version.rb +1 -1
  50. data/lib/wassup.rb +1 -0
  51. metadata +42 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 941e170c1128cdd099c74de0c068bddabe50ef1921dedcd4f7c278cb6032bd94
4
- data.tar.gz: b76965eec5063a77ec8d6bca7dee5081a7c380af28b95732298039d1958b5ab6
3
+ metadata.gz: fe6fcd8e497b99430a22d16872f83d9b8a08356436c95f222bb3c9bed1b86d47
4
+ data.tar.gz: db98e8f4af5997b228bd8f148b13fc0b09681dcfa5486ad8d37e8c21aae0dc7b
5
5
  SHA512:
6
- metadata.gz: 8371c29c1c55e96837e07f2c904d27ac22ccec2f848ee2540f9caf0cf4c5d43a746fab12d23a742222dc56c49584eb5a2dead3599c6db86786ed5aa667446bee
7
- data.tar.gz: 0ad9c8dade67a8a83236c01c1c252bffb96218175eae256268c366f5f7078efa4dbb0d2c1a82fbe0936cfc3a75a52d0aa362814ddb5d6b15b380b825b27e21d3
6
+ metadata.gz: 7623256788359eac541c314581b9b552257f58af44a36216df2922c80a411a9a0dd078e3ca3291b0b0943706689f06c49ec27898879bca2a2131857e960c8b21
7
+ data.tar.gz: 9b4a0cbb77b12eebb1e9a1392d4d0ac6fcc9796aac72c9632bab5d9217aba1d179847220348532106ae4175131207f3f1484041b7527db1cc5e7957f038d3b89
@@ -0,0 +1,3 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: [joshdholtz]
data/.gitignore CHANGED
@@ -10,4 +10,8 @@
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
12
 
13
+ *.gem
14
+
15
+ .DS_Store
16
+
13
17
  *.swp
data/README.md CHANGED
@@ -1,8 +1,48 @@
1
- # Wassup
2
-
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/wassup`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
1
+ <h3 align="center">
2
+ <img height="200" alt="Wassup logo" src="https://user-images.githubusercontent.com/401294/145626927-7eb0fda5-c62a-47c8-9422-074b178fd8ef.png" />
3
+ </h3>
4
+
5
+ [![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/fastlane/fastlane/blob/master/LICENSE)
6
+ [![Gem](https://img.shields.io/gem/v/wassup.svg?style=flat)](https://rubygems.org/gems/wassup)
7
+
8
+ **Wassup** is a scriptable terminal dashboard. Configure panes and content logic in a `Supfile` and then run `wassup`.
9
+
10
+ <hr/>
11
+
12
+ https://user-images.githubusercontent.com/401294/145632767-d75a8244-b68f-4838-8ff4-4017ba0c1ed2.mov
13
+
14
+ ## Example `Supfile`
15
+
16
+ ```rb
17
+ require 'json'
18
+ require 'rest-client'
19
+
20
+ add_pane do |pane|
21
+ pane.height = 0.5
22
+ pane.width = 0.5
23
+ pane.top = 0
24
+ pane.left = 0
25
+
26
+ pane.highlight = true
27
+ pane.title = "Open PRs - fastlane/fastlane"
28
+
29
+ pane.interval = 60 * 5
30
+ pane.content do |builder|
31
+ resp = RestClient.get "https://api.github.com/repos/fastlane/fastlane/pulls"
32
+ json = JSON.parse(resp)
33
+ json.map do |pr|
34
+ display = "##{pr["number"]} #{pr["title"]}"
35
+
36
+ # First argument is displayed
37
+ # Second argument is passed to pane.selection
38
+ builder.add_row(display, pr["html_url"])
39
+ end
40
+ end
41
+ pane.selection do |url|
42
+ `open #{url}`
43
+ end
44
+ end
45
+ ```
6
46
 
7
47
  ## Installation
8
48
 
data/bin/wassup CHANGED
@@ -1,4 +1,11 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'wassup'
4
- Wassup::App.start(path: ARGV[0])
4
+
5
+ path = ARGV[0] || 'Supfile'
6
+
7
+ unless File.exists?(path)
8
+ raise "Missing file: #{path}"
9
+ end
10
+
11
+ Wassup::App.start(path: path)
data/docs/.gitignore ADDED
@@ -0,0 +1,20 @@
1
+ # Dependencies
2
+ /node_modules
3
+
4
+ # Production
5
+ /build
6
+
7
+ # Generated files
8
+ .docusaurus
9
+ .cache-loader
10
+
11
+ # Misc
12
+ .DS_Store
13
+ .env.local
14
+ .env.development.local
15
+ .env.test.local
16
+ .env.production.local
17
+
18
+ npm-debug.log*
19
+ yarn-debug.log*
20
+ yarn-error.log*
data/docs/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # Website
2
+
3
+ This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
4
+
5
+ ### Installation
6
+
7
+ ```
8
+ $ yarn
9
+ ```
10
+
11
+ ### Local Development
12
+
13
+ ```
14
+ $ yarn start
15
+ ```
16
+
17
+ This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18
+
19
+ ### Build
20
+
21
+ ```
22
+ $ yarn build
23
+ ```
24
+
25
+ This command generates static content into the `build` directory and can be served using any static contents hosting service.
26
+
27
+ ### Deployment
28
+
29
+ Using SSH:
30
+
31
+ ```
32
+ $ USE_SSH=true yarn deploy
33
+ ```
34
+
35
+ Not using SSH:
36
+
37
+ ```
38
+ $ GIT_USER=<Your GitHub username> yarn deploy
39
+ ```
40
+
41
+ If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3
+ };
@@ -0,0 +1,8 @@
1
+ ---
2
+ slug: welcome
3
+ title: Welcome
4
+ authors: [joshdholtz]
5
+ tags: [wassup, hello]
6
+ ---
7
+
8
+ This is the first blog
@@ -0,0 +1,5 @@
1
+ joshdholtz:
2
+ name: Josh Holtz
3
+ title: Maintainer of wassup
4
+ url: https://github.com/joshdholtz
5
+ image_url: https://github.com/joshdholtz.png
@@ -0,0 +1,4 @@
1
+ {
2
+ "label": "Supfile - Basics",
3
+ "position": 2
4
+ }
@@ -0,0 +1,50 @@
1
+ ---
2
+ sidebar_position: 1
3
+ ---
4
+
5
+ # Understanding the `Supfile`
6
+
7
+ The `Supfile` is what **Wassup** uses to generate the dashboard.
8
+
9
+ The dashboard is made up of **panes**. These **panes** are configured by the `Supfile`.
10
+
11
+ ```ruby title="Supfile"
12
+ add_pane do |pane|
13
+ pane.height = 0.5
14
+ pane.width = 0.4
15
+ pane.top = 0
16
+ pane.left = 0
17
+
18
+ pane.title = "Current Time"
19
+
20
+ pane.highlight = false
21
+
22
+ pane.interval = 1
23
+ pane.content do |content|
24
+ date = `date`
25
+ content.add_row(date)
26
+ end
27
+ end
28
+ ```
29
+
30
+ ## Properties
31
+
32
+ ### Positioning
33
+
34
+ | Property | Type | Description |
35
+ | --- | --- | --- |
36
+ | height | Float | Height of the pane (value between 0 and 1) |
37
+ | width | Float | Width of the pane (value between 0 and 1) |
38
+ | top | Float | Top positioning of the pane (value between 0 and 1) |
39
+ | left | Float | Left positioning of the pane (value between 0 and 1) |
40
+ | title | String | Title to display in the top border of the pane |
41
+
42
+ ### Content
43
+
44
+ | Property | Type | Description |
45
+ | --- | --- | --- |
46
+ | interval | Integer (or Float) | Interval (in seconds) on how often to refresh pane with the `content` block |
47
+ | show_refresh | Boolean | Whether or not to show when a content refresh is happening |
48
+ | highlight | Boolean | Whether or not to allow highlighting and selection of rows |
49
+ | content | Block | A Ruby block for fetching and adding content to the pane |
50
+ | selection | Block | A Ruby block for fetching and adding content to the pane |
@@ -0,0 +1,54 @@
1
+ ---
2
+ sidebar_position: 1
3
+ ---
4
+
5
+ # Getting Started
6
+
7
+ Get started by **installing the gem**.
8
+
9
+ ## Installing
10
+
11
+ Install **Wassup** from RubyGems:
12
+
13
+ ```shell
14
+ gem install wassup
15
+ ```
16
+
17
+ Or in a `Gemfile`:
18
+
19
+ ```rb
20
+ source "https://rubygems.org"
21
+
22
+ gem "wassup"
23
+ ```
24
+
25
+ ## Create Your First `Supfile`
26
+
27
+ Create a `Supfile` with the following contents:
28
+
29
+ ```ruby title="Supfile"
30
+ add_pane do |pane|
31
+ pane.height = 0.5
32
+ pane.width = 0.4
33
+ pane.top = 0
34
+ pane.left = 0
35
+
36
+ pane.highlight = false
37
+ pane.title = "Current Time"
38
+
39
+ pane.interval = 1
40
+ pane.content do |content|
41
+ date = `date`
42
+
43
+ content.add_row(date)
44
+ end
45
+ end
46
+ ```
47
+
48
+ Run `wassup` (or `bundle exec wassup` if using a `Gemfile`) from your terminal in the same directory as your `Supfile`.
49
+
50
+ ### Screenshot
51
+
52
+ You should see a pane in the top left corner that updates the time every second.
53
+
54
+ ![Tutorial intro starter screenshot](/img/tutorial-intro-starter-screenshot.png)
@@ -0,0 +1,110 @@
1
+ // @ts-check
2
+ // Note: type annotations allow type checking and IDEs autocompletion
3
+
4
+ const lightCodeTheme = require('prism-react-renderer/themes/github');
5
+ const darkCodeTheme = require('prism-react-renderer/themes/dracula');
6
+
7
+ /** @type {import('@docusaurus/types').Config} */
8
+ const config = {
9
+ title: 'Wassup',
10
+ tagline: 'Scriptable terminal dashboard',
11
+ url: 'https://wassup.tools',
12
+ baseUrl: '/',
13
+ onBrokenLinks: 'throw',
14
+ onBrokenMarkdownLinks: 'warn',
15
+ favicon: 'img/favicon.ico',
16
+ organizationName: 'joshdholtz', // Usually your GitHub org/user name.
17
+ projectName: 'wassup', // Usually your repo name.
18
+
19
+ presets: [
20
+ [
21
+ 'classic',
22
+ /** @type {import('@docusaurus/preset-classic').Options} */
23
+ ({
24
+ docs: {
25
+ sidebarPath: require.resolve('./sidebars.js'),
26
+ // Please change this to your repo.
27
+ editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/',
28
+ },
29
+ blog: {
30
+ showReadingTime: true,
31
+ // Please change this to your repo.
32
+ editUrl:
33
+ 'https://github.com/facebook/docusaurus/edit/main/website/blog/',
34
+ },
35
+ theme: {
36
+ customCss: require.resolve('./src/css/custom.css'),
37
+ },
38
+ }),
39
+ ],
40
+ ],
41
+
42
+ themeConfig:
43
+ /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
44
+ ({
45
+ navbar: {
46
+ title: 'Wassup',
47
+ logo: {
48
+ alt: 'Wassup Logo',
49
+ src: 'img/logo.svg',
50
+ },
51
+ items: [
52
+ {
53
+ type: 'doc',
54
+ docId: 'intro',
55
+ position: 'left',
56
+ label: 'Tutorial',
57
+ },
58
+ {to: '/blog', label: 'Blog', position: 'left'},
59
+ {
60
+ href: 'https://github.com/joshdholtz/wassup',
61
+ label: 'GitHub',
62
+ position: 'right',
63
+ },
64
+ ],
65
+ },
66
+ footer: {
67
+ style: 'dark',
68
+ links: [
69
+ {
70
+ title: 'Docs',
71
+ items: [
72
+ {
73
+ label: 'Tutorial',
74
+ to: '/docs/intro',
75
+ },
76
+ ],
77
+ },
78
+ {
79
+ title: 'Community',
80
+ items: [
81
+ {
82
+ label: 'Twitter',
83
+ href: 'https://twitter.com/joshdholtz',
84
+ },
85
+ ],
86
+ },
87
+ {
88
+ title: 'More',
89
+ items: [
90
+ {
91
+ label: 'Blog',
92
+ to: '/blog',
93
+ },
94
+ {
95
+ label: 'GitHub',
96
+ href: 'https://github.com/joshdholtz/wassup',
97
+ },
98
+ ],
99
+ },
100
+ ],
101
+ copyright: `Copyright © ${new Date().getFullYear()} Josh Holtz. Built with Docusaurus.`,
102
+ },
103
+ prism: {
104
+ theme: lightCodeTheme,
105
+ darkTheme: darkCodeTheme,
106
+ },
107
+ }),
108
+ };
109
+
110
+ module.exports = config;