raylayers 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ pkg/*
2
+ *.gem
3
+ .bundle
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in raylayers.gemspec
4
+ gemspec
data/README ADDED
@@ -0,0 +1,44 @@
1
+ QQQQQQQY: .-^.,vwwmQQQQQQQmmgwc;-~!QWQQQQQQQQQQQQQQQQQQQQQQQ
2
+ QQQQQQf=} .. vmmWQQQQQQQQQQQQmdAwwaw@YQQQQQQ OpenLayers QQQQ
3
+ QQQQQ@'s _amQWQQQQQQQQQQQQQQQQQmd$W$as/WQQQQ for QQQQ
4
+ QQQQ@'-`_mQQWQQQQQQQWQQQQQQQQmBWWQBQWWc!$QQQ Rails QQQQ
5
+ QQQ@',.<dWQQQQQQQQQQQQQQQQQQQQQ2IVammWQw>3QQQQQQQQQQQQQQQQQQ
6
+ QQW` --{nQWQQQQQQQQQQQQQQBHmmwwuvvw%?9WWHQWQQQQQQQQQQQQQQQQW
7
+ QQ'.a "XUWQQQQQQQQWQWWY!+ "=+#2<>?$Q2QWQQQQQQQQQQQQQQQ
8
+ QW`)C =X3WWWQQQQQWWZn?`-` :3m;$m%mmmWQQQQQQQQQQQQQQW
9
+ Qm.)[ .=ssvnXWTYo2":+ :-H(-=_aQUHWQQQQQQQQQQQQQW
10
+ QQ;-._"^- -""+{no( : <qwc"?" )WQQQQQWQQQQWQQ
11
+ QF =` -?' .- "9QW; <,3QQQQQQQQQWQQW
12
+ Q[-` - _wa, .- ._: =umWQ,-{3mWQQQWQQQQQQQQ
13
+ Qm, .mWWQQws|vliii__s_s,-{$WQL -`]WQQQQQQQQQQQW
14
+ QQg <QWQQQWQWg%>"?9QQQQp3g:IWWWsswmQQQQQQQQWQQQW
15
+ QQQL _%+` . _JQQQQQQQWW@"Qmw, "9WWp3L=vQBWmWQE$WQQWQQQQQQW
16
+ QQQQm,-"""!^.a"=QWQQQWT!" .mQQma. ~IVo3av3QcvQQCdQQQQQQQQQQW
17
+ QQQQf .a@^.%?!-^~- _yQQQQQg,. {vvQcl$f<TT{QQQQQQQWQQQW
18
+ QQQQm, _dB( jms .{mWVY"^~"?l> ll3({Q[ _<mWQQQWQQQQQQW
19
+ QQQQQm. -nI`<QEli.___ad?^ _. .w;+li><+ jQQQQQQQQQQQQQQW
20
+ QQQQQQc - +?nu""- .aawmQQyw,.jWmaoi;); QQQQQQQQQQQQWQQW
21
+ QQQQQQm.. , " . awQQWWZ??!"sa!mWWmc=i`:QWQQQQQQWQQQQQQW
22
+ QQQQQQQc<. nc mQVT?sawgy2T":jQQQQz:> )WQQQQQQQQQQQQQQW
23
+ QQQQQQQQ/ )Ww,=,.-"`_wW8VY!"=_;mQQQQQc:- )F?QWQQQQQQQWQQQW
24
+ QQQQQQQQQa. )WWp>"^~-~^~-_aaamQQmQWQQ@> :I` -$QQQQWQQQQQQW
25
+ QQQQQQQQQQQ, ?mWg%_. .awmwmmQQQQQQQQV~ -` |?$QQQQQQQQQW
26
+ QQQQQQQQQQWQ/ "VQQgwwQQQWWQWQWWHWT!~ .-n,-??HQWQQQQ
27
+ QQQQQQQQQQQQQw, ~="YVW$QQQ@("!Y!~ 3c-k -
28
+ QQQQQQQQQQQQQQQc -~)Y!+ - =|m.k
29
+ QQQQQQQQQQQWQB? _wd( 3p
30
+ QQQQQQWD?!~- :( .%=$1,
31
+
32
+ Installation
33
+
34
+ In your Gemfile, add this line:
35
+
36
+ gem "raylayers"
37
+
38
+ Then, run bundle install. To invoke the generator, run:
39
+
40
+ rails generate raylayers:install
41
+
42
+ You're done!
43
+
44
+
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,57 @@
1
+ require 'zip/zip'
2
+ require 'fileutils'
3
+
4
+ module Raylayers
5
+ module Generators
6
+ class InstallGenerator < ::Rails::Generators::Base
7
+ desc "This generator downloads and installs OpenLayers"
8
+ class_option :version, :type => :string, :default => '2.10', :desc => "Which version of OpenLayers to fetch"
9
+
10
+ def download_openlayers
11
+ @tmp_file = "tmp/OpenLayers-#{options.version}.zip"
12
+ say_status("fetching", "OpenLayers (#{options.version})", :green)
13
+ get "http://openlayers.org/download/OpenLayers-#{options.version}.zip", @tmp_file
14
+ rescue OpenURI::HTTPError
15
+ say_status("error", "could not find OpenLayers ({options.version})", :red)
16
+ end
17
+
18
+ def unpack_openlayers
19
+ say_status("unpacking", @tmp_file, :green)
20
+ Zip::ZipFile.open(@tmp_file) do |zip|
21
+ zip.each do |file|
22
+ file_path = File.join("tmp/", file.to_s)
23
+ directory = file_path[0, file_path.rindex("/") + 1]
24
+ FileUtils.mkdir_p(directory) unless File.directory?(directory)
25
+ zip.extract(file, file_path) unless File.exists? file_path
26
+ end
27
+ end
28
+ rescue
29
+ say_status("error", "could not unpack #{@tmp_file}", :red)
30
+ end
31
+
32
+ def build_openlayers
33
+ say_status("building", "OpenLayers (#{options.version})", :green)
34
+ # TODO: ruby script?
35
+ Dir.chdir("tmp/OpenLayers-#{options.version}/build"){ system("python build.py 1> /dev/null")}
36
+ rescue
37
+ say_status("error", "could not build OpenLayers", :red)
38
+ end
39
+
40
+ def install_openlayers
41
+ say_status("installing", "OpenLayers (#{options.version})", :green)
42
+ FileUtils.mkdir_p("public/openlayers/")
43
+ FileUtils.cp("tmp/OpenLayers-#{options.version}/build/OpenLayers.js", "public/openlayers/OpenLayers.js")
44
+ FileUtils.cp_r("tmp/OpenLayers-#{options.version}/theme", "public/openlayers/theme")
45
+ FileUtils.cp_r("tmp/OpenLayers-#{options.version}/img", "public/openlayers/img")
46
+ rescue
47
+ say_status("error", "could not install OpenLayers", :red)
48
+ end
49
+
50
+ def remove_tmp_files
51
+ say_status("clean", "Removing temp files", :green)
52
+ FileUtils.rm_f(@tmp_file)
53
+ FileUtils.rm_rf("tmp/OpenLayers-#{options.version}")
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,3 @@
1
+ module Raylayers
2
+ VERSION = "0.1.0"
3
+ end
data/lib/raylayers.rb ADDED
@@ -0,0 +1,2 @@
1
+ module Raylayers
2
+ end
data/raylayers.gemspec ADDED
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "raylayers/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "raylayers"
7
+ s.version = Raylayers::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Fabio R. Panettieri"]
10
+ s.email = ["fpanettieri@xoomcode.com"]
11
+ s.homepage = "http://www.xoomcode.com/projects/raylayers"
12
+ s.summary = %q{OpenLayers for Rails}
13
+ s.description = %q{"This gem provides a Rails generator to install OpenLayers into your Rails 3 app}
14
+
15
+ s.rubyforge_project = "raylayers"
16
+
17
+ s.add_dependency "rubyzip", "~> 0.9.4"
18
+
19
+ s.files = `git ls-files`.split("\n")
20
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
21
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
22
+ s.require_paths = ["lib"]
23
+ end
metadata ADDED
@@ -0,0 +1,90 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: raylayers
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 0
10
+ version: 0.1.0
11
+ platform: ruby
12
+ authors:
13
+ - Fabio R. Panettieri
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-01-10 00:00:00 -03:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: rubyzip
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ hash: 51
30
+ segments:
31
+ - 0
32
+ - 9
33
+ - 4
34
+ version: 0.9.4
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ description: "\"This gem provides a Rails generator to install OpenLayers into your Rails 3 app"
38
+ email:
39
+ - fpanettieri@xoomcode.com
40
+ executables: []
41
+
42
+ extensions: []
43
+
44
+ extra_rdoc_files: []
45
+
46
+ files:
47
+ - .gitignore
48
+ - Gemfile
49
+ - README
50
+ - Rakefile
51
+ - lib/generators/raylayers/install/install_generator.rb
52
+ - lib/raylayers.rb
53
+ - lib/raylayers/version.rb
54
+ - raylayers.gemspec
55
+ has_rdoc: true
56
+ homepage: http://www.xoomcode.com/projects/raylayers
57
+ licenses: []
58
+
59
+ post_install_message:
60
+ rdoc_options: []
61
+
62
+ require_paths:
63
+ - lib
64
+ required_ruby_version: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ hash: 3
70
+ segments:
71
+ - 0
72
+ version: "0"
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ hash: 3
79
+ segments:
80
+ - 0
81
+ version: "0"
82
+ requirements: []
83
+
84
+ rubyforge_project: raylayers
85
+ rubygems_version: 1.4.1
86
+ signing_key:
87
+ specification_version: 3
88
+ summary: OpenLayers for Rails
89
+ test_files: []
90
+