leonardo 1.7.1 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,7 +1,14 @@
1
+ 1.7.2 (October 5th, 2011) Marco Mastrodonato
2
+ * Updated formtastic support to version 2.0
3
+ * Updated template.rb
4
+
5
+
6
+
1
7
  1.7.1 (October 3th, 2011) Marco Mastrodonato
2
8
  * Fixed a layout issue
3
9
 
4
10
 
11
+
5
12
  1.7.0 (September 28th, 2011) Marco Mastrodonato
6
13
  * New feature to add a resource management within a namescape. Unlike the original way (rails g leosca admin/resource ...which remains available), the resource is not under the namespace but only its management so you could create one for several kind of users. Try it adding the new option like this example: --leospace=admin
7
14
  * Huge code improvements
@@ -43,14 +43,8 @@ class LeolayGenerator < Rails::Generators::Base
43
43
  break if files.any?
44
44
  end
45
45
 
46
- #copy_file "styles/#{style_name}/views/kaminari/_next_page.html.erb", "app/views/kaminari/_next_page.html.erb"
47
- #copy_file "styles/#{style_name}/views/kaminari/_page.html.erb", "app/views/kaminari/_page.html.erb"
48
- #copy_file "styles/#{style_name}/views/kaminari/_paginator.html.erb", "app/views/kaminari/_paginator.html.erb"
49
- #copy_file "styles/#{style_name}/views/kaminari/_prev_page.html.erb", "app/views/kaminari/_prev_page.html.erb"
50
46
  directory "styles/#{style_name}/views/kaminari", "app/views/kaminari"
51
47
 
52
-
53
- #copy_file "styles/#{style_name}/images/kaminari/nav.png", "app/assets/images/styles/#{style_name}/kaminari/nav.png"
54
48
  directory "styles/#{style_name}/images/kaminari", "app/assets/images/styles/#{style_name}/kaminari"
55
49
  end
56
50
 
@@ -199,12 +193,15 @@ class LeolayGenerator < Rails::Generators::Base
199
193
  copy_file file, file
200
194
 
201
195
  file = "config/initializers/formtastic.rb"
202
- inject_into_file file, :after => "# Formtastic::SemanticFormBuilder.i18n_lookups_by_default = false" do
196
+ inject_into_file file, :after => "# Formtastic::FormBuilder.i18n_lookups_by_default = false" do
203
197
  <<-FILE.gsub(/^ /, '')
204
198
 
205
- Formtastic::SemanticFormBuilder.i18n_lookups_by_default = true
199
+ Formtastic::FormBuilder.i18n_lookups_by_default = true
206
200
  FILE
207
201
  end if File.exists?(file)
202
+
203
+ path = "lib/templates/erb/"
204
+ remove_file path if File.exists?(path)
208
205
  end
209
206
 
210
207
  def setup_javascript
@@ -244,10 +241,6 @@ class LeolayGenerator < Rails::Generators::Base
244
241
  FILE
245
242
  end
246
243
 
247
- #files = Dir["#{vendor_path}/jquery-ui/jquery.ui.datepicker-??.js"]
248
- #files.each do |f|
249
- # copy_file f, f
250
- #end
251
244
  directory "#{vendor_path}/jquery-ui", "#{vendor_path}/jquery-ui"
252
245
 
253
246
  file = "#{vendor_path}/vendor.js"
@@ -336,12 +329,6 @@ class LeolayGenerator < Rails::Generators::Base
336
329
  copy_file file, file
337
330
  file = "spec/helpers/application_helpers_spec.rb"
338
331
  copy_file file, file
339
- #file = "lib/templates/rspec/scaffold"
340
- #directory file, file
341
- #file = "lib/templates/rspec/scaffold"
342
- #directory file, file
343
- #file = "lib/generators/rspec/scaffold"
344
- #directory file, file
345
332
 
346
333
  end
347
334
 
@@ -1,2 +1,3 @@
1
1
  // Leonardo
2
- // Group files into a folder and require it
2
+ // Group files into a folder and require it
3
+ //= require_tree ./include
data/template.rb CHANGED
@@ -6,6 +6,7 @@
6
6
  # USAGE: rails new yourappname -m template.rb
7
7
  #
8
8
  # -------------------------------------------------------
9
+ # 05-10-2011: Added ajax option
9
10
  # 25-08-2011: Added rspec generation
10
11
  #########################################################
11
12
 
@@ -38,10 +39,6 @@ gem 'state_machine' if yes?("Do you have to handle states ?")
38
39
 
39
40
  formtastic = yes?("Formtastic ?")
40
41
  if formtastic
41
- #gem 'justinfrench-formtastic', :lib => 'formtastic', :source => 'http://gems.github.com'
42
- #rake "gems:install" if install_gem
43
-
44
- #A Rails FormBuilder DSL (with some other goodies) to make it far easier to create beautiful, semantically rich, syntactically awesome, readily stylable and wonderfully accessible HTML forms in your Rails applications.
45
42
  gem 'formtastic'
46
43
  gem 'validation_reflection'
47
44
  end
@@ -56,7 +53,7 @@ if rspec
56
53
  end
57
54
 
58
55
  model_name = nil
59
- devise = yes?("Would you like to install Devise?")
56
+ devise = yes?("Would you install Devise?")
60
57
  if devise
61
58
  gem 'devise'
62
59
  model_name = ask(" What would you like the user model to be called? [user]")
@@ -66,6 +63,9 @@ end
66
63
  cancan = yes?("Authorization ?")
67
64
  gem 'cancan' if cancan
68
65
 
66
+ ajax = yes?("Would you enhance ajax ?")
67
+ gem "rails3-jquery-autocomplete" if ajax
68
+
69
69
  #home = yes?("Generate controller home ? (raccomanded)")
70
70
  home = true
71
71
 
@@ -79,7 +79,7 @@ if leolay
79
79
  leolay_second_color = ask(" Choose secondary color [blank=default color]:")
80
80
  end
81
81
 
82
- run "bundle install"
82
+ run "bundle install" if yes?("Bundle install ?")
83
83
 
84
84
  generate "kaminari:config" if pagination
85
85
 
@@ -95,6 +95,30 @@ end
95
95
 
96
96
  generate "cancan:ability" if cancan
97
97
 
98
+ generate "autocomplete:install" if ajax
99
+
100
+ ####################################################################
101
+ # F I X
102
+ ####################################################################
103
+ p "Update source path #{File.join(File.dirname(__FILE__), app_name)}"
104
+ source_paths << File.join(File.dirname(__FILE__), app_name)
105
+
106
+ if formtastic
107
+ path = "lib/templates/erb/"
108
+ remove_file path if File.exists?(path)
109
+ end
110
+
111
+ if ajax
112
+ path = "public/javascripts/"
113
+ file = "autocomplete-rails.js"
114
+ pathfile = "#{path}#{file}"
115
+ if File.exists? pathfile
116
+ copy_file pathfile, "vendor/assets/javascripts/include/#{file}"
117
+ remove_file path
118
+ end
119
+ end
120
+ ####################################################################
121
+
98
122
  if leolay
99
123
  generate "leolay",
100
124
  "cloudy",
@@ -102,9 +126,12 @@ if leolay
102
126
  ("--second_color=#{leolay_second_color}" if leolay_second_color.any?),
103
127
  (cancan ? "" : "--skip-authorization"),
104
128
  (devise ? "" : "--skip-authentication"),
129
+ (ajax ? "" : "--skip-jquery_ui"),
105
130
  (formtastic ? "" : "--skip-formtastic")
106
131
  end
107
132
 
133
+ generate "autocomplete:install" if ajax
134
+
108
135
  if home
109
136
  generate "controller", "home", "index"
110
137
  route "root :to => 'home#index'"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leonardo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 7
9
- - 1
10
- version: 1.7.1
9
+ - 2
10
+ version: 1.7.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Marco Mastrodonato
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-03 00:00:00 Z
18
+ date: 2011-10-05 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: A generator for creating Rails 3.1 applications ready to go. It generates the layout, the style, the internationalization and manage external gems for authentication, authorization and other. It also provides a customized scaffold to generates cool sites ajax ready in few minutes. If you find a bug please report to m.mastrodonato@gmail.com