hands_engine 1.1.0 → 1.2.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/README.rdoc CHANGED
@@ -7,6 +7,7 @@ Engines will be available on Rails 3.1 as the new plugin generator and invoked a
7
7
  == Usage
8
8
 
9
9
  $ hands path/ENGINE_NAME Ex: hands_engine sites/vwvarejo
10
+ $ hands path/ENGINE_NAME -t themes Ex: hands_engine sites/vwvarejo -t themes
10
11
 
11
12
  Give --help to see supported options.
12
13
 
data/lib/hands_engine.rb CHANGED
@@ -24,7 +24,10 @@ class HandsEngine < Thor::Group
24
24
  METHOD
25
25
  end
26
26
 
27
- argument :path, :type => :string, :desc => "Path to the engine to be created"
27
+ argument :path, :type => :string, :desc => "Path to the engine to be created."
28
+
29
+ class_option :themes, :default => "default", :aliases => "-t",
30
+ :desc => "Hands engine to use. default or themes."
28
31
 
29
32
  desc "Creates a Rails 3 engine."
30
33
 
@@ -35,7 +38,7 @@ class HandsEngine < Thor::Group
35
38
  [ File.expand_path(path, destination_root) ]
36
39
  end
37
40
 
38
- say_step "Removing unneeded files"
41
+ say_step "Removing unneeded files #{name.underscore}"
39
42
 
40
43
  def remove_uneeded_rails_files
41
44
  inside path do
@@ -50,6 +53,8 @@ class HandsEngine < Thor::Group
50
53
  remove_file "config/database.yml"
51
54
  remove_file "config/routes.rb"
52
55
  remove_file "config/environment.rb"
56
+ remove_file "config/application.rb"
57
+ remove_file "config/boot.rb"
53
58
  remove_file "db"
54
59
  remove_file "doc"
55
60
  remove_file "log"
@@ -57,18 +62,28 @@ class HandsEngine < Thor::Group
57
62
  remove_file "app/assets/images/rails.png"
58
63
  remove_file "public/index.html"
59
64
  remove_file "public/robots.txt"
60
- remove_file "public/javascripts/application.js"
61
- remove_file "public/javascripts/controls.js"
62
- remove_file "public/javascripts/dragdrop.js"
63
- remove_file "public/javascripts/effects.js"
64
- remove_file "public/javascripts/prototype.js"
65
- remove_file "public/javascripts/rails.js"
66
65
  remove_file "README"
67
66
  remove_file "script"
68
67
  remove_file "tmp"
69
68
  remove_file "test"
70
69
  remove_file "vendor"
71
70
  end
71
+
72
+ if themes?
73
+ inside path do
74
+ remove_file "app/assets/javascripts/script.js"
75
+ remove_file "app/assets/javascripts/application.js"
76
+ remove_file "app/assets/stylesheets/application.css"
77
+ remove_file "app/controllers"
78
+ remove_file "app/helpers"
79
+ remove_file "app/models"
80
+ remove_file "app/views"
81
+ remove_file "config"
82
+ remove_file "lib/tasks"
83
+ remove_file "public"
84
+ remove_file "Rakefile"
85
+ end
86
+ end
72
87
  end
73
88
 
74
89
  say_step "Creating site engine #{name.underscore}"
@@ -77,11 +92,22 @@ class HandsEngine < Thor::Group
77
92
  self.destination_root = File.expand_path(path, destination_root)
78
93
  set_accessors!
79
94
 
80
- directory "root", "."
81
- FileUtils.cd(destination_root)
95
+ if themes?
96
+ directory "themes", "."
97
+ FileUtils.cd(destination_root)
98
+ else
99
+ directory "root", "."
100
+ FileUtils.cd(destination_root)
101
+ end
82
102
  end
83
103
 
84
104
  protected
105
+
106
+ # if themes site return true
107
+ def themes?
108
+ options[:themes] == "themes"
109
+ end
110
+
85
111
  # Cache accessors since we are changing the directory
86
112
  def set_accessors!
87
113
  self.name
@@ -1,3 +1,3 @@
1
1
  module HandsEngine
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -6,4 +6,4 @@ Gem::Specification.new do |s|
6
6
  s.description = "<%= camelized %> mobilized by Hands."
7
7
  s.files = Dir["{app,lib,config}/**/*"]
8
8
  s.version = "0.0.1"
9
- end
9
+ end
@@ -0,0 +1,9 @@
1
+ # Provide a simple gemspec so you can easily use your hands_engine
2
+ # project in your rails apps through git.
3
+ Gem::Specification.new do |s|
4
+ s.name = "<%= underscored %>"
5
+ s.summary = "<%= camelized %> mobilized by Hands."
6
+ s.description = "<%= camelized %> mobilized by Hands."
7
+ s.files = Dir["{app,lib,config}/**/*"]
8
+ s.version = "0.0.1"
9
+ end
@@ -0,0 +1,32 @@
1
+ menu:
2
+ template: "menu"
3
+ level: 0
4
+ css_layout: "two-col"
5
+
6
+ home:
7
+ box1:
8
+ html_container: "ul"
9
+ template: "news_banner"
10
+ section_code: "ENTER_YOUR_SECTION_CODE"
11
+ content_type: "item"
12
+ box2:
13
+ html_container: "ul"
14
+ template: "news_block"
15
+ section_code: "ENTER_YOUR_SECTION_CODE"
16
+ content_type: "item"
17
+ box2:
18
+ html_container: "ul"
19
+ template: "gallery"
20
+ section_code: "ENTER_YOUR_SECTION_CODE"
21
+ content_type: "item"
22
+
23
+ section:
24
+ box1:
25
+ html_container: "ul"
26
+ template: "news_block"
27
+ content_type: "item"
28
+
29
+ view:
30
+ box1:
31
+ content_type: "item"
32
+ template: "news_show"
@@ -0,0 +1,79 @@
1
+ <!doctype html>
2
+ <!-- Conditional comment for mobile ie7 http://blogs.msdn.com/b/iemobile/ -->
3
+ <!-- Appcache Facts http://appcachefacts.info/ -->
4
+ <!--[if IEMobile 7 ]> <html class="no-js iem7" manifest="default.appcache?v=1"> <![endif]-->
5
+ <!--[if (gt IEMobile 7)|!(IEMobile)]><!--> <html class="no-js" manifest="default.appcache?v=1"> <!--<![endif]-->
6
+ <head>
7
+ <meta charset="utf-8">
8
+
9
+ <title>INSERT THE APP NAME HERE</title>
10
+ <meta name="description" content="">
11
+ <meta name="author" content="Hands Awesome Mobile">
12
+
13
+ <!-- Mobile viewport optimization http://goo.gl/b9SaQ -->
14
+ <meta name="HandheldFriendly" content="True">
15
+ <meta name="MobileOptimized" content="320"/>
16
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
17
+
18
+ <!-- Home screen icon Mathias Bynens http://goo.gl/6nVq0 -->
19
+ <!-- For iPhone 4 with high-resolution Retina display: -->
20
+ <link rel="apple-touch-icon-precomposed" sizes="114x114" href="<%= theme_image_path('apple-touch-icon-precomposed.png') %>">
21
+ <!-- For first-generation iPad: -->
22
+ <link rel="apple-touch-icon-precomposed" sizes="72x72" href="<%= theme_image_path('apple-touch-icon-precomposed.png') %>">
23
+ <!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
24
+ <link rel="apple-touch-icon-precomposed" href="<%= theme_image_path('apple-touch-icon-precomposed.png') %>">
25
+ <!-- For nokia devices: -->
26
+ <link rel="shortcut icon" href="<%= theme_image_path('favicon.ico') %>" />
27
+
28
+ <!-- Mobile IE allows us to activate ClearType technology for smoothing fonts for easy reading -->
29
+ <meta http-equiv="cleartype" content="on">
30
+
31
+ <%= stylesheet_link_tag 'default', 'plataforma' %>
32
+ <%= theme_stylesheet %>
33
+ <!-- <%= theme_stylesheet 'mscloud' %> -->
34
+
35
+ <% if isBlackberry? %>
36
+ <%= stylesheet_link_tag 'blackberry' %>
37
+ <% elsif isNokia? %>
38
+ <%= stylesheet_link_tag 'nokia' %>
39
+ <% elsif isiOs? %>
40
+ <%= stylesheet_link_tag 'iOS' %>
41
+ <% elsif isAndroid? %>
42
+ <%= stylesheet_link_tag 'android' %>
43
+ <% end %>
44
+
45
+ <%= javascript_include_tag 'zepto.min.js' %>
46
+ <%= javascript_include_tag 'plataforma.js' %>
47
+
48
+ <%= theme_javascript %>
49
+ </head>
50
+ <body <%= section_code_html_id %>>
51
+
52
+ <!-- coloque seu banner tag aqui, descomente a linha abaixo -->
53
+ <%# banner_tag_options({:pub_id => 1, :zone_id => {:homo => 2626, :prod => 1909}}) %>
54
+
55
+ <div class="header">
56
+ <%= link_to(image_tag(theme_image_path("high/logo.png"), :id => "logo"), root_path) %>
57
+ <%= menu %>
58
+ </div>
59
+
60
+ <%= content %>
61
+
62
+ <!-- coloque seu banner tag aqui, descomente a linha abaixo -->
63
+ <%# banner_tag_options({:pub_id => 1, :zone_id => {:homo => 2627, :prod => 2152}}) %>
64
+
65
+ <% if content_for? :footer_with_url %>
66
+ <%= yield :footer_with_url %>
67
+ <% else %>
68
+ <%= render :partial => "shared/plataforma_layout_footer.html", :locals => {:home_url => url_for(:controller => "home", :action => "index", :p => params[:p]), :web_version_url => ''} %>
69
+ <% end %>
70
+
71
+ <!-- para usar descomente a linha abaixo -->
72
+ <%# analytics_tag(88, @device, request ) %>
73
+
74
+ <!-- dentro da funcao init ficam todas as inicializacoes do javascript do site -->
75
+ <% javascript_tag do %>
76
+ init();
77
+ <% end %>
78
+ </body>
79
+ </html>
@@ -0,0 +1,3 @@
1
+ module <%= camelized %>
2
+ require '<%= underscored %>/engine' if defined? Rails
3
+ end
@@ -0,0 +1,11 @@
1
+ require "<%= underscored %>" # Require all the real code
2
+ require "rails"
3
+
4
+ module <%= camelized %>
5
+ class Engine < Rails::Engine
6
+ initializer "static assets" do |app|
7
+ # app.middleware.use ActionDispatch::Static, "#{root}/public" # Old way, does not work in production
8
+ app.middleware.insert_after ActionDispatch::Static, ActionDispatch::Static, "#{root}/public"
9
+ end
10
+ end
11
+ end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: hands_engine
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.1.0
5
+ version: 1.2.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Bruno S. Barros (Hands Mobile)
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-13 00:00:00 -03:00
13
+ date: 2011-05-16 00:00:00 -03:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -67,6 +67,15 @@ files:
67
67
  - lib/templates/root/config/routes.rb.tt
68
68
  - lib/templates/root/lib/%underscored%.rb.tt
69
69
  - lib/templates/root/lib/%underscored%/engine.rb.tt
70
+ - lib/templates/themes/%underscored%.gemspec.tt
71
+ - lib/templates/themes/app/assets/images/%underscored%/rails.png
72
+ - lib/templates/themes/app/assets/javascripts/%underscored%/script.js
73
+ - lib/templates/themes/app/assets/stylesheets/%underscored%/colors.css
74
+ - lib/templates/themes/app/assets/stylesheets/%underscored%/style.css
75
+ - lib/templates/themes/behavior.yml
76
+ - lib/templates/themes/layout.html.erb
77
+ - lib/templates/themes/lib/%underscored%.rb.tt
78
+ - lib/templates/themes/lib/%underscored%/engine.rb.tt
70
79
  - spec/hands_engine_spec.rb
71
80
  - spec/spec_helper.rb
72
81
  has_rdoc: true