utopia_data 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/COPYING ADDED
@@ -0,0 +1,86 @@
1
+ GNU GENERAL PUBLIC LICENSE
2
+
3
+ Version 2, June 1991
4
+
5
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
6
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
7
+
8
+ Everyone is permitted to copy and distribute verbatim copies
9
+ of this license document, but changing it is not allowed.
10
+ Preamble
11
+
12
+ The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
13
+
14
+ When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
15
+
16
+ To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
17
+
18
+ For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
19
+
20
+ We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
21
+
22
+ Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
23
+
24
+ Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
25
+
26
+ The precise terms and conditions for copying, distribution and modification follow.
27
+
28
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
29
+
30
+ 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
31
+
32
+ Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
33
+
34
+ 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
35
+
36
+ You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
37
+
38
+ 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
39
+
40
+ a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
41
+ b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
42
+ c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
43
+ These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
44
+
45
+ Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
46
+
47
+ In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
48
+
49
+ 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
50
+
51
+ a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
52
+ b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
53
+ c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
54
+ The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
55
+
56
+ If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
57
+
58
+ 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
59
+
60
+ 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
61
+
62
+ 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
63
+
64
+ 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
65
+
66
+ If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
67
+
68
+ It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
69
+
70
+ This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
71
+
72
+ 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
73
+
74
+ 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
75
+
76
+ Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
77
+
78
+ 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
79
+
80
+ NO WARRANTY
81
+
82
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
83
+
84
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
85
+
86
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,50 @@
1
+ = UtopiaData Documentation
2
+
3
+ == About
4
+ Quando minha Utopia de Abertura de Dados por parte do governo for realidade,
5
+ ainda então, estaremos caminhando para um pais mais democratico
6
+
7
+ == Install
8
+ UtopiaData run on top of Rails application
9
+ gem 'utopia_data' # on Gemfile
10
+
11
+ bundle install
12
+ bundle exec rails g utopia:resource law
13
+
14
+
15
+ == Configure
16
+ Please check your database config on *database.yml*
17
+
18
+ == Create a Resource
19
+ Atention! create a resource *DON'T* touch on database, *you need* create your table before it
20
+
21
+ In the example _law_ is my resource, the should be a word in singular
22
+ bundle exec rails g utopia:resource law
23
+
24
+ It will create app/resource/law.rb, like it
25
+ UtopiaData.register :site do
26
+ end
27
+
28
+ === Changing default
29
+ ==== Database Table Name
30
+ to change the database table name you can pass your database name to table_name config
31
+ UtopiaData.register :law do
32
+ table_name "LAW122"
33
+ end
34
+ ==== Attributes
35
+ to change what attribute you want to expose, you can use attribites config
36
+ UtopiaData.register :law do
37
+ attributes do
38
+ set :number
39
+ set :author
40
+ end
41
+ end
42
+
43
+ All other attributes will be protected
44
+
45
+ == Run Server
46
+ bundle exec rails s # run server
47
+
48
+ == License
49
+
50
+ See COPYING file
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'UtopiaData Documentation'
18
+ rdoc.options += %w[ --line-numbers --charset utf-8 -f horo]
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
24
+ load 'rails/tasks/engine.rake'
25
+
26
+
27
+ desc "update documentation"
28
+ task :update_documentation => :rdoc do
29
+
30
+ system 'mv rdoc /tmp/rdoc'
31
+ system 'git checkout gh-pages'
32
+ system 'rm -Rf doc/code'
33
+ system 'mv /tmp/rdoc doc/code'
34
+ system 'git add doc/'
35
+ system 'git commit -m "updated code documentation"'
36
+ system 'git push origin gh-pages'
37
+ system 'git checkout master'
38
+
39
+ end
40
+
41
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,20 @@
1
+ //--
2
+ // Copyright (C) 2012 Emerson Vinicius Moreira de Almeida
3
+
4
+ // This file is part of UtopiaData source code.
5
+
6
+ // UtopiaData source code is free software; you can redistribute it
7
+ // and/or modify it under the terms of the GNU General Public License as
8
+ // published by the Free Software Foundation; either version 2 of the License,
9
+ // or (at your option) any later version.
10
+
11
+ // UtopiaData source code is distributed in the hope that it will be
12
+ // useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ // GNU General Public License for more details.
15
+
16
+ // You should have received a copy of the GNU General Public License
17
+ // along with Foobar; if not, write to the Free Software
18
+ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
+ //
20
+ //++
@@ -0,0 +1,20 @@
1
+ /*--
2
+ # Copyright (C) 2012 Emerson Vinicius Moreira de Almeida
3
+
4
+ # This file is part of UtopiaData source code.
5
+
6
+ # UtopiaData source code is free software; you can redistribute it
7
+ # and/or modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of the License,
9
+ # or (at your option) any later version.
10
+
11
+ # UtopiaData source code is distributed in the hope that it will be
12
+ # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with Foobar; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
+ #
20
+ #++*/
@@ -0,0 +1,25 @@
1
+ #--
2
+ # Copyright (C) 2012 Emerson Vinicius Moreira de Almeida
3
+
4
+ # This file is part of UtopiaData source code.
5
+
6
+ # UtopiaData source code is free software; you can redistribute it
7
+ # and/or modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of the License,
9
+ # or (at your option) any later version.
10
+
11
+ # UtopiaData source code is distributed in the hope that it will be
12
+ # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with Foobar; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
+ #
20
+ #++
21
+
22
+ module UtopiaData
23
+ class ApplicationController < ActionController::Base
24
+ end
25
+ end
@@ -0,0 +1,25 @@
1
+ #--
2
+ # Copyright (C) 2012 Emerson Vinicius Moreira de Almeida
3
+
4
+ # This file is part of UtopiaData source code.
5
+
6
+ # UtopiaData source code is free software; you can redistribute it
7
+ # and/or modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of the License,
9
+ # or (at your option) any later version.
10
+
11
+ # UtopiaData source code is distributed in the hope that it will be
12
+ # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with Foobar; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
+ #
20
+ #++
21
+
22
+ module UtopiaData
23
+ module ApplicationHelper
24
+ end
25
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Utopia</title>
5
+ <%= stylesheet_link_tag "utopia_data/application", :media => "all" %>
6
+ <%= javascript_include_tag "utopia_data/application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,35 @@
1
+ #--
2
+ # Copyright (C) 2012 Emerson Vinicius Moreira de Almeida
3
+
4
+ # This file is part of UtopiaData source code.
5
+
6
+ # UtopiaData source code is free software; you can redistribute it
7
+ # and/or modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of the License,
9
+ # or (at your option) any later version.
10
+
11
+ # UtopiaData source code is distributed in the hope that it will be
12
+ # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with Foobar; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
+ #
20
+ #++
21
+
22
+ module UtopiaData
23
+ class InstallGenerator < Rails::Generators::NamedBase
24
+ source_root File.expand_path('../../templates', __FILE__)
25
+ argument :name, :default => ""
26
+
27
+ def copy_initializer
28
+ template 'initializer.rb.erb', 'config/initializers/utopia_data.rb'
29
+ end
30
+
31
+ def setup_routes
32
+ route "UtopiaData.routes(self)"
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,8 @@
1
+ Description:
2
+ Utopia:Resource
3
+
4
+ Example:
5
+ rails generate utopia:resource TheResource
6
+
7
+ This will create:
8
+ app/utopia_data/the_resource
@@ -0,0 +1,30 @@
1
+ #--
2
+ # Copyright (C) 2012 Emerson Vinicius Moreira de Almeida
3
+
4
+ # This file is part of UtopiaData source code.
5
+
6
+ # UtopiaData source code is free software; you can redistribute it
7
+ # and/or modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of the License,
9
+ # or (at your option) any later version.
10
+
11
+ # UtopiaData source code is distributed in the hope that it will be
12
+ # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with Foobar; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
+ #
20
+ #++
21
+
22
+ module UtopiaData
23
+ class ResourceGenerator < Rails::Generators::NamedBase
24
+ source_root File.expand_path('../../templates', __FILE__)
25
+
26
+ def create_initializer_file
27
+ template "resource.rb", "app/resource/#{file_path.gsub('/', '_')}.rb"
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,3 @@
1
+ UtopiaData.setup do |config|
2
+
3
+ end
@@ -0,0 +1,3 @@
1
+ UtopiaData.register :<%= file_name %> do
2
+
3
+ end
@@ -0,0 +1,25 @@
1
+ #--
2
+ # Copyright (C) 2012 Emerson Vinicius Moreira de Almeida
3
+
4
+ # This file is part of UtopiaData source code.
5
+
6
+ # UtopiaData source code is free software; you can redistribute it
7
+ # and/or modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of the License,
9
+ # or (at your option) any later version.
10
+
11
+ # UtopiaData source code is distributed in the hope that it will be
12
+ # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with Foobar; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
+ #
20
+ #++
21
+
22
+ # desc "Explaining what the task does"
23
+ # task :utopia do
24
+ # # Task goes here
25
+ # end
@@ -0,0 +1,46 @@
1
+ #--
2
+ # Copyright (C) 2012 Emerson Vinicius Moreira de Almeida
3
+
4
+ # This file is part of UtopiaData source code.
5
+
6
+ # UtopiaData source code is free software; you can redistribute it
7
+ # and/or modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of the License,
9
+ # or (at your option) any later version.
10
+
11
+ # UtopiaData source code is distributed in the hope that it will be
12
+ # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with Foobar; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
+ #
20
+ #++
21
+
22
+ require "utopia_data/engine"
23
+
24
+ module UtopiaData
25
+ autoload :Application, 'utopia_data/application'
26
+ autoload :BaseController, 'utopia_data/base_controller'
27
+ autoload :DSL, 'utopia_data/dsl'
28
+ autoload :Resource, 'utopia_data/resource'
29
+ autoload :ResourceController, 'utopia_data/resource_controller'
30
+ autoload :ResourceDSL, 'utopia_data/resource_dsl'
31
+
32
+ class << self
33
+ # the Application to this application
34
+ def application
35
+ @application ||= ::UtopiaData::Application.new
36
+ end
37
+
38
+ # TODO: documentation
39
+ def setup
40
+ end
41
+
42
+ delegate :register, :to => :application
43
+ delegate :routes, :to => :application
44
+ delegate :load!, :to => :application
45
+ end
46
+ end
@@ -0,0 +1,103 @@
1
+ #--
2
+ # Copyright (C) 2012 Emerson Vinicius Moreira de Almeida
3
+
4
+ # This file is part of UtopiaData source code.
5
+
6
+ # UtopiaData source code is free software; you can redistribute it
7
+ # and/or modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of the License,
9
+ # or (at your option) any later version.
10
+
11
+ # UtopiaData source code is distributed in the hope that it will be
12
+ # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with Foobar; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
+ #
20
+ #++
21
+
22
+ require 'utopia_data/router'
23
+
24
+ module UtopiaData
25
+ # In UtopiaData 0.0.1, UtopiaData::Application object is to manipulate the utopia system, here
26
+ # there are the recources, loads, start routes, etc
27
+ class Application
28
+
29
+ # A hash of all the registered resources
30
+ attr_accessor :resources, :load_paths
31
+
32
+ # create a default value to resources and
33
+ # Load paths for utopia configurations. Add folders to this load path
34
+ # to load up other resources for utopia.
35
+ def initialize
36
+ self.resources ||= {}
37
+ self.load_paths = [File.expand_path('app/resource', Rails.root)]
38
+ end
39
+
40
+ # === Register a resource
41
+ # You can register a resource using the generetor resource, only run:
42
+ # rails g utopia:resource lei
43
+ #
44
+ # This command you be create a lei.rb path on app/resource with the content
45
+ # UtopiaData.register :lei do
46
+ # configs...
47
+ # end
48
+ #
49
+ # or
50
+ #
51
+ # UtopiaData.regsiter :lei
52
+ #
53
+ # After, you can enter on */leis.json* for example and see your resource expose
54
+ #
55
+ def register(resource_name, options = {}, &block)
56
+ resource = find_or_create_resource(resource_name, options, &block)
57
+ end
58
+
59
+ # The Router to this application
60
+ #
61
+ def router
62
+ @router ||= Router.new(self)
63
+ end
64
+
65
+ # Create the routes to resource on your application
66
+ # use:
67
+ #
68
+ # YourApplication::Application.routes.draw do
69
+ # UtopiaData.routes(self)
70
+ # end
71
+ #
72
+ def routes(rails_router)
73
+ load!
74
+ router.apply(rails_router)
75
+ end
76
+
77
+ def find_or_create_resource(name, options = {}, &block) # :nodoc:
78
+ return @resources[name] if resources[name]
79
+ resource = Resource.new(name, options, &block)
80
+ @resources[name] = resource
81
+ end
82
+
83
+ @@loaded = false
84
+
85
+ # verify if the application is loaded or not
86
+ def loaded?
87
+ @@loaded
88
+ end
89
+
90
+ # Load files in _files_in_load_path_ and set @loaded to true
91
+ def load!
92
+ return false if loaded?
93
+ files_in_load_path.each{|file| load file }
94
+
95
+ @@loaded = true
96
+ end
97
+
98
+ # get files to (re)load
99
+ def files_in_load_path
100
+ load_paths.flatten.compact.uniq.collect{|path| Dir["#{path}/**/*.rb"] }.flatten
101
+ end
102
+ end
103
+ end
@@ -0,0 +1,29 @@
1
+ #--
2
+ # Copyright (C) 2012 Emerson Vinicius Moreira de Almeida
3
+
4
+ # This file is part of UtopiaData source code.
5
+
6
+ # UtopiaData source code is free software; you can redistribute it
7
+ # and/or modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of the License,
9
+ # or (at your option) any later version.
10
+
11
+ # UtopiaData source code is distributed in the hope that it will be
12
+ # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with Foobar; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
+ #
20
+ #++
21
+
22
+ require 'inherited_resources'
23
+
24
+ module UtopiaData
25
+ class BaseController < ::InheritedResources::Base
26
+ actions :index, :show
27
+ respond_to :xml, :json#, :cvs
28
+ end
29
+ end
@@ -0,0 +1,53 @@
1
+ #--
2
+ # Copyright (C) 2012 Emerson Vinicius Moreira de Almeida
3
+
4
+ # This file is part of UtopiaData source code.
5
+
6
+ # UtopiaData source code is free software; you can redistribute it
7
+ # and/or modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of the License,
9
+ # or (at your option) any later version.
10
+
11
+ # UtopiaData source code is distributed in the hope that it will be
12
+ # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with Foobar; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
+ #
20
+ #++
21
+
22
+ module UtopiaData
23
+
24
+ #
25
+ # The UtopiaData DSL. This class is where all the registration blocks
26
+ # are instance eval'd. This is the central place for the API given to
27
+ # users of UtopiaData
28
+ #
29
+ class DSL
30
+ # Runs the registration block inside this object
31
+ def run_registration_block(config, &block)
32
+ @config = config
33
+ instance_eval &block if block_given?
34
+ end
35
+
36
+ private
37
+
38
+ # The instance of UtopiaData::Config that's being registered
39
+ # currently. You can use this within your registration blocks to
40
+ # modify options:
41
+ #
42
+ # eg:
43
+ #
44
+ # UtopiaData.register :post do
45
+ # config.table_name = "por22"
46
+ # end
47
+ #
48
+ def config
49
+ @config
50
+ end
51
+
52
+ end
53
+ end
@@ -0,0 +1,25 @@
1
+ #--
2
+ # Copyright (C) 2012 Emerson Vinicius Moreira de Almeida
3
+
4
+ # This file is part of UtopiaData source code.
5
+
6
+ # UtopiaData source code is free software; you can redistribute it
7
+ # and/or modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of the License,
9
+ # or (at your option) any later version.
10
+
11
+ # UtopiaData source code is distributed in the hope that it will be
12
+ # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with Foobar; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
+ #
20
+ #++
21
+
22
+ module UtopiaData
23
+ class Engine < ::Rails::Engine
24
+ end
25
+ end
@@ -0,0 +1,73 @@
1
+ #--
2
+ # Copyright (C) 2012 Emerson Vinicius Moreira de Almeida
3
+
4
+ # This file is part of UtopiaData source code.
5
+
6
+ # UtopiaData source code is free software; you can redistribute it
7
+ # and/or modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of the License,
9
+ # or (at your option) any later version.
10
+
11
+ # UtopiaData source code is distributed in the hope that it will be
12
+ # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with Foobar; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
+ #
20
+ #++
21
+
22
+ require 'utopia_data/resource/naming'
23
+ require 'utopia_data/resource/models'
24
+ require 'utopia_data/resource/controllers'
25
+ require 'utopia_data/resource/representer'
26
+
27
+ module UtopiaData
28
+ class Resource
29
+ include Naming
30
+ include Controllers
31
+ include Models
32
+ include Representer
33
+
34
+ # The name of the resource class
35
+ attr_reader :resource_class_name
36
+ # The configuration to resource
37
+ attr_accessor :config
38
+
39
+ def initialize(resource_name, options = {}, &block)
40
+ @config ||= {}
41
+ parse_registration_block(self, &block) if block_given?
42
+ @resource_class_name = "#{resource_name.to_s.classify}"
43
+ @options = options
44
+ create!
45
+ end
46
+
47
+ # The class this resource wraps. If you register the Post model, Resource#resource_class
48
+ # will point to the Post class
49
+ def resource_class
50
+ ActiveSupport::Dependencies.constantize(resource_class_name)
51
+ end
52
+
53
+ def resource_table_name
54
+ resource_class.quoted_table_name
55
+ end
56
+
57
+ protected
58
+
59
+ def resource_dsl
60
+ @resource_dsl ||= ResourceDSL.new
61
+ end
62
+
63
+ def parse_registration_block(config, &block)
64
+ resource_dsl.run_registration_block(config, &block)
65
+ end
66
+
67
+ def create!
68
+ create_resource_model
69
+ create_resource_representer
70
+ create_resource_controller
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,50 @@
1
+ #--
2
+ # Copyright (C) 2012 Emerson Vinicius Moreira de Almeida
3
+
4
+ # This file is part of UtopiaData source code.
5
+
6
+ # UtopiaData source code is free software; you can redistribute it
7
+ # and/or modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of the License,
9
+ # or (at your option) any later version.
10
+
11
+ # UtopiaData source code is distributed in the hope that it will be
12
+ # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with Foobar; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
+ #
20
+ #++
21
+
22
+ module UtopiaData
23
+ class Resource
24
+ module Controllers
25
+
26
+ # Returns a properly formatted controller name for this
27
+ # config within its namespace
28
+ def controller_name
29
+ [resource_name.plural.camelize + "Controller"].compact.join('::')
30
+ end
31
+
32
+ # Returns the controller for this config
33
+ def controller
34
+ @controller ||= controller_name.constantize
35
+ end
36
+
37
+ # Create the resource controller
38
+ def create_resource_controller
39
+ controller_class = <<-CONTROLLER
40
+ class ::#{controller_name} < UtopiaData::ResourceController
41
+ responders Roar::Rails::Responder
42
+ end
43
+ CONTROLLER
44
+
45
+ eval controller_class
46
+ controller.utopia_config = self
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,59 @@
1
+ #--
2
+ # Copyright (C) 2012 Emerson Vinicius Moreira de Almeida
3
+
4
+ # This file is part of UtopiaData source code.
5
+
6
+ # UtopiaData source code is free software; you can redistribute it
7
+ # and/or modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of the License,
9
+ # or (at your option) any later version.
10
+
11
+ # UtopiaData source code is distributed in the hope that it will be
12
+ # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with Foobar; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
+ #
20
+ #++
21
+
22
+ module UtopiaData
23
+ class Resource
24
+ module Models
25
+ def model_name
26
+ resource_class_name
27
+ end
28
+
29
+ def model
30
+ @model ||= resource_class
31
+ end
32
+
33
+ def attributes(&block)
34
+ @columns = []
35
+ instance_eval &block if block_given?
36
+ end
37
+
38
+ def set(attribute, options = {})
39
+ @columns << attribute
40
+ end
41
+
42
+ def columns
43
+ @columns ||= []
44
+ end
45
+
46
+ # Create the resource model
47
+ def create_resource_model
48
+ table_name = @config[:table_name] ? "self.table_name = '#{@config[:table_name]}'" : nil
49
+ model_class = <<-MODEL
50
+ class ::#{model_name} < ActiveRecord::Base
51
+ #{table_name}
52
+ attr_accessor #{columns.join(", ")}
53
+ end
54
+ MODEL
55
+ eval model_class
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,70 @@
1
+ #--
2
+ # Copyright (C) 2012 Emerson Vinicius Moreira de Almeida
3
+
4
+ # This file is part of UtopiaData source code.
5
+
6
+ # UtopiaData source code is free software; you can redistribute it
7
+ # and/or modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of the License,
9
+ # or (at your option) any later version.
10
+
11
+ # UtopiaData source code is distributed in the hope that it will be
12
+ # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with Foobar; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
+ #
20
+ #++
21
+
22
+ module UtopiaData
23
+ class Resource
24
+
25
+ module Naming
26
+
27
+ # Returns a name used to uniquely identify this resource
28
+ # this should be an instance of ActiveAdmin:Resource::Name, which responds to
29
+ # #singular, #plural, #route_key, #human etc.
30
+ def resource_name
31
+ custom_name = @options[:as] && @options[:as].gsub(/\s/,'')
32
+ @resource_name ||= if custom_name || !resource_class.respond_to?(:model_name)
33
+ Resource::Name.new(resource_class, custom_name)
34
+ else
35
+ Resource::Name.new(resource_class)
36
+ end
37
+ end
38
+
39
+ # Returns the name to call this resource such as "Bank Account"
40
+ def resource_label
41
+ if @options[:as]
42
+ @options[:as]
43
+ else
44
+ resource_name.human(:default => resource_name.gsub('::', ' ')).titleize
45
+ end
46
+ end
47
+
48
+ def plural_resource_label
49
+ if @options[:as]
50
+ @options[:as].pluralize
51
+ else
52
+ resource_name.human(:count => 3, :default => resource_label.pluralize).titleize
53
+ end
54
+ end
55
+ end
56
+
57
+ # A subclass of ActiveModel::Name which supports the different APIs presented
58
+ # in Rails < 3.1 and > 3.1.
59
+ class Name < ActiveModel::Name
60
+
61
+ def initialize(klass, name = nil)
62
+ super(klass, nil, name)
63
+ end
64
+
65
+ def route_key
66
+ plural
67
+ end
68
+ end
69
+ end
70
+ end
@@ -0,0 +1,41 @@
1
+ #--
2
+ # Copyright (C) 2012 Emerson Vinicius Moreira de Almeida
3
+
4
+ # This file is part of UtopiaData source code.
5
+
6
+ # UtopiaData source code is free software; you can redistribute it
7
+ # and/or modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of the License,
9
+ # or (at your option) any later version.
10
+
11
+ # UtopiaData source code is distributed in the hope that it will be
12
+ # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with Foobar; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
+ #
20
+ #++
21
+
22
+ require 'roar/representer/json'
23
+ require 'roar/representer/feature/hypermedia'
24
+
25
+ module UtopiaData
26
+ class Resource
27
+ module Representer
28
+ def create_resource_representer
29
+ representer_module = <<-MODEL
30
+ module ::#{model_name}Representer
31
+ include Roar::Representer::JSON
32
+ include Roar::Representer::Feature::Hypermedia
33
+
34
+ #{columns.map{|c| "property :#{c}" }.join("\n")}
35
+ end
36
+ MODEL
37
+ eval representer_module
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,35 @@
1
+ #--
2
+ # Copyright (C) 2012 Emerson Vinicius Moreira de Almeida
3
+
4
+ # This file is part of UtopiaData source code.
5
+
6
+ # UtopiaData source code is free software; you can redistribute it
7
+ # and/or modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of the License,
9
+ # or (at your option) any later version.
10
+
11
+ # UtopiaData source code is distributed in the hope that it will be
12
+ # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with Foobar; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
+ #
20
+ #++
21
+
22
+ module UtopiaData
23
+ # All Resources Controller inherits from this controller.
24
+ # It implements actions and helpers for resources.
25
+ class ResourceController < BaseController
26
+ class << self
27
+ def utopia_config=(config)
28
+ @utopia_config = config
29
+
30
+ defaults :resource_class => config.resource_class,
31
+ :instance_name => config.resource_name.singular
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,35 @@
1
+ #--
2
+ # Copyright (C) 2012 Emerson Vinicius Moreira de Almeida
3
+
4
+ # This file is part of UtopiaData source code.
5
+
6
+ # UtopiaData source code is free software; you can redistribute it
7
+ # and/or modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of the License,
9
+ # or (at your option) any later version.
10
+
11
+ # UtopiaData source code is distributed in the hope that it will be
12
+ # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with Foobar; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
+ #
20
+ #++
21
+
22
+ module UtopiaData
23
+ # This is the class where all the register blocks are instance eval'd
24
+ class ResourceDSL < DSL
25
+ private
26
+
27
+ def table_name(name)
28
+ config.config[:table_name] = name
29
+ end
30
+
31
+ def attributes(&block)
32
+ config.attributes(&block)
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,39 @@
1
+ #--
2
+ # Copyright (C) 2012 Emerson Vinicius Moreira de Almeida
3
+
4
+ # This file is part of UtopiaData source code.
5
+
6
+ # UtopiaData source code is free software; you can redistribute it
7
+ # and/or modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of the License,
9
+ # or (at your option) any later version.
10
+
11
+ # UtopiaData source code is distributed in the hope that it will be
12
+ # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with Foobar; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
+ #
20
+ #++
21
+
22
+ module UtopiaData
23
+ class Router
24
+ def initialize(application)
25
+ @application = application
26
+ end
27
+
28
+ def apply(router)
29
+ router.instance_exec(@application.resources) do |resources|
30
+ resources.each do |k, config|
31
+ route_definition_block = Proc.new do
32
+ resources config.resource_name.route_key, :only => [:index, :show]
33
+ end
34
+ instance_eval &route_definition_block
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,24 @@
1
+ #--
2
+ # Copyright (C) 2012 Emerson Vinicius Moreira de Almeida
3
+
4
+ # This file is part of UtopiaData source code.
5
+
6
+ # UtopiaData source code is free software; you can redistribute it
7
+ # and/or modify it under the terms of the GNU General Public License as
8
+ # published by the Free Software Foundation; either version 2 of the License,
9
+ # or (at your option) any later version.
10
+
11
+ # UtopiaData source code is distributed in the hope that it will be
12
+ # useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ # GNU General Public License for more details.
15
+
16
+ # You should have received a copy of the GNU General Public License
17
+ # along with Foobar; if not, write to the Free Software
18
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
+ #
20
+ #++
21
+
22
+ module UtopiaData
23
+ VERSION = "0.0.1"
24
+ end
metadata ADDED
@@ -0,0 +1,112 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: utopia_data
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Duke
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-04-14 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: &70290610791600 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 3.2.2
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70290610791600
25
+ - !ruby/object:Gem::Dependency
26
+ name: inherited_resources
27
+ requirement: &70290610791120 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70290610791120
36
+ - !ruby/object:Gem::Dependency
37
+ name: roar-rails
38
+ requirement: &70290610790460 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *70290610790460
47
+ description: Gem to open data.
48
+ email:
49
+ - duke@vertigem.xxx
50
+ executables: []
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - app/assets/javascripts/utopia_data/application.js
55
+ - app/assets/stylesheets/utopia_data/application.css
56
+ - app/controllers/utopia_data/application_controller.rb
57
+ - app/helpers/utopia_data/application_helper.rb
58
+ - app/views/layouts/utopia_data/application.html.erb
59
+ - lib/generators/utopia_data/install/install_generator.rb
60
+ - lib/generators/utopia_data/resource/resource_generator.rb
61
+ - lib/generators/utopia_data/resource/USAGE
62
+ - lib/generators/utopia_data/templates/initializer.rb.erb
63
+ - lib/generators/utopia_data/templates/resource.rb
64
+ - lib/tasks/utopia_tasks.rake
65
+ - lib/utopia_data/application.rb
66
+ - lib/utopia_data/base_controller.rb
67
+ - lib/utopia_data/dsl.rb
68
+ - lib/utopia_data/engine.rb
69
+ - lib/utopia_data/resource/controllers.rb
70
+ - lib/utopia_data/resource/models.rb
71
+ - lib/utopia_data/resource/naming.rb
72
+ - lib/utopia_data/resource/representer.rb
73
+ - lib/utopia_data/resource.rb
74
+ - lib/utopia_data/resource_controller.rb
75
+ - lib/utopia_data/resource_dsl.rb
76
+ - lib/utopia_data/router.rb
77
+ - lib/utopia_data/version.rb
78
+ - lib/utopia_data.rb
79
+ - COPYING
80
+ - Rakefile
81
+ - README.rdoc
82
+ homepage: http://utopia.vertigem.xxx
83
+ licenses: []
84
+ post_install_message:
85
+ rdoc_options: []
86
+ require_paths:
87
+ - lib
88
+ required_ruby_version: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ segments:
95
+ - 0
96
+ hash: 2849814793115095415
97
+ required_rubygems_version: !ruby/object:Gem::Requirement
98
+ none: false
99
+ requirements:
100
+ - - ! '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ segments:
104
+ - 0
105
+ hash: 2849814793115095415
106
+ requirements: []
107
+ rubyforge_project:
108
+ rubygems_version: 1.8.15
109
+ signing_key:
110
+ specification_version: 3
111
+ summary: Gem to open data.
112
+ test_files: []