katapult 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rspec +1 -0
- data/.ruby-version +1 -1
- data/Gemfile +9 -0
- data/README.md +122 -94
- data/Rakefile +13 -0
- data/bin/katapult +59 -25
- data/features/application_model.feature +55 -0
- data/features/authenticate.feature +88 -62
- data/features/basics.feature +64 -402
- data/features/binary.feature +56 -42
- data/features/configuration.feature +4 -4
- data/features/model.feature +21 -30
- data/features/navigation.feature +35 -48
- data/features/step_definitions/aruba_steps.rb +3 -0
- data/features/step_definitions/katapult_steps.rb +307 -8
- data/features/step_definitions/rails_steps.rb +74 -14
- data/features/step_definitions/test_steps.rb +5 -5
- data/features/step_definitions/version_steps.rb +22 -0
- data/features/support/env.rb +11 -3
- data/features/{wui.feature → web_ui.feature} +175 -148
- data/katapult.gemspec +8 -13
- data/lib/generators/katapult/app_model/app_model_generator.rb +12 -0
- data/lib/generators/katapult/app_model/templates/lib/katapult/application_model.rb +40 -0
- data/lib/generators/katapult/basics/basics_generator.rb +186 -51
- data/lib/generators/katapult/basics/templates/.browserslistrc +1 -0
- data/lib/generators/katapult/basics/templates/.gitignore +20 -21
- data/lib/generators/katapult/basics/templates/.rspec_parallel +3 -0
- data/lib/generators/katapult/basics/templates/Capfile +5 -1
- data/lib/generators/katapult/basics/templates/Gemfile +23 -34
- data/lib/generators/katapult/basics/templates/Guardfile +0 -12
- data/lib/generators/katapult/basics/templates/app/controllers/errors_controller.rb +9 -0
- data/lib/generators/katapult/basics/templates/app/helpers/unpoly_helper.rb +13 -0
- data/lib/generators/katapult/{haml → basics}/templates/app/views/layouts/_flashes.html.haml +1 -1
- data/lib/generators/katapult/basics/templates/app/views/layouts/_menu_bar.html.haml.tt +12 -0
- data/lib/generators/katapult/basics/templates/app/views/layouts/application.html.haml.tt +25 -0
- data/lib/generators/katapult/basics/templates/app/webpack/assets/images/.keep +0 -0
- data/lib/generators/katapult/basics/templates/app/webpack/assets/index.js +16 -0
- data/lib/generators/katapult/basics/templates/app/webpack/assets/javascripts/application.js +0 -0
- data/lib/generators/katapult/basics/templates/app/webpack/assets/javascripts/bootstrap.js +12 -0
- data/lib/generators/katapult/basics/templates/app/webpack/assets/javascripts/compilers/.keep +0 -0
- data/lib/generators/katapult/basics/templates/app/webpack/assets/javascripts/macros/content_link.js +17 -0
- data/lib/generators/katapult/basics/templates/app/webpack/assets/javascripts/macros/modal_link.js +17 -0
- data/lib/generators/katapult/basics/templates/app/webpack/assets/javascripts/unpoly.js +9 -0
- data/lib/generators/katapult/basics/templates/app/webpack/assets/stylesheets/_definitions.sass +25 -0
- data/lib/generators/katapult/basics/templates/app/webpack/assets/stylesheets/_environment.sass +2 -0
- data/lib/generators/katapult/basics/templates/app/webpack/assets/stylesheets/_mixins.sass +3 -0
- data/lib/generators/katapult/basics/templates/app/webpack/assets/stylesheets/blocks/.keep +0 -0
- data/lib/generators/katapult/basics/templates/app/webpack/assets/stylesheets/custom_bootstrap.sass +50 -0
- data/lib/generators/katapult/basics/templates/app/webpack/assets/stylesheets/ext/.keep +0 -0
- data/lib/generators/katapult/basics/templates/app/webpack/assets/stylesheets/ext/bootstrap/navbar.sass +83 -0
- data/lib/generators/katapult/basics/templates/app/webpack/assets/stylesheets/theme.sass +11 -0
- data/lib/generators/katapult/basics/templates/app/webpack/assets/stylesheets/unpoly.sass +2 -0
- data/lib/generators/katapult/basics/templates/app/webpack/packs/application.js +13 -0
- data/lib/generators/katapult/basics/templates/config/database.sample.yml +1 -1
- data/lib/generators/katapult/basics/templates/config/deploy.rb +3 -4
- data/lib/generators/katapult/basics/templates/config/environments/staging.rb +5 -0
- data/lib/generators/katapult/basics/templates/config/initializers/better_errors.rb +23 -0
- data/lib/generators/katapult/basics/templates/config/initializers/exception_notification.rb.tt +1 -1
- data/lib/generators/katapult/basics/templates/config/initializers/ext.rb +1 -1
- data/lib/generators/katapult/basics/templates/config/webpack/loaders/unpoly.js +4 -0
- data/lib/generators/katapult/basics/templates/features/support/capybara_screenshot.rb +7 -0
- data/lib/generators/katapult/basics/templates/features/support/factory_bot.rb +1 -0
- data/lib/generators/katapult/basics/templates/features/support/paths.rb +7 -2
- data/lib/generators/katapult/basics/templates/features/support/rspec_doubles.rb +1 -0
- data/lib/generators/katapult/basics/templates/features/support/selectors.rb +3 -3
- data/lib/generators/katapult/basics/templates/features/support/selenium.rb +13 -0
- data/lib/generators/katapult/basics/templates/features/support/{env-custom.rb → spreewald.rb} +0 -0
- data/lib/generators/katapult/basics/templates/features/support/webpacker.rb +35 -0
- data/lib/generators/katapult/basics/templates/lib/ext/action_view/form_for_with_development_errors.rb +31 -31
- data/lib/generators/katapult/basics/templates/lib/ext/active_record/find_by_anything.rb +4 -3
- data/lib/generators/katapult/basics/templates/public/robots.txt +5 -0
- data/lib/generators/katapult/basics/templates/spec/assets/sample.pdf +0 -0
- data/lib/generators/katapult/basics/templates/spec/factories/factories.rb +1 -1
- data/lib/generators/katapult/basics/templates/spec/support/database_cleaner.rb +20 -0
- data/lib/generators/katapult/basics/templates/spec/support/factory_bot.rb +3 -0
- data/lib/generators/katapult/basics/templates/spec/support/fixture_file.rb +6 -0
- data/lib/generators/katapult/basics/templates/spec/support/postgresql_sequences.rb +15 -0
- data/lib/generators/katapult/basics/templates/spec/support/timecop.rb +3 -0
- data/lib/generators/katapult/clearance/clearance_generator.rb +14 -2
- data/lib/generators/katapult/clearance/templates/app/views/layouts/_current_user.html.haml +11 -0
- data/lib/generators/katapult/clearance/templates/app/views/passwords/create.html.haml +10 -4
- data/lib/generators/katapult/clearance/templates/app/views/passwords/edit.html.haml +12 -12
- data/lib/generators/katapult/clearance/templates/app/views/passwords/new.html.haml +14 -11
- data/lib/generators/katapult/clearance/templates/app/views/sessions/new.html.haml +16 -15
- data/lib/generators/katapult/clearance/templates/features/authentication.feature +3 -3
- data/lib/generators/katapult/cucumber_features/templates/feature.feature +1 -1
- data/lib/generators/katapult/model_specs/templates/model_spec.rb +3 -5
- data/lib/generators/katapult/navigation/navigation_generator.rb +7 -1
- data/lib/generators/katapult/navigation/templates/app/views/layouts/_navigation.html.haml +15 -0
- data/lib/generators/katapult/transform/transform_generator.rb +12 -17
- data/lib/generators/katapult/views/templates/_form.html.haml +48 -0
- data/lib/generators/katapult/views/templates/app/helpers/table_helper.rb +14 -0
- data/lib/generators/katapult/views/templates/app/webpack/assets/stylesheets/blocks/action_bar.sass +22 -0
- data/lib/generators/katapult/views/templates/app/webpack/assets/stylesheets/blocks/title.sass +11 -0
- data/lib/generators/katapult/views/templates/custom_action.html.haml +5 -0
- data/lib/generators/katapult/views/templates/edit.html.haml +4 -0
- data/lib/generators/katapult/views/templates/index.html.haml +26 -0
- data/lib/generators/katapult/{haml → views}/templates/new.html.haml +1 -1
- data/lib/generators/katapult/views/templates/show.html.haml +39 -0
- data/lib/generators/katapult/{haml/haml_generator.rb → views/views_generator.rb} +19 -25
- data/lib/generators/katapult/{w_u_i → web_ui}/templates/_route.rb +3 -3
- data/lib/generators/katapult/{w_u_i → web_ui}/templates/controller.rb +21 -23
- data/lib/generators/katapult/{w_u_i/w_u_i_generator.rb → web_ui/web_ui_generator.rb} +7 -12
- data/lib/katapult/action.rb +1 -1
- data/lib/katapult/application_model.rb +8 -8
- data/lib/katapult/binary_util.rb +48 -10
- data/lib/katapult/generator.rb +2 -10
- data/lib/katapult/generator_goodies.rb +23 -0
- data/lib/katapult/navigation.rb +10 -5
- data/lib/katapult/parser.rb +15 -8
- data/lib/katapult/version.rb +5 -1
- data/lib/katapult/{wui.rb → web_ui.rb} +19 -4
- data/lib/katapult.rb +0 -5
- data/script/console +5 -2
- data/script/kta +8 -0
- data/script/update +80 -0
- data/spec/action_spec.rb +0 -1
- data/spec/attribute_spec.rb +0 -1
- data/spec/element_spec.rb +0 -1
- data/spec/model_spec.rb +0 -1
- data/spec/parser_spec.rb +26 -0
- data/spec/util_spec.rb +0 -1
- data/spec/{wui_spec.rb → web_ui_spec.rb} +24 -12
- metadata +86 -124
- data/lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_all.sass +0 -4
- data/lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_items.sass +0 -11
- data/lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_layout.sass +0 -26
- data/lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_navigation.sass +0 -11
- data/lib/generators/katapult/basics/templates/app/assets/stylesheets/application/blocks/_tools.sass +0 -12
- data/lib/generators/katapult/basics/templates/app/assets/stylesheets/application.sass +0 -6
- data/lib/generators/katapult/basics/templates/config/spring.rb +0 -3
- data/lib/generators/katapult/basics/templates/features/support/factory_girl.rb +0 -1
- data/lib/generators/katapult/basics/templates/spec/support/factory_girl.rb +0 -3
- data/lib/generators/katapult/haml/templates/_form.html.haml +0 -38
- data/lib/generators/katapult/haml/templates/app/views/layouts/application.html.haml +0 -33
- data/lib/generators/katapult/haml/templates/custom_action.html.haml +0 -5
- data/lib/generators/katapult/haml/templates/edit.html.haml +0 -4
- data/lib/generators/katapult/haml/templates/index.html.haml +0 -29
- data/lib/generators/katapult/haml/templates/show.html.haml +0 -39
- data/lib/generators/katapult/install/install_generator.rb +0 -14
- data/lib/generators/katapult/install/templates/lib/katapult/application_model.rb +0 -20
- data/lib/generators/katapult/navigation/templates/app/models/navigation.rb +0 -12
@@ -1,39 +0,0 @@
|
|
1
|
-
%h1
|
2
|
-
= <%= model_name(:ivar) %>.to_s
|
3
|
-
|
4
|
-
.tools
|
5
|
-
= link_to 'All <%= model_name(:humans) %>', <%= wui.path(:index) %>, class: 'tools__button'
|
6
|
-
= link_to 'Edit', <%= wui.path(:edit, model_name(:ivar)) %>, class: 'tools__button is_primary'
|
7
|
-
= link_to 'Destroy', <%= wui.path(:destroy, model_name(:ivar)) %>, method: :delete, class: 'tools__button', confirm: 'Really destroy?'
|
8
|
-
<% wui.custom_actions.select(&:member?).each do |action| -%>
|
9
|
-
= link_to '<%= action.name(:human).titleize %>', <%= wui.path(action, model_name(:ivar)) %>, class: 'tools__button'<%=
|
10
|
-
", method: :#{action.method}" unless action.get?
|
11
|
-
%>
|
12
|
-
<% end -%>
|
13
|
-
|
14
|
-
%dl.values
|
15
|
-
<% wui.model.renderable_attrs.each do |attribute| -%>
|
16
|
-
<%- model_attribute = "#{model_name(:ivar)}.#{attribute.name}" -%>
|
17
|
-
%dt
|
18
|
-
= <%= model_name(:class) %>.human_attribute_name(:<%= attribute.name %>)
|
19
|
-
%dd
|
20
|
-
<%- case attribute.type -%>
|
21
|
-
<%- when :string -%>
|
22
|
-
= <%= model_attribute %>
|
23
|
-
<%- when :email -%>
|
24
|
-
= mail_to <%= model_attribute %>, nil, class: 'hyperlink'
|
25
|
-
<%- when :url -%>
|
26
|
-
= link_to <%= model_attribute %>, <%= model_attribute %>, class: 'hyperlink'
|
27
|
-
<%- when :integer -%>
|
28
|
-
= <%= model_attribute %>
|
29
|
-
<%- when :money -%>
|
30
|
-
= <%= model_attribute %>
|
31
|
-
€
|
32
|
-
<%- when :text -%>
|
33
|
-
= simple_format(<%= model_attribute %>)
|
34
|
-
<%- when :flag -%>
|
35
|
-
= <%= model_attribute %> ? 'Yes' : 'No'
|
36
|
-
<%- when :datetime -%>
|
37
|
-
= l(<%= model_attribute %>.to_date) if <%= model_attribute %>
|
38
|
-
<%- end -%>
|
39
|
-
<%- end -%>
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# Install katapult into an application.
|
2
|
-
|
3
|
-
module Katapult
|
4
|
-
class InstallGenerator < Rails::Generators::Base
|
5
|
-
|
6
|
-
desc 'Install katapult into a Rails app'
|
7
|
-
source_root File.expand_path('../templates', __FILE__)
|
8
|
-
|
9
|
-
def setup_lib
|
10
|
-
template 'lib/katapult/application_model.rb'
|
11
|
-
end
|
12
|
-
|
13
|
-
end
|
14
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
# Here you define the fundamentals of your application.
|
2
|
-
#
|
3
|
-
# Add a model:
|
4
|
-
# model 'user' do |user|
|
5
|
-
# user.attr :name
|
6
|
-
# user.attr :birth, type: :datetime
|
7
|
-
# user.attr :email
|
8
|
-
# end
|
9
|
-
#
|
10
|
-
# Add a web user interface:
|
11
|
-
# wui 'user' do |wui|
|
12
|
-
# wui.crud # Creates all CRUD actions: index, new, show, etc.
|
13
|
-
# wui.action :lock, scope: :member, method: :post
|
14
|
-
# end
|
15
|
-
#
|
16
|
-
# Add navigation
|
17
|
-
# navigation :main
|
18
|
-
#
|
19
|
-
# Add authentication
|
20
|
-
# authenticate 'user', system_email: 'system@example.com'
|
@@ -1,12 +0,0 @@
|
|
1
|
-
class Navigation
|
2
|
-
include Navy::Description
|
3
|
-
|
4
|
-
navigation :<%= name.downcase %> do
|
5
|
-
<% navigation.wuis.each do |wui| -%>
|
6
|
-
<%- if wui.find_action(:index) -%>
|
7
|
-
section <%= navigation.section_name(wui) %>, <%= wui.model_name(:humans).titlecase.inspect %>, <%= wui.path(:index) %>
|
8
|
-
<%- end -%>
|
9
|
-
<% end -%>
|
10
|
-
end
|
11
|
-
|
12
|
-
end
|