moblove 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/README.md +17 -0
- data/Rakefile +2 -0
- data/lib/generators/mobile/USAGE +9 -0
- data/lib/generators/mobile/mobile_generator.rb +29 -0
- data/lib/generators/mobile/templates/base.layout.css +16 -0
- data/lib/generators/mobile/templates/base.min.css +92 -0
- data/lib/generators/mobile/templates/layout.html.erb +23 -0
- data/lib/generators/mobile/templates/mobile.landscape.css +21 -0
- data/lib/generators/mobile/templates/mobile.min.css +48 -0
- data/lib/moblove/version.rb +3 -0
- data/lib/moblove.rb +3 -0
- data/moblove.gemspec +21 -0
- metadata +83 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# moblove
|
2
|
+
|
3
|
+
## Usage
|
4
|
+
|
5
|
+
### in rails
|
6
|
+
|
7
|
+
_Gemfile_
|
8
|
+
|
9
|
+
group :development do
|
10
|
+
gem "moblove"
|
11
|
+
end
|
12
|
+
|
13
|
+
`rails generate mobile`
|
14
|
+
|
15
|
+
this will create a layout file that uses html5 and media queries to optimize your app for mobile devices.
|
16
|
+
|
17
|
+
The generator will also create stylesheets that serve as a solid baseline for a mobile app-like experience.
|
data/Rakefile
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
class MobileGenerator < Rails::Generators::Base
|
2
|
+
|
3
|
+
source_root File.expand_path('../templates', __FILE__)
|
4
|
+
argument :layout_file, :type => :string, :default => "application"
|
5
|
+
class_option :stylesheets, :type => :boolean, :default => true, :desc => "Including stylesheet files."
|
6
|
+
|
7
|
+
def generate_html
|
8
|
+
template "layout.html.erb", "app/views/layouts/#{layout_file.underscore}.html.erb"
|
9
|
+
end
|
10
|
+
|
11
|
+
def generate_stylesheets
|
12
|
+
if options.stylesheets?
|
13
|
+
stylesheet_files.each do |css|
|
14
|
+
copy_file file_name(css), "public/stylesheets/#{file_name(css)}"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def file_name(path)
|
22
|
+
path[/[^\/]+$/]
|
23
|
+
end
|
24
|
+
|
25
|
+
def stylesheet_files
|
26
|
+
Dir["lib/generators/mobile/templates/*.css"]
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
article, nav, header, section, figure, footer {
|
2
|
+
display: block;
|
3
|
+
}
|
4
|
+
|
5
|
+
body {
|
6
|
+
background-color: #fff;
|
7
|
+
color: #444;
|
8
|
+
font: 12px Helvetica, Arial, sans-serif;
|
9
|
+
margin: 0;
|
10
|
+
padding: 0 12px;
|
11
|
+
}
|
12
|
+
|
13
|
+
a {
|
14
|
+
color: #71cbfb;
|
15
|
+
text-decoration: none;
|
16
|
+
font-weight: bold;
|
17
|
+
}
|
18
|
+
|
19
|
+
a:hover {
|
20
|
+
text-decoration: underline;
|
21
|
+
}
|
22
|
+
|
23
|
+
/* teaser */
|
24
|
+
|
25
|
+
.teaser {
|
26
|
+
font-size: 1.3em;
|
27
|
+
border-bottom: 1px solid #ddd;
|
28
|
+
padding-top: 1.7em;
|
29
|
+
margin-bottom: 3em;
|
30
|
+
}
|
31
|
+
|
32
|
+
.teaser-header {
|
33
|
+
font-size: 1.1em;
|
34
|
+
text-transform: uppercase;
|
35
|
+
font-weight: normal;
|
36
|
+
margin: 0;
|
37
|
+
}
|
38
|
+
|
39
|
+
.teaser-subheader, .article-header {
|
40
|
+
font-size: 2.5em;
|
41
|
+
font-weight: normal;
|
42
|
+
text-transform: lowercase;
|
43
|
+
letter-spacing: 1px;
|
44
|
+
color: #555;
|
45
|
+
margin: 0;
|
46
|
+
padding: 0 0 0.5em 0;
|
47
|
+
}
|
48
|
+
|
49
|
+
.teaser-body, .article-body, footer {
|
50
|
+
line-height: 140%;
|
51
|
+
color: #888;
|
52
|
+
letter-spacing: 4px;
|
53
|
+
padding: 1.5em 0;
|
54
|
+
}
|
55
|
+
|
56
|
+
p {
|
57
|
+
margin: 0;
|
58
|
+
}
|
59
|
+
|
60
|
+
/* articles; lists */
|
61
|
+
|
62
|
+
.article-header {
|
63
|
+
margin: 0;
|
64
|
+
padding: 0;
|
65
|
+
font-size: 2.4em;
|
66
|
+
letter-spacing: -1px;
|
67
|
+
border-bottom: none;
|
68
|
+
color: black;
|
69
|
+
}
|
70
|
+
|
71
|
+
.article-subheader {
|
72
|
+
margin: 0.2em 0 1em 0;
|
73
|
+
padding: 0;
|
74
|
+
font-size: 1.2em;
|
75
|
+
letter-spacing: 2px;
|
76
|
+
font-weight: bold;
|
77
|
+
border-bottom: none;
|
78
|
+
}
|
79
|
+
|
80
|
+
.article-body {
|
81
|
+
letter-spacing: 2px;
|
82
|
+
line-height: 180%;
|
83
|
+
font-size: 1.1em;
|
84
|
+
padding-bottom: 2.3em;
|
85
|
+
}
|
86
|
+
|
87
|
+
footer {
|
88
|
+
clear: both;
|
89
|
+
margin-top: 1.5em;
|
90
|
+
padding: 0.5em 0 0 0;
|
91
|
+
border-top: 1px solid #ddd;
|
92
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<!DOCTYPE HTML>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<title><%= layout_file.camelize %></title>
|
6
|
+
<% if options.stylesheets? %>
|
7
|
+
<link rel="stylesheet" href="css/base.min.css" media="all">
|
8
|
+
<link rel="stylesheet" href="css/base.layout.css" media="(min-width: 900px)">
|
9
|
+
<link rel="stylesheet" href="css/mobile.min.css" media="only screen and (max-width: 800px)">
|
10
|
+
<link rel="stylesheet" href="css/mobile.landscape.css" media="only screen and (orientation:landscape) and (max-width: 800px)">
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<meta name=viewport content="width=device-width, initial-scale=1.0, minimum-scale=0.5 maximum-scale=1.0">
|
14
|
+
|
15
|
+
<!-- iOS: run in fullscreen mode and display upper status bar in translucent mode -->
|
16
|
+
<meta name="apple-mobile-web-app-capable" content="yes">
|
17
|
+
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
18
|
+
</head>
|
19
|
+
<body>
|
20
|
+
<%%= yield %>
|
21
|
+
</body>
|
22
|
+
</html>
|
23
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
.body {
|
2
|
+
margin-top: 1em;
|
3
|
+
}
|
4
|
+
|
5
|
+
.teaser {
|
6
|
+
float: left;
|
7
|
+
width: 38%;
|
8
|
+
margin: 0 12px 0 0;
|
9
|
+
padding: 0;
|
10
|
+
border-bottom: none;
|
11
|
+
border-right: 1px solid #eee;
|
12
|
+
}
|
13
|
+
|
14
|
+
.teaser-body {
|
15
|
+
overflow: show;
|
16
|
+
height: 100%;
|
17
|
+
}
|
18
|
+
|
19
|
+
#content {
|
20
|
+
padding-top: 24px;
|
21
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
body {
|
2
|
+
overflow-x: hidden;
|
3
|
+
height: 100%;
|
4
|
+
min-height: 100%;
|
5
|
+
-webkit-text-size-adjust: none;
|
6
|
+
-ms-text-size-adjust: none;
|
7
|
+
font-size: 10px;
|
8
|
+
}
|
9
|
+
|
10
|
+
a:hover {
|
11
|
+
text-decoration: none;
|
12
|
+
}
|
13
|
+
|
14
|
+
.teaser {
|
15
|
+
margin-bottom: 1em;
|
16
|
+
}
|
17
|
+
|
18
|
+
.teaser-subheader, .article-subheader {
|
19
|
+
overflow: hidden;
|
20
|
+
text-overflow: ellipsis;
|
21
|
+
white-space: nowrap;
|
22
|
+
margin: -5px 0 0 0;
|
23
|
+
padding: 0px;
|
24
|
+
letter-spacing: -1px;
|
25
|
+
font-weight: normal;
|
26
|
+
}
|
27
|
+
|
28
|
+
.article-header, .article-subheader {
|
29
|
+
letter-spacing: 0px;
|
30
|
+
}
|
31
|
+
|
32
|
+
.teaser-body {
|
33
|
+
padding: 0.5em 0 1em 0;
|
34
|
+
overflow: hidden;
|
35
|
+
text-overflow: ellipsis;
|
36
|
+
height: 2em;
|
37
|
+
}
|
38
|
+
|
39
|
+
.article-body {
|
40
|
+
margin: 0.5em 0 0.8em 0;
|
41
|
+
padding: 0;
|
42
|
+
overflow: hidden;
|
43
|
+
max-height: 2.5em;
|
44
|
+
line-height: 120%;
|
45
|
+
}
|
46
|
+
|
47
|
+
.list-item {
|
48
|
+
}
|
data/lib/moblove.rb
ADDED
data/moblove.gemspec
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "moblove/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "moblove"
|
7
|
+
s.version = Moblove::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Ömür Özkir"]
|
10
|
+
s.email = ["oemuer.oezkir@gmail.com"]
|
11
|
+
s.homepage = ""
|
12
|
+
s.summary = %q{Helps you to quickly create webapps for mobile devices}
|
13
|
+
s.description = %q{moblove helps you create mobile webapps by automatically creating templates ans styles that are optimized for mobile devices}
|
14
|
+
|
15
|
+
s.rubyforge_project = "moblove"
|
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
|
metadata
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: moblove
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- !binary |
|
14
|
+
w5Ztw7xyIMOWemtpcg==
|
15
|
+
|
16
|
+
autorequire:
|
17
|
+
bindir: bin
|
18
|
+
cert_chain: []
|
19
|
+
|
20
|
+
date: 2011-05-17 00:00:00 +02:00
|
21
|
+
default_executable:
|
22
|
+
dependencies: []
|
23
|
+
|
24
|
+
description: moblove helps you create mobile webapps by automatically creating templates ans styles that are optimized for mobile devices
|
25
|
+
email:
|
26
|
+
- oemuer.oezkir@gmail.com
|
27
|
+
executables: []
|
28
|
+
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files: []
|
32
|
+
|
33
|
+
files:
|
34
|
+
- .gitignore
|
35
|
+
- Gemfile
|
36
|
+
- README.md
|
37
|
+
- Rakefile
|
38
|
+
- lib/generators/mobile/USAGE
|
39
|
+
- lib/generators/mobile/mobile_generator.rb
|
40
|
+
- lib/generators/mobile/templates/base.layout.css
|
41
|
+
- lib/generators/mobile/templates/base.min.css
|
42
|
+
- lib/generators/mobile/templates/layout.html.erb
|
43
|
+
- lib/generators/mobile/templates/mobile.landscape.css
|
44
|
+
- lib/generators/mobile/templates/mobile.min.css
|
45
|
+
- lib/moblove.rb
|
46
|
+
- lib/moblove/version.rb
|
47
|
+
- moblove.gemspec
|
48
|
+
has_rdoc: true
|
49
|
+
homepage: ""
|
50
|
+
licenses: []
|
51
|
+
|
52
|
+
post_install_message:
|
53
|
+
rdoc_options: []
|
54
|
+
|
55
|
+
require_paths:
|
56
|
+
- lib
|
57
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
hash: 3
|
63
|
+
segments:
|
64
|
+
- 0
|
65
|
+
version: "0"
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
hash: 3
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
version: "0"
|
75
|
+
requirements: []
|
76
|
+
|
77
|
+
rubyforge_project: moblove
|
78
|
+
rubygems_version: 1.3.7
|
79
|
+
signing_key:
|
80
|
+
specification_version: 3
|
81
|
+
summary: Helps you to quickly create webapps for mobile devices
|
82
|
+
test_files: []
|
83
|
+
|