Skip to content

Commit

Permalink
[api, webui] do not rely on multi_json or yajl, json will do for us
Browse files Browse the repository at this point in the history
  • Loading branch information
coolo committed May 13, 2013
1 parent f4395fb commit aff975d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/api/Gemfile
Expand Up @@ -14,7 +14,6 @@ gem 'nokogiri', '~>1.5.0'
gem 'delayed_job', '>3.0'
gem 'delayed_job_active_record'
gem 'hoptoad_notifier', "~> 2.3"
gem 'yajl-ruby'
gem 'rdoc'
gem 'xmlhash', '>=1.3.5'
gem 'fast_xs'
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/controllers/webui_controller.rb
@@ -1,4 +1,4 @@
require 'yajl'
require 'json/ext'

include SearchHelper

Expand Down Expand Up @@ -254,7 +254,7 @@ def all_projects
Project.connection.execute(projects.to_sql).each do |id, name, title|
ret[name] = {title: title, important: important[id] ? true : false}
end
render text: Yajl::Encoder.encode(ret), content_type: "application/json"
render text: JSON.fast_generate(ret), content_type: "application/json"
end

def owner
Expand Down
2 changes: 1 addition & 1 deletion src/webui/Gemfile
Expand Up @@ -48,7 +48,7 @@ gem 'nokogiri', '~>1.5.0'
gem 'delayed_job', '>3.0'
gem 'delayed_job_active_record'
gem 'hoptoad_notifier', "~> 2.3"
gem 'yajl-ruby'
gem 'json'
gem 'rdoc'
gem 'xmlhash', '>=1.3.2'
gem 'fast_xs'
Expand Down
4 changes: 2 additions & 2 deletions src/webui/app/models/api_details.rb
Expand Up @@ -24,7 +24,7 @@ def self.find(info, opts = {})
uri = transport.substitute_uri(uri, opts)
#transport.replace_server_if_needed(uri)
data = transport.http_do 'get', uri
data = ActiveSupport::JSON.decode(data)
data = JSON.parse(data)
logger.debug "data #{JSON.pretty_generate(data)}"
data
end
Expand All @@ -37,7 +37,7 @@ def self.command(info, opts)
rescue ActiveXML::Transport::Error => e
raise CommandFailed, e.summary
end
#data = ActiveSupport::JSON.decode(data)
#data = JSON.parse(data)
logger.debug "command #{data}"
data
end
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/models/bs_request.rb
Expand Up @@ -203,7 +203,7 @@ def prepare_list_path(path, opts)
def list_ids(opts)
path = prepare_list_path("/webui/request_list", opts)
data = ActiveXML::transport.direct_http(URI(path))
return ActiveSupport::JSON.decode(data)
return JSON.parse(data)
end

def list(opts)
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/layouts/application.html.erb
Expand Up @@ -85,7 +85,7 @@
<ul>
<li><%= link_to "Your Home", :controller => :home, :action => :index %></li>
<li><%= link_to "Home Project", :controller => 'project', :action => :show, :project => "home:#{@user}" %></li>
<li><%= link_to 'Logout', { :controller => 'user', :action => 'logout'} %></li>
<li><%= link_to 'Logout', { :controller => 'user', :action => 'logout'}, method: :post %></li>
</ul>
</div>
<% end -%>
Expand Down

0 comments on commit aff975d

Please sign in to comment.