Skip to content

Commit

Permalink
remove Crack gem usage
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebaker committed Nov 29, 2017
1 parent 58b1fe2 commit 811fedc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion Gemfile
Expand Up @@ -26,7 +26,6 @@ gem "system_timer", "~> 1.2.4", :platform => :ruby_18
gem "will_paginate", "2.3.14"
gem "geoip", "1.2.1"
gem "geokit", "1.5.0"
gem "crack", "0.1.4"
gem "friendly_id", "2.2.5"
gem "sax-machine", "0.0.14"
gem "i18n", "0.3.7"
Expand Down
5 changes: 3 additions & 2 deletions Gemfile.lock
Expand Up @@ -44,7 +44,6 @@ GEM
sass (~> 3.1)
compass-rails (1.0.3)
compass (>= 0.12.2, < 0.14)
crack (0.1.4)
cucumber (1.1.0)
builder (>= 2.1.2)
diff-lcs (>= 1.1.2)
Expand Down Expand Up @@ -188,7 +187,6 @@ DEPENDENCIES
aws-sdk (~> 1.5.0)
capybara (~> 1.1.2)
compass-rails (~> 1.0.3)
crack (= 0.1.4)
cucumber (= 1.1.0)
cucumber-rails2 (~> 0.3.2)
database_cleaner (= 0.5.0)
Expand Down Expand Up @@ -235,3 +233,6 @@ DEPENDENCIES
will_paginate (= 2.3.14)
xml-simple (= 1.0.12)
yfactorial-utility_scopes (= 0.2.2)

BUNDLED WITH
1.16.0
6 changes: 3 additions & 3 deletions app/controllers/prompts_controller.rb
Expand Up @@ -58,7 +58,7 @@ def skip
if skip = @prompt.post(:skip, :question_id => question_id,
:skip => get_object_request_options(params, :skip),
:next_prompt => get_next_prompt_options)
next_prompt = Crack::XML.parse(skip.body)['prompt']
next_prompt = Hash.from_xml(skip.body)['prompt']

result = {
:newleft => CGI::escapeHTML(truncate(next_prompt['left_choice_text'], :length => 140, :omission => '…')),
Expand Down Expand Up @@ -107,7 +107,7 @@ def flag
:visitor_identifier => @survey_session.session_id,
:explanation => reason)

new_choice = Crack::XML.parse(c.body)['choice']
new_choice = Hash.from_xml(c.body)['choice']
flag_choice_success = (c.code == "201" && new_choice['active'] == false)
IdeaMailer.delay.deliver_flag_notification(@earl, new_choice["id"], new_choice["data"], reason, @photocracy)

Expand All @@ -122,7 +122,7 @@ def flag
end

if flag_choice_success && skip
next_prompt = Crack::XML.parse(skip.body)['prompt']
next_prompt = Hash.from_xml(skip.body)['prompt']

result = {
:newleft => CGI::escapeHTML(truncate(next_prompt['left_choice_text'], :length => 140, :omission => '…')),
Expand Down
Binary file removed vendor/cache/crack-0.1.4.gem
Binary file not shown.

0 comments on commit 811fedc

Please sign in to comment.