charming 0.2.2 → 0.2.3
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 +15 -2
- data/lib/charming/cli.rb +16 -4
- data/lib/charming/controller.rb +1 -1
- data/lib/charming/generators/app_file_generator.rb +29 -0
- data/lib/charming/generators/app_generator.rb +12 -25
- data/lib/charming/generators/base.rb +5 -0
- data/lib/charming/generators/layout_generator.rb +155 -0
- data/lib/charming/generators/screen_generator.rb +0 -29
- data/lib/charming/generators/templates/app/README.md.template +15 -1
- data/lib/charming/generators/templates/app/application.template +0 -6
- data/lib/charming/generators/templates/app/application_controller.template +0 -10
- data/lib/charming/generators/templates/app/layout.template +4 -93
- data/lib/charming/generators/templates/app/routes.template +3 -1
- data/lib/charming/generators/templates/layout/sidebar/application_layout.rb.template +110 -0
- data/lib/charming/image/protocol/kitty.rb +7 -0
- data/lib/charming/image/source.rb +10 -0
- data/lib/charming/presentation/components/autocomplete.rb +7 -0
- data/lib/charming/presentation/components/form/field.rb +5 -0
- data/lib/charming/presentation/components/form/input.rb +14 -4
- data/lib/charming/presentation/components/form/textarea.rb +18 -8
- data/lib/charming/presentation/components/form.rb +6 -0
- data/lib/charming/presentation/components/modal.rb +4 -4
- data/lib/charming/presentation/components/stopwatch.rb +1 -1
- data/lib/charming/presentation/components/text_area.rb +2 -2
- data/lib/charming/presentation/components/text_input.rb +2 -2
- data/lib/charming/presentation/components/timer.rb +1 -1
- data/lib/charming/presentation/components/toast.rb +4 -3
- data/lib/charming/presentation/components/viewport.rb +11 -1
- data/lib/charming/runtime.rb +13 -2
- data/lib/charming/version.rb +1 -1
- data/lib/charming/welcome/controller.rb +23 -0
- data/lib/charming/welcome/show_view.rb +113 -0
- data/lib/charming/welcome.rb +13 -0
- metadata +6 -7
- data/lib/charming/generators/templates/app/home_controller.template +0 -6
- data/lib/charming/generators/templates/app/home_state.template +0 -7
- data/lib/charming/generators/templates/app/spec_controller.template +0 -17
- data/lib/charming/generators/templates/app/spec_state.template +0 -17
- data/lib/charming/generators/templates/app/spec_view.template +0 -16
- data/lib/charming/generators/templates/app/view.template +0 -21
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "__APP_SNAKE__"
|
|
4
|
-
|
|
5
|
-
RSpec.describe __APP_CLASS__::HomeState do
|
|
6
|
-
describe "#title" do
|
|
7
|
-
it "has the correct default string value" do
|
|
8
|
-
instance = described_class.new
|
|
9
|
-
expect(instance.title).to eq("__APP_NAME__")
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
it "accepts overridden title values" do
|
|
13
|
-
instance = described_class.new(title: "Alternative")
|
|
14
|
-
expect(instance.title).to eq("Alternative")
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "__APP_SNAKE__"
|
|
4
|
-
|
|
5
|
-
RSpec.describe __APP_CLASS__::Home::ShowView do
|
|
6
|
-
describe "#render" do
|
|
7
|
-
it "renders the state title" do
|
|
8
|
-
view = described_class.new(
|
|
9
|
-
home: double(title: "__APP_NAME__"),
|
|
10
|
-
theme: __APP_CLASS__::Application.new.theme
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
expect(view.render).to include("__APP_NAME__")
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module __APP_CLASS__
|
|
4
|
-
module Home
|
|
5
|
-
class ShowView < Charming::View
|
|
6
|
-
def render
|
|
7
|
-
column(title_line, help_line, gap: 1)
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
private
|
|
11
|
-
|
|
12
|
-
def title_line
|
|
13
|
-
text home.title, style: theme.title
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def help_line
|
|
17
|
-
text "Press ctrl+p for commands, q to quit.", style: theme.muted
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
end
|