silmarails 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5038a4b76855b99d2b34ffb7a2b6755a6d660737
4
- data.tar.gz: c024c7cc2899c518f5c14405b270b5393fc92c7a
3
+ metadata.gz: c429426bdd6696730bb425aaa790af3099fd4438
4
+ data.tar.gz: b07c37b771d0e0390bb3efa721529ac3e6b40121
5
5
  SHA512:
6
- metadata.gz: 8c0ca654399858d4c8ff9f481253df488ac4e6669ca013c10e9be4c2c2e12c006964df526aee595a76e4aff48b4193c8696aa5f6915755eed44a7d921b0bb99e
7
- data.tar.gz: 0ce5c3df6b92a8d45ea78e93c3238c3cf2fdff88541245ad85e7e12558ca062fce5acf97a0e7fb39aff95372bc29ab0e4827bdfe4f4d2c1f30ca925f3d3b4caa
6
+ metadata.gz: cc9d1d1b0aa5280d88e51f6dd383d4b73f5c785bff6f2cd3752263d37aeec8d321adddbb1ddb3a32e026afc53df80ce605efaa59618f7117ca12cb490c4ae7fb
7
+ data.tar.gz: c15eb8db946256900ef8f2e29762c2083fdad0a19e06478ffa79f7a409e74c6ada3a4815f9a09995040b3cd288e333ce3d0dec47074e5d7dd8a926d86b034d83
@@ -0,0 +1,18 @@
1
+ <div class="small-8 small-offset-2
2
+ medium-6 medium-offset-3
3
+ large-4 large-offset-4 columns">
4
+ <%%= simple_form_for(@<%= singular_table_name %>) do |f| %>
5
+ <%%= f.error_notification %>
6
+
7
+ <div class="form-inputs">
8
+ <%- attributes.each do |attribute| -%>
9
+ <%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
10
+ <%- end -%>
11
+ </div>
12
+
13
+ <div class="form-actions">
14
+ <%%= f.button :submit, class: "btn btn-primary pull-right" %>
15
+ </div>
16
+ <%% end %>
17
+ </div>
18
+
@@ -0,0 +1,11 @@
1
+ <h1 class="text-center">
2
+ Editing <%= singular_table_name.titleize %> - <%%= @<%= singular_table_name %>.to_title %>
3
+ </h1>
4
+
5
+ <div class="text-center">
6
+ <%%= link_to 'Show', @<%= singular_table_name %> %> |
7
+ <%%= link_to 'Back', <%= index_helper %>_path %>
8
+ </div>
9
+
10
+ <%%= render 'form', <%= singular_table_name %>: @<%= singular_table_name %> %>
11
+
@@ -0,0 +1,38 @@
1
+ <h1 class="text-center"><%= plural_table_name.titleize %></h1>
2
+
3
+ <div class="text-center">
4
+ <%%= link_to 'New <%= singular_table_name.titleize %>', new_<%= singular_table_name %>_path %>
5
+ </div>
6
+
7
+ <table>
8
+ <thead>
9
+ <tr>
10
+ <% attributes.reject(&:password_digest?).each do |attribute| -%>
11
+ <th><%= attribute.human_name %></th>
12
+ <% end -%>
13
+ <th colspan="3"></th>
14
+ </tr>
15
+ </thead>
16
+
17
+ <tbody>
18
+ <%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
19
+ <tr>
20
+ <% attributes.reject(&:password_digest?).each do |attribute| -%>
21
+ <td><%%= <%= singular_table_name %>.<%= attribute.name %> %></td>
22
+ <% end -%>
23
+ <td><%%= link_to 'Show', <%= singular_table_name %>,
24
+ class: "expanded secondary button" %></td>
25
+ <td><%%= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>),
26
+ class: "expanded primary button" %></td>
27
+ <td><%%= link_to 'Destroy', <%= singular_table_name %>,
28
+ class: "expanded alert button",
29
+ method: :delete, data: { confirm: 'Are you sure?' } %></td>
30
+ </tr>
31
+ <%% end %>
32
+ </tbody>
33
+ </table>
34
+
35
+ <div class="text-center">
36
+ <%%= paginate @<%= plural_table_name %> %>
37
+ </div>
38
+
@@ -0,0 +1,9 @@
1
+ <h1 class="text-center">New <%= singular_table_name.titleize %></h1>
2
+
3
+ <div class="text-center">
4
+ <%%= link_to 'Back', <%= index_helper %>_path %>
5
+ </div>
6
+
7
+ <%%= render 'form', <%= singular_table_name %>: @<%= singular_table_name %> %>
8
+
9
+
@@ -0,0 +1,20 @@
1
+ <h1 class="text-center">
2
+ <%= singular_table_name.titleize %> - <%%= @<%= singular_table_name %>.to_title %>
3
+ </h1>
4
+
5
+ <div class="text-center">
6
+ <%%= link_to 'Edit', edit_<%= singular_table_name %>_path(@<%= singular_table_name %>) %> |
7
+ <%%= link_to 'Back', <%= index_helper %>_path %>
8
+ </div>
9
+
10
+ <section class="small-8 small-offset-2
11
+ medium-6 medium-offset-3
12
+ large-4 large-offset-4 columns">
13
+ <% attributes.reject(&:password_digest?).each do |attribute| -%>
14
+ <p>
15
+ <strong><%= attribute.human_name %>:</strong>
16
+ <%%= @<%= singular_table_name %>.<%= attribute.name %> %>
17
+ </p>
18
+ <% end -%>
19
+ </section>
20
+
@@ -1,6 +1,8 @@
1
1
  require 'rails/generators'
2
2
  module Silmarails
3
3
  class InstallGenerator < Rails::Generators::Base
4
+ class_option :framework, desc: 'Frontend framework to use (bootstrap, foundation).'
5
+
4
6
  def self.source_root
5
7
  @source_root ||= Silmarails::Engine.root.join "lib/generators/silmarails/install/files"
6
8
  end
@@ -11,6 +13,12 @@ module Silmarails
11
13
  copy_file file, "lib/templates/#{file.gsub(templates.to_s, "")}"
12
14
  end
13
15
 
16
+ framework = options[:framework] || "bootstrap"
17
+ framework_templates = self.class.source_root.join "#{framework}/templates"
18
+ Dir[framework_templates.join "**/*.*"].each do |file|
19
+ copy_file file, "lib/templates/#{file.gsub(framework_templates.to_s, "")}"
20
+ end
21
+
14
22
  spec_support = self.class.source_root.join "spec/support"
15
23
  Dir[spec_support.join "**/*.*"].each do |file|
16
24
  copy_file file, "spec/support/#{file.gsub(spec_support.to_s, "")}"
@@ -1,3 +1,3 @@
1
1
  module Silmarails
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: silmarails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kelvinst
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-27 00:00:00.000000000 Z
11
+ date: 2016-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -70,14 +70,19 @@ files:
70
70
  - app/assets/stylesheets/scaffold.css
71
71
  - config/routes.rb
72
72
  - lib/generators/silmarails/install/USAGE
73
+ - lib/generators/silmarails/install/files/bootstrap/templates/erb/scaffold/_form.html.erb
74
+ - lib/generators/silmarails/install/files/bootstrap/templates/erb/scaffold/edit.html.erb
75
+ - lib/generators/silmarails/install/files/bootstrap/templates/erb/scaffold/index.html.erb
76
+ - lib/generators/silmarails/install/files/bootstrap/templates/erb/scaffold/new.html.erb
77
+ - lib/generators/silmarails/install/files/bootstrap/templates/erb/scaffold/show.html.erb
78
+ - lib/generators/silmarails/install/files/foundation/templates/erb/scaffold/_form.html.erb
79
+ - lib/generators/silmarails/install/files/foundation/templates/erb/scaffold/edit.html.erb
80
+ - lib/generators/silmarails/install/files/foundation/templates/erb/scaffold/index.html.erb
81
+ - lib/generators/silmarails/install/files/foundation/templates/erb/scaffold/new.html.erb
82
+ - lib/generators/silmarails/install/files/foundation/templates/erb/scaffold/show.html.erb
73
83
  - lib/generators/silmarails/install/files/spec/support/silmarails.rb
74
84
  - lib/generators/silmarails/install/files/templates/active_record/model/model.rb
75
85
  - lib/generators/silmarails/install/files/templates/coffee/assets/javascript.coffee
76
- - lib/generators/silmarails/install/files/templates/erb/scaffold/_form.html.erb
77
- - lib/generators/silmarails/install/files/templates/erb/scaffold/edit.html.erb
78
- - lib/generators/silmarails/install/files/templates/erb/scaffold/index.html.erb
79
- - lib/generators/silmarails/install/files/templates/erb/scaffold/new.html.erb
80
- - lib/generators/silmarails/install/files/templates/erb/scaffold/show.html.erb
81
86
  - lib/generators/silmarails/install/files/templates/rails/responders_controller/controller.rb
82
87
  - lib/generators/silmarails/install/files/templates/rspec/scaffold/controller_spec.rb
83
88
  - lib/generators/silmarails/install/files/templates/rspec/scaffold/edit_spec.rb