rails_app_generator 0.1.13 → 0.1.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -0
  3. data/CHANGELOG.md +23 -0
  4. data/after_templates/addons/acts_as_list/_.rb +62 -0
  5. data/after_templates/addons/acts_as_list/app/controllers/home_controller.rb +7 -0
  6. data/after_templates/addons/acts_as_list/app/controllers/todo_items_controller.rb +132 -0
  7. data/after_templates/addons/acts_as_list/app/models/todo_item.rb +23 -0
  8. data/after_templates/addons/acts_as_list/app/models/todo_list.rb +12 -0
  9. data/after_templates/addons/acts_as_list/app/views/home/index.html.erb +23 -0
  10. data/after_templates/addons/acts_as_list/app/views/layouts/_alerts.html.erb +2 -0
  11. data/after_templates/addons/acts_as_list/app/views/layouts/_footer.html.erb +3 -0
  12. data/after_templates/addons/acts_as_list/app/views/layouts/_navbar.html.erb +8 -0
  13. data/after_templates/addons/acts_as_list/app/views/layouts/application.html.erb +28 -0
  14. data/after_templates/addons/acts_as_list/app/views/todo_items/_todo_item.html.erb +21 -0
  15. data/after_templates/addons/acts_as_list/app/views/todo_items/index.html.erb +25 -0
  16. data/after_templates/addons/acts_as_list/config/routes.rb +15 -0
  17. data/after_templates/addons/acts_as_list/db/seeds.rb +17 -0
  18. data/after_templates/addons/faker/_.rb +38 -0
  19. data/after_templates/addons/faker/app/controllers/home_controller.rb +7 -0
  20. data/after_templates/addons/faker/app/views/home/index.html.erb +102 -0
  21. data/after_templates/addons/faker/app/views/layouts/_alerts.html.erb +2 -0
  22. data/after_templates/addons/faker/app/views/layouts/_footer.html.erb +3 -0
  23. data/after_templates/addons/faker/app/views/layouts/_navbar.html.erb +3 -0
  24. data/after_templates/addons/faker/app/views/layouts/application.html.erb +28 -0
  25. data/after_templates/addons/twilio_ruby/_.rb +23 -0
  26. data/after_templates/addons/twilio_ruby/app/controllers/home_controller.rb +54 -0
  27. data/after_templates/addons/twilio_ruby/app/views/home/index.html.erb +27 -0
  28. data/after_templates/addons/twilio_ruby/config/initializers/twilio.rb +4 -0
  29. data/lib/rails_app_generator/addons/acts_as_list.rb +17 -0
  30. data/lib/rails_app_generator/addons/faker.rb +25 -0
  31. data/lib/rails_app_generator/app_generator.rb +81 -90
  32. data/lib/rails_app_generator/options/rails_options.rb +4 -1
  33. data/lib/rails_app_generator/version.rb +1 -1
  34. data/package-lock.json +2 -2
  35. data/package.json +1 -1
  36. data/profiles/addons/acts_as_list.json +13 -0
  37. data/profiles/addons/faker.json +12 -0
  38. data/profiles/addons/twilio_ruby.json +12 -0
  39. data/tasks/addon.thor +4 -5
  40. data/tasks/profile.thor +20 -7
  41. data/templates/thor_task/profile/{after_template.rb.tt → after_template.rb} +11 -1
  42. data/templates/thor_task/profile/app/controllers/home_controller.rb +7 -0
  43. data/templates/thor_task/profile/app/views/home/index.html.erb.tt +23 -0
  44. data/templates/thor_task/profile/app/views/layouts/_alerts.html.erb.tt +2 -0
  45. data/templates/thor_task/profile/app/views/layouts/_footer.html.erb.tt +3 -0
  46. data/templates/thor_task/profile/app/views/layouts/_navbar.html.erb +7 -0
  47. data/templates/thor_task/profile/app/views/layouts/application.html.erb.tt +28 -0
  48. data/templates/thor_task/profile/config/initializers/addon_name.rb +1 -0
  49. data/templates/thor_task/profile/db/seeds.rb +16 -0
  50. metadata +41 -5
  51. data/after_templates/addons/rails_html_sanitizer_xxx/home/index.html.erb +0 -31
  52. data/templates/thor_task/profile/home/index.html.erb.tt +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1505eaa23b41f69afe5f4060221b479ae01209f1a76df69577ef715b17c9455f
4
- data.tar.gz: f33d5a7001365a84503d2640053604e3e6fe52632f54f0c03c17fe36ff83c869
3
+ metadata.gz: d4678312f0c3daef59040ffdff420854a8830450683873c7543d9738634ac185
4
+ data.tar.gz: 3db0da5693679fb06ab7958d10379805419cd55e8c190668d9d0888a312db152
5
5
  SHA512:
6
- metadata.gz: 00b2d94306f636e25800d4d6ed09d8536535f47c630662ee6beda2939dbf871e01721d2978e19dc6bb5c0e281f47913d73535bfb2ef8ecaee427726e9308be7f
7
- data.tar.gz: 3dde1c772e2d56ad34d9b190742c25725e744145e4754630425613ced8525e026d935a671f8335b3fb60a56122547b0bc589845bb9f1de61689c94a74b5e0070
6
+ metadata.gz: e6a6cc4fc9d402061464492e6853973aaa727131f972116827582b07b24d248a605efd763395e1b8c47869734b0ac73f0525a29ff47ef519b521a66b923fcbe1
7
+ data.tar.gz: 9063b3dac614fcd9798103919adb62a99b9cb3cf9ca58b9bacbeb2c0002a1f385425e48e462b4b627fb50888e6cd382ea601bee787c85b920acb6b45f6c7602e
data/.rubocop.yml CHANGED
@@ -12,6 +12,7 @@ AllCops:
12
12
  - "spec/samples/**/*"
13
13
  - "a/**/*"
14
14
  - "after_templates/**/*"
15
+ - "templates/**/*"
15
16
 
16
17
  Metrics/BlockLength:
17
18
  Exclude:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## [0.1.15](https://github.com/klueless-io/rails_app_generator/compare/v0.1.14...v0.1.15) (2022-08-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * addon acts_as_list ([6b7e759](https://github.com/klueless-io/rails_app_generator/commit/6b7e759b1601300b7f616ced2a8dce27056bf781))
7
+ * addon acts_as_list ([c88e583](https://github.com/klueless-io/rails_app_generator/commit/c88e58373833e5ab9685dd1ddf7dd4327ef7db8b))
8
+
9
+ ## [0.1.14](https://github.com/klueless-io/rails_app_generator/compare/v0.1.13...v0.1.14) (2022-08-04)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * add twilio addon ([2a70a12](https://github.com/klueless-io/rails_app_generator/commit/2a70a1216dc9d7475289a154f6c7b8c4a2a80403))
15
+
16
+ ## [0.1.13](https://github.com/klueless-io/rails_app_generator/compare/v0.1.12...v0.1.13) (2022-08-03)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * add honeybadger addon ([5118957](https://github.com/klueless-io/rails_app_generator/commit/511895750056a8eff7bc41c0cc902ff81cfcd7d3))
22
+ * add honeybadger addon + cops ([e105b47](https://github.com/klueless-io/rails_app_generator/commit/e105b47790c2a91a0a9ec0224f8a7aecb75067a9))
23
+
1
24
  ## [0.1.12](https://github.com/klueless-io/rails_app_generator/compare/v0.1.11...v0.1.12) (2022-08-02)
2
25
 
3
26
 
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ # require 'pry'
4
+
5
+ # This "acts_as" extension provides the capabilities for sorting and reordering a number of objects in a list. The class that has this specified needs to have a "position" column defined as an integer on the mapped database table.
6
+ #
7
+ # exe/rag addons/acts_as_list
8
+
9
+ self.local_template_path = File.dirname(__FILE__)
10
+
11
+ gac 'base rails 7 image created'
12
+
13
+ add_controller('home', 'index')
14
+ route("root 'home#index'")
15
+
16
+ force_copy
17
+
18
+ add_scaffold('todo_list', 'name')
19
+ add_scaffold('todo_item', 'task', 'position:integer', 'todo_list:references')
20
+
21
+ copy_file 'app/controllers/home_controller.rb' , 'app/controllers/home_controller.rb'
22
+ copy_file 'app/controllers/todo_items_controller.rb' , 'app/controllers/todo_items_controller.rb'
23
+ copy_file 'app/models/todo_list.rb' , 'app/models/todo_list.rb'
24
+ copy_file 'app/models/todo_item.rb' , 'app/models/todo_item.rb'
25
+
26
+ copy_file 'app/views/home/index.html.erb' , 'app/views/home/index.html.erb'
27
+
28
+ copy_file 'app/views/layouts/_alerts.html.erb' , 'app/views/layouts/_alerts.html.erb'
29
+ copy_file 'app/views/layouts/_navbar.html.erb' , 'app/views/layouts/_navbar.html.erb'
30
+ copy_file 'app/views/layouts/_footer.html.erb' , 'app/views/layouts/_footer.html.erb'
31
+ template 'app/views/layouts/application.html.erb' , 'app/views/layouts/application.html.erb'
32
+
33
+ copy_file 'app/views/todo_items/index.html.erb' , 'app/views/todo_items/index.html.erb'
34
+ copy_file 'app/views/todo_items/_todo_item.html.erb' , 'app/views/todo_items/_todo_item.html.erb'
35
+
36
+ copy_file 'config/routes.rb' , 'config/routes.rb'
37
+
38
+ template 'db/seeds.rb' , 'db/seeds.rb'
39
+
40
+ after_bundle do
41
+ setup_db
42
+ end
43
+
44
+ def setup_db
45
+
46
+ db_migrate
47
+ rails_command('db:seed')
48
+ end
49
+
50
+ # Other template command examples
51
+ # css_install('tailwind')
52
+ # rails_command('db:migrate')
53
+ # bundle_add('hotwire-rails')
54
+ # rails_command('hotwire:install')
55
+ # run('bin/importmap pin sortablejs')
56
+ # run('npm install daisyui')
57
+ # create_file 'app/assets/stylesheets/custom-bootstrap-import.scss' , read_template('custom-bootstrap-import.scss')
58
+ # append_to_file 'app/assets/config/manifest.js' , read_template('manifest.js')
59
+ # insert_into_file 'app/views/layouts/application.html.erb', read_template('application.html.erb'),
60
+ # before: %( <%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>)
61
+ # gsub_file 'app/views/layouts/application.html.erb', %(container mx-auto mt-28 px-5 flex), 'container mx-auto px-5'
62
+ # template 'home.css', 'app/assets/stylesheets/home.css'
@@ -0,0 +1,7 @@
1
+ class HomeController < ApplicationController
2
+ def index
3
+ end
4
+
5
+ def some_action
6
+ end
7
+ end
@@ -0,0 +1,132 @@
1
+ class TodoItemsController < ApplicationController
2
+ before_action :set_todo_item, only: %i[
3
+ show
4
+ edit
5
+ update
6
+ destroy
7
+ insert_at
8
+ move_lower
9
+ move_higher
10
+ move_to_bottom
11
+ move_to_top
12
+ remove_from_list
13
+ ]
14
+
15
+ before_action :set_todo_items, only: %i[
16
+ index
17
+ insert_at
18
+ move_lower
19
+ move_higher
20
+ move_to_bottom
21
+ move_to_top
22
+ remove_from_list
23
+ ]
24
+
25
+ # GET /todo_items or /todo_items.json
26
+ def index
27
+ end
28
+
29
+ # GET /todo_items/1 or /todo_items/1.json
30
+ def show
31
+ end
32
+
33
+ def insert_at
34
+ @todo_item.insert_at(2)
35
+ render :index, params
36
+ end
37
+
38
+ def move_lower
39
+ @todo_item.move_lower
40
+ render :index, params
41
+ end
42
+
43
+ def move_higher
44
+ @todo_item.move_higher
45
+ render :index, params
46
+ end
47
+
48
+ def move_to_bottom
49
+ @todo_item.move_to_bottom
50
+ render :index, params
51
+ end
52
+
53
+ def move_to_top
54
+ @todo_item.move_to_top
55
+ render :index, params
56
+ end
57
+
58
+ def remove_from_list
59
+ @todo_item.remove_from_list
60
+ render :index, params
61
+ end
62
+
63
+ # GET /todo_items/new
64
+ def new
65
+ @todo_item = TodoItem.new
66
+ end
67
+
68
+ # GET /todo_items/1/edit
69
+ def edit
70
+ end
71
+
72
+ # POST /todo_items or /todo_items.json
73
+ def create
74
+ @todo_item = TodoItem.new(todo_item_params)
75
+
76
+ respond_to do |format|
77
+ if @todo_item.save
78
+ format.html { redirect_to todo_item_url(@todo_item), notice: "Todo item was successfully created." }
79
+ format.json { render :show, status: :created, location: @todo_item }
80
+ else
81
+ format.html { render :new, status: :unprocessable_entity }
82
+ format.json { render json: @todo_item.errors, status: :unprocessable_entity }
83
+ end
84
+ end
85
+ end
86
+
87
+ # PATCH/PUT /todo_items/1 or /todo_items/1.json
88
+ def update
89
+ respond_to do |format|
90
+ if @todo_item.update(todo_item_params)
91
+ format.html { redirect_to todo_item_url(@todo_item), notice: "Todo item was successfully updated." }
92
+ format.json { render :show, status: :ok, location: @todo_item }
93
+ else
94
+ format.html { render :edit, status: :unprocessable_entity }
95
+ format.json { render json: @todo_item.errors, status: :unprocessable_entity }
96
+ end
97
+ end
98
+ end
99
+
100
+ # DELETE /todo_items/1 or /todo_items/1.json
101
+ def destroy
102
+ @todo_item.destroy
103
+
104
+ respond_to do |format|
105
+ format.html { redirect_to todo_items_url, notice: "Todo item was successfully destroyed." }
106
+ format.json { head :no_content }
107
+ end
108
+ end
109
+
110
+ def query_params
111
+ params.permit(:todo_list_id)
112
+ end
113
+ helper_method :query_params
114
+
115
+ private
116
+ # Use callbacks to share common setup or constraints between actions.
117
+ def set_todo_item
118
+ @todo_item = TodoItem.find(params[:id])
119
+ end
120
+
121
+ def set_todo_items
122
+ todo_list_id = params[:todo_list_id]
123
+
124
+ @todo_items = todo_list_id.nil? ? TodoItem.all : TodoItem.where(todo_list_id: todo_list_id)
125
+ @todo_items = @todo_items.order(:todo_list_id, :position)
126
+ end
127
+
128
+ # Only allow a list of trusted parameters through.
129
+ def todo_item_params
130
+ params.require(:todo_item).permit(:task, :position, :todo_list_id)
131
+ end
132
+ end
@@ -0,0 +1,23 @@
1
+ # == Schema Information
2
+ #
3
+ # Table name: todo_items
4
+ #
5
+ # id :integer not null, primary key
6
+ # position :integer
7
+ # task :string
8
+ # created_at :datetime not null
9
+ # updated_at :datetime not null
10
+ # todo_list_id :integer not null
11
+ #
12
+ # Indexes
13
+ #
14
+ # index_todo_items_on_todo_list_id (todo_list_id)
15
+ #
16
+ # Foreign Keys
17
+ #
18
+ # todo_list_id (todo_list_id => todo_lists.id)
19
+ #
20
+ class TodoItem < ApplicationRecord
21
+ belongs_to :todo_list
22
+ acts_as_list scope: :todo_list
23
+ end
@@ -0,0 +1,12 @@
1
+ # == Schema Information
2
+ #
3
+ # Table name: todo_lists
4
+ #
5
+ # id :integer not null, primary key
6
+ # name :string
7
+ # created_at :datetime not null
8
+ # updated_at :datetime not null
9
+ #
10
+ class TodoList < ApplicationRecord
11
+ has_many :todo_items, -> { order(position: :asc) }
12
+ end
@@ -0,0 +1,23 @@
1
+ <style>
2
+ .alert { color: red; }
3
+ .notice { color: green; }
4
+ </style>
5
+
6
+ <% flash.each do |type, msg| %><div class="<%= type %>"><%= msg %></div><% end %>
7
+ <% if flash.any? %><hr /><% end %>
8
+
9
+ <h1>Acts as list</h1>
10
+
11
+ <h2>This "acts_as" extension provides the capabilities for sorting and reordering a number of objects in a list. The class that has this specified needs to have a "position" column defined as an integer on the mapped database table.</h2>
12
+
13
+ <!--
14
+ Add/Remove as needed
15
+ -->
16
+
17
+ <!--
18
+ <= link_to 'Some Action', home_some_action_path %>
19
+
20
+ <= link_to 'Products', products_path %> |
21
+ <= link_to 'Posts', posts_path %> |
22
+ <= link_to 'People', people_path %>
23
+ -->
@@ -0,0 +1,2 @@
1
+ <% flash.each do |type, msg| %><div class="<%= type %>"><%= msg %></div><% end %>
2
+ <% if flash.any? %><hr /><% end %>
@@ -0,0 +1,3 @@
1
+ <footer>
2
+ <hr />
3
+ </footer>
@@ -0,0 +1,8 @@
1
+ <header>
2
+ <%= link_to 'Home', root_path %> |
3
+ <%= link_to 'ToDo List', todo_lists_path %> |
4
+ <%= link_to 'ToDo Items', todo_items_path %> |
5
+ <%= link_to 'People', todo_items_path(todo_list_id: TodoList.find_by(name: 'people')) %> |
6
+ <%= link_to 'Jobs', todo_items_path(todo_list_id: TodoList.find_by(name: 'jobs')) %>
7
+ <hr />
8
+ </header>
@@ -0,0 +1,28 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title><%= camelized %></title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <%%= csrf_meta_tags %>
7
+ <%%= csp_meta_tag %>
8
+
9
+ <%- if options[:skip_hotwire] || options[:skip_javascript] -%>
10
+ <%%= stylesheet_link_tag "application" %>
11
+ <%- else -%>
12
+ <%%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
13
+ <%- end -%>
14
+ <style>
15
+ .alert { color: red; }
16
+ .notice { color: green; }
17
+ </style>
18
+ </head>
19
+
20
+ <body>
21
+ <%%= render 'layouts/navbar' %>
22
+ <main>
23
+ <%%= render 'layouts/alerts' %>
24
+ <%%= yield %>
25
+ </main>
26
+ <%%= render 'layouts/footer' %>
27
+ </body>
28
+ </html>
@@ -0,0 +1,21 @@
1
+ <tr>
2
+ <td>
3
+ <%= todo_item.task %>
4
+ </td>
5
+ <td>
6
+ <%= todo_item.position %>
7
+ </td>
8
+ <td>
9
+ <%= todo_item.todo_list.name %>
10
+ </td>
11
+ <td>
12
+ <%= link_to "Show", todo_item %> |
13
+ <%= link_to "Insert At #2", insert_at_todo_item_path(todo_item.id, **query_params) %> |
14
+ <%= link_to "Higher", move_higher_todo_item_path(todo_item.id, **query_params) %> |
15
+ <%= link_to "Lower", move_lower_todo_item_path(todo_item.id, **query_params) %> |
16
+ <%= link_to "Top", move_to_top_todo_item_path(todo_item.id, **query_params) %> |
17
+ <%= link_to "Bottom", move_to_bottom_todo_item_path(todo_item.id, **query_params) %> |
18
+ <%= link_to "Remove From List", remove_from_list_todo_item_path(todo_item.id, **query_params) %>
19
+ </td>
20
+ </tr>
21
+
@@ -0,0 +1,25 @@
1
+ <p style="color: green"><%= notice %></p>
2
+
3
+ <h1>Todo items</h1>
4
+
5
+ <div id="todo_items">
6
+ <table>
7
+ <thead>
8
+ <tr>
9
+ <th>Task</th>
10
+ <th>Position</th>
11
+ <th>List Name</th>
12
+ </tr>
13
+ </thead>
14
+ <tbody>
15
+
16
+ <% @todo_items.each do |todo_item| %>
17
+ <%= render todo_item %>
18
+ <% end %>
19
+
20
+ </tbody>
21
+ </table>
22
+
23
+ </div>
24
+
25
+ <%= link_to "New todo item", new_todo_item_path %>
@@ -0,0 +1,15 @@
1
+ Rails.application.routes.draw do
2
+ resources :todo_items do
3
+ member do
4
+ get :insert_at
5
+ get :move_lower
6
+ get :move_higher
7
+ get :move_to_bottom
8
+ get :move_to_top
9
+ get :remove_from_list
10
+ end
11
+ end
12
+ resources :todo_lists
13
+ root 'home#index'
14
+ get 'home/index'
15
+ end
@@ -0,0 +1,17 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
3
+ #
4
+ # User.find_or_create_by(email: "admin@admin.com") do |user|
5
+ # user.name = 'Admin'
6
+ # user.password = 'password'
7
+ # user.admin = true
8
+ # end
9
+
10
+ people = TodoList.create(name: 'people')
11
+ jobs = TodoList.create(name: 'jobs')
12
+ # lisa = User.create(email: 'lisa@site.com', name: 'lisa', password: 'password')
13
+
14
+ 5.times do |i|
15
+ TodoItem.create(todo_list: people, task: "Person Name #{i}", position: i)
16
+ TodoItem.create(todo_list: jobs , task: "Profession #{i}", position: i)
17
+ end
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ # require 'pry'
4
+
5
+ # Faker, a port of Data::Faker from Perl, is used to easily generate fake data: names, addresses, phone numbers, etc.
6
+ #
7
+ # exe/rag addons/faker
8
+
9
+ self.local_template_path = File.dirname(__FILE__)
10
+
11
+ gac 'base rails 7 image created'
12
+
13
+ add_controller('home', 'index')
14
+ route("root 'home#index'")
15
+
16
+ force_copy
17
+
18
+ copy_file 'app/controllers/home_controller.rb' , 'app/controllers/home_controller.rb'
19
+ copy_file 'app/views/home/index.html.erb' , 'app/views/home/index.html.erb'
20
+
21
+ copy_file 'app/views/layouts/_alerts.html.erb' , 'app/views/layouts/_alerts.html.erb'
22
+ copy_file 'app/views/layouts/_navbar.html.erb' , 'app/views/layouts/_navbar.html.erb'
23
+ copy_file 'app/views/layouts/_footer.html.erb' , 'app/views/layouts/_footer.html.erb'
24
+ template 'app/views/layouts/application.html.erb' , 'app/views/layouts/application.html.erb'
25
+
26
+ # Other template command examples
27
+ # css_install('tailwind')
28
+ # rails_command('db:migrate')
29
+ # bundle_add('hotwire-rails')
30
+ # rails_command('hotwire:install')
31
+ # run('bin/importmap pin sortablejs')
32
+ # run('npm install daisyui')
33
+ # create_file 'app/assets/stylesheets/custom-bootstrap-import.scss' , read_template('custom-bootstrap-import.scss')
34
+ # append_to_file 'app/assets/config/manifest.js' , read_template('manifest.js')
35
+ # insert_into_file 'app/views/layouts/application.html.erb', read_template('application.html.erb'),
36
+ # before: %( <%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>)
37
+ # gsub_file 'app/views/layouts/application.html.erb', %(container mx-auto mt-28 px-5 flex), 'container mx-auto px-5'
38
+ # template 'home.css', 'app/assets/stylesheets/home.css'
@@ -0,0 +1,7 @@
1
+ class HomeController < ApplicationController
2
+ def index
3
+ end
4
+
5
+ def some_action
6
+ end
7
+ end
@@ -0,0 +1,102 @@
1
+ <h1>Faker</h1>
2
+
3
+ <h2>Faker, a port of Data::Faker from Perl, is used to easily generate fake data: names, addresses, phone numbers, etc.</h2>
4
+
5
+ <hr>
6
+ <h3>Names</h3>
7
+
8
+ <pre>
9
+ Faker::Name.name
10
+ # or
11
+ Faker::Name.unique.name
12
+ </pre>
13
+
14
+ <ul>
15
+ <% 10.times do |i| %>
16
+ <li><%= Faker::Name.name %></li>
17
+ <% end%>
18
+ </ul>
19
+
20
+
21
+ <hr>
22
+ <h3>Emails</h3>
23
+
24
+ <pre>
25
+ Faker::Internet.email
26
+ </pre>
27
+
28
+ <ul>
29
+ <% 10.times do |i| %>
30
+ <li><%= Faker::Internet.email %></li>
31
+ <% end%>
32
+ </ul>
33
+
34
+
35
+ <hr>
36
+ <h3>Artist</h3>
37
+
38
+ <pre>
39
+ Faker::Artist.name
40
+ </pre>
41
+
42
+ <ul>
43
+ <% 10.times do |i| %>
44
+ <li><%= Faker::Artist.name %></li>
45
+ <% end%>
46
+ </ul>
47
+
48
+
49
+ <hr>
50
+ <h3>Adress</h3>
51
+
52
+ <pre>
53
+ Faker::Address.city #=> "Imogeneborough"
54
+ Faker::Address.street_name #=> "Larkin Fork"
55
+ Faker::Address.street_address #=> "282 Kevin Brook"
56
+ Faker::Address.secondary_address #=> "Apt. 672"
57
+ Faker::Address.building_number #=> "7304"
58
+ Faker::Address.mail_box #=> "PO Box 123"
59
+ Faker::Address.community #=> "University Crossing"
60
+ Faker::Address.zip_code #=> "58517" or "23285-4905"
61
+ Faker::Address.zip #=> "58517" or "66259-8212"
62
+ Faker::Address.postcode #=> "76032-4907" or "58517"
63
+ Faker::Address.time_zone #=> "Asia/Yakutsk"
64
+ Faker::Address.street_suffix #=> "Street"
65
+ Faker::Address.city_suffix #=> "fort"
66
+ Faker::Address.city_prefix #=> "Lake"
67
+ Faker::Address.state #=> "California"
68
+ Faker::Address.state_abbr #=> "AP"
69
+ Faker::Address.country #=> "French Guiana"
70
+
71
+ # Keyword arguments: code
72
+ Faker::Address.country_by_code(code: 'NL') #=> "Netherlands"
73
+
74
+ # Keyword arguments: name
75
+ Faker::Address.country_name_to_code(name: 'united_states') #=> "US"
76
+ Faker::Address.country_code #=> "IT"
77
+ Faker::Address.country_code_long #=> "ITA"
78
+ Faker::Address.latitude #=> "-58.17256227443719"
79
+ Faker::Address.longitude #=> "-156.65548382095133"
80
+ Faker::Address.full_address #=> "282 Kevin Brook, Imogeneborough, CA 58517"
81
+ </pre>
82
+
83
+ <ul>
84
+ <li><%= Faker::Address.city %></li>
85
+ <li><%= Faker::Address.street_name %></li>
86
+ <li><%= Faker::Address.street_address %></li>
87
+ <li><%= Faker::Address.secondary_address %></li>
88
+ <li><%= Faker::Address.building_number %></li>
89
+ <li><%= Faker::Address.mail_box %></li>
90
+ <li><%= Faker::Address.community %></li>
91
+ <li><%= Faker::Address.zip_code %></li>
92
+ <li><%= Faker::Address.zip %></li>
93
+ <li><%= Faker::Address.postcode %></li>
94
+ <li><%= Faker::Address.time_zone %></li>
95
+ <li><%= Faker::Address.street_suffix %></li>
96
+ <li><%= Faker::Address.city_suffix %></li>
97
+ <li><%= Faker::Address.city_prefix %></li>
98
+ <li><%= Faker::Address.state %></li>
99
+ <li><%= Faker::Address.state_abbr %></li>
100
+ <li><%= Faker::Address.country %></li>
101
+ </ul>
102
+
@@ -0,0 +1,2 @@
1
+ <% flash.each do |type, msg| %><div class="<%= type %>"><%= msg %></div><% end %>
2
+ <% if flash.any? %><hr /><% end %>
@@ -0,0 +1,3 @@
1
+ <footer>
2
+ <hr />
3
+ </footer>
@@ -0,0 +1,3 @@
1
+ <header>
2
+ <hr />
3
+ </header>
@@ -0,0 +1,28 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title><%= camelized %></title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <%%= csrf_meta_tags %>
7
+ <%%= csp_meta_tag %>
8
+
9
+ <%- if options[:skip_hotwire] || options[:skip_javascript] -%>
10
+ <%%= stylesheet_link_tag "application" %>
11
+ <%- else -%>
12
+ <%%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
13
+ <%- end -%>
14
+ <style>
15
+ .alert { color: red; }
16
+ .notice { color: green; }
17
+ </style>
18
+ </head>
19
+
20
+ <body>
21
+ <%%= render 'layouts/navbar' %>
22
+ <main>
23
+ <%%= render 'layouts/alerts' %>
24
+ <%%= yield %>
25
+ </main>
26
+ <%%= render 'layouts/footer' %>
27
+ </body>
28
+ </html>
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ # require 'pry'
4
+
5
+ # The official library for communicating with the Twilio REST API, building TwiML, and generating Twilio JWT Capability Tokens
6
+ #
7
+ # exe/rag addons/twilio_ruby
8
+
9
+ self.local_template_path = File.dirname(__FILE__)
10
+
11
+ gac 'base rails 7 image created'
12
+
13
+ add_controller('home', 'index')
14
+ route("root 'home#index'")
15
+ route("get 'home/send_sms'")
16
+
17
+ # route("root 'home#index'")
18
+
19
+ force_copy
20
+
21
+ copy_file 'app/controllers/home_controller.rb', 'app/controllers/home_controller.rb'
22
+ copy_file 'app/views/home/index.html.erb', 'app/views/home/index.html.erb'
23
+ copy_file 'config/initializers/twilio.rb', 'config/initializers/twilio.rb'