Skip to content

Instantly share code, notes, and snippets.

View Keqi's full-sized avatar

Maciej Nowak Keqi

View GitHub Profile
Part of xml :
<grading>
<grade>3</grade>
<scale>5</scale>
<gradeDescription>moderate</gradeDescription>
</grading>
[1] pry(#<RSpec::Core::ExampleGroup::Nested_1::Nested_1>)> subject.grading
=> #<RowlfTours::WorldExpeditions::GradingWrapper:0x00000001ba8730
@entity={"grade"=>"5", "scale"=>"10", "gradeDescription"=>"Moderate level"},
postgres=# SELECT *FROM pg_shadow;
usename | usesysid | usecreatedb | usesuper | usecatupd | userepl | passwd | valuntil | useconfig
----------+----------+-------------+----------+-----------+---------+-------------------------------------+----------+-----------
postgres | 10 | t | t | t | t | md50b24c6ea6da80e959b1a6f4d79cea5d0 | |
rowlf | 16384 | f | f | f | f | md5f8bfe67e0de2146e78ae8ece30d67e49 | |
(2 rows)
master@ubuntu:~/Dokumenty/LonelyPlanet/rowlf/rowlf$ bundle exec rake db:setup:all
DEPRECATION WARNING: Yajl's Gzip support is going to be removed in 2.0
createuser: could not connect to database postgres: FATAL: role "master" is not permitted to log in
rake aborted!
psql: FATAL: Peer authentication failed for user "rowlf"
/home/master/Dokumenty/LonelyPlanet/rowlf/rowlf/lib/tasks/postgis.rb:23:in `block (3 levels) in <top (required)>'
Tasks: TOP => db:setup:all => db:postgis:setup
(See full trace by running task with --trace)
createuser: creation of new role failed: ERROR: role "rowlf" already exists
rake aborted!
psql: FATAL: Peer authentication failed for user "rowlf"
/home/master/Dokumenty/LonelyPlanet/rowlf/rowlf/lib/tasks/postgis.rb:23:in `block (3 levels) in <top (required)>'
Tasks: TOP => db:setup:all => db:postgis:setup
(See full trace by running task with --trace)
DEPRECATION WARNING: Yajl's Gzip support is going to be removed in 2.0
rake aborted!
psql: FATAL: Peer authentication failed for user "rowlf"
/home/master/Dokumenty/LonelyPlanet/rowlf/rowlf/lib/tasks/postgis.rb:23:in `block (3 levels) in <top (required)>'
Tasks: TOP => db:setup:all => db:postgis:setup
(See full trace by running task with --trace)
master@ubuntu:~/Dokumenty/LonelyPlanet/rowlf/rowlf$ grep -rl "atlas.lonelyplanet.com" "."
./lib/rowlf/atlas.rb
./spec/fixtures/vcr_cassettes/atlas_populate_shapes_command.yml
./spec/fixtures/vcr_cassettes/atlas_pages.yml
./spec/fixtures/vcr_cassettes/rowlf_commands_fetch_command_atlas.yml
./spec/fixtures/vcr_cassettes/atlas_place_fetch_command.yml
./spec/lib/rowlf/commands/atlas_populate_shapes_command_spec.rb
master@ubuntu:~/Dokumenty/LonelyPlanet/rowlf/rowlf$ grep -rl "atlas.devint.lpo" "."
master@ubuntu:~/Dokumenty/LonelyPlanet/rowlf/rowlf$
GIT
remote: git@github.com:lonelyplanet/rowlf-tours.git
revision: c44760e28a13ab83cdd1333ea6a9737259ce9c3e
specs:
rowlf_tours (0.0.1)
activesupport (~> 3.2.0)
confstruct
faraday
nokogiri
nori (= 2.0.3)
task :fetch do
FileUtils.mkdir_p('tmp/intrepid')
json = RowlfTours::Intrepid::Provider.new.render.to_json
File.open("tmp/intrepid/trips.json", 'w') {|f| f.write(json) }
end
namespace :update do
namespace :world_expeditions do
task :fetch do
monitor = Rowlf.monitor("world_expeditions")
monitor.start '.fetch.rake.task', 1 do |progress|
json_doc = JSON.pretty_generate(RowlfTours::WorldExpeditions::Provider.new.wrapper.render)
File.open("tmp/world_expeditions/trips.json", 'w') {|f| f.write(json_doc) }
end
end
All examples were filtered out; ignoring {:focus=>true}
1) RowlfTours::FileSystemFetcher#fetch saves data if cached file not exist
Failure/Error: subject.fetch(url)
NoMethodError:
undefined method `url' for {:uris=>[#<Addressable::URI:0x197f0a8 URI:http://api.com/1>]}:Hash
# ./lib/rowlf_tours/shared/fetchers/file_system_fetcher.rb:42:in `block in missing_files'
# ./lib/rowlf_tours/shared/fetchers/requests.rb:10:in `each'
# ./lib/rowlf_tours/shared/fetchers/requests.rb:10:in `each'
# ./lib/rowlf_tours/shared/fetchers/file_system_fetcher.rb:41:in `reject'
# ./lib/rowlf_tours/shared/fetchers/file_system_fetcher.rb:41:in `missing_files'