humdrum-rails 0.0.3 → 0.0.4

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 (51) hide show
  1. data/humdrum-rails.gemspec +3 -0
  2. data/lib/humdrum/version.rb +1 -1
  3. data/lib/rails/generators/humdrum/layout/layout_generator.rb +53 -39
  4. data/lib/rails/generators/humdrum/layout/templates/stylesheets/application.css +25 -0
  5. data/lib/rails/generators/humdrum/layout/templates/stylesheets/gumby.css +1845 -0
  6. data/lib/rails/generators/humdrum/layout/templates/stylesheets/overrides-bootstrap.css +4 -0
  7. data/lib/rails/generators/humdrum/layout/templates/stylesheets/overrides-gumby.css +11 -0
  8. data/lib/rails/generators/humdrum/layout/templates/views/{layouts → bootstrap/layouts}/admin/_footer.html.erb +0 -0
  9. data/lib/rails/generators/humdrum/layout/templates/views/{layouts → bootstrap/layouts}/admin/_header.html.erb +0 -0
  10. data/lib/rails/generators/humdrum/layout/templates/views/{layouts → bootstrap/layouts}/admin/_navbar.html.erb +0 -0
  11. data/lib/rails/generators/humdrum/layout/templates/views/{layouts → bootstrap/layouts}/admin.html.erb +0 -0
  12. data/lib/rails/generators/humdrum/layout/templates/views/{layouts → bootstrap/layouts}/common/_flash_message.html.erb +0 -0
  13. data/lib/rails/generators/humdrum/layout/templates/views/{layouts → bootstrap/layouts}/common/_meta_tags.html.erb +0 -0
  14. data/lib/rails/generators/humdrum/layout/templates/views/{layouts → bootstrap/layouts}/common/_overlays.html.erb +0 -0
  15. data/lib/rails/generators/humdrum/layout/templates/views/{layouts → bootstrap/layouts}/public/_footer.html.erb +0 -0
  16. data/lib/rails/generators/humdrum/layout/templates/views/{layouts → bootstrap/layouts}/public/_header.html.erb +0 -0
  17. data/lib/rails/generators/humdrum/layout/templates/views/{layouts → bootstrap/layouts}/public/_navbar.html.erb +0 -0
  18. data/lib/rails/generators/humdrum/layout/templates/views/{layouts → bootstrap/layouts}/public.html.erb +0 -0
  19. data/lib/rails/generators/humdrum/layout/templates/views/{layouts → bootstrap/layouts}/user/_footer.html.erb +0 -0
  20. data/lib/rails/generators/humdrum/layout/templates/views/{layouts → bootstrap/layouts}/user/_header.html.erb +0 -0
  21. data/lib/rails/generators/humdrum/layout/templates/views/{layouts → bootstrap/layouts}/user/_navbar.html.erb +0 -0
  22. data/lib/rails/generators/humdrum/layout/templates/views/{layouts → bootstrap/layouts}/user.html.erb +0 -0
  23. data/lib/rails/generators/humdrum/layout/templates/views/bootstrap/welcome/index.html.erb +5 -0
  24. data/lib/rails/generators/humdrum/layout/templates/views/gumby/layouts/admin/_footer.html.erb +0 -0
  25. data/lib/rails/generators/humdrum/layout/templates/views/gumby/layouts/admin/_header.html.erb +43 -0
  26. data/lib/rails/generators/humdrum/layout/templates/views/gumby/layouts/admin/_navbar.html.erb +0 -0
  27. data/lib/rails/generators/humdrum/layout/templates/views/gumby/layouts/admin.html.erb +65 -0
  28. data/lib/rails/generators/humdrum/layout/templates/views/gumby/layouts/common/_flash_message.html.erb +24 -0
  29. data/lib/rails/generators/humdrum/layout/templates/views/gumby/layouts/common/_meta_tags.html.erb +42 -0
  30. data/lib/rails/generators/humdrum/layout/templates/views/gumby/layouts/common/_overlays.html.erb +9 -0
  31. data/lib/rails/generators/humdrum/layout/templates/views/gumby/layouts/public/_footer.html.erb +0 -0
  32. data/lib/rails/generators/humdrum/layout/templates/views/gumby/layouts/public/_header.html.erb +43 -0
  33. data/lib/rails/generators/humdrum/layout/templates/views/gumby/layouts/public/_navbar.html.erb +0 -0
  34. data/lib/rails/generators/humdrum/layout/templates/views/gumby/layouts/public.html.erb +63 -0
  35. data/lib/rails/generators/humdrum/layout/templates/views/gumby/layouts/user/_footer.html.erb +0 -0
  36. data/lib/rails/generators/humdrum/layout/templates/views/gumby/layouts/user/_header.html.erb +43 -0
  37. data/lib/rails/generators/humdrum/layout/templates/views/gumby/layouts/user/_navbar.html.erb +0 -0
  38. data/lib/rails/generators/humdrum/layout/templates/views/gumby/layouts/user.html.erb +65 -0
  39. data/lib/rails/generators/humdrum/layout/templates/views/gumby/welcome/index.html.erb +5 -0
  40. metadata +69 -28
  41. data/lib/rails/generators/humdrum/layout/templates/stylesheets/bootstrap-responsive.css +0 -1109
  42. data/lib/rails/generators/humdrum/layout/templates/stylesheets/humdrum/boilerplate.css.scss +0 -299
  43. data/lib/rails/generators/humdrum/layout/templates/stylesheets/humdrum/box.css.scss +0 -57
  44. data/lib/rails/generators/humdrum/layout/templates/stylesheets/humdrum/caligraphy.css.scss +0 -30
  45. data/lib/rails/generators/humdrum/layout/templates/stylesheets/humdrum/dividers.css.scss +0 -18
  46. data/lib/rails/generators/humdrum/layout/templates/stylesheets/humdrum/form.css.scss +0 -80
  47. data/lib/rails/generators/humdrum/layout/templates/stylesheets/humdrum/misc.css.scss +0 -9
  48. data/lib/rails/generators/humdrum/layout/templates/stylesheets/humdrum/normalize.css.scss +0 -533
  49. data/lib/rails/generators/humdrum/layout/templates/stylesheets/humdrum/palettes.css.scss +0 -66
  50. data/lib/rails/generators/humdrum/layout/templates/stylesheets/humdrum/positioning.css.scss +0 -702
  51. data/lib/rails/generators/humdrum/layout/templates/views/welcome/index.html.erb +0 -5
@@ -26,5 +26,8 @@ Gem::Specification.new do |gem|
26
26
 
27
27
  gem.add_development_dependency 'rails', '~> 3.0.0'
28
28
  gem.add_development_dependency 'rainbow'
29
+ gem.add_development_dependency 'rainbow'
30
+ gem.add_development_dependency 'handy-css-rails', '0.0.3'
31
+
29
32
 
30
33
  end
@@ -1,4 +1,4 @@
1
1
  module Humdrum
2
2
  # http://semver.org/
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
@@ -9,9 +9,9 @@ module Humdrum
9
9
  "Pass --user_layout to generate another layout for users who are signed in." <<
10
10
  "Pass --admin_layout to generate another layout for admin users."
11
11
 
12
- argument :layout_name, :type=>:string, :default => "application"
13
12
  argument :application_name, :type=>:string, :default => "Application Name"
14
-
13
+ #argument :layout_name, :type=>:string, :default => "application"
14
+
15
15
  class_option :fluid, :type => :boolean, :default => true, :desc => "Pass false to create fixed layouts. Default is true"
16
16
 
17
17
  class_option :stylesheet, :type => :boolean, :default => true, :desc => "This will not generate the stylesheets"
@@ -21,7 +21,21 @@ module Humdrum
21
21
  class_option :public_layout, :type => :boolean, :default => true, :desc => "This will create a public.html.erb which can be used for public pages, not logged in users."
22
22
  class_option :admin_layout, :type => :boolean, :default => false, :desc => "This will create a public.html.erb which can be used for admin pages."
23
23
  class_option :user_layout, :type => :boolean, :default => false, :desc => "This will create a public.html.erb which can be used for pages shown to a signed in user."
24
-
24
+
25
+ class_option :front_end_framework, :type => :string, :default => 'bootstrap', :desc => "Support Twitter Bootstrap (twitter.github.io/bootstrap/) and Gumpy (http://gumbyframework.com/). Default is bootstrap. Pass gumby for Gumby Framework"
26
+
27
+ ## Parse from config file
28
+ #class_option :config_file, :type => :string, :desc => "Parse options from the config file."
29
+
30
+ #@@config = nil
31
+
32
+ #def config
33
+ # args = options.dup
34
+ # args.config_file ||= '.csvconverter.yaml'
35
+ #
36
+ # config = YAML::load File.open(args[:file], 'r')
37
+ #end
38
+
25
39
  def remove_index_file
26
40
  remove_file "public/index.html"
27
41
  end
@@ -29,22 +43,24 @@ module Humdrum
29
43
  def generate_stylesheets
30
44
  if options.stylesheet?
31
45
 
46
+ template "stylesheets/application.css", "app/assets/stylesheets/application.css"
32
47
 
33
- copy_file "stylesheets/bootstrap.css", "app/assets/stylesheets/bootstrap.css"
34
- copy_file "stylesheets/bootstrap-responsive.css", "app/assets/stylesheets/bootstrap-responsive.css"
35
- # Its named overrides-bootstrap so that it loads after bootstrap.css
36
- copy_file "stylesheets/overrides-bootstrap.css", "app/assets/stylesheets/overrides-bootstrap.css"
37
-
38
- copy_file "stylesheets/humdrum/boilerplate.css.scss", "app/assets/stylesheets/humdrum/boilerplate.css.scss"
48
+ if options.front_end_framework == "bootstrap"
49
+
50
+ # Copy bootstrap css file
51
+ copy_file "stylesheets/bootstrap.css", "app/assets/stylesheets/bootstrap.css"
52
+
53
+ # Its named overrides-bootstrap so that it loads after bootstrap.css
54
+ copy_file "stylesheets/overrides-bootstrap.css", "app/assets/stylesheets/overrides-bootstrap.css"
55
+ elsif options.front_end_framework == "gumby"
56
+
57
+ # Copy gumby css file
58
+ copy_file "stylesheets/gumby.css", "app/assets/stylesheets/gumby.css"
59
+
60
+ # Its named overrides-gumby so that it loads after gumby.css
61
+ copy_file "stylesheets/overrides-gumby.css", "app/assets/stylesheets/overrides-gumby.css"
62
+ end
39
63
 
40
- copy_file "stylesheets/humdrum/normalize.css.scss", "app/assets/stylesheets/humdrum/normalize.css.scss"
41
- copy_file "stylesheets/humdrum/positioning.css.scss", "app/assets/stylesheets/humdrum/positioning.css.scss"
42
- copy_file "stylesheets/humdrum/palettes.css.scss", "app/assets/stylesheets/humdrum/palettes.css.scss"
43
- copy_file "stylesheets/humdrum/box.css.scss", "app/assets/stylesheets/humdrum/box.css.scss"
44
- copy_file "stylesheets/humdrum/caligraphy.css.scss", "app/assets/stylesheets/humdrum/caligraphy.css.scss"
45
- copy_file "stylesheets/humdrum/dividers.css.scss", "app/assets/stylesheets/humdrum/dividers.css.scss"
46
- copy_file "stylesheets/humdrum/form.css.scss", "app/assets/stylesheets/humdrum/form.css.scss"
47
- copy_file "stylesheets/humdrum/misc.css.scss", "app/assets/stylesheets/humdrum/misc.css.scss"
48
64
  end
49
65
  end
50
66
 
@@ -58,8 +74,10 @@ module Humdrum
58
74
  def generate_graphics
59
75
  if options.graphics?
60
76
  copy_file "images/favicon.ico", "app/assets/images/favicon.ico"
61
- copy_file "images/glyphicons-halflings.png", "app/assets/images/glyphicons-halflings.png"
62
- copy_file "images/glyphicons-halflings-white.png", "app/assets/images/glyphicons-halflings-white.png"
77
+ if options.front_end_framework == "bootstrap"
78
+ copy_file "images/glyphicons-halflings.png", "app/assets/images/glyphicons-halflings.png"
79
+ copy_file "images/glyphicons-halflings-white.png", "app/assets/images/glyphicons-halflings-white.png"
80
+ end
63
81
  end
64
82
  end
65
83
 
@@ -71,29 +89,29 @@ module Humdrum
71
89
  end
72
90
 
73
91
  def generate_layout
74
- template "views/layouts/common/_flash_message.html.erb", "app/views/layouts/common/_flash_message.html.erb"
75
- template "views/layouts/common/_meta_tags.html.erb", "app/views/layouts/common/_meta_tags.html.erb"
76
- template "views/layouts/common/_overlays.html.erb", "app/views/layouts/common/_overlays.html.erb"
92
+ template "views/#{options.front_end_framework}/layouts/common/_flash_message.html.erb", "app/views/layouts/common/_flash_message.html.erb"
93
+ template "views/#{options.front_end_framework}/layouts/common/_meta_tags.html.erb", "app/views/layouts/common/_meta_tags.html.erb"
94
+ template "views/#{options.front_end_framework}/layouts/common/_overlays.html.erb", "app/views/layouts/common/_overlays.html.erb"
77
95
 
78
96
  if options.admin_layout?
79
- template "views/layouts/admin.html.erb", "app/views/layouts/admin.html.erb"
80
- template "views/layouts/admin/_header.html.erb", "app/views/layouts/admin/_header.html.erb"
81
- template "views/layouts/admin/_footer.html.erb", "app/views/layouts/admin/_footer.html.erb"
82
- template "views/layouts/admin/_navbar.html.erb", "app/views/layouts/admin/_navbar.html.erb"
97
+ template "views/#{options.front_end_framework}/layouts/admin.html.erb", "app/views/layouts/admin.html.erb"
98
+ template "views/#{options.front_end_framework}/layouts/admin/_header.html.erb", "app/views/layouts/admin/_header.html.erb"
99
+ template "views/#{options.front_end_framework}/layouts/admin/_footer.html.erb", "app/views/layouts/admin/_footer.html.erb"
100
+ template "views/#{options.front_end_framework}/layouts/admin/_navbar.html.erb", "app/views/layouts/admin/_navbar.html.erb"
83
101
  end
84
102
 
85
103
  if options.public_layout?
86
- template "views/layouts/public.html.erb", "app/views/layouts/public.html.erb"
87
- template "views/layouts/public/_header.html.erb", "app/views/layouts/public/_header.html.erb"
88
- template "views/layouts/public/_footer.html.erb", "app/views/layouts/public/_footer.html.erb"
89
- template "views/layouts/public/_navbar.html.erb", "app/views/layouts/public/_navbar.html.erb"
104
+ template "views/#{options.front_end_framework}/layouts/public.html.erb", "app/views/layouts/public.html.erb"
105
+ template "views/#{options.front_end_framework}/layouts/public/_header.html.erb", "app/views/layouts/public/_header.html.erb"
106
+ template "views/#{options.front_end_framework}/layouts/public/_footer.html.erb", "app/views/layouts/public/_footer.html.erb"
107
+ template "views/#{options.front_end_framework}/layouts/public/_navbar.html.erb", "app/views/layouts/public/_navbar.html.erb"
90
108
  end
91
109
 
92
110
  if options.user_layout?
93
- template "views/layouts/user.html.erb", "app/views/layouts/user.html.erb"
94
- template "views/layouts/user/_header.html.erb", "app/views/layouts/user/_header.html.erb"
95
- template "views/layouts/user/_footer.html.erb", "app/views/layouts/user/_footer.html.erb"
96
- template "views/layouts/user/_navbar.html.erb", "app/views/layouts/user/_navbar.html.erb"
111
+ template "views/#{options.front_end_framework}/layouts/user.html.erb", "app/views/layouts/user.html.erb"
112
+ template "views/#{options.front_end_framework}/layouts/user/_header.html.erb", "app/views/layouts/user/_header.html.erb"
113
+ template "views/#{options.front_end_framework}/layouts/user/_footer.html.erb", "app/views/layouts/user/_footer.html.erb"
114
+ template "views/#{options.front_end_framework}/layouts/user/_navbar.html.erb", "app/views/layouts/user/_navbar.html.erb"
97
115
  end
98
116
 
99
117
  end
@@ -107,7 +125,7 @@ module Humdrum
107
125
  end
108
126
 
109
127
  def generate_views
110
- template "views/welcome/index.html.erb", "app/views/welcome/index.html.erb" if options.public_layout?
128
+ template "views/#{options.front_end_framework}/welcome/index.html.erb", "app/views/welcome/index.html.erb" if options.public_layout?
111
129
  end
112
130
 
113
131
  def generate_routes
@@ -116,10 +134,6 @@ module Humdrum
116
134
 
117
135
  private
118
136
 
119
- def file_name
120
- layout_name.underscore
121
- end
122
-
123
137
  def container_class
124
138
  options.fluid? ? "container-fluid" : "container"
125
139
  end
@@ -0,0 +1,25 @@
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 vendor/assets/stylesheets of plugins, if any, 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 top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ <% if options.front_end_framework == "bootstrap" -%>
13
+ * require bootstrap-rails
14
+ *= require bootstrap
15
+ *= require overrides-bootstrap
16
+ <% elsif options.front_end_framework == "gumby" -%>
17
+ * require gumby-rails
18
+ *= require gumby
19
+ *= require overrides-gumby
20
+ <% end %>
21
+ *= require handyCSS.css
22
+ *= require handyCSS.box.css
23
+ *= require handyCSS.backdrops.css
24
+
25
+ */