wassup 0.2.0 → 0.3.2

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 +2 -0
  3. data/Gemfile.lock +19 -1
  4. data/README.md +11 -11
  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 +18 -0
  41. data/examples/josh-fastlane/Supfile +37 -94
  42. data/examples/simple/Supfile +17 -0
  43. data/examples/starter/Supfile +44 -0
  44. data/lib/wassup/app.rb +166 -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 +85 -16
  51. data/lib/wassup/pane_builder.rb +14 -1
  52. data/lib/wassup/version.rb +1 -1
  53. data/lib/wassup.rb +5 -0
  54. data/wassup.gemspec +1 -0
  55. metadata +59 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 432db97778e804dfdfe02ec44d382aa7e7a275745c8b2ae73b4dd579bf215ae7
4
- data.tar.gz: 99ccf1045dbad2b6431df2a55be38c643204b3389a0da7a3ecc06d7ede6d0218
3
+ metadata.gz: bc1589d0e24a9bac6c55315341d403e6083a82d7e6f1c05316264c005a5bcbe4
4
+ data.tar.gz: 35453b0fd0f67c6a25f4d3fdd94d5dd59bb0c03aaae3ecfc54f5b157ec34f8fa
5
5
  SHA512:
6
- metadata.gz: 264ec05425e3078e3ae97089dc890884b8c9aeff6ac6a10c6a49e6bf85c75dda370fb9135c665118e7fa4efdae1407865ae681074a462291b96eee2b700222c5
7
- data.tar.gz: c8f13c8cd5f63e494e5408f5cc318a523d6ccc2922f227c7c630d4cc18e865367392a0e1038f6ae79abadf6e1c161edc535dc0908b216adbe91dc80f8f29318b
6
+ metadata.gz: 3889de2432cded98ced5b57f48daef6e26baa5d3faf3b7388f85208dd806ae09b0c21684c16b9816bc07d7958e9c1861c62088b08dac528bb98d1609b284f953
7
+ data.tar.gz: 7aadbc0767bdc437ee312e0497e5f71f9b2bd0976104c732a27d27c7dd423631622e3abb531bfb2eaa9c63b90e5455803e91170ac502ae6b09d2e2979ed21cf5
data/.gitignore CHANGED
@@ -12,4 +12,6 @@
12
12
 
13
13
  *.gem
14
14
 
15
+ .DS_Store
16
+
15
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
@@ -9,7 +9,7 @@
9
9
 
10
10
  <hr/>
11
11
 
12
- https://user-images.githubusercontent.com/401294/144465499-a8903d4c-f003-4550-b47c-f70c17cc02d8.mov
12
+ https://user-images.githubusercontent.com/401294/145632767-d75a8244-b68f-4838-8ff4-4017ba0c1ed2.mov
13
13
 
14
14
  ## Example `Supfile`
15
15
 
@@ -17,25 +17,25 @@ https://user-images.githubusercontent.com/401294/144465499-a8903d4c-f003-4550-b4
17
17
  require 'json'
18
18
  require 'rest-client'
19
19
 
20
- add_pane do |pane|
21
- pane.height = 0.5
22
- pane.width = 00.5
23
- pane.top = 0
20
+ add_pane do |pane|
21
+ pane.height = 0.5
22
+ pane.width = 0.5
23
+ pane.top = 0
24
24
  pane.left = 0
25
25
 
26
26
  pane.highlight = true
27
27
  pane.title = "Open PRs - fastlane/fastlane"
28
28
 
29
29
  pane.interval = 60 * 5
30
- pane.content do
30
+ pane.content do |builder|
31
31
  resp = RestClient.get "https://api.github.com/repos/fastlane/fastlane/pulls"
32
32
  json = JSON.parse(resp)
33
33
  json.map do |pr|
34
- display = "##{pr["number"]} pr["title"]"
35
-
36
- # First element is displayed
37
- # Second element is passed to pane.selection
38
- [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"])
39
39
  end
40
40
  end
41
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;