hp_generater 0.1.0
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 +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +7 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +35 -0
- data/LICENSE.txt +21 -0
- data/README.md +31 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/hp_generater +4 -0
- data/hp_generater.gemspec +36 -0
- data/lib/hp_generater.rb +20 -0
- data/lib/hp_generater/css_template.rb +89 -0
- data/lib/hp_generater/html_template.rb +55 -0
- data/lib/hp_generater/version.rb +3 -0
- metadata +102 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 33b4ded7ba85e87f33d7944db6f52ae03d1d26bf0bdcbf8035b9dff367f3224e
|
|
4
|
+
data.tar.gz: fdc6b0af462f6a9d91e1922e932d84c4f4c7d06ab6494de36ca9071f3643b0ba
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: e8475b6bce1157ef86933967810b2ba47a4d3ce1d0659794fa1bebdb0afadc3d11a9d24f52ff484eb75b5be987986efa13f2f22454ff00957808be735bd25aac
|
|
7
|
+
data.tar.gz: 5d2479119d6dad9362ad8463aacd0da6caade9b462a0b98f32a8568e8b158200803fc53456e8c40f17c1a9432e30193b8b4726505960293e530bd770fe8ad4ec
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
hp_generater (0.1.0)
|
|
5
|
+
|
|
6
|
+
GEM
|
|
7
|
+
remote: https://rubygems.org/
|
|
8
|
+
specs:
|
|
9
|
+
diff-lcs (1.3)
|
|
10
|
+
rake (10.5.0)
|
|
11
|
+
rspec (3.8.0)
|
|
12
|
+
rspec-core (~> 3.8.0)
|
|
13
|
+
rspec-expectations (~> 3.8.0)
|
|
14
|
+
rspec-mocks (~> 3.8.0)
|
|
15
|
+
rspec-core (3.8.0)
|
|
16
|
+
rspec-support (~> 3.8.0)
|
|
17
|
+
rspec-expectations (3.8.2)
|
|
18
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
19
|
+
rspec-support (~> 3.8.0)
|
|
20
|
+
rspec-mocks (3.8.0)
|
|
21
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
22
|
+
rspec-support (~> 3.8.0)
|
|
23
|
+
rspec-support (3.8.0)
|
|
24
|
+
|
|
25
|
+
PLATFORMS
|
|
26
|
+
ruby
|
|
27
|
+
|
|
28
|
+
DEPENDENCIES
|
|
29
|
+
bundler (~> 1.16)
|
|
30
|
+
hp_generater!
|
|
31
|
+
rake (~> 10.0)
|
|
32
|
+
rspec (~> 3.0)
|
|
33
|
+
|
|
34
|
+
BUNDLED WITH
|
|
35
|
+
1.16.4
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 masatoshi_moritsuka
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# HpGenerater
|
|
2
|
+
|
|
3
|
+
This gem makes template of "html&css"
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add this line to your application's Gemfile:
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
gem 'hp_generater'
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
And then execute:
|
|
14
|
+
|
|
15
|
+
$ bundle
|
|
16
|
+
|
|
17
|
+
Or install it yourself as:
|
|
18
|
+
|
|
19
|
+
$ gem install hp_generater
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```ruby
|
|
24
|
+
$ hp_generater xxx
|
|
25
|
+
```
|
|
26
|
+
make directory "xxx" , and make file "index.html & sample.css" in this directory.
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
## License
|
|
30
|
+
|
|
31
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
|
|
3
|
+
require "bundler/setup"
|
|
4
|
+
require "hp_generater"
|
|
5
|
+
|
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
|
8
|
+
|
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
10
|
+
# require "pry"
|
|
11
|
+
# Pry.start
|
|
12
|
+
|
|
13
|
+
require "irb"
|
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/exe/hp_generater
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
+
require "hp_generater/version"
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |spec|
|
|
7
|
+
spec.name = "hp_generater"
|
|
8
|
+
spec.version = HpGenerater::VERSION
|
|
9
|
+
spec.authors = ["J2525"]
|
|
10
|
+
spec.email = ["blue.east1028@gmail.com"]
|
|
11
|
+
|
|
12
|
+
spec.summary = "genarate homepage's template(html&css)"
|
|
13
|
+
spec.homepage = "https://github.com/J2525/hp_generater"
|
|
14
|
+
|
|
15
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
|
16
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
|
17
|
+
# if spec.respond_to?(:metadata)
|
|
18
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
|
19
|
+
# else
|
|
20
|
+
# raise "RubyGems 2.0 or newer is required to protect against " \
|
|
21
|
+
# "public gem pushes."
|
|
22
|
+
# end
|
|
23
|
+
|
|
24
|
+
# Specify which files should be added to the gem when it is released.
|
|
25
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
26
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
|
27
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
28
|
+
end
|
|
29
|
+
spec.bindir = "exe"
|
|
30
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
31
|
+
spec.require_paths = ["lib"]
|
|
32
|
+
|
|
33
|
+
spec.add_development_dependency "bundler", "~> 1.16"
|
|
34
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
|
35
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
|
36
|
+
end
|
data/lib/hp_generater.rb
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require "hp_generater/version"
|
|
2
|
+
require "hp_generater/css_template"
|
|
3
|
+
require "hp_generater/html_template"
|
|
4
|
+
|
|
5
|
+
module HpGenerater
|
|
6
|
+
|
|
7
|
+
def self.mkdir(title)
|
|
8
|
+
html = HtmlTemplate.html_template
|
|
9
|
+
css = CssTemplate.css_template
|
|
10
|
+
Dir::mkdir("#{title}")
|
|
11
|
+
Dir.chdir("./#{title}")
|
|
12
|
+
File.open("index.html","w") do |file|
|
|
13
|
+
file.puts html
|
|
14
|
+
end
|
|
15
|
+
File.open("sample.css","w") do |file|
|
|
16
|
+
file.puts css
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
end
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
class CssTemplate
|
|
2
|
+
def self.css_template
|
|
3
|
+
css = <<-HERE
|
|
4
|
+
/** * Eric Meyer's Reset CSS v2.0 (http://meyerweb.com/eric/tools/css/reset/) * http://cssreset.com */
|
|
5
|
+
html, body, div, span, applet, object, iframe,h1, h2, h3, h4, h5, h6, p, blockquote, pre,a, abbr, acronym, address, big, cite, code,del, dfn, em, img, ins, kbd, q, s, samp,small, strike, strong, sub, sup, tt, var,b, u, i, center,dl, dt, dd, ol, ul, li,fieldset, form, label, legend,table, caption, tbody, tfoot, thead, tr, th, td,article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary,time, mark, audio, video {
|
|
6
|
+
margin: 0;
|
|
7
|
+
padding: 0;
|
|
8
|
+
border: 0;
|
|
9
|
+
font-size: 100%;
|
|
10
|
+
font: inherit;
|
|
11
|
+
vertical-align: baseline;
|
|
12
|
+
}
|
|
13
|
+
/* HTML5 display-role reset for older browsers */
|
|
14
|
+
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
|
|
15
|
+
display: block;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
body {
|
|
19
|
+
background-color: #D7EEFF;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.header {
|
|
23
|
+
width: 100%;
|
|
24
|
+
margin-left: auto;
|
|
25
|
+
margin-right: auto;
|
|
26
|
+
background-color: #EEE;
|
|
27
|
+
font-family: serif;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.header_title {
|
|
31
|
+
text-align: center;
|
|
32
|
+
font-size: 50px;
|
|
33
|
+
height: 105px;
|
|
34
|
+
padding-top: 49px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.global-nav_items {
|
|
38
|
+
display: flex;
|
|
39
|
+
justify-content: space-between;
|
|
40
|
+
text-align: center;
|
|
41
|
+
align-items: center;
|
|
42
|
+
width: 100%;
|
|
43
|
+
height: 50px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.global-nav li {
|
|
47
|
+
background-color: #333;
|
|
48
|
+
color: #ffffee;
|
|
49
|
+
width: 100%;
|
|
50
|
+
height: 100%;
|
|
51
|
+
list-style: none;
|
|
52
|
+
line-height: 3;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.global-nav li:nth-child(2n) {
|
|
56
|
+
background-color: #ccffff;
|
|
57
|
+
color: #000;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.article_title {
|
|
61
|
+
font-size: 50px;
|
|
62
|
+
padding-left: 25px;
|
|
63
|
+
padding-top: 25px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.article_section {
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-wrap: wrap;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.article_section-paragraph {
|
|
72
|
+
font-size: 35px;
|
|
73
|
+
width: 45%;
|
|
74
|
+
height: 180px;
|
|
75
|
+
background-color: #EEE;
|
|
76
|
+
border-radius: #24px;
|
|
77
|
+
margin: 25px;
|
|
78
|
+
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.footer {
|
|
82
|
+
border-top: 5px solid #444;
|
|
83
|
+
text-align: center;
|
|
84
|
+
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
HERE
|
|
88
|
+
end
|
|
89
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
class HtmlTemplate
|
|
2
|
+
def self.html_template
|
|
3
|
+
html = <<-HERE
|
|
4
|
+
<!DOCTYPE html>
|
|
5
|
+
<html lang="ja">
|
|
6
|
+
<head>
|
|
7
|
+
<meta charset="utf-8">
|
|
8
|
+
<title>サイトタイトル</title>
|
|
9
|
+
<meta name="description" content="サイトキャプションを入力">
|
|
10
|
+
<meta name="keywords" content="サイトキーワードを,で区切って入力">
|
|
11
|
+
<link rel="stylesheet" href="sample.css">
|
|
12
|
+
<!--[if lt IE 9]>
|
|
13
|
+
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
14
|
+
<script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>
|
|
15
|
+
<![endif]-->
|
|
16
|
+
<script src="sample.js"></script>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<!----- ヘッダー ----->
|
|
21
|
+
<header class="header">
|
|
22
|
+
<h1 class="header_title">サイトのタイトル</h1>
|
|
23
|
+
</header>
|
|
24
|
+
<nav class="global-nav">
|
|
25
|
+
<ul class="global-nav_items">
|
|
26
|
+
<li class="global-nav_item">ナビ</li>
|
|
27
|
+
<li class="global-nav_item">ナビ</li>
|
|
28
|
+
<li class="global-nav_item">ナビ</li>
|
|
29
|
+
<li class="global-nav_item">ナビ</li>
|
|
30
|
+
<li class="global-nav_item">ナビ</li>
|
|
31
|
+
<li class="global-nav_item">ナビ</li>
|
|
32
|
+
</ul>
|
|
33
|
+
</nav>
|
|
34
|
+
<!----- ヘッダー END ----->
|
|
35
|
+
|
|
36
|
+
<!----- メインコンテンツ ----->
|
|
37
|
+
<article class="article">
|
|
38
|
+
<h1 class="article_title">タイトル</h1>
|
|
39
|
+
<section class="article_section">
|
|
40
|
+
<p class="article_section-paragraph">コンテンツ1</p>
|
|
41
|
+
<p class="article_section-paragraph">コンテンツ2</p>
|
|
42
|
+
<p class="article_section-paragraph">コンテンツ3</p>
|
|
43
|
+
<p class="article_section-paragraph">コンテンツ4</p>
|
|
44
|
+
</section>
|
|
45
|
+
</article>
|
|
46
|
+
<!----- メインコンテンツ END ----->
|
|
47
|
+
|
|
48
|
+
<!----- フッター ----->
|
|
49
|
+
<footer class="footer">フッター</footer>
|
|
50
|
+
<!----- フッター END ----->
|
|
51
|
+
</body>
|
|
52
|
+
</html>
|
|
53
|
+
HERE
|
|
54
|
+
end
|
|
55
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: hp_generater
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- J2525
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2018-11-03 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.16'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.16'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '10.0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '10.0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: rspec
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '3.0'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '3.0'
|
|
55
|
+
description:
|
|
56
|
+
email:
|
|
57
|
+
- blue.east1028@gmail.com
|
|
58
|
+
executables:
|
|
59
|
+
- hp_generater
|
|
60
|
+
extensions: []
|
|
61
|
+
extra_rdoc_files: []
|
|
62
|
+
files:
|
|
63
|
+
- ".gitignore"
|
|
64
|
+
- ".rspec"
|
|
65
|
+
- ".travis.yml"
|
|
66
|
+
- Gemfile
|
|
67
|
+
- Gemfile.lock
|
|
68
|
+
- LICENSE.txt
|
|
69
|
+
- README.md
|
|
70
|
+
- Rakefile
|
|
71
|
+
- bin/console
|
|
72
|
+
- bin/setup
|
|
73
|
+
- exe/hp_generater
|
|
74
|
+
- hp_generater.gemspec
|
|
75
|
+
- lib/hp_generater.rb
|
|
76
|
+
- lib/hp_generater/css_template.rb
|
|
77
|
+
- lib/hp_generater/html_template.rb
|
|
78
|
+
- lib/hp_generater/version.rb
|
|
79
|
+
homepage: https://github.com/J2525/hp_generater
|
|
80
|
+
licenses: []
|
|
81
|
+
metadata: {}
|
|
82
|
+
post_install_message:
|
|
83
|
+
rdoc_options: []
|
|
84
|
+
require_paths:
|
|
85
|
+
- lib
|
|
86
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
87
|
+
requirements:
|
|
88
|
+
- - ">="
|
|
89
|
+
- !ruby/object:Gem::Version
|
|
90
|
+
version: '0'
|
|
91
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
|
+
requirements:
|
|
93
|
+
- - ">="
|
|
94
|
+
- !ruby/object:Gem::Version
|
|
95
|
+
version: '0'
|
|
96
|
+
requirements: []
|
|
97
|
+
rubyforge_project:
|
|
98
|
+
rubygems_version: 2.7.6
|
|
99
|
+
signing_key:
|
|
100
|
+
specification_version: 4
|
|
101
|
+
summary: genarate homepage's template(html&css)
|
|
102
|
+
test_files: []
|