maplibre-gl-rails 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ce659c9acebabab6c64041e6dff5850208ca4fd7e76cb1ccbdf0155c4c3f19b9
4
+ data.tar.gz: 994c25483846a55da00dbd0f39c33c89acb478acad15b7579c845d94d8188c74
5
+ SHA512:
6
+ metadata.gz: 1f22f2f122e46829e2f65009fea1af08ddfb817085b51ed7cc77c5f07daa4c976dadc63ff7c322f2f60c99b1e467d747812090343fb201dcf6dc84f766f7305c
7
+ data.tar.gz: 8e8a728a34b2fc5922333e685cd803a44c4cc739a596c2a39e31a48d3aa62574350b5799e74d8fbcb17bdd1ea2b07e22cc192bddf4c3fb7d41839eff1b85fac9
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ group :development,:test do
4
+ gem 'pry'
5
+ end
6
+
7
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,53 @@
1
+ Copyright (c) 2020, MapLibre contributors
2
+
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without modification,
6
+ are permitted provided that the following conditions are met:
7
+
8
+ * Redistributions of source code must retain the above copyright notice,
9
+ this list of conditions and the following disclaimer.
10
+ * Redistributions in binary form must reproduce the above copyright notice,
11
+ this list of conditions and the following disclaimer in the documentation
12
+ and/or other materials provided with the distribution.
13
+ * Neither the name of MapLibre GL JS nor the names of its contributors
14
+ may be used to endorse or promote products derived from this software
15
+ without specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
21
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+
29
+ -------------------------------------------------------------------------------
30
+
31
+ Contains code from mapbox-gl-rails (https://github.com/nbulaj/mapbox-gl-rails)
32
+
33
+ MIT License
34
+
35
+ Copyright (c) 2018 Nikita Bulai
36
+
37
+ Permission is hereby granted, free of charge, to any person obtaining a copy
38
+ of this software and associated documentation files (the "Software"), to deal
39
+ in the Software without restriction, including without limitation the rights
40
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
41
+ copies of the Software, and to permit persons to whom the Software is
42
+ furnished to do so, subject to the following conditions:
43
+
44
+ The above copyright notice and this permission notice shall be included in all
45
+ copies or substantial portions of the Software.
46
+
47
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
48
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
49
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
50
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
51
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
52
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
53
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,130 @@
1
+ # MapLibre for Rails
2
+
3
+ [![License](http://img.shields.io/badge/license-MIT-brightgreen.svg)](#license)
4
+
5
+ `maplibre-gl-rails` provides the [Maplibre GL JS](https://github.com/maplibre/maplibre-gl-js) library as a Rails engine for
6
+ use with the asset pipeline. It uses the same versioning as the Maplibre GL JS.
7
+
8
+ Supports Rails >= 3.2 (see [Travis build matrix]((.travis.yml))).
9
+
10
+ ## Installation
11
+
12
+ Add this to your Gemfile:
13
+
14
+ ```ruby
15
+ gem 'maplibre-gl-rails'
16
+ ```
17
+
18
+ and run `bundle install`.
19
+
20
+ ## Usage
21
+
22
+ In your `application.js`, include the following:
23
+
24
+ ```js
25
+ //
26
+ //*= require maplibre-gl
27
+ //= require_tree .
28
+ ```
29
+
30
+ In your `application.css`, include the css file:
31
+
32
+ ```css
33
+ /*
34
+ *= require maplibre-gl
35
+ */
36
+ ```
37
+
38
+ Then restart your webserver if it was previously running.
39
+
40
+ Congrats! You now have Maplibre GL JS on board and check out the
41
+ [Maplibre Examples](https://maplibre.org/maplibre-gl-js-docs/example/).
42
+ ### Sass Support
43
+
44
+ If you prefer [SCSS](http://sass-lang.com/documentation/file.SASS_REFERENCE.html), add this to your
45
+ `application.css.scss` file:
46
+
47
+ ```scss
48
+ @import 'maplibre-gl';
49
+ ```
50
+
51
+ If you use the [Sass indented syntax](http://sass-lang.com/docs/yardoc/file.INDENTED_SYNTAX.html),
52
+ add this to your `application.css.sass` file:
53
+
54
+ ```sass
55
+ @import maplibre-gl
56
+ ```
57
+
58
+ ## Misc
59
+
60
+ ### Rails engines
61
+
62
+ When building a Rails engine that includes maplibre-gl-rails as a dependency,
63
+ be sure to `require "maplibre-gl-rails"` somewhere during the intialization of
64
+ your engine. Otherwise, Rails will not automatically pick up the load path of
65
+ the maplibre-gl-rails assets and helpers.
66
+
67
+ ### Deploying to sub-folders
68
+
69
+ It is sometimes the case that deploying a Rails application to a production
70
+ environment requires the application to be hosted at a sub-folder on the server.
71
+ This may be the case, for example, if Apache HTTPD or Nginx is being used as a
72
+ front-end proxy server, with Rails handling only requests that come in to a sub-folder
73
+ such as `http://example.com/myrailsapp`. In this case, the
74
+ MaplibreRails gem (and other asset-serving engines) needs to know the sub-folder,
75
+ otherwise you can experience a problem roughly described as ["my app works
76
+ fine in development, but fails when I deploy
77
+ it"](https://github.com/bokmann/font-awesome-rails/issues/74).
78
+
79
+ To fix this, set the *relative URL root* for the application. In the
80
+ environment file for the deployed version of the app, for example
81
+ `config/environments/production.rb`,
82
+ set the config option `action_controller.relative_url_root`:
83
+
84
+ MyApp::Application.configure do
85
+ ...
86
+
87
+ # set the relative root, because we're deploying to /myrailsapp
88
+ config.action_controller.relative_url_root = "/myrailsapp"
89
+
90
+ ...
91
+ end
92
+
93
+ The default value of this variable is taken from `ENV['RAILS_RELATIVE_URL_ROOT']`,
94
+ so configuring the environment to define `RAILS_RELATIVE_URL_ROOT` is an alternative strategy.
95
+
96
+ In addition you need to indicate the subfolder when you *precompile* the assets:
97
+
98
+ RAILS_ENV=production bundle exec rake assets:precompile RAILS_RELATIVE_URL_ROOT=/myrailsapp
99
+
100
+ ### Rails 3.2
101
+
102
+ **Note:** In Rails 3.2, make sure maplibre-gl-rails is outside the bundler asset group
103
+ so that these helpers are automatically loaded in production environments.
104
+
105
+ ## Versioning
106
+
107
+ Versioning follows the core releases of Maplibre GL JS which follows Semantic
108
+ Versioning 2.0 as defined at <http://semver.org>. We will do our best not to
109
+ make any breaking changes until Maplibre core makes a major version bump.
110
+
111
+ Additional build number can be added to fix internal gem errors (like 0.43.0.**0**).
112
+
113
+ ## Releasing
114
+
115
+ 1. Update gem version in `lib/maplibre-gl/rails/version.rb` to match latest Maplibre GL version.
116
+ 2. Run `bundle exec rake update` (this will automatically load and convert assets).
117
+ 3. Commit
118
+ 4. Create gem and push it to Rubygems
119
+ 5. Create a GitHub release.
120
+
121
+ ## License
122
+
123
+ * The [Maplibre GL JS](https://github.com/maplibre/maplibre-gl-js) and it's components are
124
+ licensed under [their own licenses](https://github.com/maplibre/maplibre-gl-js/blob/master/LICENSE.txt).
125
+ * This gem is a fork of the [mapbox-gl-rails](https://github.com/nbulaj/mapbox-gl-rails) project which is licensed under the
126
+ [MIT License](http://opensource.org/licenses/mit-license.html).
127
+
128
+ ## Acknowledgment
129
+
130
+ This template is based on Nikita Bulai's [Mapbox GL Rails gem](https://github.com/nbulaj/mapbox-gl-rails/blob/master/mapbox-gl-rails.gemspec), which works great with maps designed in Mapbox's Studio tool but requires a Mapbox access token.
data/Rakefile ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env rake
2
+ require 'bundler/gem_tasks'
3
+ require 'rake/testtask'
4
+ require File.expand_path('../lib/maplibre-gl/updater', __FILE__)
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << 'lib'
8
+ t.libs << 'test'
9
+ t.pattern = 'test/**/*_test.rb'
10
+ t.verbose = false
11
+ end
12
+
13
+ desc 'Update MapLibre GL JS assets and plugins'
14
+ task 'update-maplibre' do
15
+ Updater.new.update
16
+ end
17
+
18
+ task update: 'update-maplibre'
19
+
20
+ task default: :test