rails-playground 0.1.1 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b917e43620b4e703b4b826f87f5be69b7c541d79be6d47637d95e8375e31017c
4
- data.tar.gz: c45d1fb0ce17fd85cc8151d57a27139caa51f902e2fb513afe53e8c9cd3d6b9f
3
+ metadata.gz: 6d3e5a3ae8b3a38899b61d42c37b61b13f1820c612c57198a3f2641b7d8aea2c
4
+ data.tar.gz: c970296e4765132b69025b20219ee1139602b55f592e228fd05ad3b94ca4848c
5
5
  SHA512:
6
- metadata.gz: dd51b76541ea6d549d3dfa0df68b575e07e2f57f0e6010fc3239c87597d8ba5dba5302d193905ca3a95fe077732c016227d4ce1ea05b26e6afa849f7db226411
7
- data.tar.gz: 5820201bf6cb9220511d7ffa66a4048b535c14cc908648037f063cf278db2ff07653d8e202f572f8e0feb9434153ae79b8c77541eb1d4338f242c13617e9c865
6
+ metadata.gz: 10aa1fb4f1ad7bd86133ead919c4fe1a437b02437f4bb732ade6de3d27239066c494aaea6a6b553566590fa1e5ec592656885bec52062016a9d46e15644216ff
7
+ data.tar.gz: f2feb2be90d401bf5d02133e13022dece8f6fad2256093470ae47d192c57380cb49eb78b363b09f2189751589ce85cbfac1c9a0babe3d6e4920f1c7448a1c59a
data/README.md CHANGED
@@ -1,53 +1,110 @@
1
- # Playground
1
+ # (Rails) Playground
2
2
 
3
3
  Back-and-forths from your editor and your rails console is a thing of the past!
4
4
 
5
- ![CleanShot 2022-03-12 at 23 41 03](https://user-images.githubusercontent.com/7149034/158014859-47625c95-aa59-489a-9681-eb36e378dcba.gif)
5
+ ![playground-demo](https://user-images.githubusercontent.com/7149034/158045230-3129bf4e-8eeb-4096-9293-04a8c6003bed.gif)
6
6
 
7
- Inspired by the Go playground and SQL Server Management Studio (SSMS) Query Editor, `playground` is a rails engine that makes it really easy to experiment with your application domain.
7
+ ## Features
8
8
 
9
- In addition to a web console, `playground` comes with a script management feature to help your personal and team development. It allows you to:
10
- * use and save gitignored scripts for personal use.
11
- * use and save version-controller scripts with your team.
9
+ ### Query Editor
12
10
 
13
- This way, shared scripts stay close to the code and more maintainable while your personal script do not pollute the git history.
11
+ Inspired by the Go playground and SQL Server Management Studio (SSMS) Query Editor, `rails-playground` is a rails engine that eases experiments with your application domain.
12
+
13
+ ### Script Management
14
+
15
+ The gem also comes with a script management tool to help share useful scripts with your teammates. Shared scripts stay close to the code and become more maintainable while personal scripts are git ignored and don't pollute the git history.
14
16
 
15
17
  ## Usage
16
18
 
19
+ ### Query Editor
20
+
17
21
  There are three ways to run ruby code in the console:
18
22
 
19
23
  * Select your code in the editor and press cmd+Enter
20
24
  * Put your cursor on any line (no selection) and press cmd+Enter
21
25
  * Type your code straight in the terminal box just like in a rails console
22
26
 
27
+ ### Script Management
28
+
29
+ Any files under `lib/playground` folder will appear in the sidebar. You can filter them by name from the search input.
30
+
31
+ See [Ignoring personal scripts](#ignoring-personal-scripts) to share scripts with your team while ignoring personal scripts.
32
+
23
33
  ## Installation
24
34
 
25
- Playground is built on top of `web-console` gem. Just like `web-console`, `playground` is only meant to be used in development. Every `web-console` information still holds true for `playground`. Check `web-console` [repository for more information](https://github.com/rails/web-console)
35
+ ### Query Editor
26
36
 
37
+ Playground is built on top of `web-console` gem. Just like `web-console`, it's only meant to be used in development. Every `web-console` information still holds for `rails-playground`. Check `web-console` [repository for more information](https://github.com/rails/web-console)
27
38
 
28
- You can require `playground` after `web-console` in your Gemfile if you already use it.
29
- Add this line to your application's Gemfile:
39
+ Add this line to your application's Gemfile under the development group:
30
40
 
31
41
  ```ruby
32
42
  group :development do
33
- gem "playground"
43
+ gem "rails-playground", require: "playground"
34
44
  end
35
45
  ```
36
46
 
47
+ _**Naming issue:** The gem was originally called `playground` but it already exists in RubyGems... Thus the gem is now called `rails-playground` but the functionality remains under the `playground` namespace for now._
48
+
37
49
  And then execute:
38
50
  ```bash
39
51
  $ bundle
40
52
  ```
41
53
 
42
- Then mount `playground` in your routes file and access the playground at `http://localhost:{PORT}/playground` on your local machine.
54
+ Finally, mount the engine in your routes file and access the web playground at `/playground` on your localhost.
55
+
43
56
  ```ruby
44
57
  Rails.application.routes.draw do
45
- mount Playground::Engine => "/playground"
58
+ mount Playground::Engine => "/playground" if Rails.env.development?
46
59
  # ...
47
60
  end
48
61
  ```
49
62
 
50
- ## Troubleshouting
63
+ _Nothing stops you from choosing any relative path. For example, you could switch from `/playground` to `/rails/play`._
64
+
65
+ ### Ignoring personal scripts
66
+
67
+ Any changes made to ignored scripts won't be recorded in your git history.
68
+ Adding a folder from lib/playground in `.gitignore` will, however, still show in the sidebar.
69
+ **Decide on a convention** with your teammates and commit the path to your `.gitignore`.
70
+
71
+ **Example**
72
+
73
+ Here is an example of file structure
74
+
75
+ * scripts version controlled
76
+ * lib/playground/shared_script_a.rb
77
+ * lib/playground/shared_script_b.rb
78
+ * lib/playground/namespace/shared_script_c.rb
79
+ * scripts ignored
80
+ * lib/playground/my_scripts/my_script_a.rb
81
+ * lib/playground/my_scripts/my_script_b.rb
82
+
83
+ ```
84
+ .gitignore
85
+
86
+ /lib/playground/my_scripts/
87
+ ```
88
+
89
+ ```
90
+ my_app/
91
+ ├─ app/
92
+ ├─ bin/
93
+ ├─ config/
94
+ ├─ db/
95
+ ├─ lib/
96
+ │ ├─ playground/
97
+ │ │ ├─ namespace/
98
+ │ │ │ ├─ shared_script_c.rb
99
+ │ │ ├─ my_scripts/
100
+ │ │ │ ├─ my_script_a.rb
101
+ │ │ │ ├─ my_script_b.rb
102
+ │ │ ├─ shared_script_a.rb
103
+ │ │ ├─ shared_script_b.rb
104
+ ├─ .gitignore
105
+ ```
106
+
107
+ ## Troubleshooting
51
108
 
52
109
  ### Session :id is no longer available in memory.
53
110
 
@@ -60,7 +117,7 @@ this request hit doesn't store e96248aec85b3006488c276b9468a4d8 in memory. Consi
60
117
  processes/workers to one (1) or using a different server in development.
61
118
  ```
62
119
 
63
- This is a known `web-console` error which happened when you run a multi threaded server locally.
120
+ This is a known `web-console` error that happens when you run a multi-threaded server locally.
64
121
  To solve this problem make sure to set the number of processes/worker to 1 on your local server.
65
122
 
66
123
  ## License
@@ -1,3 +1,3 @@
1
1
  module Playground
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-playground
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Barret
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-13 00:00:00.000000000 Z
11
+ date: 2022-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: web-console
@@ -48,13 +48,13 @@ files:
48
48
  - MIT-LICENSE
49
49
  - README.md
50
50
  - Rakefile
51
- - app/assets/javascripts/playground/application.js
52
- - app/assets/javascripts/playground/controllers/codemirror_controller.js
53
- - app/assets/javascripts/playground/controllers/hello_controller.js
54
- - app/assets/javascripts/playground/controllers/playground_controller.js
55
- - app/assets/javascripts/playground/controllers/search_scripts_controller.js
56
- - app/assets/javascripts/playground/controllers/select_script_controller.js
57
- - app/assets/stylesheets/playground/application.scss
51
+ - app/assets/javascripts/application.js
52
+ - app/assets/javascripts/controllers/codemirror_controller.js
53
+ - app/assets/javascripts/controllers/hello_controller.js
54
+ - app/assets/javascripts/controllers/playground_controller.js
55
+ - app/assets/javascripts/controllers/search_scripts_controller.js
56
+ - app/assets/javascripts/controllers/select_script_controller.js
57
+ - app/assets/stylesheets/application.scss
58
58
  - app/controllers/playground/application_controller.rb
59
59
  - app/controllers/playground/consoles_controller.rb
60
60
  - app/controllers/playground/scripts_controller.rb
@@ -81,12 +81,12 @@ files:
81
81
  - vendor/javascripts/playground/application.js
82
82
  - vendor/stylesheets/playground/application.css
83
83
  - vendor/stylesheets/playground/application.css.map
84
- homepage: https://github.com/AlexB52/playground
84
+ homepage: https://github.com/AlexB52/rails-playground
85
85
  licenses:
86
86
  - MIT
87
87
  metadata:
88
- homepage_uri: https://github.com/AlexB52/playground
89
- source_code_uri: https://github.com/AlexB52/playground
88
+ homepage_uri: https://github.com/AlexB52/rails-playground
89
+ source_code_uri: https://github.com/AlexB52/rails-playground
90
90
  post_install_message:
91
91
  rdoc_options: []
92
92
  require_paths:
@@ -105,5 +105,5 @@ requirements: []
105
105
  rubygems_version: 3.2.22
106
106
  signing_key:
107
107
  specification_version: 4
108
- summary: A playground web console for Rails applications.
108
+ summary: A local playground for Rails applications.
109
109
  test_files: []