--- /dev/null
+---
+:position: before
+:position_in_additional_file_patterns: before
+:position_in_class: before
+:position_in_factory: before
+:position_in_fixture: before
+:position_in_routes: before
+:position_in_serializer: before
+:position_in_test: before
+:classified_sort: false
+:exclude_controllers: true
+:exclude_factories: true
+:exclude_fixtures: true
+:exclude_helpers: true
+:exclude_scaffolds: true
+:exclude_serializers: true
+:exclude_sti_subclasses: false
+:exclude_tests: true
+:force: false
+:format_markdown: false
+:format_rdoc: false
+:format_yard: false
+:frozen: false
+:ignore_model_sub_dir: false
+:ignore_unknown_models: false
+:include_version: false
+:show_check_constraints: false
+:show_complete_foreign_keys: false
+:show_foreign_keys: true
+:show_indexes: true
+:simple_indexes: false
+:sort: false
+:timestamp: false
+:trace: false
+:with_comment: true
+:with_column_comments: true
+:with_table_comments: true
+:active_admin: false
+:command:
+:debug: false
+:hide_default_column_types: ''
+:hide_limit_column_types: 'integer,bigint,boolean'
+:ignore_columns:
+:ignore_routes:
+:models: true
+:routes: false
+:skip_on_db_migrate: false
+:target_action: :do_annotations
+:wrapper:
+:wrapper_close:
+:wrapper_open:
+:classes_default_to_s: []
+:additional_file_patterns: []
+:model_dir:
+- app/models
+:require: []
+:root_dir:
+- ''
ruby-version: ${{ env.ruby }}
rubygems: 3.4.10
bundler-cache: true
+ - name: Configure rails
+ run: |
+ cp config/github.database.yml config/database.yml
+ cp config/example.storage.yml config/storage.yml
- name: Setup database
run: |
sudo systemctl start postgresql
sudo -u postgres createuser -s $(id -un)
createdb openstreetmap
- cp config/github.database.yml config/database.yml
bundle exec rails db:schema:load
- name: Run Annotate Models
- run: bundle exec rails annotate_models
+ run: bundle exec annotaterb models
- name: Fail if model annotations are out of date
run: git diff --exit-code
end
group :development, :test do
- gem "annotate"
+ gem "annotaterb"
gem "teaspoon"
gem "teaspoon-mocha", "~> 2.3.3"
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
- annotate (3.2.0)
- activerecord (>= 3.2, < 8.0)
- rake (>= 10.4, < 14.0)
+ annotaterb (4.14.0)
argon2 (2.3.2)
ffi (~> 1.15)
ffi-compiler (~> 1.0)
active_record_union
activerecord-import
addressable (~> 2.8)
- annotate
+ annotaterb
argon2
autoprefixer-rails
aws-sdk-s3
{
"name": "OpenStreetMap",
- "icons": [
- {
- "src": "<%= image_path("android-chrome-36x36.png").gsub("/", "\\/") %>",
- "sizes": "36x36",
- "type": "image\/png",
- "density": "0.75"
- },
- {
- "src": "<%= image_path("android-chrome-48x48.png").gsub("/", "\\/") %>",
- "sizes": "48x48",
- "type": "image\/png",
- "density": "1.0"
- },
- {
- "src": "<%= image_path("android-chrome-72x72.png").gsub("/", "\\/") %>",
- "sizes": "72x72",
- "type": "image\/png",
- "density": "1.5"
- },
- {
- "src": "<%= image_path("android-chrome-96x96.png").gsub("/", "\\/") %>",
- "sizes": "96x96",
- "type": "image\/png",
- "density": "2.0"
- },
- {
- "src": "<%= image_path("android-chrome-144x144.png").gsub("/", "\\/") %>",
- "sizes": "144x144",
- "type": "image\/png",
- "density": "3.0"
- },
- {
- "src": "<%= image_path("android-chrome-192x192.png").gsub("/", "\\/") %>",
- "sizes": "192x192",
- "type": "image\/png",
- "density": "4.0"
- }
- ],
+ "short_name": "OSM",
+ "icons": <%= [36, 48, 72, 96, 144, 192].map { |res| {
+ src: image_path("android-chrome-#{res}x#{res}.png"),
+ sizes: "#{res}x#{res}",
+ type: "image/png",
+ density: res.to_f / 48
+ } }.push({
+ src: image_path("../images/osm_logo.svg"),
+ sizes: "any",
+ type: "image/svg+xml"
+ }).to_json %>,
"start_url": "/",
+ "theme_color": "#7ebc6f",
+ "background_color": "#fff",
"display": "minimal-ui"
}
I18n.fallbacks = true;
window.onload = function () {
- const args = Object.fromEntries(new URLSearchParams(window.location.search));
+ const args = Object.fromEntries(new URLSearchParams(location.search));
const tileOptions = {
mapnik: {
};
function addObject(type, id, version, center) {
- const hashParams = OSM.parseHash(window.location.hash);
+ const hashParams = OSM.parseHash(location.hash);
map.addObject({ type: type, id: parseInt(id, 10), version: version && parseInt(version, 10) }, function (bounds) {
if (!hashParams.center && bounds.isValid() &&
(center || !map.getBounds().contains(bounds))) {
"/account/home": OSM.Home(map)
});
- if (OSM.preferred_editor === "remote" && document.location.pathname === "/edit") {
+ if (OSM.preferred_editor === "remote" && location.pathname === "/edit") {
remoteEditHandler(map.getBounds(), params.object);
OSM.router.setCurrentPath("/");
}
const changesetData = content.find("[data-changeset]").data("changeset");
changesetData.type = "changeset";
- const hashParams = OSM.parseHash(window.location.hash);
+ const hashParams = OSM.parseHash(location.hash);
initialize();
map.addObject(changesetData, function (bounds) {
if (!hashParams.center && bounds.isValid()) {
});
})
.then(() => {
- OSM.loadSidebarContent(window.location.pathname, page.load);
+ OSM.loadSidebarContent(location.pathname, page.load);
})
.catch(error => {
content.find("button[data-method][data-url]").prop("disabled", false);
map.fire("startinglocation", { latlng: [lat, lng] });
}
+ function startingLocationListener({ latlng }) {
+ if (endpoints[0].value) return;
+ endpoints[0].setValue(latlng.join(", "));
+ }
+
map.on("locationfound", ({ latlng: { lat, lng } }) =>
lastLocation = [lat, lng]
).on("locateactivate", () => {
- map.once("startinglocation", ({ latlng }) => {
- if (endpoints[0].value) return;
- endpoints[0].setValue(latlng.join(", "));
- });
+ map.once("startinglocation", startingLocationListener);
});
const page = {};
OSM.Directions.engines = [];
OSM.Directions.addEngine = function (engine, supportsHTTPS) {
- if (document.location.protocol === "http:" || supportsHTTPS) {
+ if (location.protocol === "http:" || supportsHTTPS) {
engine.id = engine.provider + "_" + engine.mode;
OSM.Directions.engines.push(engine);
}
function update() {
const data = new URLSearchParams();
- if (window.location.pathname === "/history") {
+ if (location.pathname === "/history") {
data.set("bbox", map.getBounds().wrap().toBBoxString());
const feedLink = $("link[type=\"application/atom+xml\"]"),
feedHref = feedLink.attr("href").split("?")[0];
data.set("list", "1");
- fetch(window.location.pathname + "?" + data)
+ fetch(location.pathname + "?" + data)
.then(response => response.text())
.then(function (html) {
displayFirstChangesets(html);
updateBounds();
- if (window.location.pathname !== "/history") {
+ if (location.pathname !== "/history") {
const bounds = group.getBounds();
if (bounds.isValid()) map.fitBounds(bounds);
}
page.load = function () {
map.addLayer(group);
- if (window.location.pathname === "/history") {
+ if (location.pathname === "/history") {
map.on("moveend", update);
}
const data = $(".details").data();
if (data) {
- const hashParams = OSM.parseHash(window.location.hash);
+ const hashParams = OSM.parseHash(location.hash);
map.addObject({
type: "note",
id: parseInt(id, 10),
const params = new URLSearchParams(path.substring(path.indexOf("?"))),
latlng = L.latLng(params.get("lat"), params.get("lon"));
- if (!window.location.hash && !noCentre && !map.getBounds().contains(latlng)) {
+ if (!location.hash && !noCentre && !map.getBounds().contains(latlng)) {
OSM.router.withoutMoveListener(function () {
map.setView(latlng, 15);
});
[params.mlat, params.mlon] = OSM.cropLocation(marker.getLatLng(), this.getZoom());
}
- let url = window.location.protocol + "//" + OSM.SERVER_URL + "/";
+ let url = location.protocol + "//" + OSM.SERVER_URL + "/";
const query = new URLSearchParams(params),
hash = OSM.formatHash(this);
// and drops the last 4 bits of the full 64 bit Morton code.
c1 = interlace(x >>> 17, y >>> 17),
c2 = interlace((x >>> 2) & 0x7fff, (y >>> 2) & 0x7fff);
- let str = window.location.protocol + "//" + window.location.hostname.replace(/^www\.openstreetmap\.org/i, "osm.org") + "/go/";
+ let str = location.protocol + "//" + location.hostname.replace(/^www\.openstreetmap\.org/i, "osm.org") + "/go/";
for (let i = 0; i < Math.ceil((zoom + 8) / 3.0) && i < 5; ++i) {
const digit = (c1 >> (24 - (6 * i))) & 0x3f;
.attr("class", "form-select w-auto")
.append($("<option>").val("png").text("PNG").prop("selected", true))
.append($("<option>").val("jpeg").text("JPEG"))
+ .append($("<option>").val("webp").text("WEBP"))
.append($("<option>").val("svg").text("SVG"))
.append($("<option>").val("pdf").text("PDF"))));
$(document).ready(function () {
// Preserve location hash in referer
- if (window.location.hash) {
- $("#referer").val($("#referer").val() + window.location.hash);
+ if (location.hash) {
+ $("#referer").val($("#referer").val() + location.hash);
}
});
if (OSM.MATOMO) {
$(document).ready(function () {
- const base = document.location.protocol + "//" + OSM.MATOMO.location + "/";
+ const base = location.protocol + "//" + OSM.MATOMO.location + "/";
let matomoTracker;
const matomoLoader = $.ajax({
},
params: function (search) {
- const query = search || window.location.search;
+ const query = search || location.search;
return Object.fromEntries(new URLSearchParams(query));
},
}
};
- let currentPath = window.location.pathname.replace(/(.)\/$/, "$1") + window.location.search,
+ let currentPath = location.pathname.replace(/(.)\/$/, "$1") + location.search,
currentRoute = routes.recognize(currentPath),
currentHash = location.hash || OSM.formatHash(map);
function updateSecondaryNav() {
$("header nav.secondary > ul > li > a").each(function () {
- const active = $(this).attr("href") === window.location.pathname;
+ const active = $(this).attr("href") === location.pathname;
$(this)
.toggleClass("text-secondary", !active)
$(window).on("popstate", function (e) {
if (!e.originalEvent.state) return; // Is it a real popstate event or just a hash change?
- const path = window.location.pathname + window.location.search,
+ const path = location.pathname + location.search,
route = routes.recognize(path);
if (path === currentPath) return;
currentRoute.run("unload", null, route === currentRoute);
};
router.stateChange = function (state) {
- const url = state.center ? OSM.formatHash(state) : window.location;
+ const url = state.center ? OSM.formatHash(state) : location;
window.history.replaceState(state, document.title, url);
};
}
function geoSuccess(position) {
- window.location = "/edit" + OSM.formatHash({
+ location = "/edit" + OSM.formatHash({
zoom: 17,
lat: position.coords.latitude,
lon: position.coords.longitude
}
function manualEdit() {
- window.location = "/?edit_help=1";
+ location = "/?edit_help=1";
}
});
#
# Table name: acls
#
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# address :inet
# k :string not null
# v :string
#
# Table name: changesets
#
-# id :bigint(8) not null, primary key
-# user_id :bigint(8) not null
+# id :bigint not null, primary key
+# user_id :bigint not null
# created_at :datetime not null
# min_lat :integer
# max_lat :integer
# Table name: changeset_comments
#
# id :integer not null, primary key
-# changeset_id :bigint(8) not null
-# author_id :bigint(8) not null
+# changeset_id :bigint not null
+# author_id :bigint not null
# body :text not null
# created_at :datetime not null
# visible :boolean not null
#
# Table name: changeset_tags
#
-# changeset_id :bigint(8) not null, primary key
+# changeset_id :bigint not null, primary key
# k :string default(""), not null, primary key
# v :string default(""), not null
#
#
# Table name: diary_comments
#
-# id :bigint(8) not null, primary key
-# diary_entry_id :bigint(8) not null
-# user_id :bigint(8) not null
+# id :bigint not null, primary key
+# diary_entry_id :bigint not null
+# user_id :bigint not null
# body :text not null
# created_at :datetime not null
# updated_at :datetime not null
#
# Table name: diary_entries
#
-# id :bigint(8) not null, primary key
-# user_id :bigint(8) not null
+# id :bigint not null, primary key
+# user_id :bigint not null
# title :string not null
# body :text not null
# created_at :datetime not null
#
# Table name: diary_entry_subscriptions
#
-# user_id :bigint(8) not null, primary key
-# diary_entry_id :bigint(8) not null, primary key
+# user_id :bigint not null, primary key
+# diary_entry_id :bigint not null, primary key
#
# Indexes
#
#
# Table name: friends
#
-# id :bigint(8) not null, primary key
-# user_id :bigint(8) not null
-# friend_user_id :bigint(8) not null
+# id :bigint not null, primary key
+# user_id :bigint not null
+# friend_user_id :bigint not null
# created_at :datetime
#
# Indexes
#
# Table name: messages
#
-# id :bigint(8) not null, primary key
-# from_user_id :bigint(8) not null
+# id :bigint not null, primary key
+# from_user_id :bigint not null
# title :string not null
# body :text not null
# sent_on :datetime not null
# message_read :boolean default(FALSE), not null
-# to_user_id :bigint(8) not null
+# to_user_id :bigint not null
# to_user_visible :boolean default(TRUE), not null
# from_user_visible :boolean default(TRUE), not null
# body_format :enum default("markdown"), not null
#
# Table name: current_nodes
#
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# latitude :integer not null
# longitude :integer not null
-# changeset_id :bigint(8) not null
+# changeset_id :bigint not null
# visible :boolean not null
# timestamp :datetime not null
-# tile :bigint(8) not null
-# version :bigint(8) not null
+# tile :bigint not null
+# version :bigint not null
#
# Indexes
#
#
# Table name: current_node_tags
#
-# node_id :bigint(8) not null, primary key
+# node_id :bigint not null, primary key
# k :string default(""), not null, primary key
# v :string default(""), not null
#
#
# Table name: notes
#
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# latitude :integer not null
# longitude :integer not null
-# tile :bigint(8) not null
+# tile :bigint not null
# updated_at :datetime not null
# created_at :datetime not null
# status :enum not null
# closed_at :datetime
# description :text default(""), not null
-# user_id :bigint(8)
+# user_id :bigint
# user_ip :inet
#
# Indexes
#
# Table name: note_comments
#
-# id :bigint(8) not null, primary key
-# note_id :bigint(8) not null
+# id :bigint not null, primary key
+# note_id :bigint not null
# visible :boolean not null
# created_at :datetime not null
# author_ip :inet
-# author_id :bigint(8)
+# author_id :bigint
# body :text
# event :enum
#
#
# Table name: note_subscriptions
#
-# user_id :bigint(8) not null, primary key
-# note_id :bigint(8) not null, primary key
+# user_id :bigint not null, primary key
+# note_id :bigint not null, primary key
#
# Indexes
#
#
# Table name: oauth_applications
#
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# owner_type :string not null
-# owner_id :bigint(8) not null
+# owner_id :bigint not null
# name :string not null
# uid :string not null
# secret :string not null
#
# Table name: nodes
#
-# node_id :bigint(8) not null, primary key
+# node_id :bigint not null, primary key
# latitude :integer not null
# longitude :integer not null
-# changeset_id :bigint(8) not null
+# changeset_id :bigint not null
# visible :boolean not null
# timestamp :datetime not null
-# tile :bigint(8) not null
-# version :bigint(8) not null, primary key
+# tile :bigint not null
+# version :bigint not null, primary key
# redaction_id :integer
#
# Indexes
#
# Table name: node_tags
#
-# node_id :bigint(8) not null, primary key
-# version :bigint(8) not null, primary key
+# node_id :bigint not null, primary key
+# version :bigint not null, primary key
# k :string default(""), not null, primary key
# v :string default(""), not null
#
# Foreign Keys
#
-# node_tags_id_fkey (["node_id", "version"] => nodes.["node_id", "version"])
+# node_tags_id_fkey ([node_id, version] => nodes[node_id, version])
#
class OldNodeTag < ApplicationRecord
#
# Table name: relations
#
-# relation_id :bigint(8) not null, primary key
-# changeset_id :bigint(8) not null
+# relation_id :bigint not null, primary key
+# changeset_id :bigint not null
# timestamp :datetime not null
-# version :bigint(8) not null, primary key
+# version :bigint not null, primary key
# visible :boolean default(TRUE), not null
# redaction_id :integer
#
#
# Table name: relation_members
#
-# relation_id :bigint(8) not null, primary key
+# relation_id :bigint not null, primary key
# member_type :enum not null
-# member_id :bigint(8) not null
+# member_id :bigint not null
# member_role :string not null
-# version :bigint(8) default(0), not null, primary key
+# version :bigint default(0), not null, primary key
# sequence_id :integer default(0), not null, primary key
#
# Indexes
#
# Foreign Keys
#
-# relation_members_id_fkey (["relation_id", "version"] => relations.["relation_id", "version"])
+# relation_members_id_fkey ([relation_id, version] => relations[relation_id, version])
#
class OldRelationMember < ApplicationRecord
#
# Table name: relation_tags
#
-# relation_id :bigint(8) not null, primary key
+# relation_id :bigint not null, primary key
# k :string default(""), not null, primary key
# v :string default(""), not null
-# version :bigint(8) not null, primary key
+# version :bigint not null, primary key
#
# Foreign Keys
#
-# relation_tags_id_fkey (["relation_id", "version"] => relations.["relation_id", "version"])
+# relation_tags_id_fkey ([relation_id, version] => relations[relation_id, version])
#
class OldRelationTag < ApplicationRecord
#
# Table name: ways
#
-# way_id :bigint(8) not null, primary key
-# changeset_id :bigint(8) not null
+# way_id :bigint not null, primary key
+# changeset_id :bigint not null
# timestamp :datetime not null
-# version :bigint(8) not null, primary key
+# version :bigint not null, primary key
# visible :boolean default(TRUE), not null
# redaction_id :integer
#
#
# Table name: way_nodes
#
-# way_id :bigint(8) not null, primary key
-# node_id :bigint(8) not null
-# version :bigint(8) not null, primary key
-# sequence_id :bigint(8) not null, primary key
+# way_id :bigint not null, primary key
+# node_id :bigint not null
+# version :bigint not null, primary key
+# sequence_id :bigint not null, primary key
#
# Indexes
#
#
# Foreign Keys
#
-# way_nodes_id_fkey (["way_id", "version"] => ways.["way_id", "version"])
+# way_nodes_id_fkey ([way_id, version] => ways[way_id, version])
#
class OldWayNode < ApplicationRecord
#
# Table name: way_tags
#
-# way_id :bigint(8) not null, primary key
+# way_id :bigint not null, primary key
# k :string not null, primary key
# v :string not null
-# version :bigint(8) not null, primary key
+# version :bigint not null, primary key
#
# Foreign Keys
#
-# way_tags_id_fkey (["way_id", "version"] => ways.["way_id", "version"])
+# way_tags_id_fkey ([way_id, version] => ways[way_id, version])
#
class OldWayTag < ApplicationRecord
# description :text not null
# created_at :datetime
# updated_at :datetime
-# user_id :bigint(8) not null
+# user_id :bigint not null
# description_format :enum default("markdown"), not null
#
# Foreign Keys
#
# Table name: current_relations
#
-# id :bigint(8) not null, primary key
-# changeset_id :bigint(8) not null
+# id :bigint not null, primary key
+# changeset_id :bigint not null
# timestamp :datetime not null
# visible :boolean not null
-# version :bigint(8) not null
+# version :bigint not null
#
# Indexes
#
#
# Table name: current_relation_members
#
-# relation_id :bigint(8) not null, primary key
+# relation_id :bigint not null, primary key
# member_type :enum not null
-# member_id :bigint(8) not null
+# member_id :bigint not null
# member_role :string not null
# sequence_id :integer default(0), not null, primary key
#
#
# Table name: current_relation_tags
#
-# relation_id :bigint(8) not null, primary key
+# relation_id :bigint not null, primary key
# k :string default(""), not null, primary key
# v :string default(""), not null
#
#
# Table name: gpx_files
#
-# id :bigint(8) not null, primary key
-# user_id :bigint(8) not null
+# id :bigint not null, primary key
+# user_id :bigint not null
# visible :boolean default(TRUE), not null
# name :string default(""), not null
-# size :bigint(8)
+# size :bigint
# latitude :float
# longitude :float
# timestamp :datetime not null
# trackid :integer not null
# latitude :integer not null
# longitude :integer not null
-# gpx_id :bigint(8) not null
+# gpx_id :bigint not null
# timestamp :datetime
-# tile :bigint(8)
+# tile :bigint
#
# Indexes
#
#
# Table name: gpx_file_tags
#
-# gpx_id :bigint(8) not null
+# gpx_id :bigint not null
# tag :string not null
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
#
# Indexes
#
# Table name: users
#
# email :string not null
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# pass_crypt :string not null
# creation_time :datetime not null
# display_name :string default(""), not null
# diary_entries_count :integer default(0), not null
# image_use_gravatar :boolean default(FALSE), not null
# auth_provider :string
-# home_tile :bigint(8)
+# home_tile :bigint
# tou_agreed :datetime
# diary_comments_count :integer default(0)
# note_comments_count :integer default(0)
# Table name: user_blocks
#
# id :integer not null, primary key
-# user_id :bigint(8) not null
-# creator_id :bigint(8) not null
+# user_id :bigint not null
+# creator_id :bigint not null
# reason :text not null
# ends_at :datetime not null
# needs_view :boolean default(FALSE), not null
-# revoker_id :bigint(8)
+# revoker_id :bigint
# created_at :datetime
# updated_at :datetime
# reason_format :enum default("markdown"), not null
#
# Table name: user_mutes
#
-# id :bigint(8) not null, primary key
-# owner_id :bigint(8) not null
-# subject_id :bigint(8) not null
+# id :bigint not null, primary key
+# owner_id :bigint not null
+# subject_id :bigint not null
# created_at :datetime not null
# updated_at :datetime not null
#
#
# Table name: user_preferences
#
-# user_id :bigint(8) not null, primary key
+# user_id :bigint not null, primary key
# k :string not null, primary key
# v :string not null
#
# Table name: user_roles
#
# id :integer not null, primary key
-# user_id :bigint(8) not null
-# role :enum not null
+# user_id :bigint not null
# created_at :datetime
# updated_at :datetime
-# granter_id :bigint(8) not null
+# role :enum not null
+# granter_id :bigint not null
#
# Indexes
#
#
# Table name: current_ways
#
-# id :bigint(8) not null, primary key
-# changeset_id :bigint(8) not null
+# id :bigint not null, primary key
+# changeset_id :bigint not null
# timestamp :datetime not null
# visible :boolean not null
-# version :bigint(8) not null
+# version :bigint not null
#
# Indexes
#
#
# Table name: current_way_nodes
#
-# way_id :bigint(8) not null, primary key
-# node_id :bigint(8) not null
-# sequence_id :bigint(8) not null, primary key
+# way_id :bigint not null, primary key
+# node_id :bigint not null
+# sequence_id :bigint not null, primary key
#
# Indexes
#
#
# Table name: current_way_tags
#
-# way_id :bigint(8) not null, primary key
+# way_id :bigint not null, primary key
# k :string default(""), not null, primary key
# v :string default(""), not null
#
<p><%= @text["section_3"] %></p>
<p><%= @text["active_defn_1"] %></p>
<p><%= @text["active_defn_2"] %></p>
- </ul>
</li>
<li>
<p><%= @text["section_4"] %></p>
--- /dev/null
+# This rake task was added by annotate_rb gem.
+
+# Can set `ANNOTATERB_SKIP_ON_DB_TASKS` to be anything to skip this
+if Rails.env.development? && ENV["ANNOTATERB_SKIP_ON_DB_TASKS"].nil?
+ require "annotate_rb"
+
+ AnnotateRb::Core.load_rake_tasks
+end
+++ /dev/null
-# NOTE: only doing this in development as some production environments (Heroku)
-# NOTE: are sensitive to local FS writes, and besides -- it's just not proper
-# NOTE: to have a dev-mode tool do its thing in production.
-if Rails.env.local?
- task :set_annotation_options => :environment do
- # You can override any of these by setting an environment variable of the
- # same name.
- Annotate.set_defaults(
- "routes" => "false",
- "position_in_routes" => "before",
- "position_in_class" => "before",
- "position_in_test" => "before",
- "position_in_fixture" => "before",
- "position_in_factory" => "before",
- "position_in_serializer" => "before",
- "show_foreign_keys" => "true",
- "show_indexes" => "true",
- "simple_indexes" => "false",
- "model_dir" => "app/models",
- "root_dir" => "",
- "include_version" => "false",
- "require" => "",
- "exclude_tests" => "true",
- "exclude_fixtures" => "true",
- "exclude_factories" => "true",
- "exclude_serializers" => "true",
- "exclude_scaffolds" => "true",
- "exclude_controllers" => "true",
- "exclude_helpers" => "true",
- "ignore_model_sub_dir" => "false",
- "ignore_columns" => nil,
- "ignore_routes" => nil,
- "ignore_unknown_models" => "false",
- "hide_limit_column_types" => "integer,boolean",
- "skip_on_db_migrate" => "false",
- "format_bare" => "true",
- "format_rdoc" => "false",
- "format_markdown" => "false",
- "sort" => "false",
- "force" => "false",
- "trace" => "false",
- "wrapper_open" => nil,
- "wrapper_close" => nil
- )
- end
-
- Annotate.load_tasks
-end
beforeEach(function () {
delete OSM.home;
delete OSM.location;
- document.location.hash = "";
+ location.hash = "";
document.cookie = "_osm_location=; expires=Thu, 01 Jan 1970 00:00:00 GMT";
// Test with another cookie set.
});
it("parses lat/lon/zoom from the hash", function () {
- document.location.hash = "#map=16/57.6247/-3.6845";
+ location.hash = "#map=16/57.6247/-3.6845";
const params = OSM.mapParams("?");
expect(params).to.have.property("lat", 57.6247);
expect(params).to.have.property("lon", -3.6845);
params = OSM.mapParams("?");
expect(params).to.have.property("layers", "C");
- document.location.hash = "#map=5/57.6247/-3.6845&layers=M";
+ location.hash = "#map=5/57.6247/-3.6845&layers=M";
params = OSM.mapParams("?");
expect(params).to.have.property("layers", "M");
});