diff --git a/.haml-lint.yml b/.haml-lint.yml new file mode 100644 index 0000000..14d209f --- /dev/null +++ b/.haml-lint.yml @@ -0,0 +1,3 @@ +linters: + LineLength: + max: 95 diff --git a/Gemfile b/Gemfile index 7597d1c..b1aa8a0 100644 --- a/Gemfile +++ b/Gemfile @@ -2,41 +2,43 @@ source 'https://rubygems.org' ruby "2.2.2" gem 'figaro', '~> 1.1.1' -gem 'rails', '~> 4.2.4' -gem 'thin', '~> 1.6.3' -gem 'responders', '~> 2.1.0' -gem 'mysql2', '~> 0.3.20' gem 'bcrypt', '~> 3.1.7' -# gem 'rack-protection', '~> 1.5.3' -gem 'sass-rails', '~> 5.0' -gem 'uglifier', '>= 1.3.0' -gem 'jquery-rails' +gem 'thin', '~> 1.6.3' +gem 'rails', '~> 4.2.4' gem 'turbolinks' -gem 'haml-rails', "~> 0.9" -gem 'actionview-encoded_mail_to' -# gem 'rabl-rails', '~> 0.4.1' -# gem 'jbuilder', '~> 2.0' +gem 'actionview-encoded_mail_to' +gem 'haml-rails', "~> 0.9" +gem 'jquery-rails' gem 'json', '~> 1.8.3' +gem 'mysql2', '~> 0.3.20' +gem 'responders', '~> 2.1.0' +gem 'sass-rails', '~> 5.0' gem 'twilio-ruby', '~> 4.3.0' +gem 'uglifier', '>= 1.3.0' # gem 'sorcery' # gem 'faraday' # gem 'faraday_middleware' +# gem 'rack-protection', '~> 1.5.3' +# gem 'rabl-rails', '~> 0.4.1' +# gem 'jbuilder', '~> 2.0' group :development, :test do - gem 'web-console', '~> 2.0' - gem 'spring' gem 'awesome_print' - gem 'pry-rails' - gem 'pry-byebug' gem 'binding_of_caller' - gem 'rubocop' - gem 'rack-livereload' - gem 'minitest-reporters' gem 'guard' + gem 'guard-livereload' + gem 'guard-minitest' gem 'guard-rubocop' gem 'guard-scss-lint' - gem 'guard-minitest' - gem 'guard-livereload' + gem 'guard-shell' + gem 'haml_lint' + gem 'minitest-reporters' + gem 'pry-byebug' + gem 'pry-rails' + gem 'rack-livereload' + gem 'rubocop' + gem 'spring' + gem 'web-console', '~> 2.0' end diff --git a/Gemfile.lock b/Gemfile.lock index 92e8a04..ca687ea 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -96,6 +96,9 @@ GEM guard-scss-lint (0.0.1alpha) guard (~> 2.0) scss-lint (~> 0.30.0) + guard-shell (0.7.1) + guard (>= 2.0.0) + guard-compat (~> 1.0) haml (4.0.6) tilt haml-rails (0.9.0) @@ -104,6 +107,10 @@ GEM haml (>= 4.0.6, < 5.0) html2haml (>= 1.0.1) railties (>= 4.0.1) + haml_lint (0.15.2) + haml (~> 4.0) + rubocop (>= 0.25.0) + sysexits (~> 1.1) html2haml (2.0.0) erubis (~> 2.7.0) haml (~> 4.0.0) @@ -219,6 +226,7 @@ GEM actionpack (>= 3.0) activesupport (>= 3.0) sprockets (>= 2.8, < 4.0) + sysexits (1.2.0) thin (1.6.3) daemons (~> 1.0, >= 1.0.9) eventmachine (~> 1.0) @@ -257,7 +265,9 @@ DEPENDENCIES guard-minitest guard-rubocop guard-scss-lint + guard-shell haml-rails (~> 0.9) + haml_lint jquery-rails json (~> 1.8.3) minitest-reporters diff --git a/Guardfile b/Guardfile index ba82655..ea66ca1 100644 --- a/Guardfile +++ b/Guardfile @@ -15,12 +15,6 @@ # # and, you'll have to watch "config/Guardfile" instead of "Guardfile" -guard :rubocop do - watch(/.+\.rb$/) - watch(/Rakefile/) - watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) } -end - guard :minitest do watch(%r{^test/test_helper\.rb$}) { 'test' } watch(%r{^test/(.*)\/?(.*)_test\.rb$}) @@ -42,6 +36,16 @@ guard 'livereload' do end end +guard :rubocop do + watch(/.+\.rb$/) + watch(/Rakefile/) + watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) } +end + guard :scsslint do watch(%r{app/assets/.+\.(scss)}) end + +guard :shell do + watch(%r{app/views/.*\.haml}) { |m| `haml-lint --color #{m[0]}` } +end diff --git a/app/views/docs/index.html.haml b/app/views/docs/index.html.haml index 05fb133..8052372 100644 --- a/app/views/docs/index.html.haml +++ b/app/views/docs/index.html.haml @@ -1,4 +1,4 @@ %h2 Something helpful later -%p= raw( ap @doc ) +%p= raw(ap @doc) diff --git a/app/views/layouts/_alerts.html.haml b/app/views/layouts/_alerts.html.haml index 3c38ec9..a3317a6 100644 --- a/app/views/layouts/_alerts.html.haml +++ b/app/views/layouts/_alerts.html.haml @@ -1,10 +1,10 @@ - unless flash.empty? - if flash[:notice].present? - .alertbox.box-blue{'data-id' => 'alertbox', 'data-alert' => 'auto_close'} - .box-close{'data-id'=> 'alert_close'} + .alertbox.box-blue{ 'data-id' => 'alertbox', 'data-alert' => 'auto_close' } + .box-close{ 'data-id' => 'alert_close' } = flash[:notice] - if flash[:alert].present? - .alertbox.box-red{'data-id' => 'alertbox'} - .box-close{'data-id'=> 'alert_close'} + .alertbox.box-red{ 'data-id' => 'alertbox' } + .box-close{ 'data-id' => 'alert_close' } %b= flash[:alert] diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 51f68df..048738d 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -1,9 +1,9 @@ !!! %html %head - %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/ + %meta{ content: "text/html; charset=UTF-8", "http-equiv" => "Content-Type" }/ %title SmsPager - = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true + = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true = javascript_include_tag 'application', 'data-turbolinks-track' => true = csrf_meta_tags = yield :custom_head diff --git a/app/views/pages/page.html.haml b/app/views/pages/page.html.haml index dcd241e..4a820b9 100644 --- a/app/views/pages/page.html.haml +++ b/app/views/pages/page.html.haml @@ -1,6 +1,8 @@ = form_for :page, url: send_page_path do |f| = f.label :person_id - = f.select :person_id, options_from_collection_for_select(@people, :id, :name, @page.person_id), include_blank: true + :ruby + options = options_from_collection_for_select(@people, :id, :name, @page.person_id) + = f.select :person_id, options, include_blank: true = f.label :to = f.phone_field :to diff --git a/app/views/parents/show.html.haml b/app/views/parents/show.html.haml index 47f066f..38cddfd 100644 --- a/app/views/parents/show.html.haml +++ b/app/views/parents/show.html.haml @@ -9,7 +9,7 @@ - @parent.children.each do |child| %li = child.name - = link_to 'remove', del_parenthood_path(@parent, child), {method: :delete} + = link_to 'remove', del_parenthood_path(@parent, child), method: :delete %p Add Child: :ruby