mapbox-gl-rails 0.43.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'mapbox-gl/rails'
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'mapbox-gl/rails/version'
4
+ require 'mapbox-gl/rails/engine'
5
+
6
+ module MapboxGl
7
+ module Rails
8
+ end
9
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MapboxGl
4
+ module Rails
5
+ class Engine < ::Rails::Engine
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MapboxGl
4
+ module Rails
5
+ ##
6
+ # Mapbox GL JS & gem version.
7
+ def self.gem_version
8
+ Gem::Version.new VERSION::STRING
9
+ end
10
+
11
+ ##
12
+ # ProxyFetcher gem semantic versioning.
13
+ module VERSION
14
+ # Major version number
15
+ MAJOR = 0
16
+ # Minor version number
17
+ MINOR = 43
18
+ # Smallest version number
19
+ TINY = 0
20
+
21
+ # Full version number
22
+ STRING = [MAJOR, MINOR, TINY, '1'].compact.join('.')
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'thor'
4
+
5
+ class Updater < Thor
6
+ include Thor::Actions
7
+
8
+ # Base assets storage URL
9
+ BASE_URL = 'https://api.tiles.mapbox.com/mapbox-gl-js'.freeze
10
+
11
+ desc 'update assets', 'update assets from the MapBox S3 storage'
12
+ def update
13
+ self.destination_root = 'app/assets'
14
+
15
+ get File.join(BASE_URL, "v#{MapboxGl::Rails::VERSION::STRING}/mapbox-gl-dev.js"), 'javascripts/mapbox-gl.js'
16
+ get File.join(BASE_URL, "v#{MapboxGl::Rails::VERSION::STRING}/mapbox-gl.css"), 'stylesheets/mapbox-gl.css'
17
+
18
+ inside destination_root do
19
+ run('sass-convert -F css -T scss stylesheets/mapbox-gl.css stylesheets/mapbox-gl.scss')
20
+ end
21
+
22
+ remove_file 'stylesheets/mapbox-gl.css'
23
+ end
24
+ end
@@ -0,0 +1,27 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'lib'))
2
+ require File.expand_path('../lib/mapbox-gl/rails/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.date = '2018-01-19'
6
+ gem.authors = ['Nikita Bulai']
7
+ gem.email = ['bulajnikita@gmail.com']
8
+ gem.description = 'mapbox-gl-rails provides Mapbox GL JS sources and stylesheets as a ' \
9
+ 'Rails engine for use with the asset pipeline.'
10
+ gem.summary = 'an asset gemification of the Mapbox GL JS library'
11
+ gem.homepage = 'https://github.com/nbulaj/mapbox-gl-rails'
12
+ gem.license = 'MIT'
13
+
14
+ gem.files = `git ls-files`.split("\n").reject { |f| f =~ /^gemfiles|^\..+/ }
15
+ gem.test_files = `git ls-files -- test/*`.split("\n")
16
+ gem.name = 'mapbox-gl-rails'
17
+ gem.require_paths = ['lib']
18
+ gem.version = MapboxGl::Rails.gem_version
19
+
20
+ gem.add_dependency 'railties', '>= 3.2', '< 5.3'
21
+
22
+ gem.add_development_dependency 'activesupport'
23
+ gem.add_development_dependency 'sass-rails'
24
+ gem.add_development_dependency 'thor'
25
+
26
+ gem.required_ruby_version = '>= 1.9.3'
27
+ end
@@ -0,0 +1,2 @@
1
+ /log
2
+ /tmp
@@ -0,0 +1 @@
1
+ @import 'mapbox-gl';
@@ -0,0 +1,3 @@
1
+ /*
2
+ *= require mapbox-gl
3
+ */
@@ -0,0 +1,2 @@
1
+ class PagesController < ActionController::Base
2
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
@@ -0,0 +1,19 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ # require 'rails/all'
4
+ require 'sprockets/railtie'
5
+
6
+ Bundler.require(:default, :development)
7
+
8
+ module Dummy
9
+ class Application < Rails::Application
10
+ config.encoding = 'utf-8'
11
+ config.assets.enabled = true
12
+ config.assets.version = '1.0'
13
+
14
+ # replacement for environments/*.rb
15
+ config.active_support.deprecation = :stderr
16
+ config.eager_load = false
17
+ config.active_support.test_order = :random rescue nil
18
+ end
19
+ end
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = 'deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef'
8
+ Dummy::Application.config.secret_key_base = 'deadbeef' if Dummy::Application.config.respond_to?(:secret_key_base)
@@ -0,0 +1,3 @@
1
+ Dummy::Application.routes.draw do
2
+ root to: 'pages#index'
3
+ end
@@ -0,0 +1,50 @@
1
+ require 'test_helper'
2
+
3
+ class MapboxRailsTest < ActionDispatch::IntegrationTest
4
+ teardown { clean_sprockets_cache }
5
+
6
+ test 'engine is loaded' do
7
+ assert_equal ::Rails::Engine, MapboxGL::Rails::Engine.superclass
8
+ end
9
+
10
+ test 'javascript are served' do
11
+ get '/assets/mapbox-gl.js'
12
+ assert_mapbox_gl_js(response)
13
+ end
14
+
15
+ test 'stylesheets are served' do
16
+ get '/assets/mapbox-gl.css'
17
+ assert_mapbox_gl_css(response)
18
+ end
19
+
20
+ test 'stylesheet is available in a css sprockets require' do
21
+ get '/assets/sprockets-require.css'
22
+ assert_mapbox_gl_css(response)
23
+ end
24
+
25
+ test 'stylesheet is available in a sass import' do
26
+ get '/assets/sass-import.css'
27
+ assert_mapbox_gl_css(response)
28
+ end
29
+
30
+ test 'stylesheet is available in a scss import' do
31
+ get '/assets/scss-import.css'
32
+ assert_mapbox_gl_css(response)
33
+ end
34
+
35
+ private
36
+
37
+ def clean_sprockets_cache
38
+ FileUtils.rm_rf File.expand_path('../dummy/tmp', __FILE__)
39
+ end
40
+
41
+ def assert_mapbox_gl_css(response)
42
+ assert_response :success
43
+ assert_match(/mapboxgl-map/, response.body)
44
+ end
45
+
46
+ def assert_mapbox_gl_js(response)
47
+ assert_response :success
48
+ assert_match(/window\.mapboxgl/, response.body)
49
+ end
50
+ end
@@ -0,0 +1,5 @@
1
+ # Configure Rails Environment
2
+ ENV['RAILS_ENV'] = 'test'
3
+
4
+ require File.expand_path('../dummy/config/environment.rb', __FILE__)
5
+ require 'rails/test_help'
metadata ADDED
@@ -0,0 +1,147 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mapbox-gl-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.43.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Nikita Bulai
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-01-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: railties
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '3.2'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '5.3'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '3.2'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '5.3'
33
+ - !ruby/object:Gem::Dependency
34
+ name: activesupport
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: sass-rails
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: thor
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ description: mapbox-gl-rails provides Mapbox GL JS sources and stylesheets as a Rails
76
+ engine for use with the asset pipeline.
77
+ email:
78
+ - bulajnikita@gmail.com
79
+ executables: []
80
+ extensions: []
81
+ extra_rdoc_files: []
82
+ files:
83
+ - Gemfile
84
+ - LICENSE
85
+ - README.md
86
+ - Rakefile
87
+ - app/assets/javascripts/mapbox-gl.js
88
+ - app/assets/stylesheets/mapbox-gl.scss
89
+ - lib/mapbox-gl-rails.rb
90
+ - lib/mapbox-gl/rails.rb
91
+ - lib/mapbox-gl/rails/engine.rb
92
+ - lib/mapbox-gl/rails/version.rb
93
+ - lib/mapbox-gl/updater.rb
94
+ - mapbox-gl-rails.gemspec
95
+ - test/dummy/.gitignore
96
+ - test/dummy/app/assets/stylesheets/sass-import.css.sass
97
+ - test/dummy/app/assets/stylesheets/scss-import.css.scss
98
+ - test/dummy/app/assets/stylesheets/sprockets-require.css
99
+ - test/dummy/app/controllers/pages_controller.rb
100
+ - test/dummy/app/views/pages/index.html.erb
101
+ - test/dummy/config.ru
102
+ - test/dummy/config/application.rb
103
+ - test/dummy/config/boot.rb
104
+ - test/dummy/config/environment.rb
105
+ - test/dummy/config/initializers/secret_token.rb
106
+ - test/dummy/config/routes.rb
107
+ - test/mapbox-gl-rails_test.rb
108
+ - test/test_helper.rb
109
+ homepage: https://github.com/nbulaj/mapbox-gl-rails
110
+ licenses:
111
+ - MIT
112
+ metadata: {}
113
+ post_install_message:
114
+ rdoc_options: []
115
+ require_paths:
116
+ - lib
117
+ required_ruby_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ version: 1.9.3
122
+ required_rubygems_version: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
127
+ requirements: []
128
+ rubyforge_project:
129
+ rubygems_version: 2.6.11
130
+ signing_key:
131
+ specification_version: 4
132
+ summary: an asset gemification of the Mapbox GL JS library
133
+ test_files:
134
+ - test/dummy/.gitignore
135
+ - test/dummy/app/assets/stylesheets/sass-import.css.sass
136
+ - test/dummy/app/assets/stylesheets/scss-import.css.scss
137
+ - test/dummy/app/assets/stylesheets/sprockets-require.css
138
+ - test/dummy/app/controllers/pages_controller.rb
139
+ - test/dummy/app/views/pages/index.html.erb
140
+ - test/dummy/config.ru
141
+ - test/dummy/config/application.rb
142
+ - test/dummy/config/boot.rb
143
+ - test/dummy/config/environment.rb
144
+ - test/dummy/config/initializers/secret_token.rb
145
+ - test/dummy/config/routes.rb
146
+ - test/mapbox-gl-rails_test.rb
147
+ - test/test_helper.rb