hands_engine 0.8.3

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/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ gem "sqlite3"
6
+ gem "rspec", "~> 2.6.0"
7
+ gem "rspec-rails", "~> 2.6.0"
8
+ gem "capybara", "~> 0.4"
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2010 Hands http://www.hands.com.br
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,19 @@
1
+ == Hands Engine
2
+
3
+ Hands Engine is a command line tool, based on Enginex, which creates a Rails 3 Engine with Rakefile, Gemfile and a ready to run test suite on top of a vendored Rails application.
4
+
5
+ Engines will be available on Rails 3.1 as the new plugin generator and invoked as: "rails plugin new". The port to Rails was made by Piotr Sarnacki.
6
+
7
+ == Usage
8
+
9
+ $ hands ENGINE_NAME [-t RSPEC/TEST_UNIT] [-theme ON/OFF]
10
+
11
+ Give --help to see supported options.
12
+
13
+ == Bugs and Feedback
14
+
15
+ If you discover any bugs, feel free to send me a message or create an issue on GitHub tracker:
16
+
17
+ http://github.com/hands
18
+
19
+ MIT License. Copyright 2010 Hands. http://www.hands.com.br
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
data/bin/hands ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ # -*- mode: ruby -*-
3
+
4
+ require 'hands_engine'
5
+
6
+ ARGV << "--help" if ARGV.empty?
7
+
8
+ HandsEngine.start
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "hands_engine/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "hands_engine"
7
+ s.version = HandsEngine::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Bruno S. Barros (Hands Mobile)"]
10
+ s.email = ["bruno.barros@hands.com.br"]
11
+ s.homepage = ""
12
+ s.summary = %q{Create a site engine, based on Enginex (Jose Valim)}
13
+ s.description = %q{Create a site engine, based on Enginex (Jose Valim)}
14
+
15
+ s.rubyforge_project = "hands_engine"
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+ end
@@ -0,0 +1,136 @@
1
+ require "thor/group"
2
+
3
+ require "active_support"
4
+ require "active_support/version"
5
+ require "active_support/core_ext/string"
6
+
7
+ require "rails/generators"
8
+ require "rails/generators/rails/app/app_generator"
9
+
10
+ class HandsEngine < Thor::Group
11
+ include Thor::Actions
12
+ check_unknown_options!
13
+
14
+ def self.source_root
15
+ @_source_root ||= File.expand_path('../templates', __FILE__)
16
+ end
17
+
18
+ def self.say_step(message)
19
+ @step = (@step || 0) + 1
20
+ class_eval <<-METHOD, __FILE__, __LINE__ + 1
21
+ def step_#{@step}
22
+ #{"puts" if @step > 1}
23
+ say_status "STEP #{@step}", #{message.inspect}
24
+ end
25
+ METHOD
26
+ end
27
+
28
+ argument :path, :type => :string, :desc => "Path to the engine to be created"
29
+
30
+ # change the default framework option on create skeleton
31
+ class_option :test_framework, :default => "rspec", :aliases => "-t", :desc => "Test framework to use. test_unit or rspec."
32
+
33
+ # case -theme off => default site , case -theme on => themes site
34
+ class_option :theme_mode, :default => "off", :aliases => "-theme", :desc => "Create theme skeleton. on or off."
35
+
36
+ desc "Creates a Rails 3 engine with Rakefile, Gemfile and running tests."
37
+
38
+ say_step "Creating site skeleton"
39
+
40
+ def create_root
41
+ self.destination_root = File.expand_path(path, destination_root)
42
+ set_accessors!
43
+
44
+ directory "root", "."
45
+ FileUtils.cd(destination_root)
46
+ end
47
+
48
+ def create_tests_or_specs
49
+ directory test_path
50
+ end
51
+
52
+ def change_gitignore
53
+ template "gitignore", ".gitignore"
54
+ end
55
+
56
+ say_step "Vendoring Rails application at test/dummy"
57
+
58
+ def invoke_rails_app_generator
59
+ invoke Rails::Generators::AppGenerator,
60
+ [ File.expand_path(dummy_path, destination_root) ]
61
+ end
62
+
63
+ say_step "Configuring Rails application"
64
+
65
+ def change_config_files
66
+ store_application_definition!
67
+ template "rails/boot.rb", "#{dummy_path}/config/boot.rb", :force => true
68
+ template "rails/application.rb", "#{dummy_path}/config/application.rb", :force => true
69
+ end
70
+
71
+ say_step "Removing unneeded files"
72
+
73
+ def remove_uneeded_rails_files
74
+ inside dummy_path do
75
+ remove_file ".gitignore"
76
+ remove_file "db/seeds.rb"
77
+ remove_file "doc"
78
+ remove_file "Gemfile"
79
+ remove_file "lib/tasks"
80
+ remove_file "public/images/rails.png"
81
+ remove_file "public/index.html"
82
+ remove_file "public/robots.txt"
83
+ remove_file "README"
84
+ remove_file "test"
85
+ remove_file "vendor"
86
+ end
87
+ end
88
+
89
+ protected
90
+
91
+ def rspec?
92
+ options[:test_framework] == "rspec"
93
+ end
94
+
95
+ def test_unit?
96
+ options[:test_framework] == "test_unit"
97
+ end
98
+
99
+ def test_path
100
+ rspec? ? "spec" : "test"
101
+ end
102
+
103
+ def dummy_path
104
+ "#{test_path}/dummy"
105
+ end
106
+
107
+ def self.banner
108
+ self_task.formatted_usage(self, false)
109
+ end
110
+
111
+ def application_definition
112
+ @application_definition ||= begin
113
+ contents = File.read(File.expand_path("#{dummy_path}/config/application.rb", destination_root))
114
+ contents[(contents.index("module Dummy"))..-1]
115
+ end
116
+ end
117
+ alias :store_application_definition! :application_definition
118
+
119
+ # Cache accessors since we are changing the directory
120
+ def set_accessors!
121
+ self.name
122
+ self.class.source_root
123
+ end
124
+
125
+ def name
126
+ @name ||= File.basename(destination_root)
127
+ end
128
+
129
+ def camelized
130
+ @camelized ||= name.camelize
131
+ end
132
+
133
+ def underscored
134
+ @underscored ||= name.underscore
135
+ end
136
+ end
@@ -0,0 +1,3 @@
1
+ module HandsEngine
2
+ VERSION = "0.8.3"
3
+ end
@@ -0,0 +1,6 @@
1
+ .bundle/
2
+ log/*.log
3
+ pkg/
4
+ db/*.sqlite3
5
+ log/*.log
6
+ tmp/
@@ -0,0 +1,12 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require "active_model/railtie"
4
+ require "active_record/railtie"
5
+ require "action_controller/railtie"
6
+ require "action_view/railtie"
7
+ require "action_mailer/railtie"
8
+
9
+ Bundler.require
10
+ require "<%= underscored %>"
11
+
12
+ <%= application_definition %>
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,5 @@
1
+ Rails.application.routes.draw do
2
+ namespace :<%= underscored %> do
3
+ # add <%= underscored %> routes here!!!
4
+ end
5
+ 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}/**/*"] + ["MIT-LICENSE", "Rakefile", "Gemfile", "README.rdoc"]
8
+ s.version = "0.0.1"
9
+ end
@@ -0,0 +1,12 @@
1
+ source "http://rubygems.org"
2
+
3
+ gem "rails", "<%= ActiveSupport::VERSION::STRING %>"
4
+ gem "capybara", ">= 0.4.0"
5
+ gem "sqlite3"
6
+ <%- if rspec? %>
7
+ gem "rspec-rails", ">= 2.5.0"
8
+ <% end -%>
9
+
10
+ # To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
11
+ gem 'ruby-debug'
12
+ gem 'ruby-debug19'
@@ -0,0 +1,20 @@
1
+ Copyright <%= Date.today.year %> HANDS MOBILE
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,3 @@
1
+ = <%= camelized %>
2
+
3
+ This project rocks and uses MIT-LICENSE.
@@ -0,0 +1,10 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+ require 'rake'
6
+
7
+ <%= camelized %>::Application.load_tasks
8
+
9
+ require '<%= underscored %>/rake/tasks'
10
+ <%= camelized %>::Rake::Tasks.new
@@ -0,0 +1,68 @@
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><%= camelized %></title>
10
+ <meta name="description" content="">
11
+ <meta name="keywords" content="">
12
+ <meta name="author" content="Hands Awesome Mobile">
13
+
14
+ <!-- Mobile viewport optimization http://goo.gl/b9SaQ -->
15
+ <meta name="HandheldFriendly" content="True">
16
+ <meta name="MobileOptimized" content="320"/>
17
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
18
+
19
+ <!-- Home screen icon Mathias Bynens http://goo.gl/6nVq0 -->
20
+ <!-- For iPhone 4 with high-resolution Retina display: -->
21
+ <link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-touch-icon-precomposed.png">
22
+ <!-- For first-generation iPad: -->
23
+ <link rel="apple-touch-icon-precomposed" sizes="72x72" href="apple-touch-icon-precomposed.png">
24
+ <!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
25
+ <link rel="apple-touch-icon-precomposed" href="apple-touch-icon-precomposed.png">
26
+ <!-- For nokia devices: -->
27
+ <link rel="shortcut icon" href="favicon.ico" />
28
+
29
+ <!-- Mobile IE allows us to activate ClearType technology for smoothing fonts for easy reading -->
30
+ <meta http-equiv="cleartype" content="on">
31
+
32
+ <%= stylesheet_link_tag 'default', 'plataforma' %>
33
+
34
+ <% if isBlackberry? %>
35
+ <%= stylesheet_link_tag 'blackberry' %>
36
+ <% elsif isNokia? %>
37
+ <%= stylesheet_link_tag 'nokia' %>
38
+ <% elsif isiOs? %>
39
+ <%= stylesheet_link_tag 'iOS' %>
40
+ <% elsif isAndroid? %>
41
+ <%= stylesheet_link_tag 'android' %>
42
+ <% end %>
43
+
44
+ <%= javascript_include_tag 'zepto.min.js' %>
45
+ <%= javascript_include_tag 'plataforma.js' %>
46
+ </head>
47
+ <body>
48
+
49
+ <%#= banner_tag_options({:pub_id => 130, :zone_id => {:homo => 2584, :prod => 2575}}) %>
50
+
51
+ <%= yield %>
52
+
53
+ <%#= banner_tag_options({:pub_id => 130, :zone_id => {:homo => 2583, :prod => 2576}}) %>
54
+
55
+ <% if content_for? :footer_with_url %>
56
+ <%= yield :footer_with_url %>
57
+ <% else %>
58
+ <%= render :partial => "shared/plataforma_layout_footer.html", :locals => {:home_url => url_for(:controller => "home", :action => "index", :p => params[:p]), :web_version_url => ''} %>
59
+ <% end %>
60
+
61
+ <!-- insert piwik id please -->
62
+ <%= analytics_tag(0, @device, request ) %>
63
+
64
+ <% javascript_tag do %>
65
+ init();
66
+ <% end %>
67
+ </body>
68
+ </html>
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ pt-BR:
5
+ hello: "Oi Mundo!"
@@ -0,0 +1,3 @@
1
+ module <%= camelized %>
2
+ require '<%= underscored %>/engine' if defined? Rails
3
+ end
@@ -0,0 +1,12 @@
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
12
+
@@ -0,0 +1,13 @@
1
+ /* Stylesheet for Android devices */
2
+ .pagination a{
3
+ margin: 0 -2px;
4
+ }
5
+ @media all and (orientation:landscape) {
6
+ nav .two-col li{
7
+ width: 48.9%;
8
+ margin: .7%;
9
+ }
10
+ nav .three-col li{
11
+ margin: .7%;
12
+ }
13
+ }
@@ -0,0 +1,11 @@
1
+ /* Stylesheet for Blackberry devices */
2
+ body{
3
+ margin-right: 1.2%; /* This fixes BlackBerry's browser scroll */
4
+ }
5
+ nav .two-col li{
6
+ width: 48%;
7
+ margin: 1%;
8
+ }
9
+ nav .first li:first-child, nav .last li:last-child{
10
+ width: 98%;
11
+ }
@@ -0,0 +1,213 @@
1
+ /**
2
+ * HTML5 ✰ Boilerplate
3
+ *
4
+ * style.css contains a reset, font normalization and some base styles.
5
+ *
6
+ * Credit is left where credit is due.
7
+ * Much inspiration was taken from these projects:
8
+ * - yui.yahooapis.com/2.8.1/build/base/base.css
9
+ * - camendesign.com/design/
10
+ * - praegnanz.de/weblog/htmlcssjs-kickstart
11
+ */
12
+
13
+
14
+ /**
15
+ * html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline)
16
+ * v1.6.1 2010-09-17 | Authors: Eric Meyer & Richard Clark
17
+ * html5doctor.com/html-5-reset-stylesheet/
18
+ */
19
+
20
+ html, body, div, span, object, iframe,
21
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
22
+ abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp,
23
+ small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li,
24
+ fieldset, form, label, legend,
25
+ table, caption, tbody, tfoot, thead, tr, th, td,
26
+ article, aside, canvas, details, figcaption, figure,
27
+ footer, header, hgroup, menu, nav, section, summary,
28
+ time, mark, audio, video {
29
+ margin: 0;
30
+ padding: 0;
31
+ border: 0;
32
+ font-size: 100%;
33
+ font: inherit;
34
+ vertical-align: baseline;
35
+ }
36
+
37
+ article, aside, details, figcaption, figure,
38
+ footer, header, hgroup, menu, nav, section {
39
+ display: block;
40
+ }
41
+
42
+ blockquote, q { quotes: none; }
43
+
44
+ blockquote:before, blockquote:after,
45
+ q:before, q:after { content: ""; content: none; }
46
+
47
+ ins { background-color: #ff9; color: #000; text-decoration: none; }
48
+
49
+ mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; }
50
+
51
+ del { text-decoration: line-through; }
52
+
53
+ abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; }
54
+
55
+ table { border-collapse: collapse; border-spacing: 0; }
56
+
57
+ hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }
58
+
59
+ input, select { vertical-align: middle; }
60
+
61
+
62
+
63
+ /**
64
+ * Font normalization inspired by YUI Library's fonts.css: developer.yahoo.com/yui/
65
+ */
66
+
67
+
68
+ body { font:13px/1.231 sans-serif; *font-size:small; } /* Hack retained to preserve specificity */
69
+ select, input, textarea, button { font:99% sans-serif; }
70
+
71
+ /* Normalize monospace sizing:
72
+ en.wikipedia.org/wiki/MediaWiki_talk:Common.css/Archive_11#Teletype_style_fix_for_Chrome */
73
+ pre, code, kbd, samp { font-family: monospace, sans-serif; }
74
+
75
+
76
+ /**
77
+ * Minimal base styles.
78
+ */
79
+
80
+ /* Prevent mobile zooming while remain desktop zooming: github.com/shichuan/mobile-html5-boilerplate/issues/closed#issue/14 */
81
+ html { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
82
+
83
+ /* Accessible focus treatment: people.opera.com/patrickl/experiments/keyboard/test */
84
+ a:hover, a:active { outline: none; }
85
+
86
+ ul, ol { margin-left: 2em; }
87
+ ol { list-style-type: decimal; }
88
+
89
+ /* Remove margins for navigation lists */
90
+ nav ul, nav li { margin: 0; list-style:none; list-style-image: none; }
91
+
92
+ small { font-size: 85%; }
93
+ strong, th { font-weight: bold; }
94
+
95
+ td { vertical-align: top; }
96
+
97
+ /* Set sub, sup without affecting line-height: gist.github.com/413930 */
98
+ sub, sup { font-size: 75%; line-height: 0; position: relative; }
99
+ sup { top: -0.5em; }
100
+ sub { bottom: -0.25em; }
101
+
102
+ pre {
103
+ /* www.pathf.com/blogs/2008/05/formatting-quoted-code-in-blog-posts-css21-white-space-pre-wrap/ */
104
+ white-space: pre; white-space: pre-wrap; word-wrap: break-word;
105
+ padding: 15px;
106
+ }
107
+
108
+ textarea { overflow: auto; } /* www.sitepoint.com/blogs/2010/08/20/ie-remove-textarea-scrollbars/ */
109
+
110
+ .iem7 legend { margin-left: -7px; }
111
+
112
+ /* Align checkboxes, radios, text inputs with their label by: Thierry Koblentz tjkdesign.com/ez-css/css/base.css */
113
+ input[type="radio"] { vertical-align: text-bottom; }
114
+ input[type="checkbox"] { vertical-align: bottom; }
115
+ .iem7 input[type="checkbox"] { vertical-align: baseline; }
116
+
117
+ /* Hand cursor on clickable input elements */
118
+ label, input[type="button"], input[type="submit"], input[type="image"], button { cursor: pointer; }
119
+
120
+ /* Webkit browsers add a 2px margin outside the chrome of form elements */
121
+ button, input, select, textarea { margin: 0; }
122
+
123
+ /* Colors for form validity */
124
+ input:valid, textarea:valid { }
125
+ input:invalid, textarea:invalid {
126
+ border-radius: 1px; -moz-box-shadow: 0px 0px 5px red; -webkit-box-shadow: 0px 0px 5px red; box-shadow: 0px 0px 5px red;
127
+ }
128
+ .no-boxshadow input:invalid, .no-boxshadow textarea:invalid { background-color: #f0dddd; }
129
+
130
+
131
+ /* These selection declarations have to be separate
132
+ No text-shadow: twitter.com/miketaylr/status/12228805301
133
+ Also: hot pink! */
134
+ ::-moz-selection{ background: #FF5E99; color:#fff; text-shadow: none; }
135
+ ::selection { background:#FF5E99; color:#fff; text-shadow: none; }
136
+
137
+ /* j.mp/webkit-tap-highlight-color */
138
+ a:link { -webkit-tap-highlight-color: #0000df; }
139
+
140
+ /* Make buttons play nice in IE:
141
+ www.viget.com/inspire/styling-the-button-element-in-internet-explorer/ */
142
+ button { width: auto; overflow: visible; }
143
+
144
+ /* Bicubic resizing for non-native sized IMG:
145
+ code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/ */
146
+ .iem7 img { -ms-interpolation-mode: bicubic; }
147
+
148
+
149
+ /**
150
+ * You might tweak these..
151
+ */
152
+
153
+ body, select, input, textarea {
154
+ /* #444 looks better than black: twitter.com/H_FJ/statuses/11800719859 */
155
+ color: #444;
156
+ /* Set your base font here, to apply evenly */
157
+ /* font-family: Georgia, serif; */
158
+ }
159
+
160
+ /* Headers (h1, h2, etc) have no default font-size or margin; define those yourself */
161
+ h1, h2, h3, h4, h5, h6 { font-weight: bold; }
162
+
163
+ a, a:active, a:visited { color: #607890; }
164
+ a:hover { color: #036; }
165
+
166
+
167
+ /*
168
+ * Helper classes
169
+ */
170
+
171
+ /* prevent callout */
172
+ .nocallout {-webkit-touch-callout: none;}
173
+
174
+ /* Text overflow with ellipsis */
175
+ .ellipsis {
176
+ text-overflow: ellipsis;
177
+ overflow: hidden;
178
+ white-space: nowrap;
179
+ }
180
+
181
+ /* A hack for HTML5 contenteditable attribute on mobile */
182
+ textarea.contenteditable {-webkit-appearance: none;}
183
+
184
+ /* A workaround for S60 3.x and 5.0 devices which do not animated gif images if they have been set as display: none */
185
+ .gifhidden {position: absolute; left: -100%;}
186
+
187
+
188
+
189
+ /* Primary Styles for mobile
190
+ Author:
191
+ */
192
+
193
+
194
+ /*
195
+ * Media queries for responsive design https://github.com/shichuan/mobile-html5-boilerplate/wiki/The-Style
196
+ */
197
+
198
+
199
+ /* Styles for desktop and large screen ----------- */
200
+
201
+ /*styles for 800px and up!*/
202
+ @media only screen and (min-width: 800px) {
203
+ /* Styles */
204
+ }/*/mediaquery*/
205
+
206
+
207
+ /* iPhone 4, Opera Mobile 11 and other high pixel ratio devices ----------- */
208
+ @media
209
+ only screen and (-webkit-min-device-pixel-ratio: 1.5),
210
+ only screen and (-o-min-device-pixel-ratio: 3/2),
211
+ only screen and (min-device-pixel-ratio: 1.5) {
212
+ /* Styles */
213
+ }
@@ -0,0 +1,22 @@
1
+ /* Stylesheet for iOS devices */
2
+ nav{
3
+ overflow: hidden;
4
+ }
5
+ nav .two-col li{
6
+ margin: .6%;
7
+ }
8
+ .pagination a{
9
+ margin: 0 -2px;
10
+ }
11
+ /* @media all and (orientation:portrait) { */
12
+ /* nav a{ */
13
+ /* width: 7.4em; */
14
+ /* width: 96px; */
15
+ /* } */
16
+ /* } */
17
+ /* @media all and (orientation:landscape) { */
18
+ /* nav a{ */
19
+ /* width: 11.55em; */
20
+ /* width: 150px; */
21
+ /* } */
22
+ /* } */
@@ -0,0 +1,30 @@
1
+ /* Stylesheet for Nokia devices */
2
+ /* Nokia does not understand float numbers on % nor em */
3
+
4
+ nav .threeXthree li{
5
+ width: 31%;
6
+ margin: 1%;
7
+ }
8
+ .pagination a{
9
+ line-height: 49px;
10
+ margin: 0 -2px;
11
+ padding: 0 5px 8px;
12
+ }
13
+ #main h2{
14
+ font-size: 16px;
15
+ margin: 1em 0 0;
16
+ }
17
+ #main p img{
18
+ margin: 1em 1em 1em 0;
19
+ }
20
+ #main #author{
21
+ margin: 0 1em 1em 0;
22
+ }
23
+ #main #photo{
24
+ margin-left: 1em;
25
+ padding-left: 1em;
26
+ }
27
+ #main h3{
28
+ margin-right: 1em;
29
+ padding-right: 1em;
30
+ }
@@ -0,0 +1,262 @@
1
+ body{
2
+ background: #fff;
3
+ margin: 1%;
4
+ }
5
+
6
+ img, object, embed{
7
+ max-width: 100%;
8
+ }
9
+
10
+ a, a:active, a:visited{
11
+ color: #007BA8;
12
+ text-decoration: none;
13
+ }
14
+
15
+ a:hover{
16
+ color: #007BA8;
17
+ }
18
+
19
+ /* Header */
20
+
21
+ #logo{
22
+ margin: 2.5% 0 0 5%;
23
+ width: 50%;
24
+ }
25
+
26
+ nav ul{
27
+ overflow: hidden;
28
+ }
29
+
30
+ nav ul li{
31
+ float: left;
32
+ margin: .8%;
33
+ }
34
+
35
+ nav ul .first li:first-child, nav ul .last li:last-child{
36
+ width: 98.8%;
37
+ }
38
+
39
+ nav .two-col li{
40
+ width: 49%;
41
+ }
42
+
43
+ nav .three-col li{
44
+ width: 32%;
45
+ }
46
+
47
+ nav ul a{
48
+ background: #666;
49
+ color: #fff;
50
+ text-align: center;
51
+ text-shadow: #999 1px 1px 1px;
52
+ display: block;
53
+ vertical-align: middle;
54
+ padding-top: 10px;
55
+ height: 40px;
56
+ max-width: 100%;
57
+ text-decoration: none;
58
+ }
59
+
60
+ nav ul a.active{
61
+ background: #007BA8;
62
+ }
63
+
64
+ nav ul a, header ul a:active, nav ul a:visited{
65
+ color: #fff;
66
+ }
67
+
68
+ header select{
69
+ width: 100%;
70
+ font-size: 1.4em;
71
+ }
72
+
73
+ /* Content */
74
+
75
+ #main{
76
+ background: #fff;
77
+ overflow: hidden;
78
+ }
79
+
80
+ p{
81
+ clear: both;
82
+ margin: 1em 0;
83
+ }
84
+
85
+ p img{
86
+ float: left;
87
+ width: 50%;
88
+ margin: .5em .5em .5em 0;
89
+ }
90
+
91
+ h2{
92
+ color: #007BA8;
93
+ font-size: 1.4em;
94
+ margin: .8em 0 0;
95
+ }
96
+
97
+ #author{
98
+ margin: 0 .3em 1em 0;
99
+ font-weight: bold;
100
+ }
101
+
102
+ #photo{
103
+ border-left: 1px solid #666;
104
+ margin-left: .5em;
105
+ padding-left: .5em;
106
+ }
107
+
108
+ h3{
109
+ display: inline;
110
+ color: #691315;
111
+ border-right: 1px solid #666;
112
+ margin-right: .5em;
113
+ padding-right: .5em;
114
+ }
115
+
116
+ /* Submenu Box Template */
117
+
118
+ .submenu{
119
+ text-align: center;
120
+ padding: 1em 0;
121
+ }
122
+
123
+ .submenu select{
124
+ width: 100%;
125
+ }
126
+
127
+ /* news_block Box Template */
128
+
129
+ .news_block{
130
+ margin: .3em 0;
131
+ list-style-type: none;
132
+ }
133
+
134
+ .news_block h2{
135
+ font-family: Georgia, Serif;
136
+ margin-top: 0;
137
+ }
138
+
139
+ .news_block li{
140
+ overflow: hidden;
141
+ margin-bottom: .2em;
142
+ padding: .5em 1.5em .5em 0;
143
+ }
144
+
145
+ .news_block .even{
146
+ background: #fff;
147
+ }
148
+
149
+ .news_block .odd{
150
+ background: #ccc;
151
+ }
152
+
153
+ .news_block .img{
154
+ float: left;
155
+ width: 20%;
156
+ margin-right: .5em;
157
+ }
158
+
159
+ .news_block .img img{
160
+ width: 100%;
161
+ }
162
+
163
+ .news_block .time-ago{
164
+ color: #898989;
165
+ font-size: .6em;
166
+ }
167
+
168
+ /* news_show Box Template */
169
+
170
+ .news_show{
171
+ font-size: 1.2em;
172
+ }
173
+
174
+ .news_show h1{
175
+ font-size: 1.4em;
176
+ font-weight: bold;
177
+ color: #000;
178
+ margin: 1em 0 .2em;
179
+ }
180
+
181
+ .news_show .redacao{
182
+ font-size: .8em;
183
+ }
184
+
185
+ .news_show .redacao strong{
186
+ font-weight: normal;
187
+ }
188
+
189
+ /* Sub-categories */
190
+
191
+ .sub-categories{
192
+ list-style-type: none;
193
+ margin: 0;
194
+ }
195
+ .sub-categories h2{
196
+ font-family: Georgia, Serif;
197
+ margin: .8em 0 0;
198
+ }
199
+ .sub-categories h3{
200
+ display: block;
201
+ border-right: 0;
202
+ padding-right: 0;
203
+ margin-right: 0;
204
+ }
205
+ .sub-categories h2 a {
206
+ color: #9a4662;
207
+ }
208
+ .sub-categories li {
209
+ background: url(../img/high/arrow.png) no-repeat 98% center;
210
+ padding: 1em 0;
211
+ overflow: hidden;
212
+ border-bottom: 1px dotted #666;
213
+ }
214
+ .sub-categories img{
215
+ float: left;
216
+ width: 20%;
217
+ margin-right: .5em;
218
+ }
219
+
220
+ /* Paginator */
221
+
222
+ .pagination{
223
+ text-align: center;
224
+ margin: 5% auto;
225
+ overflow: hidden;
226
+ }
227
+ .pagination a{
228
+ background: url(../img/high/pag-bg.png) repeat-x;
229
+ display: inline-block;
230
+ font-size: 1.4em;
231
+ line-height: 52px;
232
+ padding: 0 .5em 1em;
233
+ }
234
+ .pagination .active{
235
+ text-decoration: underline;
236
+ }
237
+ .pagination .prev_page, .pagination .next_page{
238
+ text-indent: -15000px;
239
+ width: 58px;
240
+ padding: 0 0 10px;
241
+ }
242
+ .pagination .prev_page{
243
+ background: url(../img/high/pag-prev-next.png) no-repeat left center;
244
+ }
245
+ .pagination .next_page{
246
+ background: url(../img/high/pag-prev-next.png) no-repeat right center;
247
+ }
248
+
249
+ /* Rodapé Hands Subnavegacao */
250
+
251
+ .subnavegacao { height:42px; width:100%; background:#efefef; border-top:1px solid #ccc; padding:0; clear:both; margin:0; line-height:0; }
252
+ .subnavegacao_icone { width:50px; height:42px; background:#efefef; line-height:0; margin:0; float:left; }
253
+ .subnavegacao_texto { height:30px; padding:12px 0 0 0; background:#efefef; margin:0; }
254
+ .subnavegacao_texto a { font-size:medium; color:#333333; line-height:100%; }
255
+ #subnavegacao_topo { background:url(http://w.hands.com.br/images/subnavegacao_topo.gif) no-repeat center center; }
256
+ #subnavegacao_home { background:url(http://w.hands.com.br/images/subnavegacao_home.gif) no-repeat center center; }
257
+ #subnavegacao_voltar { background:url(http://w.hands.com.br/images/subnavegacao_voltar.gif) no-repeat center center; }
258
+ #subnavegacao_web { background:url(http://w.hands.com.br/images/subnavegacao_web.gif) no-repeat center center; }
259
+ .rodape { background:#999; padding:8px 0 8px 0; text-align:center; }
260
+ .rodape p { font-size:small; font-weight:bold; margin:0; }
261
+ .rodape a { color:#333; text-decoration:underline; }
262
+ .rodape img { display:block; }
@@ -0,0 +1,7 @@
1
+ require 'spec_helper'
2
+
3
+ describe <%= camelized %> do
4
+ it "should be valid" do
5
+ <%= camelized %>.should be_a(Module)
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Navigation" do
4
+ include Capybara
5
+
6
+ it "should be a valid app" do
7
+ ::Rails.application.should be_a(Dummy::Application)
8
+ end
9
+ end
@@ -0,0 +1,33 @@
1
+ # Configure Rails Envinronment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+ require "rspec/rails"
7
+
8
+ ActionMailer::Base.delivery_method = :test
9
+ ActionMailer::Base.perform_deliveries = true
10
+ ActionMailer::Base.default_url_options[:host] = "test.com"
11
+
12
+ Rails.backtrace_cleaner.remove_silencers!
13
+
14
+ # Configure capybara for integration testing
15
+ require "capybara/rails"
16
+ Capybara.default_driver = :rack_test
17
+ Capybara.default_selector = :css
18
+
19
+ # Run any available migration
20
+ ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
21
+
22
+ # Load support files
23
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
24
+
25
+ RSpec.configure do |config|
26
+ # Remove this line if you don't want RSpec's should and should_not
27
+ # methods or matchers
28
+ require 'rspec/expectations'
29
+ config.include RSpec::Matchers
30
+
31
+ # == Mock Framework
32
+ config.mock_with :rspec
33
+ end
metadata ADDED
@@ -0,0 +1,86 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hands_engine
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.8.3
6
+ platform: ruby
7
+ authors:
8
+ - Bruno S. Barros (Hands Mobile)
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-05-02 00:00:00 -03:00
14
+ default_executable:
15
+ dependencies: []
16
+
17
+ description: Create a site engine, based on Enginex (Jose Valim)
18
+ email:
19
+ - bruno.barros@hands.com.br
20
+ executables:
21
+ - hands
22
+ extensions: []
23
+
24
+ extra_rdoc_files: []
25
+
26
+ files:
27
+ - Gemfile
28
+ - MIT-LICENSE
29
+ - README.rdoc
30
+ - Rakefile
31
+ - bin/hands
32
+ - hands_engine.gemspec
33
+ - lib/hands_engine.rb
34
+ - lib/hands_engine/version.rb
35
+ - lib/template/gitignore
36
+ - lib/template/rails/application.rb
37
+ - lib/template/rails/boot.rb
38
+ - lib/template/rails/routes.rb
39
+ - lib/template/root/%underscored%.gemspec.tt
40
+ - lib/template/root/Gemfile.tt
41
+ - lib/template/root/MIT-LICENSE.tt
42
+ - lib/template/root/README.rdoc.tt
43
+ - lib/template/root/Rakefile.tt
44
+ - lib/template/root/app/views/layouts/%underscored%.html.erb.tt
45
+ - lib/template/root/config/locales/pt-BR.yml
46
+ - lib/template/root/lib/%underscored%.rb.tt
47
+ - lib/template/root/lib/%underscored%.tt/engine.rb
48
+ - lib/template/root/public/stylesheets/android.css
49
+ - lib/template/root/public/stylesheets/blackberry.css
50
+ - lib/template/root/public/stylesheets/default.css
51
+ - lib/template/root/public/stylesheets/iOS.css
52
+ - lib/template/root/public/stylesheets/nokia.css
53
+ - lib/template/root/public/stylesheets/plataforma.css
54
+ - lib/template/spec/%underscored%_spec.rb.tt
55
+ - lib/template/spec/integration/navigation_spec.tt
56
+ - lib/template/spec/spec_helper.rb
57
+ has_rdoc: true
58
+ homepage: ""
59
+ licenses: []
60
+
61
+ post_install_message:
62
+ rdoc_options: []
63
+
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: "0"
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: "0"
78
+ requirements: []
79
+
80
+ rubyforge_project: hands_engine
81
+ rubygems_version: 1.5.0
82
+ signing_key:
83
+ specification_version: 3
84
+ summary: Create a site engine, based on Enginex (Jose Valim)
85
+ test_files: []
86
+