rubydojo 0.1.0 β 0.1.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.
- checksums.yaml +4 -4
- data/README.md +83 -25
- data/app/controllers/rubydojo/assets_controller.rb +8 -0
- data/app/views/layouts/rubydojo/application.html.erb +61 -61
- data/config/routes.rb +8 -7
- data/lib/rubydojo/lessons.rb +736 -736
- data/lib/rubydojo/version.rb +3 -3
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c4b2415906457be2b297e6406c4c65c242823d14bfb66bdc6a61338c10169f7e
|
|
4
|
+
data.tar.gz: c25feb74b9aff24769fec76323cd4f47a07f11b4c56584ec1e772ca7ab888e3e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 05d42262c5d668e383e9d7b2d5eff35e480bc52186aca2cfe5196e40093f23168f0231cb9d4ebe2617aadced15192187b214cb8eea985a15f87d35613578baf0
|
|
7
|
+
data.tar.gz: 23093dc1c31ed496e38c73937a749a184c6714b07c3fe094f7d6f67c4fc2d694f7e84b15fdcfdbfcf20cfe75adc555f2bc3c2bc609716a541426b8b3d1be8a74
|
data/README.md
CHANGED
|
@@ -1,25 +1,83 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
# Rubydojo π
|
|
2
|
+
|
|
3
|
+
An interactive Ruby learning roadmap, playground, and compiler built directly into your Rails application. Designed to accelerate the onboarding and training of interns and junior developers in modern Ruby conventions and Rails-specific idioms.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Features π
|
|
8
|
+
|
|
9
|
+
- **Interactive Learning Roadmap**: A beautifully styled, interactive visual timeline nodes to track lesson completion progress.
|
|
10
|
+
- **Embedded Sandbox Compiler**: Run and execute Ruby code in real-time inside a custom isolated evaluation class contextβno global namespace pollution or warning logs.
|
|
11
|
+
- **Simulated Terminal Console**: An elegant, retro-modern dark chestnut terminal that prints live output, compilation results, and detailed validator feedback.
|
|
12
|
+
- **7 In-Depth, Structurally Rich Lessons**: Each lesson includes a comprehensive **5-point guide** covering core principles, common pitfalls, and Rails/enterprise-grade practices.
|
|
13
|
+
- **Royal Red & Beige Theme**: Designed to feel premium, royal, and clean, using an Outfit/Inter typography hierarchy, ivory backgrounds, and subtle Ruby-red highlights.
|
|
14
|
+
- **API-Only App Support**: Includes self-contained, direct asset serving that works out-of-the-box in API-only Rails applications without needing Sprockets or Propshaft.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Curriculum Outline π
|
|
19
|
+
|
|
20
|
+
1. **Variables & Constants** (Naming conventions, scope levels, and Ruby's constant reassignment warning system)
|
|
21
|
+
2. **Collections & Arrays** (Slicing, negative indices, mutating shovel operations, and index safety)
|
|
22
|
+
3. **Hashes & Symbols** (Memory allocation advantages of symbols, keyword arguments, and hash manipulation)
|
|
23
|
+
4. **Blocks, Procs & Lambdas** (Yielding control, `block_given?`, and argument checking/return behavior differences)
|
|
24
|
+
5. **Object-Oriented Programming** (Classes, `attr_accessor`, module mixins, and inheritance)
|
|
25
|
+
6. **Metaprogramming** (Dynamic dispatch using `send`, and defining dynamic methods with `define_method`)
|
|
26
|
+
7. **Rails Ruby Idioms & ActiveSupport** (Open classes/monkey patching, `blank?` vs `present?`, and the safe navigation operator `&.`)
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Installation π¦
|
|
31
|
+
|
|
32
|
+
Add this line to your application's `Gemfile` (typically inside the `:development` group):
|
|
33
|
+
|
|
34
|
+
```ruby
|
|
35
|
+
group :development do
|
|
36
|
+
gem "rubydojo"
|
|
37
|
+
end
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
And then execute:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
bundle install
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Configuration βοΈ
|
|
47
|
+
Mount the engine inside your Rails application's config/routes.rb:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
Rails.application.routes.draw do
|
|
51
|
+
# Mount Rubydojo under the path of your choice
|
|
52
|
+
mount Rubydojo::Engine => "/rubydojo"
|
|
53
|
+
|
|
54
|
+
# Your other routes...
|
|
55
|
+
end
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
How to Use π―
|
|
59
|
+
|
|
60
|
+
1. Start your Rails server:
|
|
61
|
+
```
|
|
62
|
+
rails server
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
2. Navigate to http://localhost:3000/rubydojo in your browser.
|
|
66
|
+
3. Select a node from the interactive Roadmap to begin a lesson.
|
|
67
|
+
4. Read the detailed 5-point explanation, complete the practice task in the code editor, and click Validate Solution to advance.
|
|
68
|
+
|
|
69
|
+
Contributing π€
|
|
70
|
+
Contributions are welcome! Please feel free to submit issues or pull requests to improve lesson content, design, or safety isolation:
|
|
71
|
+
|
|
72
|
+
Fork the repository (https://github.com/J14as/rubydojo/fork).
|
|
73
|
+
Create your feature branch (git checkout -b feature/amazing-feature).
|
|
74
|
+
Commit your changes (git commit -m 'Add some amazing feature').
|
|
75
|
+
Push to the branch (git push origin feature/amazing-feature).
|
|
76
|
+
Open a Pull Request.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
Made with pure intensions to help new comers!
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
License π
|
|
83
|
+
The gem is available as open source under the terms of the MIT License.
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>Rubydojo | Interactive Ruby Roadmap & Playground</title>
|
|
7
|
-
<meta name="description" content="An interactive suite inside your Rails development environment designed to accelerate learning the Ruby language with structured roadmaps, live compilation, and exercises.">
|
|
8
|
-
|
|
9
|
-
<%= csrf_meta_tags %>
|
|
10
|
-
<%= csp_meta_tag %>
|
|
11
|
-
|
|
12
|
-
<!-- Google Fonts -->
|
|
13
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
14
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
15
|
-
|
|
16
|
-
<!-- CodeMirror CDN Stylesheets -->
|
|
17
|
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.13/codemirror.min.css">
|
|
18
|
-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.13/theme/material-palenight.min.css">
|
|
19
|
-
|
|
20
|
-
<!-- Engine Custom CSS -->
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<%= yield :head %>
|
|
24
|
-
</head>
|
|
25
|
-
<body>
|
|
26
|
-
|
|
27
|
-
<!-- Top Glassmorphism Navigation -->
|
|
28
|
-
<header class="app-header">
|
|
29
|
-
<a href="<%= root_path %>" class="logo">
|
|
30
|
-
<svg viewBox="0 0 100 100" style="fill: currentColor; width: 2.2rem; height: 2.2rem; padding: 0.2rem; background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)); border-radius: 0.5rem; color: white; box-shadow: 0 4px 10px var(--color-primary-glow);">
|
|
31
|
-
<polygon points="50,15 80,15 90,40 50,85 10,40 20,15" />
|
|
32
|
-
<polygon points="50,15 20,15 10,40 35,40" style="fill: rgba(255,255,255,0.25);" />
|
|
33
|
-
<polygon points="50,15 80,15 90,40 65,40" style="fill: rgba(0,0,0,0.15);" />
|
|
34
|
-
<polygon points="35,40 65,40 50,85" style="fill: rgba(255,255,255,0.15);" />
|
|
35
|
-
</svg>
|
|
36
|
-
<span>Rubydojo</span>
|
|
37
|
-
</a>
|
|
38
|
-
|
|
39
|
-
<nav class="nav-links">
|
|
40
|
-
<a href="<%= root_path %>" class="nav-btn secondary">Roadmap</a>
|
|
41
|
-
<a href="https://ruby-doc.org" target="_blank" rel="noopener noreferrer" class="nav-btn secondary">Ruby Docs</a>
|
|
42
|
-
<a href="https://guides.rubyonrails.org" target="_blank" rel="noopener noreferrer" class="nav-btn secondary">Rails Guides</a>
|
|
43
|
-
</nav>
|
|
44
|
-
</header>
|
|
45
|
-
|
|
46
|
-
<main>
|
|
47
|
-
<%= yield %>
|
|
48
|
-
</main>
|
|
49
|
-
|
|
50
|
-
<!-- CodeMirror CDN JavaScripts -->
|
|
51
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.13/codemirror.min.js"></script>
|
|
52
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.13/mode/ruby/ruby.min.js"></script>
|
|
53
|
-
|
|
54
|
-
<!-- Engine Custom JavaScript -->
|
|
55
|
-
<script>
|
|
56
|
-
// Global asset config or simple helpers if needed
|
|
57
|
-
window.Rubydojo = {};
|
|
58
|
-
</script>
|
|
59
|
-
|
|
60
|
-
</body>
|
|
61
|
-
</html>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Rubydojo | Interactive Ruby Roadmap & Playground</title>
|
|
7
|
+
<meta name="description" content="An interactive suite inside your Rails development environment designed to accelerate learning the Ruby language with structured roadmaps, live compilation, and exercises.">
|
|
8
|
+
|
|
9
|
+
<%= csrf_meta_tags %>
|
|
10
|
+
<%= csp_meta_tag %>
|
|
11
|
+
|
|
12
|
+
<!-- Google Fonts -->
|
|
13
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
14
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
15
|
+
|
|
16
|
+
<!-- CodeMirror CDN Stylesheets -->
|
|
17
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.13/codemirror.min.css">
|
|
18
|
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.13/theme/material-palenight.min.css">
|
|
19
|
+
|
|
20
|
+
<!-- Engine Custom CSS -->
|
|
21
|
+
<link rel="stylesheet" href="<%= stylesheet_path %>">
|
|
22
|
+
|
|
23
|
+
<%= yield :head %>
|
|
24
|
+
</head>
|
|
25
|
+
<body>
|
|
26
|
+
|
|
27
|
+
<!-- Top Glassmorphism Navigation -->
|
|
28
|
+
<header class="app-header">
|
|
29
|
+
<a href="<%= root_path %>" class="logo">
|
|
30
|
+
<svg viewBox="0 0 100 100" style="fill: currentColor; width: 2.2rem; height: 2.2rem; padding: 0.2rem; background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)); border-radius: 0.5rem; color: white; box-shadow: 0 4px 10px var(--color-primary-glow);">
|
|
31
|
+
<polygon points="50,15 80,15 90,40 50,85 10,40 20,15" />
|
|
32
|
+
<polygon points="50,15 20,15 10,40 35,40" style="fill: rgba(255,255,255,0.25);" />
|
|
33
|
+
<polygon points="50,15 80,15 90,40 65,40" style="fill: rgba(0,0,0,0.15);" />
|
|
34
|
+
<polygon points="35,40 65,40 50,85" style="fill: rgba(255,255,255,0.15);" />
|
|
35
|
+
</svg>
|
|
36
|
+
<span>Rubydojo</span>
|
|
37
|
+
</a>
|
|
38
|
+
|
|
39
|
+
<nav class="nav-links">
|
|
40
|
+
<a href="<%= root_path %>" class="nav-btn secondary">Roadmap</a>
|
|
41
|
+
<a href="https://ruby-doc.org" target="_blank" rel="noopener noreferrer" class="nav-btn secondary">Ruby Docs</a>
|
|
42
|
+
<a href="https://guides.rubyonrails.org" target="_blank" rel="noopener noreferrer" class="nav-btn secondary">Rails Guides</a>
|
|
43
|
+
</nav>
|
|
44
|
+
</header>
|
|
45
|
+
|
|
46
|
+
<main>
|
|
47
|
+
<%= yield %>
|
|
48
|
+
</main>
|
|
49
|
+
|
|
50
|
+
<!-- CodeMirror CDN JavaScripts -->
|
|
51
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.13/codemirror.min.js"></script>
|
|
52
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.13/mode/ruby/ruby.min.js"></script>
|
|
53
|
+
|
|
54
|
+
<!-- Engine Custom JavaScript -->
|
|
55
|
+
<script>
|
|
56
|
+
// Global asset config or simple helpers if needed
|
|
57
|
+
window.Rubydojo = {};
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
</body>
|
|
61
|
+
</html>
|
data/config/routes.rb
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
Rubydojo::Engine.routes.draw do
|
|
2
|
-
root to: "dashboard#index"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
post :
|
|
6
|
-
|
|
7
|
-
end
|
|
1
|
+
Rubydojo::Engine.routes.draw do
|
|
2
|
+
root to: "dashboard#index"
|
|
3
|
+
get "assets/application.css", to: "assets#css", as: :stylesheet
|
|
4
|
+
resources :lessons, only: [:show] do
|
|
5
|
+
post :run, on: :member
|
|
6
|
+
post :validate, on: :member
|
|
7
|
+
end
|
|
8
|
+
end
|