gmap-fontawesome 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +18 -0
  3. data/.ruby-gemset +1 -0
  4. data/.ruby-version +1 -0
  5. data/.versions.conf +4 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE.txt +22 -0
  8. data/README.md +49 -0
  9. data/Rakefile +1 -0
  10. data/gmap-fontawesome.gemspec +25 -0
  11. data/lib/gmap/fontawesome.rb +8 -0
  12. data/lib/gmap/fontawesome/version.rb +6 -0
  13. data/lib/tasks/.keep +0 -0
  14. data/lib/tasks/gmap_awesome.rake +99 -0
  15. data/spec/Dummy/.gitignore +16 -0
  16. data/spec/Dummy/Gemfile +42 -0
  17. data/spec/Dummy/README.rdoc +28 -0
  18. data/spec/Dummy/Rakefile +6 -0
  19. data/spec/Dummy/app/assets/images/.keep +0 -0
  20. data/spec/Dummy/app/assets/javascripts/application.js +17 -0
  21. data/spec/Dummy/app/assets/javascripts/welcome.js +31 -0
  22. data/spec/Dummy/app/assets/stylesheets/application.css +15 -0
  23. data/spec/Dummy/app/assets/stylesheets/welcome.css.scss +9 -0
  24. data/spec/Dummy/app/controllers/application_controller.rb +5 -0
  25. data/spec/Dummy/app/controllers/concerns/.keep +0 -0
  26. data/spec/Dummy/app/controllers/welcome_controller.rb +9 -0
  27. data/spec/Dummy/app/helpers/application_helper.rb +2 -0
  28. data/spec/Dummy/app/helpers/welcome_helper.rb +2 -0
  29. data/spec/Dummy/app/mailers/.keep +0 -0
  30. data/spec/Dummy/app/models/.keep +0 -0
  31. data/spec/Dummy/app/models/concerns/.keep +0 -0
  32. data/spec/Dummy/app/views/layouts/application.html.erb +16 -0
  33. data/spec/Dummy/app/views/welcome/index.html.erb +5 -0
  34. data/spec/Dummy/bin/bundle +3 -0
  35. data/spec/Dummy/bin/rails +8 -0
  36. data/spec/Dummy/bin/rake +8 -0
  37. data/spec/Dummy/bin/spring +18 -0
  38. data/spec/Dummy/config.ru +4 -0
  39. data/spec/Dummy/config/application.rb +23 -0
  40. data/spec/Dummy/config/boot.rb +4 -0
  41. data/spec/Dummy/config/database.yml +25 -0
  42. data/spec/Dummy/config/environment.rb +5 -0
  43. data/spec/Dummy/config/environments/development.rb +37 -0
  44. data/spec/Dummy/config/environments/production.rb +83 -0
  45. data/spec/Dummy/config/environments/test.rb +39 -0
  46. data/spec/Dummy/config/initializers/backtrace_silencers.rb +7 -0
  47. data/spec/Dummy/config/initializers/cookies_serializer.rb +3 -0
  48. data/spec/Dummy/config/initializers/filter_parameter_logging.rb +4 -0
  49. data/spec/Dummy/config/initializers/inflections.rb +16 -0
  50. data/spec/Dummy/config/initializers/mime_types.rb +4 -0
  51. data/spec/Dummy/config/initializers/session_store.rb +3 -0
  52. data/spec/Dummy/config/initializers/wrap_parameters.rb +14 -0
  53. data/spec/Dummy/config/locales/en.yml +23 -0
  54. data/spec/Dummy/config/routes.rb +56 -0
  55. data/spec/Dummy/config/secrets.yml +22 -0
  56. data/spec/Dummy/db/seeds.rb +7 -0
  57. data/spec/Dummy/lib/assets/.keep +0 -0
  58. data/spec/Dummy/lib/tasks/.keep +0 -0
  59. data/spec/Dummy/log/.keep +0 -0
  60. data/spec/Dummy/public/404.html +67 -0
  61. data/spec/Dummy/public/422.html +67 -0
  62. data/spec/Dummy/public/500.html +66 -0
  63. data/spec/Dummy/public/favicon.ico +0 -0
  64. data/spec/Dummy/public/robots.txt +5 -0
  65. data/spec/Dummy/test/controllers/.keep +0 -0
  66. data/spec/Dummy/test/controllers/welcome_controller_test.rb +7 -0
  67. data/spec/Dummy/test/fixtures/.keep +0 -0
  68. data/spec/Dummy/test/helpers/.keep +0 -0
  69. data/spec/Dummy/test/helpers/welcome_helper_test.rb +4 -0
  70. data/spec/Dummy/test/integration/.keep +0 -0
  71. data/spec/Dummy/test/mailers/.keep +0 -0
  72. data/spec/Dummy/test/models/.keep +0 -0
  73. data/spec/Dummy/test/test_helper.rb +13 -0
  74. data/spec/Dummy/vendor/assets/javascripts/.keep +0 -0
  75. data/spec/Dummy/vendor/assets/javascripts/gmap-fontawesome.js +505 -0
  76. data/spec/Dummy/vendor/assets/stylesheets/.keep +0 -0
  77. data/vendor/assets/javascripts/gmap-fontawesome.js +505 -0
  78. metadata +237 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 48202a196f62ac3f1e597e71909cd94dbc783eb5
4
+ data.tar.gz: 37486a19003e441155cd53d6820918a590ccb542
5
+ SHA512:
6
+ metadata.gz: 0b931279a0bdf41af93fed41d39e234aa06a3bdcbb1333663931e435f07613d391b649b364c2fadf5f3768a50feef5c289b094c93c2481c763bffac1a1c06c05
7
+ data.tar.gz: 2410905e5676cb8581e863eca0f910bafdd1a0ef3307bef3a7d3ff2db90f0e273e470335d3b87d6d1e742f3916e5a9e036a98f2a7febd828732546e85b7e3c24
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ .idea
@@ -0,0 +1 @@
1
+ rails4.1
@@ -0,0 +1 @@
1
+ ruby-2.1.1
@@ -0,0 +1,4 @@
1
+ ruby=ruby-2.1.1
2
+ ruby-gemset=rails4.1
3
+ #ruby-gem-install=bundler rake
4
+ #ruby-bundle-install=true
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in gmap-fontawesome.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Marino
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,49 @@
1
+ # Gmap::Fontawesome
2
+
3
+ You can use this gem to display the Font-awesome icons as markers in google-maps
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'gmap-fontawesome'
10
+
11
+ If you want the last gliphs then execute:
12
+
13
+ $ bundle exec rake gmap_awesome:compile
14
+
15
+ Else you can use the precompiled version and go to the next step
16
+
17
+ ## Usage
18
+
19
+ include in your javascript file
20
+
21
+ //= require gmap-fontawesome
22
+
23
+
24
+ All glyphs have the same names as font-awesome, except they are capitalised, and underscored, eg "exclamation-sign" becomes "EXCLAMATION_SIGN"
25
+
26
+ new google.maps.Marker({
27
+ map: map,
28
+ icon: {
29
+ path: GMAP_FA.EXCLAMATION,
30
+ scale:0.02,
31
+ rotation:180,
32
+ strokeWeight: 0.2,
33
+ strokeColor: 'black',
34
+ strokeOpacity: 1,
35
+ fillColor: '#f8ae5f',
36
+ fillOpacity: 0.7,
37
+ },
38
+ clickable: false,
39
+ position: new google.maps.LatLng(lat, lng)
40
+ });
41
+
42
+
43
+ ## Contributing
44
+
45
+ 1. Fork it ( http://github.com/oniram88/gmap-fontawesome/fork )
46
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
47
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
48
+ 4. Push to the branch (`git push origin my-new-feature`)
49
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'gmap/fontawesome/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "gmap-fontawesome"
8
+ spec.version = Gmap::Fontawesome::VERSION
9
+ spec.authors = ["Marino"]
10
+ spec.email = ["marinobonetti@gmail.com"]
11
+ spec.summary = %q{Font awesome svg path is for google maps}
12
+ spec.description = %q{Font-awesome svg path is for google maps, whith rake task to download and compile the last version of the icons }
13
+ spec.homepage = "https://github.com/oniram88/gmap-fontawesome"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib,vendor"]
20
+
21
+
22
+ spec.add_runtime_dependency 'rubyzip', '~> 1.1', '>= 1.1.3'
23
+ spec.add_development_dependency "bundler", "~> 1.5"
24
+ spec.add_development_dependency 'rake', '~> 10.3', '>= 10.3.2'
25
+ end
@@ -0,0 +1,8 @@
1
+ require "gmap/fontawesome/version"
2
+
3
+ module Gmap
4
+ module Fontawesome
5
+ class Engine < ::Rails::Engine
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,6 @@
1
+ module Gmap
2
+ module Fontawesome
3
+ VERSION = '1.0.0'.freeze
4
+ FONTAWES_VERSION = '4.1.0'.freeze
5
+ end
6
+ end
File without changes
@@ -0,0 +1,99 @@
1
+ require 'logger'
2
+ require 'zip'
3
+ require "open-uri"
4
+ require 'rexml/document'
5
+ include REXML
6
+
7
+
8
+ namespace :gmap_awesome do
9
+
10
+
11
+ desc 'compila la versione di font-awesome in array di path svg javascript'
12
+ task :compile => :environment do
13
+
14
+ Dir.mktmpdir do |dir|
15
+ # use the directory...
16
+
17
+ zip = File.join(dir, 'font-awesome.zip')
18
+
19
+ puts 'Download'
20
+ if File.exist? zip
21
+ puts 'Skip'
22
+ else
23
+ data = URI.parse("https://github.com/FortAwesome/Font-Awesome/archive/master.zip").read
24
+ open(zip, 'wb') { |file|
25
+ file.write(data)
26
+ }
27
+ end
28
+
29
+ path = File.join(dir, 'Font-Awesome-master')
30
+ puts "Extract"
31
+ if File.exist? path
32
+ puts "skip"
33
+ else
34
+ unzip_file(zip)
35
+ end
36
+
37
+ vars = []
38
+
39
+ File.open(File.join(path, 'scss', '_variables.scss')) do |f|
40
+ f.each_line do |line|
41
+
42
+ if line.match /\$fa-var/
43
+ m = line.match /\$fa-var-(?<name>[a-z0-9-]+): "(?<code>\\f\h+)";/i
44
+ # puts line
45
+ # puts m.inspect
46
+ vars << {
47
+ :code => m[:code].gsub("\\", ''),
48
+ :name => m[:name].gsub(/\-/,'_').upcase,
49
+ :value => nil
50
+ }
51
+ end
52
+
53
+ end
54
+ end
55
+
56
+
57
+ puts "Compilation"
58
+ svg_content = File.read(File.join(path, "fonts", 'fontawesome-webfont.svg'))
59
+
60
+
61
+ vars.each do |v|
62
+ m = svg_content.match /glyph unicode="&#x#{v[:code]};".*d="(?<value>.*)" \/>/i
63
+ if m
64
+ v[:value]=m[:value]
65
+ end
66
+ end
67
+
68
+
69
+ vendor=Rails.root.join('vendor', 'assets', 'javascripts')
70
+ FileUtils.mkdir_p(vendor)
71
+
72
+
73
+ File.open(File.join(vendor, 'gmap-fontawesome.js'), 'w') do |f|
74
+ string = []
75
+ vars.reject { |v| v[:value].empty? }.each do |v|
76
+ string<< "#{v[:name]}:'#{v[:value]}'"
77
+ end
78
+ f.write("window.GMAP_FA = {\n#{string.join("\n,")}\n};")
79
+ end
80
+
81
+ end
82
+ end
83
+
84
+
85
+ def unzip_file(file)
86
+ root_path = File.dirname(file)
87
+ Zip::File.open(file) do |zip_file|
88
+ # Handle entries one by one
89
+ zip_file.each do |entry|
90
+ # Extract to file/directory/symlink
91
+ dest = File.join(root_path, entry.name)
92
+ entry.extract(dest)
93
+ end
94
+ end
95
+
96
+
97
+ end
98
+
99
+ end
@@ -0,0 +1,16 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*.log
16
+ /tmp
@@ -0,0 +1,42 @@
1
+ source 'https://rubygems.org'
2
+
3
+
4
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5
+ gem 'rails', '4.1.1'
6
+ # Use sqlite3 as the database for Active Record
7
+ gem 'sqlite3'
8
+ # Use SCSS for stylesheets
9
+ gem 'sass-rails', '~> 4.0.3'
10
+ # Use Uglifier as compressor for JavaScript assets
11
+ gem 'uglifier', '>= 1.3.0'
12
+ # Use CoffeeScript for .js.coffee assets and views
13
+ gem 'coffee-rails', '~> 4.0.0'
14
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
15
+ # gem 'therubyracer', platforms: :ruby
16
+
17
+ # Use jquery as the JavaScript library
18
+ gem 'jquery-rails'
19
+ # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
20
+ gem 'turbolinks'
21
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
22
+ gem 'jbuilder', '~> 2.0'
23
+ # bundle exec rake doc:rails generates the API under doc/api.
24
+ gem 'sdoc', '~> 0.4.0', group: :doc
25
+
26
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
27
+ gem 'spring', group: :development
28
+
29
+ # Use ActiveModel has_secure_password
30
+ # gem 'bcrypt', '~> 3.1.7'
31
+
32
+ # Use unicorn as the app server
33
+ # gem 'unicorn'
34
+
35
+ # Use Capistrano for deployment
36
+ # gem 'capistrano-rails', group: :development
37
+
38
+ # Use debugger
39
+ # gem 'debugger', group: [:development, :test]
40
+
41
+ gem 'gmap-fontawesome', path: "../../."
42
+
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Rails.application.load_tasks
File without changes
@@ -0,0 +1,17 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require turbolinks
16
+ //= require_tree .
17
+ //= require gmap-fontawesome
@@ -0,0 +1,31 @@
1
+ var map;
2
+ function initialize() {
3
+ var mapOptions = {
4
+ zoom:8,
5
+ center:new google.maps.LatLng( -34.397, 150.644 )
6
+ };
7
+ map = new google.maps.Map( document.getElementById( 'map' ),
8
+ mapOptions );
9
+
10
+ new google.maps.Marker( {
11
+ map:map,
12
+ icon:{
13
+ path:GMAP_FA.EXCLAMATION,
14
+ scale:0.02,
15
+ rotation:180,
16
+ strokeWeight:0.2,
17
+ strokeColor:'black',
18
+ strokeOpacity:1,
19
+ fillColor:'#000000',
20
+ fillOpacity:0.7
21
+ },
22
+ clickable:false,
23
+ position:new google.maps.LatLng( -34.397, 150.644 )
24
+ } );
25
+
26
+ }
27
+
28
+
29
+ $( document ).ready( function () {
30
+ initialize();
31
+ } );
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,9 @@
1
+ // Place all the styles related to the Welcome controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
4
+
5
+
6
+ #map{
7
+ width:100%;
8
+ height: 500px;
9
+ }