prettytodo 0.0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d32acbeeedc358558fc30fced3a181f9a440e0968c382000d30510e45382b209
4
+ data.tar.gz: 1da1ec5826abd0c0b3640e6216d0184f432cb931413c9448b09a881bbc068fa1
5
+ SHA512:
6
+ metadata.gz: 7208d25eb144ca1ba2c53e57f021a1d07b45957d10309c258d021336ce66af025406282686083bbe2098616ec7363222d7ae8cb7d52ac3c311b03ef054deaac8
7
+ data.tar.gz: 62a8dcbcea95a0ab85854f155f6f37f8be154991ebba20f18c90b3db7e80d4822463c2c46d87ce43aff96c3259a4a98092c14e9502bfc645a4902b7b10462ea8
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright Celina Lopez
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # Prettytodo
2
+ Short description and motivation.
3
+
4
+ ## Usage
5
+ How to use my plugin.
6
+
7
+ ## Installation
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem "prettytodo"
12
+ ```
13
+
14
+ And then execute:
15
+ ```bash
16
+ $ bundle
17
+ ```
18
+
19
+ Or install it yourself as:
20
+ ```bash
21
+ $ gem install prettytodo
22
+ ```
23
+
24
+ ## Contributing
25
+ Contribution directions go here.
26
+
27
+ ## License
28
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require "bundler/setup"
2
+
3
+ APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
4
+ load "rails/tasks/engine.rake"
5
+
6
+ load "rails/tasks/statistics.rake"
7
+
8
+ require "bundler/gem_tasks"
@@ -0,0 +1 @@
1
+ //= link_directory ../stylesheets/prettytodo .css
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,4 @@
1
+ module Prettytodo
2
+ class ApplicationController < ActionController::Base
3
+ end
4
+ end
@@ -0,0 +1,19 @@
1
+ class Prettytodo::NotesController < Prettytodo::ApplicationController
2
+ PrettyTodoStruct = Struct.new(:tag, :text, :line, :file_name)
3
+ def index
4
+ annotations = Rails::SourceAnnotationExtractor.new(
5
+ Rails::SourceAnnotationExtractor::Annotation.tags.join("|")
6
+ ).find(
7
+ Rails::SourceAnnotationExtractor::Annotation.directories
8
+ )
9
+ pretty_annotations = []
10
+ annotations.keys.each do |file_name|
11
+ annotations[file_name].each do |todo|
12
+ pretty_annotations << PrettyTodoStruct.new(
13
+ todo.tag, todo.text, todo.line, file_name
14
+ )
15
+ end
16
+ end
17
+ @annotations_by_tag = pretty_annotations.group_by(&:tag)
18
+ end
19
+ end
@@ -0,0 +1,4 @@
1
+ module Prettytodo
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Prettytodo
2
+ class ApplicationJob < ActiveJob::Base
3
+ end
4
+ end
@@ -0,0 +1,6 @@
1
+ module Prettytodo
2
+ class ApplicationMailer < ActionMailer::Base
3
+ default from: "from@example.com"
4
+ layout "mailer"
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module Prettytodo
2
+ class ApplicationRecord < ActiveRecord::Base
3
+ self.abstract_class = true
4
+ end
5
+ end
@@ -0,0 +1,71 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Prettytodo</title>
5
+ <%= csrf_meta_tags %>
6
+ <%= csp_meta_tag %>
7
+ <style>
8
+ body {
9
+ font-family: system-ui, -apple-system, sans-serif;
10
+ padding: 20px;
11
+ }
12
+
13
+ h1 {
14
+ font-size: 2.5em;
15
+ border-bottom: 2px solid #000;
16
+ padding-bottom: 10px;
17
+ margin-bottom: 30px;
18
+ }
19
+
20
+ .container {
21
+ display: grid;
22
+ grid-template-columns: repeat(3, 1fr);
23
+ gap: 20px;
24
+ }
25
+
26
+ .column {
27
+ background: #fff;
28
+ border-radius: 8px;
29
+ padding: 20px;
30
+ }
31
+
32
+ .column h2 {
33
+ font-size: 1.5em;
34
+ margin-bottom: 20px;
35
+ display: flex;
36
+ justify-content: space-between;
37
+ align-items: center;
38
+ }
39
+
40
+ .column h2 .menu {
41
+ color: #999;
42
+ font-size: 1.2em;
43
+ }
44
+
45
+ .task {
46
+ background: #f0f0f0;
47
+ padding: 12px;
48
+ margin-bottom: 10px;
49
+ border-radius: 6px;
50
+ }
51
+
52
+ .task.purple {
53
+ background: #e0e0f0;
54
+ }
55
+
56
+ .task.orange {
57
+ background: #ffe4d6;
58
+ }
59
+
60
+ .task.green {
61
+ background: #e0f0e0;
62
+ }
63
+ </style>
64
+ <%= yield :head %>
65
+
66
+ </head>
67
+ <body>
68
+ <%= yield %>
69
+
70
+ </body>
71
+ </html>
@@ -0,0 +1,52 @@
1
+ <h1>Notes</h1>
2
+ <%
3
+ colors = %w[purple orange green]
4
+ random = Random.new(415)
5
+ %>
6
+
7
+ <div class="container">
8
+ <% @annotations_by_tag.keys.each do |tag| %>
9
+ <div class="column">
10
+ <h2><%= tag %></h2>
11
+ <% @annotations_by_tag[tag].each do |annotation| %>
12
+ <div class="task <%= colors[(random.rand(annotation.line)) % colors.size] %>">
13
+ <%= annotation.text %>
14
+ <div style="display: flex; font-size: 14px; margin-top: 7px;">
15
+ <div><%= annotation.file_name %>:<%= annotation.line %></div>
16
+
17
+ <svg
18
+ xmlns="http://www.w3.org/2000/svg"
19
+ width="14"
20
+ height="14"
21
+ viewBox="0 0 24 24"
22
+ fill="none"
23
+ stroke="currentColor"
24
+ stroke-width="2"
25
+ stroke-linecap="round"
26
+ stroke-linejoin="round"
27
+ style="align-self: center; margin-left: 2px; cursor: pointer;"
28
+ onclick="copyToClipboard(this,'<%= annotation.file_name %>:<%= annotation.line %>')"
29
+ class="lucide lucide-copy-icon lucide-copy"
30
+ >
31
+ <rect width="14" height="14" x="8" y="8" rx="2" ry="2" />
32
+ <path
33
+ d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
34
+ />
35
+ </svg>
36
+ <div style="margin-left: 2px; display: none; color: green;" class="copied">
37
+ copied!
38
+ </div>
39
+ </div>
40
+ </div>
41
+ <% end %>
42
+ </div>
43
+ <% end %>
44
+ </div>
45
+
46
+ <script>
47
+ function copyToClipboard(element, text) {
48
+ navigator.clipboard.writeText(text);
49
+ const copied = element.parentElement.querySelector('.copied');
50
+ copied.style.display = 'block';
51
+ }
52
+ </script>
data/config/routes.rb ADDED
@@ -0,0 +1,3 @@
1
+ Prettytodo::Engine.routes.draw do
2
+ root to: "notes#index"
3
+ end
@@ -0,0 +1,5 @@
1
+ module Prettytodo
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace Prettytodo
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module Prettytodo
2
+ VERSION = "0.0.1"
3
+ end
data/lib/prettytodo.rb ADDED
@@ -0,0 +1,6 @@
1
+ require "prettytodo/version"
2
+ require "prettytodo/engine"
3
+
4
+ module Prettytodo
5
+ # Your code goes here...
6
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :prettytodo do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,78 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: prettytodo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Marisa Lopez
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2025-04-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 7.2.2.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 7.2.2.1
27
+ description: 'T O D O: make pretty notes'
28
+ email:
29
+ - marisa.celina.lopez4@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - MIT-LICENSE
35
+ - README.md
36
+ - Rakefile
37
+ - app/assets/config/prettytodo_manifest.js
38
+ - app/assets/stylesheets/prettytodo/application.css
39
+ - app/controllers/prettytodo/application_controller.rb
40
+ - app/controllers/prettytodo/notes_controller.rb
41
+ - app/helpers/prettytodo/application_helper.rb
42
+ - app/jobs/prettytodo/application_job.rb
43
+ - app/mailers/prettytodo/application_mailer.rb
44
+ - app/models/prettytodo/application_record.rb
45
+ - app/views/layouts/prettytodo/application.html.erb
46
+ - app/views/prettytodo/notes/index.html.erb
47
+ - config/routes.rb
48
+ - lib/prettytodo.rb
49
+ - lib/prettytodo/engine.rb
50
+ - lib/prettytodo/version.rb
51
+ - lib/tasks/prettytodo_tasks.rake
52
+ homepage: https://github.com/celina-lopez/prettytodo
53
+ licenses:
54
+ - MIT
55
+ metadata:
56
+ homepage_uri: https://github.com/celina-lopez/prettytodo
57
+ source_code_uri: https://github.com/celina-lopez/prettytodo
58
+ changelog_uri: https://github.com/celina-lopez/prettytodo/blob/main/CHANGELOG.md
59
+ post_install_message:
60
+ rdoc_options: []
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ requirements: []
74
+ rubygems_version: 3.5.11
75
+ signing_key:
76
+ specification_version: 4
77
+ summary: A prettier UI for Rails notes
78
+ test_files: []