layout-generator 0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/generators/layout/USAGE +8 -0
- data/lib/generators/layout/layout_generator.rb +19 -0
- data/lib/generators/layout/templates/javascript.js +16 -0
- data/lib/generators/layout/templates/layout.html.erb +14 -0
- data/lib/generators/layout/templates/stylesheet.css +15 -0
- metadata +63 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a2f740bb05ecd6ee594c10dbb989fca65462f74f
|
4
|
+
data.tar.gz: 7f80776783357ccb9a9d2e4ba54772bc2b9d592b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 311cbc374c15f1e6adc7e370cb805aa27a86b1620a01bb1cc779caef3527fde0ac5866cec15e7da49296fdc52b26f90e04b91d628283c4a4f015e1a84b717a50
|
7
|
+
data.tar.gz: 9949b7e1d4a0742744375b0aa5ec4c600e168089c20901204704b1f474c09adb105c1d13eebb303d8775f55fdbcbf823955f5c882c17f82598aade73da352680
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'rails/generators/base'
|
2
|
+
|
3
|
+
class LayoutGenerator < Rails::Generators::Base
|
4
|
+
source_root File.expand_path('../templates', __FILE__)
|
5
|
+
argument :layout_name, :type => :string , :default => "application"
|
6
|
+
|
7
|
+
def generate_layout
|
8
|
+
copy_file "stylesheet.css" , "app/assets/stylesheets/#{file_name}.css"
|
9
|
+
copy_file "javascript.js" , "app/assets/javascripts/#{file_name}.js"
|
10
|
+
template "layout.html.erb" , "app/views/layouts/#{file_name}.html.erb"
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def file_name
|
16
|
+
layout_name.underscore
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// compiled file.
|
9
|
+
//
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
// about supported directives.
|
12
|
+
//
|
13
|
+
//= require jquery
|
14
|
+
//= require jquery_ujs
|
15
|
+
//= require turbolinks
|
16
|
+
//= require_tree .
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>CustomGenerator</title>
|
5
|
+
<%%= stylesheet_link_tag "<%= file_name %>", media: 'all', 'data-turbolinks-track' => true %>
|
6
|
+
<%%= javascript_include_tag "<%= file_name %>", 'data-turbolinks-track' => true %>
|
7
|
+
<%%= csrf_meta_tags %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<%%= yield %>
|
12
|
+
|
13
|
+
</body>
|
14
|
+
</html>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
+
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
+
* file per style scope.
|
12
|
+
*
|
13
|
+
*= require_tree .
|
14
|
+
*= require_self
|
15
|
+
*/
|
metadata
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: layout-generator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.1'
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Shantilal Matariya
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-07-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 4.2.0
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 4.2.0
|
27
|
+
description: This generator will put the layout library file in your vendor assets,
|
28
|
+
and configure the asset pipeline to load it for you
|
29
|
+
email:
|
30
|
+
- shantilal13@gmail.com
|
31
|
+
executables: []
|
32
|
+
extensions: []
|
33
|
+
extra_rdoc_files: []
|
34
|
+
files:
|
35
|
+
- lib/generators/layout/USAGE
|
36
|
+
- lib/generators/layout/layout_generator.rb
|
37
|
+
- lib/generators/layout/templates/javascript.js
|
38
|
+
- lib/generators/layout/templates/layout.html.erb
|
39
|
+
- lib/generators/layout/templates/stylesheet.css
|
40
|
+
homepage: https://github.com/shantilal-narola/layout_create.git
|
41
|
+
licenses: []
|
42
|
+
metadata: {}
|
43
|
+
post_install_message:
|
44
|
+
rdoc_options: []
|
45
|
+
require_paths:
|
46
|
+
- lib
|
47
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
48
|
+
requirements:
|
49
|
+
- - ">="
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '0'
|
52
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
57
|
+
requirements: []
|
58
|
+
rubyforge_project:
|
59
|
+
rubygems_version: 2.6.4
|
60
|
+
signing_key:
|
61
|
+
specification_version: 4
|
62
|
+
summary: A rails generator for layout.
|
63
|
+
test_files: []
|