wassup 0.1.2 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +4 -0
  3. data/Gemfile.lock +19 -1
  4. data/README.md +19 -13
  5. data/bin/wassup +6 -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 +183 -16
  40. data/examples/debug/Supfile +90 -13
  41. data/examples/josh-fastlane/Supfile +61 -117
  42. data/examples/simple/Supfile +17 -0
  43. data/examples/starter/Supfile +44 -0
  44. data/lib/wassup/app.rb +167 -6
  45. data/lib/wassup/color.rb +5 -0
  46. data/lib/wassup/helpers/circleci.rb +75 -0
  47. data/lib/wassup/helpers/github.rb +137 -0
  48. data/lib/wassup/helpers/netlify.rb +70 -0
  49. data/lib/wassup/helpers/shortcut.rb +114 -0
  50. data/lib/wassup/pane.rb +244 -134
  51. data/lib/wassup/pane_builder.rb +60 -1
  52. data/lib/wassup/version.rb +1 -1
  53. data/lib/wassup.rb +5 -0
  54. data/wassup.gemspec +1 -0
  55. metadata +55 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e0460f6c9734dcfa48fe6d0561d1de6d5c81d1d49a6f8f6e89cfe8dbb54bb78a
4
- data.tar.gz: f017aea6ab05afe32a5c21ba470f4aa82400d08a54d666172596c27c9f74659c
3
+ metadata.gz: 2ba0effd144c52ef2122ea0437d58d6d3cbb784a6f2bbbb8d1e85da6771076e0
4
+ data.tar.gz: 50a155898f0edca3b6a9be0bb43df316f0477c69fe002a52b0e2a06b2eebb635
5
5
  SHA512:
6
- metadata.gz: 0a4d4e533f3519c77053a5388a00ad584b84203ae18926e7a105a05a72bbe27b68fac844c22ec152baa394b1dcdf1aafc6ae30bbe1b51c80f6a415baf70540c0
7
- data.tar.gz: 447c01199ef5ee734f9836d30d1ee7fe24fdf01d6652b7499d1c053f4903cfba6e63ee979b26122b44b3ef0ba4c213a2ae0f9dc196effe3537d5cf00a2ef9bb7
6
+ metadata.gz: fbd28897624210fa90cb987570b7aaefaeec74abbdcbb75ba42d0ccb984438ba156bb7d5c2d729a0af42b2ddab550e9c567d94ddc5b6676e5071b695ba48a54e
7
+ data.tar.gz: d7a714ace610668a6cd6338547a404ef6d9dd5e6ea3bfc68e9d341a87647a8af70330166262e315eb56a4786add5b95569100dbd5bc4a467622f021fd171fb46
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/Gemfile.lock CHANGED
@@ -1,15 +1,30 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- wassup (0.1.0)
4
+ wassup (0.2.1)
5
5
  curses
6
+ rest-client
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
9
10
  specs:
10
11
  curses (1.4.2)
11
12
  diff-lcs (1.4.4)
13
+ domain_name (0.5.20190701)
14
+ unf (>= 0.0.5, < 1.0.0)
15
+ http-accept (1.7.0)
16
+ http-cookie (1.0.4)
17
+ domain_name (~> 0.5)
18
+ mime-types (3.4.1)
19
+ mime-types-data (~> 3.2015)
20
+ mime-types-data (3.2021.1115)
21
+ netrc (0.11.0)
12
22
  rake (12.3.3)
23
+ rest-client (2.1.0)
24
+ http-accept (>= 1.7.0, < 2.0)
25
+ http-cookie (>= 1.0.2, < 2.0)
26
+ mime-types (>= 1.16, < 4.0)
27
+ netrc (~> 0.8)
13
28
  rspec (3.10.0)
14
29
  rspec-core (~> 3.10.0)
15
30
  rspec-expectations (~> 3.10.0)
@@ -23,6 +38,9 @@ GEM
23
38
  diff-lcs (>= 1.2.0, < 2.0)
24
39
  rspec-support (~> 3.10.0)
25
40
  rspec-support (3.10.3)
41
+ unf (0.1.4)
42
+ unf_ext
43
+ unf_ext (0.0.8)
26
44
 
27
45
  PLATFORMS
28
46
  arm64-darwin-21
data/README.md CHANGED
@@ -1,9 +1,15 @@
1
- # Wassup
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>
2
4
 
3
- A scriptable terminal dashboard
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)
4
7
 
8
+ **Wassup** is a scriptable terminal dashboard. Configure panes and content logic in a `Supfile` and then run `wassup`.
5
9
 
6
- https://user-images.githubusercontent.com/401294/144465499-a8903d4c-f003-4550-b47c-f70c17cc02d8.mov
10
+ <hr/>
11
+
12
+ https://user-images.githubusercontent.com/401294/145632767-d75a8244-b68f-4838-8ff4-4017ba0c1ed2.mov
7
13
 
8
14
  ## Example `Supfile`
9
15
 
@@ -11,25 +17,25 @@ https://user-images.githubusercontent.com/401294/144465499-a8903d4c-f003-4550-b4
11
17
  require 'json'
12
18
  require 'rest-client'
13
19
 
14
- add_pane do |pane|
15
- pane.height = 0.5
16
- pane.width = 00.5
17
- pane.top = 0
20
+ add_pane do |pane|
21
+ pane.height = 0.5
22
+ pane.width = 0.5
23
+ pane.top = 0
18
24
  pane.left = 0
19
25
 
20
26
  pane.highlight = true
21
27
  pane.title = "Open PRs - fastlane/fastlane"
22
28
 
23
29
  pane.interval = 60 * 5
24
- pane.content do
30
+ pane.content do |builder|
25
31
  resp = RestClient.get "https://api.github.com/repos/fastlane/fastlane/pulls"
26
32
  json = JSON.parse(resp)
27
33
  json.map do |pr|
28
- display = "##{pr["number"]} pr["title"]"
29
-
30
- # First element is displayed
31
- # Second element is passed to pane.selection
32
- [display, pr["html_url"]]
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"])
33
39
  end
34
40
  end
35
41
  pane.selection do |url|
data/bin/wassup CHANGED
@@ -2,10 +2,15 @@
2
2
 
3
3
  require 'wassup'
4
4
 
5
+ debug = ARGV.delete("--debug")
5
6
  path = ARGV[0] || 'Supfile'
6
7
 
7
8
  unless File.exists?(path)
8
9
  raise "Missing file: #{path}"
9
10
  end
10
11
 
11
- Wassup::App.start(path: path)
12
+ if debug
13
+ Wassup::App.debug(path: path)
14
+ else
15
+ Wassup::App.start(path: path)
16
+ end
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;