This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
price_xml.search('price_items/price_item').each_with_index do |item, inx| | |
row = [] | |
price_item_filters = {} | |
item.children.each do |item_attr| | |
case item_attr.name | |
when 'oem' | |
row[0] = item_attr.text.to_s.gsub(/[\r\n\t\;\"]/, '').upcase | |
row[1] = item_attr.text.to_s.to_oem | |
when 'make_name' | |
row[2] = item_attr.text.to_s.mb_chars.upcase.gsub(/[\r\n\t\;\"]/, '').strip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{ | |
"price_request_id": null, | |
"price_id": 319, | |
"oem": "S1K25", | |
"make_name": "Frixa", | |
"detail_name": "Колодки тормозные дисковые | перед |", | |
"cost": 5636.2, | |
"raw_cost": null, | |
"first_cost": null, | |
"min_qnt": 1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class ExcelBlank | |
{ | |
protected Application _excel_ap; | |
protected Workbook _excel_wb; | |
protected Worksheet _excel_ws_current; | |
public ExcelBlank() | |
{ | |
_excel_ap = new Application(); | |
_excel_ap.Visible = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'mechanize' | |
class TestApiClient | |
attr_accessor :agent, :host, :login, :password | |
def initialize(host, login, password) | |
self.agent, self.host, self.login, self.password = Mechanize.new, host, login, password | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
before_filter :set_locale | |
helper_method :current_user | |
private | |
def current_user_session | |
return @current_user_session if defined?(@current_user_session) && ! @current_user_session.blank? | |
@current_user_session = UserSession.find |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
before_filter :set_locale | |
helper_method :current_user | |
private | |
def current_user_session | |
return @current_user_session if defined?(@current_user_session) && ! @current_user_session.blank? | |
@current_user_session = UserSession.find |