zing 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +0 -1
- data/Gemfile.lock +0 -8
- data/VERSION +1 -1
- data/bin/zing +64 -238
- data/zing.gemspec +3 -6
- metadata +14 -25
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,13 +1,7 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
chunky_png (1.2.5)
|
5
4
|
colorize (0.5.8)
|
6
|
-
compass (0.11.5)
|
7
|
-
chunky_png (~> 1.2)
|
8
|
-
fssm (>= 0.2.7)
|
9
|
-
sass (~> 3.1)
|
10
|
-
fssm (0.2.7)
|
11
5
|
git (1.2.5)
|
12
6
|
jeweler (1.6.4)
|
13
7
|
bundler (~> 1.0)
|
@@ -15,7 +9,6 @@ GEM
|
|
15
9
|
rake
|
16
10
|
rake (0.9.2.2)
|
17
11
|
rcov (0.9.11)
|
18
|
-
sass (3.1.11)
|
19
12
|
shoulda (2.11.3)
|
20
13
|
|
21
14
|
PLATFORMS
|
@@ -24,7 +17,6 @@ PLATFORMS
|
|
24
17
|
DEPENDENCIES
|
25
18
|
bundler (~> 1.0.0)
|
26
19
|
colorize
|
27
|
-
compass
|
28
20
|
jeweler (~> 1.6.4)
|
29
21
|
rcov
|
30
22
|
shoulda
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/bin/zing
CHANGED
@@ -122,7 +122,10 @@ views_directory = project_absolute_dir + "/views"
|
|
122
122
|
routes_directory = project_absolute_dir + "/routes"
|
123
123
|
push_directory = project_absolute_dir + "/push"
|
124
124
|
helpers_directory = project_absolute_dir + "/helpers"
|
125
|
+
|
125
126
|
scss_directory = project_absolute_dir + "/public/sass"
|
127
|
+
|
128
|
+
css_directory = project_absolute_dir + "/public/css"
|
126
129
|
images_directory = project_absolute_dir + "/public/images"
|
127
130
|
|
128
131
|
# check if config.ru and app_name.rb exist
|
@@ -137,18 +140,9 @@ end
|
|
137
140
|
# This will be the base CMS, the rest will not function without this
|
138
141
|
if options.base
|
139
142
|
|
140
|
-
#
|
141
|
-
compass_create_result = system("compass create --sass-dir public/sass --css-dir public/stylesheets --images-dir public/images --javascripts-dir public/javascripts --using blueprint/semantic")
|
142
|
-
if compass_create_result
|
143
|
-
puts "passed".green + " compass create"
|
144
|
-
else
|
145
|
-
puts "failed".red + " compass create"
|
146
|
-
exit!
|
147
|
-
end
|
148
|
-
|
149
|
-
# copy cms images from gem to the app images folder
|
143
|
+
# copy cms images from gem to the app images directory
|
150
144
|
zing_images = `gem contents zing`.split("\n").select {|e| e.match(/\.png/i)}
|
151
|
-
FileUtils.cp zing_images,images_directory
|
145
|
+
FileUtils.cp zing_images, images_directory
|
152
146
|
|
153
147
|
# check if database config exist and connection successful
|
154
148
|
ZingHelper.connect_db(project_absolute_dir + "/models.rb")
|
@@ -214,124 +208,6 @@ end
|
|
214
208
|
cms_content
|
215
209
|
ZingHelper.create_file("#{routes_directory}/cms.rb", cms_content)
|
216
210
|
|
217
|
-
# create application.scss
|
218
|
-
application_scss_content = <<-application_scss_content
|
219
|
-
@import "compass";
|
220
|
-
@import "blueprint";
|
221
|
-
|
222
|
-
@import "partials/base";
|
223
|
-
@import "partials/page";
|
224
|
-
@import "partials/form";
|
225
|
-
|
226
|
-
.top_wrapper {
|
227
|
-
background: white url('../images/background-v2.png') 0 0 repeat-x;
|
228
|
-
}
|
229
|
-
|
230
|
-
.footer_wrapper {
|
231
|
-
background: url('../images/bg_footer_top.png') #F8F8F8 repeat-x;
|
232
|
-
}
|
233
|
-
|
234
|
-
.bottom_wrapper {
|
235
|
-
background: url('../images/bg_footer_bottom.png') white repeat-x;
|
236
|
-
height: 40px;
|
237
|
-
}
|
238
|
-
|
239
|
-
#main{
|
240
|
-
@include container;
|
241
|
-
|
242
|
-
#header {
|
243
|
-
@include column(24);
|
244
|
-
height: 91px;
|
245
|
-
|
246
|
-
.logo {
|
247
|
-
@include column(11);
|
248
|
-
@include prepend(1);
|
249
|
-
display:block;
|
250
|
-
position:relative;
|
251
|
-
top: 16px;
|
252
|
-
}
|
253
|
-
|
254
|
-
.topnav {
|
255
|
-
@include column(11);
|
256
|
-
@include append(1);
|
257
|
-
text-align: right;
|
258
|
-
display:block;
|
259
|
-
position:relative;
|
260
|
-
|
261
|
-
}
|
262
|
-
}
|
263
|
-
|
264
|
-
#content{
|
265
|
-
@include column(22);
|
266
|
-
@include append(1);
|
267
|
-
@include prepend(1);
|
268
|
-
@include prepend-top(-20px);
|
269
|
-
@include append-bottom(10px);
|
270
|
-
background: url('../images/background-white.png') 0 0 no-repeat;
|
271
|
-
// @include column-grid-background;
|
272
|
-
|
273
|
-
#login {
|
274
|
-
@include prepend-top(70px);
|
275
|
-
@include append-bottom(60px);
|
276
|
-
@include column(10);
|
277
|
-
@include prepend(7);
|
278
|
-
@include append(7);
|
279
|
-
}
|
280
|
-
|
281
|
-
#page_title {
|
282
|
-
@include prepend-top(20px);
|
283
|
-
@include column(22);
|
284
|
-
// @include column-grid-background;
|
285
|
-
}
|
286
|
-
|
287
|
-
#page_content {
|
288
|
-
@include column(22);
|
289
|
-
// @include column-grid-background;
|
290
|
-
}
|
291
|
-
|
292
|
-
}
|
293
|
-
|
294
|
-
}
|
295
|
-
|
296
|
-
#footer{
|
297
|
-
@include container;
|
298
|
-
|
299
|
-
#upper_footer {
|
300
|
-
@include column(24);
|
301
|
-
overflow: hidden;
|
302
|
-
height: 60px;
|
303
|
-
|
304
|
-
.copyright{
|
305
|
-
@include column(15);
|
306
|
-
text-align: right;
|
307
|
-
display:block;
|
308
|
-
position:relative;
|
309
|
-
top: 25px;
|
310
|
-
}
|
311
|
-
|
312
|
-
.bottom_logo {
|
313
|
-
@include column(7, true);
|
314
|
-
@include append(1);
|
315
|
-
text-align: right;
|
316
|
-
display:block;
|
317
|
-
position:relative;
|
318
|
-
top: 14px;
|
319
|
-
|
320
|
-
h1 {
|
321
|
-
color:rgb(219, 220, 221);
|
322
|
-
}
|
323
|
-
}
|
324
|
-
|
325
|
-
}
|
326
|
-
|
327
|
-
#lower_footer {
|
328
|
-
|
329
|
-
}
|
330
|
-
|
331
|
-
}
|
332
|
-
application_scss_content
|
333
|
-
ZingHelper.create_file("#{scss_directory}/application.scss", application_scss_content)
|
334
|
-
|
335
211
|
# create login.haml
|
336
212
|
login_haml_content = <<-login_haml_content
|
337
213
|
!!! 5
|
@@ -340,48 +216,36 @@ end
|
|
340
216
|
%title= if @page_title then "CMS " + @page_title.humanize else "CMS" end
|
341
217
|
%meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"}
|
342
218
|
%meta{:content => "NONE,NOARCHIVE", :name => "robots"}
|
343
|
-
%link{:href => "/
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
#footer
|
374
|
-
#upper_footer
|
375
|
-
.copyright
|
376
|
-
= "All rights reserved. © " + Time.now.year.to_s + " " + $APP_NAME + "."
|
377
|
-
|
378
|
-
.bottom_logo
|
379
|
-
%h1
|
380
|
-
= $APP_NAME + " CMS"
|
381
|
-
|
382
|
-
#lower_footer
|
383
|
-
|
384
|
-
.bottom_wrapper
|
219
|
+
%link{:href => "http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css", :rel => "sytlesheet", :type => "text/css"}
|
220
|
+
|
221
|
+
%body
|
222
|
+
|
223
|
+
.topbar
|
224
|
+
.fill
|
225
|
+
.container
|
226
|
+
%a.brand{:href=>"#"}
|
227
|
+
= $APP_NAME + " CMS"
|
228
|
+
%ul.nav
|
229
|
+
%li.active
|
230
|
+
%a{:href => "#"}Home
|
231
|
+
%li
|
232
|
+
%a{:href => "#about"}About
|
233
|
+
%li
|
234
|
+
%a{:href => "#contact"}Contact
|
235
|
+
%form.pull-right{:action => "/cms/login", :method => "post"}
|
236
|
+
%input.input-small{:type => "text", :placeholder => "Username"}
|
237
|
+
%input.input-small{:type => "text", :placeholder => "Password"}
|
238
|
+
%button.btn{:type => "submit"}Sign in
|
239
|
+
|
240
|
+
.container
|
241
|
+
.hero-unit
|
242
|
+
%h1 CMS
|
243
|
+
%p App CMS
|
244
|
+
|
245
|
+
.footer
|
246
|
+
%p
|
247
|
+
= "All rights reserved. © " + Time.now.year.to_s + " " + $APP_NAME + "."
|
248
|
+
|
385
249
|
login_haml_content
|
386
250
|
ZingHelper.create_file("#{views_directory}/login.haml", login_haml_content)
|
387
251
|
|
@@ -393,44 +257,35 @@ end
|
|
393
257
|
%title= if @page_title then "CMS " + @page_title.humanize else "CMS" end
|
394
258
|
%meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"}
|
395
259
|
%meta{:content => "NONE,NOARCHIVE", :name => "robots"}
|
396
|
-
%link{:href => "/
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
= "All rights reserved. © " + Time.now.year.to_s + " " + $APP_NAME + "."
|
426
|
-
|
427
|
-
.bottom_logo
|
428
|
-
%h1
|
429
|
-
= $APP_NAME + " CMS"
|
430
|
-
|
431
|
-
#lower_footer
|
432
|
-
|
433
|
-
.bottom_wrapper
|
260
|
+
%link{:href => "http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css", :rel => "sytlesheet", :type => "text/css"}
|
261
|
+
|
262
|
+
%body
|
263
|
+
|
264
|
+
.topbar
|
265
|
+
.fill
|
266
|
+
.container
|
267
|
+
%a.brand{:href=>"#"}
|
268
|
+
= $APP_NAME + " CMS"
|
269
|
+
%ul.nav
|
270
|
+
%li.active
|
271
|
+
%a{:href => "#"}Home
|
272
|
+
%li
|
273
|
+
%a{:href => "#about"}About
|
274
|
+
%li
|
275
|
+
%a{:href => "#contact"}Contact
|
276
|
+
%form.pull-right{:action => "/cms/login", :method => "post"}
|
277
|
+
%input.input-small{:type => "text", :placeholder => "Username"}
|
278
|
+
%input.input-small{:type => "text", :placeholder => "Password"}
|
279
|
+
%button.btn{:type => "submit"}Sign in
|
280
|
+
|
281
|
+
.container
|
282
|
+
.content
|
283
|
+
= yield
|
284
|
+
|
285
|
+
.footer
|
286
|
+
%p
|
287
|
+
= "All rights reserved. © " + Time.now.year.to_s + " " + $APP_NAME + "."
|
288
|
+
|
434
289
|
layout_haml_content
|
435
290
|
ZingHelper.create_file("#{views_directory}/layout.haml", layout_haml_content)
|
436
291
|
|
@@ -440,35 +295,6 @@ end
|
|
440
295
|
dashboard_haml_content
|
441
296
|
ZingHelper.create_file("#{views_directory}/dashboard.haml", dashboard_haml_content)
|
442
297
|
|
443
|
-
# add View Partial
|
444
|
-
# check if helpers folder exist
|
445
|
-
ZingHelper.create_directory(helpers_directory)
|
446
|
-
|
447
|
-
view_partial_content = <<-view_partial_content
|
448
|
-
module ViewPartial
|
449
|
-
def page_navigation(current_page)
|
450
|
-
haml :page_navigation
|
451
|
-
end
|
452
|
-
end
|
453
|
-
view_partial_content
|
454
|
-
ZingHelper.create_file("#{helpers_directory}/view_partial.rb", view_partial_content)
|
455
|
-
|
456
|
-
# page_navigation.haml
|
457
|
-
page_navigation_haml = <<-page_navigation_haml
|
458
|
-
%p
|
459
|
-
%ul
|
460
|
-
%li page_navigation
|
461
|
-
page_navigation_haml
|
462
|
-
ZingHelper.create_file("#{views_directory}/page_navigation.haml", page_navigation_haml)
|
463
|
-
|
464
|
-
# compass compile scss
|
465
|
-
compass_compile_result = system("compass compile")
|
466
|
-
if compass_compile_result
|
467
|
-
puts "passed".green + " compass compile"
|
468
|
-
else
|
469
|
-
puts "failed".red + " compass compile"
|
470
|
-
exit!
|
471
|
-
end
|
472
298
|
end
|
473
299
|
|
474
300
|
# PUSH
|
data/zing.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "zing"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.2.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Samuel Chandra"]
|
12
|
-
s.date = "
|
12
|
+
s.date = "2012-01-31"
|
13
13
|
s.description = "This gem will generate common code for a new or existing Sinatra project"
|
14
14
|
s.email = "samuelchandra@yahoo.com"
|
15
15
|
s.executables = ["zing"]
|
@@ -38,7 +38,7 @@ Gem::Specification.new do |s|
|
|
38
38
|
s.homepage = "http://github.com/schandra/zing"
|
39
39
|
s.licenses = ["MIT"]
|
40
40
|
s.require_paths = ["lib"]
|
41
|
-
s.rubygems_version = "1.8.
|
41
|
+
s.rubygems_version = "1.8.15"
|
42
42
|
s.summary = "Zing is Sinatra code generator"
|
43
43
|
|
44
44
|
if s.respond_to? :specification_version then
|
@@ -46,14 +46,12 @@ Gem::Specification.new do |s|
|
|
46
46
|
|
47
47
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
48
48
|
s.add_runtime_dependency(%q<colorize>, [">= 0"])
|
49
|
-
s.add_runtime_dependency(%q<compass>, [">= 0"])
|
50
49
|
s.add_development_dependency(%q<shoulda>, [">= 0"])
|
51
50
|
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
52
51
|
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
53
52
|
s.add_development_dependency(%q<rcov>, [">= 0"])
|
54
53
|
else
|
55
54
|
s.add_dependency(%q<colorize>, [">= 0"])
|
56
|
-
s.add_dependency(%q<compass>, [">= 0"])
|
57
55
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
58
56
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
59
57
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
@@ -61,7 +59,6 @@ Gem::Specification.new do |s|
|
|
61
59
|
end
|
62
60
|
else
|
63
61
|
s.add_dependency(%q<colorize>, [">= 0"])
|
64
|
-
s.add_dependency(%q<compass>, [">= 0"])
|
65
62
|
s.add_dependency(%q<shoulda>, [">= 0"])
|
66
63
|
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
67
64
|
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-01-31 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: colorize
|
16
|
-
requirement: &
|
16
|
+
requirement: &70332049192580 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,21 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: compass
|
27
|
-
requirement: &70110395420520 !ruby/object:Gem::Requirement
|
28
|
-
none: false
|
29
|
-
requirements:
|
30
|
-
- - ! '>='
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '0'
|
33
|
-
type: :runtime
|
34
|
-
prerelease: false
|
35
|
-
version_requirements: *70110395420520
|
24
|
+
version_requirements: *70332049192580
|
36
25
|
- !ruby/object:Gem::Dependency
|
37
26
|
name: shoulda
|
38
|
-
requirement: &
|
27
|
+
requirement: &70332049191840 !ruby/object:Gem::Requirement
|
39
28
|
none: false
|
40
29
|
requirements:
|
41
30
|
- - ! '>='
|
@@ -43,10 +32,10 @@ dependencies:
|
|
43
32
|
version: '0'
|
44
33
|
type: :development
|
45
34
|
prerelease: false
|
46
|
-
version_requirements: *
|
35
|
+
version_requirements: *70332049191840
|
47
36
|
- !ruby/object:Gem::Dependency
|
48
37
|
name: bundler
|
49
|
-
requirement: &
|
38
|
+
requirement: &70332049191020 !ruby/object:Gem::Requirement
|
50
39
|
none: false
|
51
40
|
requirements:
|
52
41
|
- - ~>
|
@@ -54,10 +43,10 @@ dependencies:
|
|
54
43
|
version: 1.0.0
|
55
44
|
type: :development
|
56
45
|
prerelease: false
|
57
|
-
version_requirements: *
|
46
|
+
version_requirements: *70332049191020
|
58
47
|
- !ruby/object:Gem::Dependency
|
59
48
|
name: jeweler
|
60
|
-
requirement: &
|
49
|
+
requirement: &70332049190020 !ruby/object:Gem::Requirement
|
61
50
|
none: false
|
62
51
|
requirements:
|
63
52
|
- - ~>
|
@@ -65,10 +54,10 @@ dependencies:
|
|
65
54
|
version: 1.6.4
|
66
55
|
type: :development
|
67
56
|
prerelease: false
|
68
|
-
version_requirements: *
|
57
|
+
version_requirements: *70332049190020
|
69
58
|
- !ruby/object:Gem::Dependency
|
70
59
|
name: rcov
|
71
|
-
requirement: &
|
60
|
+
requirement: &70332049148920 !ruby/object:Gem::Requirement
|
72
61
|
none: false
|
73
62
|
requirements:
|
74
63
|
- - ! '>='
|
@@ -76,7 +65,7 @@ dependencies:
|
|
76
65
|
version: '0'
|
77
66
|
type: :development
|
78
67
|
prerelease: false
|
79
|
-
version_requirements: *
|
68
|
+
version_requirements: *70332049148920
|
80
69
|
description: This gem will generate common code for a new or existing Sinatra project
|
81
70
|
email: samuelchandra@yahoo.com
|
82
71
|
executables:
|
@@ -117,7 +106,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
117
106
|
version: '0'
|
118
107
|
segments:
|
119
108
|
- 0
|
120
|
-
hash: -
|
109
|
+
hash: -1937797000887539868
|
121
110
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
111
|
none: false
|
123
112
|
requirements:
|
@@ -126,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
115
|
version: '0'
|
127
116
|
requirements: []
|
128
117
|
rubyforge_project:
|
129
|
-
rubygems_version: 1.8.
|
118
|
+
rubygems_version: 1.8.15
|
130
119
|
signing_key:
|
131
120
|
specification_version: 3
|
132
121
|
summary: Zing is Sinatra code generator
|