guyifeng 0.0.9

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.
Files changed (36) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +22 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +29 -0
  6. data/Rakefile +2 -0
  7. data/bin/guyifeng +4 -0
  8. data/guyifeng.gemspec +26 -0
  9. data/lib/guyifeng/command.rb +25 -0
  10. data/lib/guyifeng/template/.DS_Store +0 -0
  11. data/lib/guyifeng/template/Gemfile +21 -0
  12. data/lib/guyifeng/template/README.html +417 -0
  13. data/lib/guyifeng/template/README.md +54 -0
  14. data/lib/guyifeng/template/Rakefile +6 -0
  15. data/lib/guyifeng/template/application.rb +44 -0
  16. data/lib/guyifeng/template/boot.rb +13 -0
  17. data/lib/guyifeng/template/config/.DS_Store +0 -0
  18. data/lib/guyifeng/template/config/database.yml +19 -0
  19. data/lib/guyifeng/template/config/rainbows.rb +59 -0
  20. data/lib/guyifeng/template/config.ru +3 -0
  21. data/lib/guyifeng/template/controllers/common_controller.rb +3 -0
  22. data/lib/guyifeng/template/helpers/common_helper.rb +3 -0
  23. data/lib/guyifeng/template/log/.gitkeep +0 -0
  24. data/lib/guyifeng/template/models/.DS_Store +0 -0
  25. data/lib/guyifeng/template/models/user.rb +3 -0
  26. data/lib/guyifeng/template/routes/common_routes.rb +5 -0
  27. data/lib/guyifeng/template/script/.DS_Store +0 -0
  28. data/lib/guyifeng/template/script/.gitkeep +1 -0
  29. data/lib/guyifeng/template/test/.DS_Store +0 -0
  30. data/lib/guyifeng/template/test/.gitkeep +1 -0
  31. data/lib/guyifeng/template/views/.DS_Store +0 -0
  32. data/lib/guyifeng/template/views/index.slim +1 -0
  33. data/lib/guyifeng/template/views/layout.slim +7 -0
  34. data/lib/guyifeng/version.rb +3 -0
  35. data/lib/guyifeng.rb +5 -0
  36. metadata +107 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c27fd82679b53546964dd7fbadf2da4c236d5950
4
+ data.tar.gz: 00c9a8ecf2ce2de7b85a9c37550d6ac7784855ea
5
+ SHA512:
6
+ metadata.gz: e8039d902559fd2a3a7f2f3ee446f21d7ed2e2367e6988412b0ce52b2c3b1aa60a0cfd48abf459af8b4592dbcb0fce23f4ebe0d71bdafbd2e6eac3fedbea8ec3
7
+ data.tar.gz: 677b33de878ffaca6bbc2344d23d2dbba2e59922195991d80bdc3eb1b9b3d10b4c7afc9bec9cbdc0d762352ddce6ef1bec3cf3c8845ca423fadc9a7af980b54c
data/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in guyifeng.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 menghuanwd
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Guyifeng
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'guyifeng'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install guyifeng
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it ( https://github.com/[my-github-username]/guyifeng/fork )
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/bin/guyifeng ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.dirname(__FILE__) + "/../lib/guyifeng"
4
+ Guyifeng::Command.start
data/guyifeng.gemspec ADDED
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'guyifeng/version'
5
+ # require 'guyifeng/model'
6
+ # require 'guyifeng/version'
7
+
8
+ Gem::Specification.new do |spec|
9
+ spec.name = "guyifeng"
10
+ spec.version = Guyifeng::VERSION
11
+ spec.authors = ["menghuanwd"]
12
+ spec.email = ["651019063@qq.com"]
13
+ spec.summary = "aaaa"
14
+ spec.description = "base sinatra"
15
+ spec.homepage = "http://www.menghuanwd.cn"
16
+ spec.license = "MIT"
17
+
18
+ spec.files = `git ls-files -z`.split("\x0")
19
+ # spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
20
+ spec.executables = 'guyifeng'
21
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
22
+ spec.require_paths = ["lib"]
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.6"
25
+ spec.add_development_dependency "rake","~> 10.3"
26
+ end
@@ -0,0 +1,25 @@
1
+ require "thor"
2
+ require "securerandom"
3
+
4
+ module Guyifeng
5
+ class Command < Thor
6
+ include Thor::Actions
7
+ map "-v" => :version
8
+
9
+ def self.source_root
10
+ File.dirname(__FILE__)
11
+ end
12
+
13
+ desc "version", "show version"
14
+ def version
15
+ puts Guyifeng::VERSION
16
+ end
17
+
18
+ desc "new", "create the skeleton of project"
19
+ def new(name)
20
+ @secret = SecureRandom.hex 32
21
+ @class_name = name
22
+ directory("template", name)
23
+ end
24
+ end
25
+ end
Binary file
@@ -0,0 +1,21 @@
1
+ source 'http://ruby.taobao.org'
2
+
3
+ gem 'sinatra'
4
+
5
+ gem 'sinatra-contrib'
6
+
7
+ gem 'sinatra-synchrony'
8
+
9
+ gem 'sinatra-activerecord'
10
+
11
+ gem 'mysql2'
12
+
13
+ gem 'compass'
14
+
15
+ gem 'sass'
16
+
17
+ gem 'slim'
18
+
19
+ group :production do
20
+ gem "puma"
21
+ end
@@ -0,0 +1,417 @@
1
+ <!DOCTYPE html><html><head><meta charset="utf-8"><style>/* Fonts */
2
+ @font-face{
3
+ font-family: octicons-anchor;
4
+ src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAYcAA0AAAAACjQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABMAAAABwAAAAca8vGTk9TLzIAAAFMAAAARAAAAFZG1VHVY21hcAA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NRC/pmjrk/zprC+8D7tBy9DHgBXoWfQ44Av8t4Bj4Z8CLtBL9CniJluPXASf0Lm4CXqFX8Q84dOLnMB17N4c7tBo1AS/Qi+hTwBH4rwHHwN8DXqQ30XXAS7QaLwSc0Gn8NuAVWou/gFmnjLrEaEh9GmDdDGgL3B4JsrRPDU2hTOiMSuJUIdKQQayiAth69r6akSSFqIJuA19TrzCIaY8sIoxyrNIrL//pw7A2iMygkX5vDj+G+kuoLdX4GlGK/8Lnlz6/h9MpmoO9rafrz7ILXEHHaAx95s9lsI7AHNMBWEZHULnfAXwG9/ZqdzLI08iuwRloXE8kfhXYAvE23+23DU3t626rbs8/8adv+9DWknsHp3E17oCf+Z48rvEQNZ78paYM38qfk3v/u3l3u3GXN2Dmvmvpf1Srwk3pB/VSsp512bA/GG5i2WJ7wu430yQ5K3nFGiOqgtmSB5pJVSizwaacmUZzZhXLlZTq8qGGFY2YcSkqbth6aW1tRmlaCFs2016m5qn36SbJrqosG4uMV4aP2PHBmB3tjtmgN2izkGQyLWprekbIntJFing32a5rKWCN/SdSoga45EJykyQ7asZvHQ8PTm6cslIpwyeyjbVltNikc2HTR7YKh9LBl9DADC0U/jLcBZDKrMhUBfQBvXRzLtFtjU9eNHKin0x5InTqb8lNpfKv1s1xHzTXRqgKzek/mb7nB8RZTCDhGEX3kK/8Q75AmUM/eLkfA+0Hi908Kx4eNsMgudg5GLdRD7a84npi+YxNr5i5KIbW5izXas7cHXIMAau1OueZhfj+cOcP3P8MNIWLyYOBuxL6DRylJ4cAAAB4nGNgYoAALjDJyIAOWMCiTIxMLDmZedkABtIBygAAAA==) format('woff');
5
+ }
6
+
7
+ @font-face{
8
+ font-family: fontawesome-mini;
9
+ src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAzUABAAAAAAFNgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABbAAAABwAAAAcZMzaOEdERUYAAAGIAAAAHQAAACAAOQAET1MvMgAAAagAAAA+AAAAYH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xFIWPd/JkUYQChEhIyAVKgdBMskm1QkKrRETpQiLRUczueB/K7HhlOxttg8LvoKPgP9DxFxANDR0tHRWi4NjrPIBEgh1p/dm+vufcawNYFWsQmP6e4jSyQB2fI9cwj++RE9wTjyPP4LYoI89iWbyLPIe6+Bh5Hs9rryMv4GbtW+RF3EhuRa7jbrIbeQkPkjdUETOLnL0Kip4FVvAhco1RXyMnSPEz8gzWxE7kWTwUp5HnsCLeR57HW/El8gJWa58iL+JO7UfkOh4l9yMv4UnyEtvQGGECgwF66MNBooF1bGCL1ELB/TYU+ZBRlvsKQ44Se6jQ4a7hef+fh72Crv25kp+8lNWGmeKoOI5jJLb1aGIGvb6TjfWNLdkqdFvJw4l1amjlXtXRZqRN7lSRylZZyhBqpVFWmTEXgWfUrpi/hZOQXdOd4rKuXOtEWT3k5IArPRzTUU5tHKjecZkTpnVbNOnt6jzN8240GD4xtikvZW56043rPMg/dS+dlOceXoR+WPbJ55Dsekq1lJpnypsMUsYOdCW30o103Ytu/lvh+5RWFLfBjm9/N8hJntPhvx92rnoE/kyHdGasGy754kw36vsVf/lFeBi+0COu+cfgQr42G3CRpeLoZ53gmfe3X6rcKt5oVxnptHR9JS8ehVUd5wvvahN2uqxOOpMXapibI5k7Zwbt4xBSaTfoKBufhAnO/uqNcfK8OTs0OQ6l7JIqFjDhYj5WcjevCnI/1DDiI8j4ndWb/5YzDZWh79yomWXeXj7Nnw70/2TIeFPTrlSh89k1ObOSRVZWZfgF0r/zJQB4nG2JUQuCQBCEd07TTg36fb2IyBaLd3vWaUh/vmSJnvpgmG8YcmS8X3Shf3R7QA4OBUocUKHGER5NNbOOEvwc1txnuWkTRb/aPjimJ5vXabI+3VfOiyS15UWvyezM2xiGOPyuMohOH8O8JiO4Af+FsAGNAEuwCFBYsQEBjlmxRgYrWCGwEFlLsBRSWCGwgFkdsAYrXFhZsBQrAAA=) format('woff');
10
+ }
11
+
12
+ /* Body */
13
+ html { font-size: 100%; overflow-y: scroll; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
14
+
15
+ body{
16
+ color:#4d4d4c;
17
+ font-family:Georgia, Palatino, 'Palatino Linotype', Times, 'Times New Roman',
18
+ "Hiragino Sans GB", "STXihei", "微软雅黑", serif;
19
+ font-size:12px;
20
+ line-height:1.5em;
21
+ background:#fefefe;
22
+ width: 45em;
23
+ margin: 10px auto;
24
+ padding: 30px;
25
+ border: 1px solid #ddd;
26
+ outline: 1300px solid #f8f8f8;
27
+ }
28
+
29
+ /* Links */
30
+ a{ color: #06d; text-decoration:none; }
31
+ a:hover{ color: #06e; text-decoration: underline; }
32
+ a:active{ color:#faa700; }
33
+ a:focus{ outline: thin dotted; }
34
+ a:hover, a:active{ outline: 0; }
35
+
36
+ ::-moz-selection { background:#a8d1ff; color:#000 }
37
+ ::selection { background:#a8d1ff; color:#000 }
38
+
39
+ a::-moz-selection { background:#a8d1ff; color:#0645ad }
40
+ a::selection { background:#a8d1ff; color:#0645ad }
41
+
42
+ /* Header Anchor Links*/
43
+ .headeranchor-link {
44
+ color:#111;
45
+ border: 0;
46
+ margin-left: -20px;
47
+ padding-right: 6px;
48
+ cursor: pointer;
49
+ position: absolute;
50
+ display: block;
51
+ top: 0;
52
+ left: 0;
53
+ bottom: 0;
54
+ }
55
+
56
+ .headeranchor {
57
+ font: normal normal 16px octicons-anchor;
58
+ line-height: 1;
59
+ -moz-osx-font-smoothing: grayscale;
60
+ -webkit-user-select: none;
61
+ -moz-user-select: none;
62
+ -ms-user-select: none;
63
+ user-select: none;
64
+ }
65
+
66
+ .headeranchor-link:hover,
67
+ .headeranchor-link:visited,
68
+ .headeranchor-link:active
69
+ { text-decoration: none; color:#4d4d4c; }
70
+ .headeranchor-link:hover .headeranchor:before,
71
+ h1:hover .headeranchor:before,
72
+ h2:hover .headeranchor:before,
73
+ h3:hover .headeranchor:before,
74
+ h4:hover .headeranchor:before,
75
+ h5:hover .headeranchor:before,
76
+ h6:hover .headeranchor:before
77
+ { content: '\f05c'; }
78
+
79
+ abbr { cursor: pointer; }
80
+
81
+ /* Paragraphs */
82
+ p { margin:1em 0; }
83
+
84
+ /* Images */
85
+ img {
86
+ max-width:100%;
87
+ border: 0;
88
+ -ms-interpolation-mode: bicubic;
89
+ vertical-align: middle;
90
+ }
91
+
92
+ /* Headers */
93
+ h1,h2,h3,h4,h5,h6 {
94
+ font-weight:normal;
95
+ color:#111;
96
+ line-height: 1.7;
97
+ position: relative;
98
+ }
99
+ h4,h5,h6{ font-weight: bold; }
100
+ h1 { font-size:2.5em; border-bottom: 1px solid #ddd;}
101
+ h2 { font-size:2em; border-bottom:1px solid #eee; padding-bottom: 5px; }
102
+ h3 { font-size:1.5em; }
103
+ h4 { font-size:1.2em; }
104
+ h5 { font-size:1em; }
105
+ h6 { font-size:0.9em; }
106
+
107
+ /* Block Quotes */
108
+ blockquote {
109
+ color:#666666;
110
+ margin:0;
111
+ padding-left: 3em;
112
+ border-left: 0.5em #EEE solid;
113
+ }
114
+ hr { display: block; height: 2px; border: 0; border-top: 1px solid #aaa;border-bottom: 1px solid #eee; margin: 1em 0; padding: 0; }
115
+
116
+ /* Raw Blocks */
117
+ pre, code, kbd, samp {
118
+ color: #000;
119
+ font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
120
+ -webkit-border-radius: 3px;
121
+ -moz-border-radius: 3px;
122
+ border-radius: 3px;
123
+ font-size: 0.88em;
124
+ background-color: #F8F8F8;
125
+ border: 1px solid #CCC;
126
+ }
127
+
128
+ pre {
129
+ padding: 10px;
130
+ overflow: auto;
131
+ }
132
+
133
+ code { padding: 0 3px 0 3px; }
134
+ pre code { border: 0; padding: 0; }
135
+
136
+ /* Admonition */
137
+ .admonition {
138
+ -webkit-border-radius: 3px;
139
+ -moz-border-radius: 3px;
140
+ border-radius: 3px;
141
+ font-size: 0.88em;
142
+ padding: 0.5em 1em 0.5em 1em;
143
+ margin: 10px auto;
144
+ color: #888888;
145
+ background-color: #F8F8F8;
146
+ border: 1px solid #888888;
147
+ }
148
+
149
+ .admonition p { padding: 0; margin: 0; }
150
+ .admonition-title { font-weight: bold; margin: 0; }
151
+
152
+ .admonition-icon {
153
+ font: normal normal 16px fontawesome-mini;
154
+ line-height: 1.5;
155
+ -moz-osx-font-smoothing: grayscale;
156
+ -webkit-user-select: none;
157
+ -moz-user-select: none;
158
+ -ms-user-select: none;
159
+ user-select: none;
160
+ float: left;
161
+ }
162
+
163
+ .admonition.attention { color: #4F8A10; background-color: #DFF2BF; border: 1px solid #4F8A10; }
164
+ .admonition.caution { color: #D63301; background-color: #FFCCBA; border: 1px solid #D63301; }
165
+ .admonition.hint { color: #00529B; background-color: #BDE5F8; border: 1px solid #00529B; }
166
+ .admonition.danger { color: #D8000C; background-color: #FFBABA; border: 1px solid #D8000C; }
167
+ .admonition.question { color: #00049b; background-color: #BDC8F8; border: 1px solid #00049b; }
168
+ .admonition.note { color: #9F6000; background-color: #FEEFB3; border: 1px solid #9F6000; }
169
+
170
+ .attention > .admonition-icon:before { content: "\f058\00a0"; }
171
+ .caution > .admonition-icon:before { content: "\f06a\00a0"; }
172
+ .hint > .admonition-icon:before { content: "\f05a\00a0"; }
173
+ .danger > .admonition-icon:before { content: "\f056\00a0"; }
174
+ .question > .admonition-icon:before { content: "\f059\00a0"; }
175
+ .note > .admonition-icon:before { content: "\f040\00a0"; }
176
+
177
+ /* progress bar*/
178
+ .progress {
179
+ display: block;
180
+ width: 300px;
181
+ margin: 10px 0;
182
+ height: 24px;
183
+ border: 1px solid #ccc;
184
+ -webkit-border-radius: 3px;
185
+ -moz-border-radius: 3px;
186
+ border-radius: 3px;
187
+ background-color: #F8F8F8;
188
+ position: relative;
189
+ box-shadow: inset -1px 1px 3px rgba(0, 0, 0, .1);
190
+ }
191
+
192
+ .progress-label {
193
+ position: absolute;
194
+ text-align: center;
195
+ font-weight: bold;
196
+ width: 100%; margin: 0;
197
+ line-height: 24px;
198
+ color: #333;
199
+ text-shadow:
200
+ 1px 1px 0px #fefefe,
201
+ -1px -1px 0px #fefefe,
202
+ -1px 1px 0px #fefefe,
203
+ 1px -1px 0px #fefefe,
204
+ 0px 1px 0px #fefefe,
205
+ 0px -1px 0px #fefefe,
206
+ 1px 0px 0px #fefefe,
207
+ -1px 0px 0px #fefefe,
208
+ 1px 1px 2px #000;
209
+ -webkit-font-smoothing: antialiased !important;
210
+ white-space: nowrap;
211
+ overflow: hidden;
212
+ }
213
+
214
+ .progress-bar {
215
+ height: 24px;
216
+ float: left;
217
+ border-right: 1px solid #ccc;
218
+ -webkit-border-radius: 3px;
219
+ -moz-border-radius: 3px;
220
+ border-radius: 3px;
221
+ background-color: #34c2e3;
222
+ box-shadow: inset 0 1px 0px rgba(255, 255, 255, .5);
223
+ background-size: 30px 30px;
224
+ background-image: -webkit-linear-gradient(
225
+ 135deg,
226
+ rgba(255, 255, 255, .4) 27%, transparent 27%,
227
+ transparent 53%, rgba(255, 255, 255, .4) 53%,
228
+ rgba(255, 255, 255, .4) 77%, transparent 77%,
229
+ transparent
230
+ );
231
+ background-image: -moz-linear-gradient(
232
+ 135deg,
233
+ rgba(255, 255, 255, .4) 27%, transparent 27%,
234
+ transparent 53%, rgba(255, 255, 255, .4) 53%,
235
+ rgba(255, 255, 255, .4) 77%, transparent 77%,
236
+ transparent
237
+ );
238
+ background-image: -ms-linear-gradient(
239
+ 135deg,
240
+ rgba(255, 255, 255, .4) 27%, transparent 27%,
241
+ transparent 53%, rgba(255, 255, 255, .4) 53%,
242
+ rgba(255, 255, 255, .4) 77%, transparent 77%,
243
+ transparent
244
+ );
245
+ background-image: -o-linear-gradient(
246
+ 135deg,
247
+ rgba(255, 255, 255, .4) 27%, transparent 27%,
248
+ transparent 53%, rgba(255, 255, 255, .4) 53%,
249
+ rgba(255, 255, 255, .4) 77%, transparent 77%,
250
+ transparent
251
+ );
252
+ background-image: linear-gradient(
253
+ 135deg,
254
+ rgba(255, 255, 255, .4) 27%, transparent 27%,
255
+ transparent 53%, rgba(255, 255, 255, .4) 53%,
256
+ rgba(255, 255, 255, .4) 77%, transparent 77%,
257
+ transparent
258
+ );
259
+ }
260
+
261
+ .progress-100plus .progress-bar { background-color: #1ee038; }
262
+ .progress-80plus .progress-bar { background-color: #86e01e; }
263
+ .progress-60plus .progress-bar { background-color: #f2d31b; }
264
+ .progress-40plus .progress-bar { background-color: #f2b01e; }
265
+ .progress-20plus .progress-bar { background-color: #f27011; }
266
+ .progress-0plus .progress-bar { background-color: #f63a0f; }
267
+
268
+ .gloss .progress-bar {
269
+ box-shadow:
270
+ inset -1px 1px 0px rgba(255, 255, 255, .5),
271
+ inset 0 -4px 12px rgba(255, 255, 255, .7),
272
+ inset 0 4px 12px rgba(255, 255, 255, .7),
273
+ inset 0 -12px 0px rgba(0, 0, 0, .05),
274
+ inset 1px -1px 0px rgba(255, 255, 255, .2);
275
+ }
276
+
277
+ .candystripe-animate .progress-bar{
278
+ -webkit-animation: animate-stripes 3s linear infinite;
279
+ -moz-animation: animate-stripes 3s linear infinite;
280
+ animation: animate-stripes 3s linear infinite;
281
+ }
282
+
283
+ @-webkit-keyframes animate-stripes { 0% { background-position: 0 0; } 100% { background-position: 60px 0; } }
284
+ @-moz-keyframes animate-stripes { 0% { background-position: 0 0; } 100% { background-position: 60px 0; } }
285
+ @keyframes animate-stripes { 0% { background-position: 0 0; } 100% { background-position: 60px 0; } }
286
+
287
+ /* Inlines */
288
+ b, strong { font-weight: bold; }
289
+
290
+ mark { background: #ff0; color: #000; font-style: italic; font-weight: bold; }
291
+
292
+ sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }
293
+ sup { top: -0.5em; }
294
+ sub { bottom: -0.25em; }
295
+
296
+ dfn { font-style: italic; }
297
+
298
+ /* Lists */
299
+ ul, ol { padding-left: 30px; }
300
+ li p:last-child { margin:0 }
301
+ .task-list-item { list-style-type: none; }
302
+ .task-list-item input { float:left; margin-left: -20px; margin-top: 6px; }
303
+ dt { font-weight: bold; font-style: italic;}
304
+ dd { margin: 0 0 0 2em; }
305
+
306
+ /* Tables */
307
+ table { width: 100%; border-collapse: collapse; overflow-x: auto; overflow-y: hidden; display: block;}
308
+ table tr { background-color: #fefefe; }
309
+ table tr:nth-child(2n) { background-color: #f8f8f8; }
310
+ td, th { border: 1px solid #ddd; padding: 6px 13px; }
311
+
312
+ /* Codehilite Tables */
313
+ .codehilitetable { border: 0; border-spacing: 0; }
314
+ .linenos, .code, .codehilitetable td { border: 0; padding: 0; }
315
+ td:not(.linenos) .linenodiv { padding: 0 !important; }
316
+ .code { width: 100%; }
317
+ .linenos div pre, .linenodiv pre {
318
+ border: 0;
319
+ border-top: 1px solid #CCC;
320
+ border-left: 1px solid #CCC;
321
+ border-right: 1px solid #CCC;
322
+ border-bottom: 1px solid #CCC;
323
+ -webkit-border-radius: 0;
324
+ -moz-border-radius: 0;
325
+ border-radius: 0;
326
+ -webkit-border-top-left-radius: 3px;
327
+ -webkit-border-bottom-left-radius: 3px;
328
+ -moz-border-radius-topleft: 3px;
329
+ -moz-border-radius-bottomleft: 3px;
330
+ border-top-left-radius: 3px;
331
+ border-bottom-left-radius: 3px;
332
+ }
333
+
334
+ .code div pre {
335
+ border: 0;
336
+ border-top: 1px solid #CCC;
337
+ border-right: 1px solid #CCC;
338
+ border-bottom: 1px solid #CCC;
339
+ -webkit-border-radius: 0;
340
+ -moz-border-radius: 0;
341
+ border-radius: 0;
342
+ -webkit-border-top-right-radius: 3px;
343
+ -webkit-border-bottom-right-radius: 3px;
344
+ -moz-border-radius-topright: 3px;
345
+ -moz-border-radius-bottomright: 3px;
346
+ border-top-right-radius: 3px;
347
+ border-bottom-right-radius: 3px;
348
+ }
349
+
350
+ /* Media */
351
+ @media only screen and (min-width: 480px) {
352
+ body{ font-size:14px; }
353
+ }
354
+
355
+ @media only screen and (min-width: 768px) {
356
+ body{ font-size:16px; }
357
+ }
358
+
359
+ @media print {
360
+ * { background: transparent !important; color: black !important; filter:none !important; -ms-filter: none !important; }
361
+ body{ font-size:12pt; max-width:100%; outline:none; border: 0;}
362
+ a, a:visited { text-decoration: underline; }
363
+ .headeranchor-link { display: none; }
364
+ hr { height: 1px; border:0; border-bottom:1px solid black; }
365
+ a[href]:after { content: " (" attr(href) ")"; }
366
+ abbr[title]:after { content: " (" attr(title) ")"; }
367
+ .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; }
368
+ pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; }
369
+ pre, blockquote { border: 1px solid #999; padding-right: 1em; page-break-inside: avoid; }
370
+ .progress, .progress-bar { box-shadow: none; }
371
+ tr, img { page-break-inside: avoid; }
372
+ img { max-width: 100% !important; }
373
+ p, h2, h3 { orphans: 3; widows: 3; }
374
+ h2, h3 { page-break-after: avoid; }
375
+ }
376
+ </style><title>README</title></head><body><h1 id="guyifeng"><a name="user-content-guyifeng" href="#guyifeng" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>Guyifeng</h1>
377
+ <p>Simba is a generator for Sinatra applications.</p>
378
+ <p>Simba chooses slim + sinatra-synchrony + activerecord to build your awesome apps.</p>
379
+ <p>Simba&rsquo;s aim is to help you to use best practices when not using ruby on rails.</p>
380
+ <h2 id="installation"><a name="user-content-installation" href="#installation" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>Installation</h2>
381
+ <pre><code>$ gem install guyifeng
382
+ </code></pre>
383
+ <h2 id="usage"><a name="user-content-usage" href="#usage" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>Usage</h2>
384
+ <pre><code>$ guyifeng new appname
385
+
386
+ $ # development
387
+ $ bundle exec rackup
388
+
389
+ $ # production
390
+ $ rake asset:precompile
391
+ $ bundle exec rackup -E production
392
+ </code></pre>
393
+ <h2 id="extra"><a name="user-content-extra" href="#extra" class="headeranchor-link" aria-hidden="true"><span class="headeranchor"></span></a>Extra</h2>
394
+ <pre><code>gem &lsquo;sinatra-flash&rsquo;
395
+ require &lsquo;sinatra/flash&rsquo;
396
+ register Sinatra::Flash
397
+
398
+ gem &lsquo;sinatra-synchrony&rsquo;
399
+ require &lsquo;sinatra/synchrony&rsquo;
400
+ register Sinatra::Synchrony
401
+
402
+ gem &lsquo;will_paginate&rsquo;
403
+ require &lsquo;will_paginate&rsquo;
404
+ require &lsquo;will_paginate/active_record&rsquo;
405
+ register WillPaginate::Sinatra
406
+
407
+ require &ldquo;sinatra/cookies&rdquo;
408
+ helpers Sinatra::Cookies
409
+
410
+ require &ldquo;sinatra/config_file&rdquo;
411
+ register Sinatra::ConfigFile
412
+
413
+ require &ldquo;sinatra/multi_route&rdquo;
414
+ register Sinatra::MultiRoute
415
+
416
+ require &ldquo;sinatra/reloader&rdquo;
417
+ register Sinatra::Reloader</code></pre></body></html>
@@ -0,0 +1,54 @@
1
+ # Guyifeng
2
+
3
+ Simba is a generator for Sinatra applications.
4
+
5
+ Simba chooses slim + sinatra-synchrony + activerecord to build your awesome apps.
6
+
7
+ Simba's aim is to help you to use best practices when not using ruby on rails.
8
+
9
+ ## Installation
10
+
11
+ $ gem install guyifeng
12
+
13
+ ## Usage
14
+
15
+ $ guyifeng new appname
16
+
17
+ $ # development
18
+ $ bundle exec rackup
19
+
20
+ $ # production
21
+ $ rake asset:precompile
22
+ $ bundle exec rackup -E production
23
+
24
+
25
+ ## Extra
26
+ gem 'sinatra-flash'
27
+ require 'sinatra/flash'
28
+ register Sinatra::Flash
29
+
30
+ gem 'sinatra-synchrony'
31
+ require 'sinatra/synchrony'
32
+ register Sinatra::Synchrony
33
+
34
+ gem 'will_paginate'
35
+ require 'will_paginate'
36
+ require 'will_paginate/active_record'
37
+ register WillPaginate::Sinatra
38
+
39
+ require "sinatra/cookies"
40
+ helpers Sinatra::Cookies
41
+
42
+ require "sinatra/config_file"
43
+ register Sinatra::ConfigFile
44
+ config_file 'config/application.yml'
45
+
46
+ require "sinatra/multi_route"
47
+ register Sinatra::MultiRoute
48
+
49
+ require "sinatra/reloader"
50
+ register Sinatra::Reloader
51
+ also_reload require file
52
+
53
+
54
+
@@ -0,0 +1,6 @@
1
+ # load rake tasks
2
+ require "sinatra/activerecord/rake"
3
+ # require "rake"
4
+ # Dir["./lib/tasks/**/*.rake"].sort.each { |ext| load ext }
5
+
6
+ require "./boot.rb"
@@ -0,0 +1,44 @@
1
+ require 'sinatra/base'
2
+ require 'sinatra/synchrony'
3
+ require "sinatra/activerecord"
4
+
5
+ require 'slim'
6
+
7
+
8
+ class Crawler < Sinatra::Base
9
+ register Sinatra::Synchrony
10
+
11
+ # register Sinatra::ActiveRecordExtension
12
+
13
+ # enable :sessions # for use flash
14
+
15
+
16
+
17
+ # ActiveRecord::Base.default_timezone = :local
18
+ # ActiveRecord::Base.establish_connection(settings.development)
19
+
20
+ set :public_folder, File.dirname(__FILE__) + '/assets'
21
+ set :views, File.dirname(__FILE__) + '/views'
22
+ set :show_exceptions, true
23
+
24
+ # 加载models
25
+ Dir[ File.expand_path('../models/*.rb', __FILE__) ].each{|file| require file }
26
+
27
+ # 加载帮助文档
28
+ Dir[ File.expand_path('../helpers/*.rb', __FILE__) ].each{|file| require file }
29
+ # Dir[ File.expand_path('../helpers/*.rb', __FILE__) ].each{|file| also_reload file }
30
+
31
+ # 加载控制器
32
+ Dir[ File.expand_path('../controllers/*.rb', __FILE__) ].each{|file| require file }
33
+ # Dir[ File.expand_path('../controllers/*.rb', __FILE__) ].each{|file| also_reload file }
34
+
35
+ # 加载路由
36
+ Dir[ File.expand_path('../routes/*.rb', __FILE__) ].each{|file| require file }
37
+ # Dir[ File.expand_path('../routes/*.rb', __FILE__) ].each{|file| also_reload file }
38
+
39
+
40
+ # after do
41
+ # ActiveRecord::Base.clear_active_connections!
42
+ # end
43
+
44
+ end
@@ -0,0 +1,13 @@
1
+ # ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __FILE__)
2
+
3
+ # require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
4
+ # # Bundler.require(:default, ENV['RACK_ENV'])
5
+
6
+ # Dir.mkdir('log') unless File.exist?('log')
7
+
8
+ # if ENV['RACK_ENV'] == "production"
9
+ # $stderr.reopen(File.new(File.expand_path("../log/#{ENV['RACK_ENV']}.log", __FILE__), "a+"))
10
+ # $stderr.sync = true
11
+ # end
12
+
13
+ require File.expand_path('../application', __FILE__)
@@ -0,0 +1,19 @@
1
+ development:
2
+ adapter: em_mysql2
3
+ encoding: utf8
4
+ reconnect: false
5
+ host: localhost
6
+ database: guyifeng
7
+ pool: 5
8
+ username: diningcity
9
+ password: dave
10
+
11
+ # development:
12
+ # adapter: em_mysql2
13
+ # encoding: utf8
14
+ # reconnect: false
15
+ # host: localhost
16
+ # database: guyifeng
17
+ # pool: 5
18
+ # username: diningcity
19
+ # password: dave
@@ -0,0 +1,59 @@
1
+ Rainbows! do
2
+ name = 'yourappname'
3
+ use :EventMachine
4
+ client_max_body_size nil # This is set in nginx
5
+ # keepalive_timeout 1
6
+
7
+ case ENV['RACK_ENV'].to_sym
8
+ when :development
9
+ worker_processes 1
10
+ worker_connections 32
11
+ # This has weird issues with kqueue on OSX for me, so I use thin for development.
12
+ listen 3333
13
+ when :production
14
+ # Number of workers. I recommend one per CPU core to get full utilization.
15
+ worker_processes 4
16
+
17
+ # The number of simultaneous connections the server will accept.
18
+ worker_connections 1024
19
+
20
+ timeout 30
21
+
22
+ # I've been told the backlog here might be a problem if you're using a load balancer.
23
+ listen "unix:/var/run/yourcompany/#{name}.sock", :backlog => 4096
24
+
25
+ pid "/var/run/yourcompany/#{name}.pid"
26
+ stderr_path "/var/log/yourcompany/#{name}.log"
27
+ stdout_path "/var/log/yourcompany/#{name}.log"
28
+
29
+ ###
30
+ # Hardcore performance tweaks, described here: https://github.com/blog/517-unicorn
31
+ ###
32
+
33
+ # This loads the app in master, and then forks workers. Kill with USR2 and it will do a graceful restart using the block proceeding.
34
+ preload_app true
35
+
36
+ before_fork do |server, worker|
37
+ ##
38
+ # When sent a USR2, Unicorn will suffix its pidfile with .oldbin and
39
+ # immediately start loading up a new version of itself (loaded with a new
40
+ # version of our app). When this new Unicorn is completely loaded
41
+ # it will begin spawning workers. The first worker spawned will check to
42
+ # see if an .oldbin pidfile exists. If so, this means we've just booted up
43
+ # a new Unicorn and need to tell the old one that it can now die. To do so
44
+ # we send it a QUIT.
45
+ #
46
+ # Using this method we get 0 downtime deploys.
47
+
48
+ old_pid = "/var/run/yourcompany/#{name}.pid.oldbin"
49
+ if File.exists?(old_pid) && server.pid != old_pid
50
+ begin
51
+ Process.kill("QUIT", File.read(old_pid).to_i)
52
+ rescue Errno::ENOENT, Errno::ESRCH
53
+ # someone else did our job for us
54
+ end
55
+ end
56
+ end
57
+
58
+ end
59
+ end
@@ -0,0 +1,3 @@
1
+ require ::File.expand_path('../boot', __FILE__)
2
+ ActiveRecord::ConnectionAdapters::ConnectionManagement
3
+ run Crawler.new
@@ -0,0 +1,3 @@
1
+ def index
2
+ slim :'index'
3
+ end
@@ -0,0 +1,3 @@
1
+ def dirname(str)
2
+ "restaurant_"+str.split(" ").join('_').gsub("(","_").gsub(")","_").gsub("'","_").gsub("\"","_").downcase
3
+ end
File without changes
@@ -0,0 +1,3 @@
1
+ class User < ActiveRecord::Base
2
+
3
+ end
@@ -0,0 +1,5 @@
1
+ class Crawler
2
+ get '/' do
3
+ index
4
+ end
5
+ end
@@ -0,0 +1 @@
1
+ .gitkeep
@@ -0,0 +1 @@
1
+ .gitkeep
@@ -0,0 +1 @@
1
+ |Hello World
@@ -0,0 +1,7 @@
1
+ doctype html
2
+ html
3
+ head
4
+ title Crawler
5
+
6
+ body
7
+ == yield
@@ -0,0 +1,3 @@
1
+ module Guyifeng
2
+ VERSION = "0.0.9"
3
+ end
data/lib/guyifeng.rb ADDED
@@ -0,0 +1,5 @@
1
+ require "guyifeng/version"
2
+ require "guyifeng/command"
3
+
4
+ module Guyifeng
5
+ end
metadata ADDED
@@ -0,0 +1,107 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: guyifeng
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.9
5
+ platform: ruby
6
+ authors:
7
+ - menghuanwd
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-08-11 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.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
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.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.3'
41
+ description: base sinatra
42
+ email:
43
+ - 651019063@qq.com
44
+ executables:
45
+ - guyifeng
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - ".gitignore"
50
+ - Gemfile
51
+ - LICENSE.txt
52
+ - README.md
53
+ - Rakefile
54
+ - bin/guyifeng
55
+ - guyifeng.gemspec
56
+ - lib/guyifeng.rb
57
+ - lib/guyifeng/command.rb
58
+ - lib/guyifeng/template/.DS_Store
59
+ - lib/guyifeng/template/Gemfile
60
+ - lib/guyifeng/template/README.html
61
+ - lib/guyifeng/template/README.md
62
+ - lib/guyifeng/template/Rakefile
63
+ - lib/guyifeng/template/application.rb
64
+ - lib/guyifeng/template/boot.rb
65
+ - lib/guyifeng/template/config.ru
66
+ - lib/guyifeng/template/config/.DS_Store
67
+ - lib/guyifeng/template/config/database.yml
68
+ - lib/guyifeng/template/config/rainbows.rb
69
+ - lib/guyifeng/template/controllers/common_controller.rb
70
+ - lib/guyifeng/template/helpers/common_helper.rb
71
+ - lib/guyifeng/template/log/.gitkeep
72
+ - lib/guyifeng/template/models/.DS_Store
73
+ - lib/guyifeng/template/models/user.rb
74
+ - lib/guyifeng/template/routes/common_routes.rb
75
+ - lib/guyifeng/template/script/.DS_Store
76
+ - lib/guyifeng/template/script/.gitkeep
77
+ - lib/guyifeng/template/test/.DS_Store
78
+ - lib/guyifeng/template/test/.gitkeep
79
+ - lib/guyifeng/template/views/.DS_Store
80
+ - lib/guyifeng/template/views/index.slim
81
+ - lib/guyifeng/template/views/layout.slim
82
+ - lib/guyifeng/version.rb
83
+ homepage: http://www.menghuanwd.cn
84
+ licenses:
85
+ - MIT
86
+ metadata: {}
87
+ post_install_message:
88
+ rdoc_options: []
89
+ require_paths:
90
+ - lib
91
+ required_ruby_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ required_rubygems_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ requirements: []
102
+ rubyforge_project:
103
+ rubygems_version: 2.2.2
104
+ signing_key:
105
+ specification_version: 4
106
+ summary: aaaa
107
+ test_files: []