rails_baseline 0.1.7 → 0.1.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 79dca9f6fd951cf25f49cf90e8d55f02dac3f4f2
4
- data.tar.gz: 7cc958a2d8fd7f14d80b12653013c038ddbdcbab
3
+ metadata.gz: ac1cd922551cf648cef727f376c2b259a4ccbe7c
4
+ data.tar.gz: cdd1dee723b429f3749d03d6c945f38185d23a35
5
5
  SHA512:
6
- metadata.gz: 0a7b27b9b56096fe5096e93bd7353a7394323320dd57e2199e4ce46624bc76762c958f9b76a06c9bdbb2429d38ce4d910577cf0c142fba1bdddb85d2d605f3d2
7
- data.tar.gz: 9028682277b0ee8461ede88b74758f76dad3ba6b2c6fd4b7dee1de6bdc236f5fc2734426dd97590ec11edc54bc3d71a6d1a9082154f81ef71429c75e247a89d5
6
+ metadata.gz: 1176ef3c4658388d853ee663203f32b146049feee04539926d4383869defb4dfbe01044b899796df51aecf3e5610a295aa036914887081e16df6c41be47efb5d
7
+ data.tar.gz: 3274e10e4cb8facf5d57307d67ddd23341e344ec1cd3a23d76a7754ffadd99ec4f4d7000223b17e6d8543656222865ac7a8e17e0760772d25f7b3d686c58fe43
data/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  This gem is still under active development.
4
4
 
5
5
  # Rails 4 Baseline
6
+ [![Gem Version](https://badge.fury.io/rb/rails_baseline.svg)](http://badge.fury.io/rb/rails_baseline)
6
7
 
7
8
  This gem is a wrapper of a Rails Applications Template to create a new Rails 4.2 application based on the normal practices in [cloudcoder.com.my](http://cloudcoder.com.my). Just go through a simple wizard to get all the gems set and you'll be good to proceed with migrations and start coding your project.
8
9
 
@@ -14,6 +15,8 @@ This gem is tested on Rails 4.2 and meant to build new Rails 4.2 app, it is unkn
14
15
 
15
16
  ## Installation
16
17
 
18
+ Please don't include this gem into Gemfile.
19
+
17
20
  $ gem install rails_baseline
18
21
 
19
22
  ## Usage
@@ -51,6 +54,7 @@ and run migration for the pending migration files:
51
54
  3. 0.1.1 - Added jQuery Validation, CanCanCan and Google Tag Manager
52
55
  3. 0.1.2 - Added Paranoia, Better Errors, Hirb and jQuery DataTables
53
56
  4. 0.1.3 - Added Quiet Assets, Decent Exposure, Paperclip, State Machines, Delayed Job and Kaminari
57
+ 5. 0.1.7 - Various fixes, and generate a static home page
54
58
 
55
59
  ## Contributing
56
60
 
@@ -17,7 +17,10 @@ Better Errors
17
17
  Hirb
18
18
  SASS
19
19
  Bootstrap
20
+ Font Awesome
21
+ Liquid
20
22
  jQuery Validate
21
23
  jQuery dataTables
22
24
  Kaminari
25
+ Deployment(Heroku, Capistrano, Engine Yard)
23
26
  Git
@@ -457,6 +457,31 @@ if use_bootstrap
457
457
  end
458
458
  end
459
459
 
460
+ # >-----------------------------[ Font Awesome ]------------------------------<
461
+
462
+ @current_recipe = "font-awesome"
463
+ @before_configs["font-awesome"].call if @before_configs["font-awesome"]
464
+ say_recipe 'Font Awesome'
465
+
466
+ font_awesome_configs = <<-TEXT
467
+ @import "font-awesome-sprockets";
468
+ @import "font-awesome";
469
+ TEXT
470
+
471
+ gem 'font-awesome-sass', '~> 4.3.0'
472
+
473
+ after_bundler do
474
+ append_to_file 'app/assets/stylesheets/application.css.scss', font_awesome_configs
475
+ end
476
+
477
+ # >-----------------------------[ Liquid ]------------------------------<
478
+
479
+ @current_recipe = "liquid"
480
+ @before_configs["liquid"].call if @before_configs["liquid"]
481
+ say_recipe 'Liquid'
482
+
483
+ gem "liquid"
484
+
460
485
  # >--------------------------[ jQuery Validation ]-----------------------------<
461
486
 
462
487
  @current_recipe = "jquery-validation-rails"
@@ -487,6 +512,64 @@ datatable_config_lines_non_bootstrap = <<-TEXT
487
512
  @import "dataTables/jquery.dataTables";
488
513
  TEXT
489
514
 
515
+ datatable_model = <<-TEXT
516
+ class Datatable
517
+ include ApplicationHelper
518
+ delegate :params, :t, :h, :current_user, :link_to, to: :@view
519
+
520
+ def initialize(view)
521
+ @view = view
522
+ end
523
+
524
+ def as_json(options = {})
525
+ {
526
+ sEcho: params[:sEcho].to_i,
527
+ iTotalRecords: rows ? rows.count : 0,
528
+ iTotalDisplayRecords: rows ? rows.total_entries : 0,
529
+ aaData: data
530
+ }
531
+ end
532
+
533
+
534
+ def rows
535
+ @rows ||= fetch_datas
536
+ end
537
+
538
+ def fetch_datas
539
+ end
540
+
541
+ def page
542
+ params[:iDisplayStart].to_i/per_page + 1
543
+ end
544
+
545
+ def per_page
546
+ params[:iDisplayLength].to_i > 0 ? params[:iDisplayLength].to_i : 10
547
+ end
548
+
549
+ def columns
550
+ %w[]
551
+ end
552
+
553
+ def sort_column
554
+ if params["iSortCol_0"].blank?
555
+ columns[params[:order]["0"]["column"].to_i]
556
+ else
557
+ columns[params["iSortCol_0"].to_i]
558
+ end
559
+
560
+ end
561
+
562
+ def sort_direction
563
+ if params["iSortCol_0"].blank?
564
+ params[:order]["0"]["dir"] == "desc" ? "desc" : "asc"
565
+ else
566
+ params["sSortDir_0"] == "desc" ? "desc" : "asc"
567
+ end
568
+
569
+ end
570
+ end
571
+ TEXT
572
+
490
573
  after_bundler do
491
574
  after_bundler do
492
575
  if @configs["bootstrap"] # if bootstrap configuration is true
@@ -501,6 +584,7 @@ after_bundler do
501
584
  "\n//= require dataTables/jquery.dataTables\n//= require dataTables/bootstrap/3/jquery.dataTables.bootstrap"
502
585
  end
503
586
  end
587
+ create_file "app/models/datatable.rb", datatable_model
504
588
  end
505
589
  end
506
590
 
@@ -527,6 +611,71 @@ after_bundler do
527
611
  inject_into_file "config/routes.rb", "\n root 'home#index'", :after => "devise_for :users"
528
612
  end
529
613
 
614
+ # >---------------------------[ Deployment ]----------------------------<
615
+
616
+ @current_recipe = "deployment"
617
+ @before_configs["deployment"].call if @before_configs["deployment"]
618
+ say_recipe 'Deployment'
619
+
620
+ config['deployment'] = multiple_choice("Which deployment method are you using?", [["Heroku", "heroku"], ["Capistrano", "capistrano"], ["Engine Yard", "engineyard"]])
621
+
622
+ unicorn_config =<<-TEXT
623
+ # config/unicorn.rb
624
+ worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3)
625
+ timeout 15
626
+ preload_app true
627
+
628
+ before_fork do |server, worker|
629
+ Signal.trap 'TERM' do
630
+ puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
631
+ Process.kill 'QUIT', Process.pid
632
+ end
633
+
634
+ defined?(ActiveRecord::Base) and
635
+ ActiveRecord::Base.connection.disconnect!
636
+ end
637
+
638
+ after_fork do |server, worker|
639
+ Signal.trap 'TERM' do
640
+ puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT'
641
+ end
642
+
643
+ defined?(ActiveRecord::Base) and
644
+ ActiveRecord::Base.establish_connection
645
+ end
646
+ TEXT
647
+
648
+ ey_config = <<-TEXT
649
+ ---
650
+ # This is all you need for a typical rails application.
651
+ defaults:
652
+ migrate: true
653
+ migration_command: rake db:migrate
654
+ precompile_assets: true
655
+ TEXT
656
+
657
+ case config['deployment']
658
+ when "heroku"
659
+ gem 'unicorn'
660
+ gem 'rails_12factor', group: :production
661
+
662
+ after_bundler do
663
+ create_file "config/unicorn.rb", unicorn_config
664
+ create_file "Procfile", "web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb"
665
+ end
666
+ when "capistrano"
667
+ gem 'capistrano', '~> 3.3.0'
668
+
669
+ after_bundler do
670
+ run "bundle exec cap install"
671
+ end
672
+
673
+ when "engineyard"
674
+ after_bundler do
675
+ create_file "config/ey.yml", ey_config
676
+ end
677
+ end
678
+
530
679
  # >----------------------------------[ Git ]----------------------------------<
531
680
 
532
681
  @current_recipe = "git"
@@ -1,3 +1,3 @@
1
1
  module RailsBaseline
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_baseline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoon Wai Yan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-02 00:00:00.000000000 Z
11
+ date: 2015-04-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Create baseline rails app with ease. Based on the normal practices by
14
14
  Cloud Coder team.