frame 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. data/Gemfile.lock +229 -1
  2. data/README.md +36 -0
  3. data/lib/generators/frame.rb +8 -0
  4. data/lib/generators/frame/admin/USAGE +11 -0
  5. data/lib/generators/frame/admin/admin_generator.rb +66 -0
  6. data/lib/generators/frame/admin/templates/pages.rb +15 -0
  7. data/lib/generators/frame/admin/templates/pages_controller.rb +25 -0
  8. data/lib/generators/frame/admin/templates/show.html.erb +7 -0
  9. data/lib/generators/frame/all/USAGE +11 -0
  10. data/lib/generators/frame/all/all_generator.rb +24 -0
  11. data/lib/generators/frame/blueprint/USAGE +11 -0
  12. data/lib/generators/frame/blueprint/blueprint_generator.rb +41 -0
  13. data/lib/generators/frame/devise/devise_generator.rb +46 -8
  14. data/lib/generators/frame/devise/templates/defaults.html.erb +7 -5
  15. data/lib/generators/frame/layout/layout_generator.rb +19 -4
  16. data/lib/generators/frame/layout/templates/application_helper.rb +1 -1
  17. data/lib/generators/frame/layout/templates/defaults.html.erb +2 -2
  18. data/lib/generators/frame/layout/templates/econ64.gif +0 -0
  19. data/lib/generators/frame/layout/templates/favicon.ico +0 -0
  20. data/lib/generators/frame/layout/templates/frame.css +145 -0
  21. data/lib/generators/frame/mysql/mysql_generator.rb +23 -2
  22. data/lib/generators/frame/omniauth/USAGE +11 -0
  23. data/lib/generators/frame/omniauth/omniauth_generator.rb +90 -0
  24. data/lib/generators/frame/omniauth/templates/defaults.html.erb +47 -0
  25. data/lib/generators/frame/omniauth/templates/omniauth.rb +6 -0
  26. data/lib/generators/frame/omniauth/templates/omniauth_callbacks_controller.rb +38 -0
  27. data/lib/generators/frame/pages/pages_generator.rb +89 -45
  28. data/lib/generators/frame/pages/templates/_sidebar.html.erb +2 -2
  29. data/lib/generators/frame/pages/templates/pages.html.erb +0 -3
  30. metadata +262 -4
@@ -1,14 +1,242 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- frame (0.0.3)
4
+ frame (0.0.4)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
8
8
  specs:
9
+ actionmailer (3.2.8)
10
+ actionpack (= 3.2.8)
11
+ mail (~> 2.4.4)
12
+ actionpack (3.2.8)
13
+ activemodel (= 3.2.8)
14
+ activesupport (= 3.2.8)
15
+ builder (~> 3.0.0)
16
+ erubis (~> 2.7.0)
17
+ journey (~> 1.0.4)
18
+ rack (~> 1.4.0)
19
+ rack-cache (~> 1.2)
20
+ rack-test (~> 0.6.1)
21
+ sprockets (~> 2.1.3)
22
+ activeadmin (0.5.0)
23
+ arbre (>= 1.0.1)
24
+ bourbon (>= 1.0.0)
25
+ devise (>= 1.1.2)
26
+ fastercsv
27
+ formtastic (>= 2.0.0)
28
+ inherited_resources (>= 1.3.1)
29
+ jquery-rails (>= 1.0.0)
30
+ kaminari (>= 0.13.0)
31
+ meta_search (>= 0.9.2)
32
+ rails (>= 3.0.0)
33
+ sass (>= 3.1.0)
34
+ activemodel (3.2.8)
35
+ activesupport (= 3.2.8)
36
+ builder (~> 3.0.0)
37
+ activerecord (3.2.8)
38
+ activemodel (= 3.2.8)
39
+ activesupport (= 3.2.8)
40
+ arel (~> 3.0.2)
41
+ tzinfo (~> 0.3.29)
42
+ activeresource (3.2.8)
43
+ activemodel (= 3.2.8)
44
+ activesupport (= 3.2.8)
45
+ activesupport (3.2.8)
46
+ i18n (~> 0.6)
47
+ multi_json (~> 1.0)
48
+ addressable (2.3.2)
49
+ arbre (1.0.1)
50
+ activesupport (>= 3.0.0)
51
+ arel (3.0.2)
52
+ bcrypt-ruby (3.0.1)
53
+ bourbon (2.1.1)
54
+ sass (>= 3.1)
55
+ builder (3.0.3)
56
+ capybara (1.1.2)
57
+ mime-types (>= 1.16)
58
+ nokogiri (>= 1.3.3)
59
+ rack (>= 1.0.0)
60
+ rack-test (>= 0.5.4)
61
+ selenium-webdriver (~> 2.0)
62
+ xpath (~> 0.1.4)
63
+ childprocess (0.3.5)
64
+ ffi (~> 1.0, >= 1.0.6)
65
+ coffee-rails (3.2.2)
66
+ coffee-script (>= 2.2.0)
67
+ railties (~> 3.2.0)
68
+ coffee-script (2.2.0)
69
+ coffee-script-source
70
+ execjs
71
+ coffee-script-source (1.3.3)
72
+ cucumber (1.2.1)
73
+ builder (>= 2.1.2)
74
+ diff-lcs (>= 1.1.3)
75
+ gherkin (~> 2.11.0)
76
+ json (>= 1.4.6)
77
+ cucumber-rails (1.3.0)
78
+ capybara (>= 1.1.2)
79
+ cucumber (>= 1.1.8)
80
+ nokogiri (>= 1.5.0)
81
+ devise (2.1.2)
82
+ bcrypt-ruby (~> 3.0)
83
+ orm_adapter (~> 0.1)
84
+ railties (~> 3.1)
85
+ warden (~> 1.2.1)
86
+ diff-lcs (1.1.3)
87
+ erubis (2.7.0)
88
+ execjs (1.4.0)
89
+ multi_json (~> 1.0)
90
+ faraday (0.8.1)
91
+ multipart-post (~> 1.1)
92
+ fastercsv (1.5.5)
93
+ ffi (1.1.5)
94
+ formtastic (2.2.1)
95
+ actionpack (>= 3.0)
96
+ gherkin (2.11.2)
97
+ json (>= 1.4.6)
98
+ has_scope (0.5.1)
99
+ hashie (1.2.0)
100
+ hike (1.2.1)
101
+ httpauth (0.1)
102
+ i18n (0.6.1)
103
+ inherited_resources (1.3.1)
104
+ has_scope (~> 0.5.0)
105
+ responders (~> 0.6)
106
+ journey (1.0.4)
107
+ jquery-rails (2.1.2)
108
+ railties (>= 3.1.0, < 5.0)
109
+ thor (~> 0.14)
110
+ json (1.7.5)
111
+ kaminari (0.13.0)
112
+ actionpack (>= 3.0.0)
113
+ activesupport (>= 3.0.0)
114
+ railties (>= 3.0.0)
115
+ libwebsocket (0.1.5)
116
+ addressable
117
+ mail (2.4.4)
118
+ i18n (>= 0.4.0)
119
+ mime-types (~> 1.16)
120
+ treetop (~> 1.4.8)
121
+ meta_search (1.1.3)
122
+ actionpack (~> 3.1)
123
+ activerecord (~> 3.1)
124
+ activesupport (~> 3.1)
125
+ polyamorous (~> 0.5.0)
126
+ mime-types (1.19)
127
+ multi_json (1.3.6)
128
+ multipart-post (1.1.5)
129
+ mysql2 (0.3.11)
130
+ nokogiri (1.5.5)
131
+ oauth (0.4.6)
132
+ oauth2 (0.6.1)
133
+ faraday (~> 0.7)
134
+ httpauth (~> 0.1)
135
+ multi_json (~> 1.3)
136
+ omniauth (1.0.0)
137
+ hashie (~> 1.2)
138
+ rack
139
+ omniauth-google-oauth2 (0.1.7)
140
+ omniauth (~> 1.0)
141
+ omniauth-oauth2
142
+ omniauth-oauth (1.0.1)
143
+ oauth
144
+ omniauth (~> 1.0)
145
+ omniauth-oauth2 (1.0.2)
146
+ oauth2 (~> 0.6.0)
147
+ omniauth (~> 1.0)
148
+ omniauth-twitter (0.0.7)
149
+ omniauth-oauth (~> 1.0)
150
+ orm_adapter (0.4.0)
151
+ polyamorous (0.5.0)
152
+ activerecord (~> 3.0)
153
+ polyglot (0.3.3)
154
+ rack (1.4.1)
155
+ rack-cache (1.2)
156
+ rack (>= 0.4)
157
+ rack-ssl (1.3.2)
158
+ rack
159
+ rack-test (0.6.1)
160
+ rack (>= 1.0)
161
+ rails (3.2.8)
162
+ actionmailer (= 3.2.8)
163
+ actionpack (= 3.2.8)
164
+ activerecord (= 3.2.8)
165
+ activeresource (= 3.2.8)
166
+ activesupport (= 3.2.8)
167
+ bundler (~> 1.0)
168
+ railties (= 3.2.8)
169
+ railties (3.2.8)
170
+ actionpack (= 3.2.8)
171
+ activesupport (= 3.2.8)
172
+ rack-ssl (~> 1.3.2)
173
+ rake (>= 0.8.7)
174
+ rdoc (~> 3.4)
175
+ thor (>= 0.14.6, < 2.0)
176
+ rake (0.9.2.2)
177
+ rdoc (3.12)
178
+ json (~> 1.4)
179
+ responders (0.9.2)
180
+ railties (~> 3.1)
181
+ rspec (2.11.0)
182
+ rspec-core (~> 2.11.0)
183
+ rspec-expectations (~> 2.11.0)
184
+ rspec-mocks (~> 2.11.0)
185
+ rspec-core (2.11.1)
186
+ rspec-expectations (2.11.3)
187
+ diff-lcs (~> 1.1.3)
188
+ rspec-mocks (2.11.2)
189
+ rspec-rails (2.11.0)
190
+ actionpack (>= 3.0)
191
+ activesupport (>= 3.0)
192
+ railties (>= 3.0)
193
+ rspec (~> 2.11.0)
194
+ rubyzip (0.9.9)
195
+ sass (3.2.1)
196
+ sass-rails (3.2.5)
197
+ railties (~> 3.2.0)
198
+ sass (>= 3.1.10)
199
+ tilt (~> 1.3)
200
+ selenium-webdriver (2.25.0)
201
+ childprocess (>= 0.2.5)
202
+ libwebsocket (~> 0.1.3)
203
+ multi_json (~> 1.0)
204
+ rubyzip
205
+ sprockets (2.1.3)
206
+ hike (~> 1.2)
207
+ rack (~> 1.0)
208
+ tilt (~> 1.1, != 1.3.0)
209
+ thor (0.16.0)
210
+ tilt (1.3.3)
211
+ treetop (1.4.10)
212
+ polyglot
213
+ polyglot (>= 0.3.1)
214
+ tzinfo (0.3.33)
215
+ uglifier (1.3.0)
216
+ execjs (>= 0.3.0)
217
+ multi_json (~> 1.0, >= 1.0.2)
218
+ warden (1.2.1)
219
+ rack (>= 1.0)
220
+ xpath (0.1.4)
221
+ nokogiri (~> 1.3)
9
222
 
10
223
  PLATFORMS
11
224
  ruby
12
225
 
13
226
  DEPENDENCIES
227
+ activeadmin
228
+ coffee-rails (~> 3.2.1)
229
+ cucumber-rails
230
+ devise
14
231
  frame!
232
+ jquery-rails
233
+ meta_search
234
+ mysql2
235
+ oauth2
236
+ omniauth
237
+ omniauth-google-oauth2
238
+ omniauth-twitter
239
+ rails (= 3.2.8)
240
+ rspec-rails
241
+ sass-rails (~> 3.2.3)
242
+ uglifier (>= 1.0.3)
@@ -0,0 +1,36 @@
1
+ Frame
2
+ =====
3
+
4
+ Frame is used to instantly setup websites with just a couple of commands. Frame users several other gems to build the
5
+ webpages up. Once they are created, then they can be fully customized and grow independent of frame.
6
+
7
+
8
+ ## Getting Started
9
+
10
+ To just see what frame was designed to do, create a new project:
11
+
12
+ ```console
13
+ rails new tester
14
+ cd tester
15
+ ```
16
+
17
+ You must add frame as a gem:
18
+ ```ruby
19
+ # Gemfile
20
+ gem 'frame'#, :path => '/home/admin/frame/'
21
+ ```
22
+
23
+
24
+ Then run the bundler:
25
+ ```console
26
+ bundle
27
+ ```
28
+
29
+ To just see what frame was designed to do run (you must hit y/a for the overwrites):
30
+
31
+ ```console
32
+ rails generate frame:all
33
+ rails generate frame:omniauth
34
+ rails server
35
+
36
+ ```
@@ -13,7 +13,15 @@ module Frame
13
13
 
14
14
  private
15
15
 
16
+ def add_if_missing(file, string, options = {}, unless_match = string)
17
+ puts "\n\n==> Adding the following to '#{file}' file:\n'#{string}' unless it already exists"
18
+ file_content = File.read(file)
19
+ #File.open(file, 'a') { |f| f.write("\n") } unless file_content =~ /\n\Z/
20
+ insert_into_file file, string, options unless file_content.include? unless_match
21
+ end
22
+
16
23
  def add_gem(name, options = {})
24
+ #add_if_missing(destination_path("Gemfile"),)
17
25
  gemfile_content = File.read(destination_path("Gemfile"))
18
26
  File.open(destination_path("Gemfile"), 'a') { |f| f.write("\n") } unless gemfile_content =~ /\n\Z/
19
27
  gem name, options unless gemfile_content.include? name
@@ -0,0 +1,11 @@
1
+ Description:
2
+ Generates active_admin installation.
3
+
4
+ Usage:
5
+ Use to generate install and setup active_admin for a project.
6
+
7
+ Examples:
8
+ rails generate frame:admin
9
+
10
+ Methods:
11
+ There are several methods generated which you can use in your application.
@@ -0,0 +1,66 @@
1
+ require 'generators/frame'
2
+ require 'rails/generators/migration'
3
+
4
+ module Frame
5
+ module Generators
6
+ class AdminGenerator < Base
7
+ include Rails::Generators::Migration
8
+
9
+ desc "Installs Active Admin."
10
+
11
+ def add_gems
12
+ add_gem("sass-rails", :group => "test")
13
+ add_gem("meta_search", :group => "test")
14
+ end
15
+
16
+ def install_active_admin
17
+ if yes?("Would you like to install Active Admin?")
18
+ gem("activeadmin")
19
+ Bundler.with_clean_env do
20
+ run "bundle install"
21
+ end
22
+ generate("active_admin:install")
23
+ default_model = "page"
24
+ generate("active_admin:resource #{default_model}")
25
+ end
26
+ end
27
+
28
+ def update_db
29
+ if yes?("Would you like to migrate the database?")
30
+ rake("db:migrate")
31
+ end
32
+ end
33
+
34
+ def update_admin_form
35
+ template 'pages.rb', 'app/admin/pages.rb'
36
+ end
37
+
38
+ def update_pages_controller
39
+ template 'pages_controller.rb', 'app/controller/pages_controller.rb'
40
+ end
41
+
42
+ def cleanup_page_routes
43
+ file='config/routes.rb'
44
+ add_if_missing(file, " match 'pages/:id' => 'pages#show', :as => :page", :after => " resources :pages\n")
45
+ comment_lines file, / resources :pages/
46
+ end
47
+
48
+ def remove_pages_cud
49
+ filenames = ["app/views/pages/new.html.erb", "app/views/pages/edit.html.erb", "app/views/pages/index.html.erb", "app/views/pages/_form.html.erb"]
50
+ filenames.each { |filename|
51
+ if File.exists?(filename) and yes?("Would you like to remove '#{filename}'?")
52
+ remove_file filename
53
+ end
54
+ }
55
+ template 'show.html.erb', 'app/views/pages/show.html.erb'
56
+ end
57
+
58
+ private
59
+
60
+ def destination_path(path)
61
+ File.join(destination_root, path)
62
+ end
63
+
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,15 @@
1
+ ActiveAdmin.register Page do
2
+
3
+ form do |f|
4
+ f.inputs "Page" do
5
+ f.input :name
6
+ f.input :title
7
+ f.input :ordinal
8
+ f.input :url, :as => :url
9
+ f.input :location, :as => :select, :collection => [['Top', 'topbar'], ['Userbar', 'userbar'], ['Sidebar', 'sidebar'], ['Bottom', 'bottombar'], ['Disabled', 'off']]
10
+ f.input :content, :as => :text
11
+ end
12
+ f.buttons
13
+ end
14
+
15
+ end
@@ -0,0 +1,25 @@
1
+ class PagesController < ApplicationController
2
+
3
+ # GET /pages/1
4
+ # GET /pages/1.json
5
+ def show
6
+ if params[:id] == 0
7
+ @page = Page.find_by_name('home') || Page.first
8
+ else
9
+ @page = Page.find(params[:id])
10
+ end
11
+
12
+ respond_to do |format|
13
+ # show.html.erb
14
+ if @page
15
+ format.html
16
+ format.json { render json: @page }
17
+ else
18
+ format.html { redirect_to action: 'new' }
19
+ format.json { render json: @page.errors, status: :unprocessable_entity }
20
+ end
21
+
22
+ end
23
+ end
24
+
25
+ end
@@ -0,0 +1,7 @@
1
+ <%% title @page.title %>
2
+
3
+ <div>
4
+ <%%= @page.content.html_safe %>
5
+ </div>
6
+
7
+ <br />
@@ -0,0 +1,11 @@
1
+ Description:
2
+ Generates active_admin installation.
3
+
4
+ Usage:
5
+ Use to generate install and setup active_admin for a project.
6
+
7
+ Examples:
8
+ rails generate frame:admin
9
+
10
+ Methods:
11
+ There are several methods generated which you can use in your application.
@@ -0,0 +1,24 @@
1
+ require 'generators/frame'
2
+ require 'rails/generators/migration'
3
+
4
+ module Frame
5
+ module Generators
6
+ class AllGenerator < Base
7
+ include Rails::Generators::Migration
8
+
9
+ desc "Installs All of Frame for a new project."
10
+
11
+ def generate_all
12
+ generate("frame:gitignore")
13
+ generate("frame:secret")
14
+ generate("frame:mysql")
15
+ generate("frame:pages")
16
+ generate("frame:layout")
17
+ generate("frame:blueprint")
18
+ generate("frame:devise")
19
+ generate("frame:admin")
20
+ end
21
+
22
+ end
23
+ end
24
+ end