Skip to content

Commit

Permalink
Hamlit updated to v2.7.0
Browse files Browse the repository at this point in the history
The hamlit-rails is not maintained at all and we don't need the provided generators at all.
  • Loading branch information
skateman committed Sep 21, 2016
1 parent 5e87466 commit 2acf8d1
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 7 deletions.
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ gem "fog-vcloud-director", "~>0.1.6", :require => false
gem "gettext_i18n_rails", "~>1.7.2"
gem "gettext_i18n_rails_js", "~>1.1.0"
gem "google-api-client", "~>0.8.6", :require => false
gem "hamlit", "~>2.0.0", :require => false
gem "hamlit-rails", "~>0.1.0"
gem "hamlit", "~>2.7.0"
gem "hashie", ">=3.4.6", :require => false
gem "high_voltage", "~>2.4.0"
gem "htauth", "2.0.0", :require => false
Expand Down
2 changes: 1 addition & 1 deletion app/mailers/generic_mailer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'hamlit-rails'
require 'hamlit'
class GenericMailer < ActionMailer::Base
include Vmdb::Logging

Expand Down
2 changes: 0 additions & 2 deletions app/models/mixins/miq_web_server_worker_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ def preload_for_console
end

def preload_for_worker_role
require 'hamlit-rails'

# Make these constants globally available
::UiConstants

Expand Down
2 changes: 0 additions & 2 deletions spec/support/view_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require 'hamlit-rails'

module Spec
module Support
module ViewHelper
Expand Down
30 changes: 30 additions & 0 deletions spec/support/view_spec_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module ViewSpecHelper
def show_element(resp, id)
set_element_visibility(resp, id, true)
end

def hide_element(resp, id)
set_element_visibility(resp, id, false)
end

private

def set_element_visibility(resp, id, visible)
c = Capybara.string(resp)
node = c.find(id, :visible => :all)
node.native["style"] = node.native["style"].gsub(/display\s*:[^;]+/, "display:#{visible ? "show" : "none"}")
c.native.to_s
end

def set_controller_for_view(controller_name)
controller.request.path_parameters[:controller] = controller_name
end

def set_controller_for_view_to_be_restful
allow(controller).to receive(:restful?).and_return(true)
end

def set_controller_for_view_to_be_nonrestful
allow(controller).to receive(:restful?).and_return(false)
end
end

0 comments on commit 2acf8d1

Please sign in to comment.