moonshot-rails 0.0.5 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,14 @@
1
+ .card.mw-800px.mx-auto.bg-white
2
+ .card-body
3
+ %h2.fs-2.mb-4= title
4
+ %ol.mb-0.ps-4
5
+ - items.each do |item|
6
+ %li.mb-4
7
+ .d-flex.justify-content-between.align-items-center
8
+ %h2.fs-4.mb-0{ class: class_names('text-gray-600 text-decoration-line-through' => item.completed?) }= item.title
9
+ - if item.completed?
10
+ %i.fas.fa-check.text-success
11
+ - else
12
+ = item
13
+ - if item.subtitle.present?
14
+ %p.fs-7.text-gray-600.lh-lg= item.subtitle
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Moonshot::App::JobsToBeDone < ViewComponent::Base
4
+ renders_many :items, 'ItemComponent'
5
+
6
+ attr_reader :title
7
+
8
+ def initialize title:
9
+ @title = title
10
+ end
11
+
12
+ def render?
13
+ !items.all?(&:completed?)
14
+ end
15
+
16
+ class ItemComponent < ViewComponent::Base
17
+ attr_reader :completed, :title, :subtitle
18
+
19
+ alias completed? completed
20
+
21
+ def initialize title:, subtitle: nil, completed: false
22
+ @title = title
23
+ @subtitle = subtitle
24
+ @completed = completed
25
+ end
26
+
27
+ def call
28
+ content
29
+ end
30
+ end
31
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MoonshotRails
4
- VERSION = '0.0.5'
4
+ VERSION = '0.0.7'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moonshot-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Catalin Ionescu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-05 00:00:00.000000000 Z
11
+ date: 2024-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -25,33 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: 7.0.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: pry
28
+ name: view_component
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: rspec
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
33
+ version: 3.0.0
34
+ type: :runtime
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
38
  - - ">="
53
39
  - !ruby/object:Gem::Version
54
- version: '0'
40
+ version: 3.0.0
55
41
  description:
56
42
  email:
57
43
  - catalin.ionescu282@gmail.com
@@ -66,6 +52,8 @@ files:
66
52
  - app/assets/javascripts/moonshot/index.js
67
53
  - app/assets/javascripts/moonshot/post_hog_controller.js
68
54
  - app/assets/javascripts/moonshot/shepherd_controller.js
55
+ - app/components/moonshot/app/jobs_to_be_done.html.haml
56
+ - app/components/moonshot/app/jobs_to_be_done.rb
69
57
  - app/helpers/moonshot/moonshot_helper.rb
70
58
  - lib/moonshot-rails.rb
71
59
  - lib/moonshot-rails/config.rb
@@ -91,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
79
  - !ruby/object:Gem::Version
92
80
  version: '0'
93
81
  requirements: []
94
- rubygems_version: 3.4.20
82
+ rubygems_version: 3.5.6
95
83
  signing_key:
96
84
  specification_version: 4
97
85
  summary: A collection of Stimulus controllers for building SaaS applications with