Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fully externalize exporter; untested #530

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ group :dependencies do
gem "autoprefixer-rails"
gem "uglifier"

# switch to main version once ready:
gem "mapknitter-exporter", git: 'https://github.com/publiclab/mapknitter-exporter', glob: '*.gemspec'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [103/80]

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer single-quoted strings when you don't need string interpolation or special symbols.

end

group :test do
Expand Down
10 changes: 9 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
GIT
remote: https://github.com/publiclab/mapknitter-exporter
revision: e46886898d0c5b36863ce5a066b85c4c4a5cd0da
glob: *.gemspec
specs:
mapknitter-exporter (0.0.1)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -195,6 +202,7 @@ DEPENDENCIES
geokit-rails (= 1.1.4)
image_science (= 1.2.6)
jshintrb
mapknitter-exporter!
mysql2 (< 0.4)
oa-openid (= 0.3.2)
open_id_authentication
Expand All @@ -220,4 +228,4 @@ RUBY VERSION
ruby 2.4.6p354

BUNDLED WITH
1.17.1
1.17.3
6 changes: 3 additions & 3 deletions app/models/map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,14 @@ def run_export(user, resolution)
new_export = Export.new({
:map_id => id
})
end
Exporter.run_export(user,
end
MapKnitterExporter.run_export(
user.id,
resolution,
self.export || new_export,
self.id,
self.slug,
Rails.root.to_s,
self.average_scale,
self.placed_warpables,
key)
end
Expand Down
5 changes: 3 additions & 2 deletions app/models/warpable.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require "mapknitterExporter"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, @icarito i'm seeing File does not exist: mapknitterExporter from this. I copied the Sinatra app config... any ideas?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer single-quoted strings when you don't need string interpolation or special symbols.


class Warpable < ActiveRecord::Base
attr_accessible :image
attr_accessor :src, :srcmedium # for json generation
Expand Down Expand Up @@ -140,9 +142,8 @@ def url=(uri)
self.uploaded_data = io
end

# TODO: simplify/reduce # of parameters needed here:
def generate_perspectival_distort(pxperm, path)
Exporter.generate_perspectival_distort(pxperm, path, nodes_array, id, image_file_name, image, height, width)
MapKnitterExporter.generate_perspectival_distort(pxperm, path, nodes_array, image_file_name, image.url(:original), height, width, Rails.root)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [145/80]

end

def user_id
Expand Down
Loading