Class: Twitter_bootstrap_scaffold::Install
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Twitter_bootstrap_scaffold::Install
- Defined in:
- lib/integratedscaffold.rb
Overview
endd of class
Class Method Summary collapse
Instance Method Summary collapse
- #create_images ⇒ Object
- #create_javascript_exclusions ⇒ Object
- #create_javascripts ⇒ Object
- #create_layouts ⇒ Object
- #create_stylesheet_images ⇒ Object
- #create_stylesheets_exclusions ⇒ Object
- #create_uploader ⇒ Object
-
#initialize(*args, &block) ⇒ Install
constructor
A new instance of Install.
Constructor Details
#initialize(*args, &block) ⇒ Install
Returns a new instance of Install.
214 215 216 217 218 219 220 221 222 223 |
# File 'lib/integratedscaffold.rb', line 214 def initialize(*args, &block) super #now we invokde generators off twitter boootstrap and gritter Rails::Generators.invoke('bootstrap:install') Rails::Generators.invoke('gritter:locale') end |
Class Method Details
.source_root ⇒ Object
209 210 211 |
# File 'lib/integratedscaffold.rb', line 209 def self.source_root File.("../templates", __FILE__) end |
Instance Method Details
#create_images ⇒ Object
230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
# File 'lib/integratedscaffold.rb', line 230 def create_images # copies the standard images into the assets/images folder @images=Array.new @images= Dir.entries("#{Integratedscaffold.source_root}/assets/images") @images.each do |image| if image!=".." and image !="." copy_file "assets/images/#{image.to_s}", "app/assets/images/#{image}" end end end |
#create_javascript_exclusions ⇒ Object
260 261 262 263 264 |
# File 'lib/integratedscaffold.rb', line 260 def create_javascript_exclusions # copies the sequenced javascript into the assets/javascripts/exclusions folder directory "#{Integratedscaffold.source_root}/assets/javascripts/exclusions", "app/assets/javascripts/exclusions" end |
#create_javascripts ⇒ Object
245 246 247 248 249 250 251 252 |
# File 'lib/integratedscaffold.rb', line 245 def create_javascripts # copies the standard javascripts into the assets/javascripts folder - Currently hard-coded # TODO : Remove the hardcoding for the javascripts inclusion copy_file "#{Integratedscaffold.source_root}/assets/javascripts/jquery.dataTables.min.js", "app/assets/javascripts/jquery.dataTables.min.js" end |
#create_layouts ⇒ Object
274 275 276 277 278 279 280 281 282 283 |
# File 'lib/integratedscaffold.rb', line 274 def create_layouts #TODO :remove hardcoding and make a loop for including all files in this folder remove_file "app/views/layouts/application.html.erb" template "#{Integratedscaffold.source_root}/layouts/application.html.erb", "app/views/layouts/application.html.erb" template "#{Integratedscaffold.source_root}/layouts//dummy_data.html.erb", "app/views/layouts/scaffold.html.erb" template "#{Integratedscaffold.source_root}/layouts/information_page.html.erb", "app/views/layouts/information_page.html.erb" template "#{Integratedscaffold.source_root}/layouts/pageslide_form_at.html.erb", "app/views/layouts/pageslide_form_at.html.erb" template "#{Integratedscaffold.source_root}/layouts/welcome.html.erb", "app/views/layouts/welcome.html.erb" end |
#create_stylesheet_images ⇒ Object
266 267 268 269 270 271 |
# File 'lib/integratedscaffold.rb', line 266 def create_stylesheet_images # copies the dependent css images into the assets/stylesheets/images folder directory "#{Integratedscaffold.source_root}/assets/stylesheets/images", "app/assets/stylesheets/images" end |
#create_stylesheets_exclusions ⇒ Object
254 255 256 257 258 |
# File 'lib/integratedscaffold.rb', line 254 def create_stylesheets_exclusions # copies the sequenced css into the assets/stylesheets/exclusions folder directory "#{Integratedscaffold.source_root}/assets/stylesheets/exclusions", "app/assets/stylesheets/exclusions" end |
#create_uploader ⇒ Object
225 226 227 228 |
# File 'lib/integratedscaffold.rb', line 225 def create_uploader #creates the uploader ruby file using carrierwave template 'file_uploader.rb', "app/uploaders/file_uploader.rb" end |