gridomatic 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Manifest.txt +12 -0
- data/README.rdoc +125 -0
- data/Rakefile +25 -0
- data/app/helpers/gridomatic_helper.rb +185 -0
- data/lib/gridomatic.rb +6 -0
- data/public/stylesheets/gridomatic.css +209 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/test/test_gridomatic.rb +11 -0
- data/test/test_helper.rb +3 -0
- metadata +105 -0
data/History.txt
ADDED
data/Manifest.txt
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
= gridomatic
|
2
|
+
|
3
|
+
* http://github.com/cmdjohnson/gridomatic
|
4
|
+
|
5
|
+
== DESCRIPTION:
|
6
|
+
|
7
|
+
Easy floatable grid structures for Rails.
|
8
|
+
|
9
|
+
Don't have too much data to display but still need to fill up that screen?
|
10
|
+
|
11
|
+
Why don't you present your data in a grid of boxes. Provided you color them right, boxes are very easy to the eyes because the mind understands its structure. Add to that custom coloring, (e.g. each controller can have its own color) background images and clickable boxes and you have a navigation that is not only great looking, but is also very easy to use on touchpad-enabled devices such as an iPad.
|
12
|
+
|
13
|
+
This is what it looks like:
|
14
|
+
https://github.com/cmdjohnson/gridomatic/blob/master/screenshots/overview.png
|
15
|
+
|
16
|
+
== SYNOPSIS:
|
17
|
+
|
18
|
+
A simple box with heading
|
19
|
+
|
20
|
+
= render_box :heading => "foo" do
|
21
|
+
- "bar"
|
22
|
+
|
23
|
+
Screenshot: https://github.com/cmdjohnson/gridomatic/blob/master/screenshots/single-box.png
|
24
|
+
|
25
|
+
Create a clickable box (no heading this time):
|
26
|
+
|
27
|
+
- link_to "http://www.example.com/" do
|
28
|
+
= render_box do
|
29
|
+
- "bar"
|
30
|
+
|
31
|
+
Create a bunch of boxes that all look the same, except for one
|
32
|
+
|
33
|
+
- array = Array.new(7)
|
34
|
+
- array[5] = { :heading => "wrong, ", :content => "i feel different", :heading_color => "red", :background_color => "orange", :link => "http://www.google.com/" }
|
35
|
+
= render_boxes array, :template => { :float_left => true, :heading => "same", :content => "stuff every day" }
|
36
|
+
|
37
|
+
Screenshot: https://github.com/cmdjohnson/gridomatic/blob/master/screenshots/multi-box-with-override.png
|
38
|
+
|
39
|
+
The render_box method accepts the following options:
|
40
|
+
|
41
|
+
# options:
|
42
|
+
# - content (string)
|
43
|
+
# - heading (string)
|
44
|
+
# - float_left (true/false)
|
45
|
+
# - text_align_center (true/false)
|
46
|
+
# - highlight (true/false)
|
47
|
+
# - background_image (url)
|
48
|
+
# - bigfont (true/false)
|
49
|
+
# - heading_color (color name, e.g. 'red')
|
50
|
+
# - background_color (color name, e.g. 'blue')
|
51
|
+
# - inner_div_style (css style, e.g. "width: 382px; height: 281px;")
|
52
|
+
# - outer_div_style (same)
|
53
|
+
# - heading_style (same)
|
54
|
+
# - height (css style unit, e.g. "100px" or "6em")
|
55
|
+
# - solid_background (true/false)
|
56
|
+
|
57
|
+
You can wrap an <a> tag around the box and it will have a:hover CSS enabled, e.g.
|
58
|
+
# - link_to "http://www.example.com/" do
|
59
|
+
# = render_box do
|
60
|
+
# - "bar"
|
61
|
+
|
62
|
+
== REQUIREMENTS:
|
63
|
+
|
64
|
+
Rails 2.3 or above, tested with 2.3.12.
|
65
|
+
|
66
|
+
== INSTALL:
|
67
|
+
|
68
|
+
Copy the file gridomatic_helper.rb to your app/helpers folder and copy gridomatic.css to your public/stylesheets folder.
|
69
|
+
|
70
|
+
You need to reference the gridomatic.css in your application layout, i.e. app/views/layouts/application.html.erb:
|
71
|
+
|
72
|
+
<link rel="stylesheet" type="text/css" media="screen" href="/stylesheets/gridomatic.css" />
|
73
|
+
|
74
|
+
The reference must be placed within the <head> section.
|
75
|
+
|
76
|
+
There is a gem version available, but I don't even use it.
|
77
|
+
|
78
|
+
== LIMITATIONS:
|
79
|
+
|
80
|
+
Unfortunately, you cannot use multiple lines to concatenate them. For instance,
|
81
|
+
|
82
|
+
- link_to "http://www.example.com/" do
|
83
|
+
= render_box do
|
84
|
+
- "foo"
|
85
|
+
- "bar"
|
86
|
+
- "baz"
|
87
|
+
|
88
|
+
=> "baz"
|
89
|
+
|
90
|
+
Will always return "baz" because that's the return value. This is against HAML's idea that you should be able to concatenate anything you put right underneath each other. Ruby blocks simply have a single return value and, as far as I know, are not aware of the difference between "foo" "bar" "baz" or "baz" -- they will only see "baz".
|
91
|
+
|
92
|
+
== OTHER NOTES:
|
93
|
+
|
94
|
+
In this description, I've used HAML examples for the view, but this ofcourse depends on your own preference. In ERB, a simple box would be rendered as such:
|
95
|
+
|
96
|
+
<%= render_box :heading => "foo" do %>
|
97
|
+
<%- "bar" %>
|
98
|
+
<%- end %>
|
99
|
+
|
100
|
+
Don't forget the 'end' tag which is required by ERB.
|
101
|
+
|
102
|
+
== LICENSE:
|
103
|
+
|
104
|
+
(The MIT License)
|
105
|
+
|
106
|
+
Copyright (c) 2011 Commander Johnson <commanderjohnson@gmail.com>
|
107
|
+
|
108
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
109
|
+
a copy of this software and associated documentation files (the
|
110
|
+
'Software'), to deal in the Software without restriction, including
|
111
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
112
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
113
|
+
permit persons to whom the Software is furnished to do so, subject to
|
114
|
+
the following conditions:
|
115
|
+
|
116
|
+
The above copyright notice and this permission notice shall be
|
117
|
+
included in all copies or substantial portions of the Software.
|
118
|
+
|
119
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
120
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
121
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
122
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
123
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
124
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
125
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
gem 'hoe', '>= 2.1.0'
|
3
|
+
require 'hoe'
|
4
|
+
require 'fileutils'
|
5
|
+
require './lib/gridomatic'
|
6
|
+
|
7
|
+
Hoe.plugin :newgem
|
8
|
+
# Hoe.plugin :website
|
9
|
+
# Hoe.plugin :cucumberfeatures
|
10
|
+
|
11
|
+
# Generate all the Rake tasks
|
12
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
13
|
+
$hoe = Hoe.spec 'gridomatic' do
|
14
|
+
self.developer 'Commander Johnson', 'commanderjohnson@gmail.com'
|
15
|
+
self.rubyforge_name = self.name # TODO this is default value
|
16
|
+
# self.extra_deps = [['activesupport','>= 2.0.2']]
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
require 'newgem/tasks'
|
21
|
+
Dir['tasks/**/*.rake'].each { |t| load t }
|
22
|
+
|
23
|
+
# TODO - want other tests/tasks run by default? Add them to the list
|
24
|
+
# remove_task :default
|
25
|
+
# task :default => [:spec, :features]
|
@@ -0,0 +1,185 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
module GridomaticHelper
|
3
|
+
COLORS = %w( blue red green yellow cyan orange purple )
|
4
|
+
|
5
|
+
# Render multiple boxes.
|
6
|
+
# Takes as argument a single array of Hash
|
7
|
+
# For the Hash options, please see render_box.
|
8
|
+
#
|
9
|
+
# The boxes are wrapped in a div with class "textboxes".
|
10
|
+
# You can pass individual styling using :textboxes_style => textboxes_style.
|
11
|
+
#
|
12
|
+
# You can specify a template Hash ( :template => template ) which will be merged with each
|
13
|
+
# indivdual's box's options Hash. This way, you can create a list of boxes that look the same
|
14
|
+
# but some have their own characteristics.
|
15
|
+
#
|
16
|
+
# Also adds a div with style "clear: both" after the output so other objects won't start floating.
|
17
|
+
# If you don't want that, add :noclear => true as an option.
|
18
|
+
def render_boxes(array = [], options = {})
|
19
|
+
boxes = ""
|
20
|
+
|
21
|
+
template = {}
|
22
|
+
|
23
|
+
if options[:template].class.to_s.eql?("Hash")
|
24
|
+
template = options[:template]
|
25
|
+
end
|
26
|
+
|
27
|
+
array.each do |individual_options|
|
28
|
+
box_options = template
|
29
|
+
box_options = template.merge(individual_options) unless individual_options.nil?
|
30
|
+
r = render_box(box_options)
|
31
|
+
|
32
|
+
unless individual_options[:link].blank?
|
33
|
+
r = "<a href='#{individual_options[:link]}' target='#{individual_options[:link_target]}' class='no_underline render_boxes'>#{r}</a>"
|
34
|
+
end
|
35
|
+
|
36
|
+
boxes += r unless r.blank?
|
37
|
+
end
|
38
|
+
|
39
|
+
boxes_div = content_tag :div, boxes, :class => "textboxes", :style => options[:textboxes_style]
|
40
|
+
|
41
|
+
clear_both_ = ""
|
42
|
+
|
43
|
+
unless options[:noclear] === true
|
44
|
+
clear_both_ = clear_both
|
45
|
+
end
|
46
|
+
|
47
|
+
boxes_div + clear_both_
|
48
|
+
end
|
49
|
+
|
50
|
+
# Render a box.
|
51
|
+
#
|
52
|
+
# options:
|
53
|
+
# - content (string)
|
54
|
+
# - heading (string)
|
55
|
+
# - float_left (true/false)
|
56
|
+
# - text_align_center (true/false)
|
57
|
+
# - highlight (true/false)
|
58
|
+
# - background_image (url)
|
59
|
+
# - bigfont (true/false)
|
60
|
+
# - heading_color (color name, e.g. 'red')
|
61
|
+
# - background_color (color name, e.g. 'blue')
|
62
|
+
# - inner_div_style (css style, e.g. "width: 382px; height: 281px;")
|
63
|
+
# - outer_div_style (same)
|
64
|
+
# - heading_style (same)
|
65
|
+
# - height (css style unit, e.g. "100px" or "6em")
|
66
|
+
# - solid_background (true/false)
|
67
|
+
#
|
68
|
+
# You can wrap an <a> tag around the box and it will have a:hover CSS enabled, e.g.
|
69
|
+
# - link_to "http://www.example.com/" do
|
70
|
+
# = render_box do
|
71
|
+
# - "bar"
|
72
|
+
def render_box(options = {})
|
73
|
+
# list of classes for the outer div.
|
74
|
+
outer_div_classes = [ "textbox_container" ]
|
75
|
+
# inner div, same story
|
76
|
+
inner_div_classes = [ "textbox" ]
|
77
|
+
# heading
|
78
|
+
heading_classes = [ "heading" ]
|
79
|
+
|
80
|
+
content = yield if block_given?
|
81
|
+
content ||= options[:content]
|
82
|
+
|
83
|
+
return nil if content.blank? && options[:heading].blank? unless options[:empty]
|
84
|
+
|
85
|
+
# Options:
|
86
|
+
# float_left
|
87
|
+
outer_div_classes.push("float_left") if options[:float_left] === true
|
88
|
+
# text_align_center
|
89
|
+
inner_div_classes.push("text_align_center") if options[:text_align_center] === true
|
90
|
+
# highlight
|
91
|
+
inner_div_classes.push("highlight") if options[:highlight] === true
|
92
|
+
# background_image
|
93
|
+
background_image = options[:background_image]
|
94
|
+
# header color
|
95
|
+
heading_color = options[:heading_color]
|
96
|
+
inner_div_classes.push("textbox_#{heading_color}") unless heading_color.blank?
|
97
|
+
# background color
|
98
|
+
background_color = options[:background_color]
|
99
|
+
|
100
|
+
############################################################################
|
101
|
+
# inner div
|
102
|
+
############################################################################
|
103
|
+
|
104
|
+
inner_div_classes.push("#{background_color}_background") unless background_color.blank?
|
105
|
+
|
106
|
+
inner_div_options = { :class => c(inner_div_classes) }
|
107
|
+
inner_div_styles = []
|
108
|
+
unless background_image.blank?
|
109
|
+
# opacity:0.4;filter:alpha(opacity=40);
|
110
|
+
inner_div_styles.push "background: url(#{background_image}) no-repeat center;"
|
111
|
+
end
|
112
|
+
|
113
|
+
unless options[:height].blank?
|
114
|
+
inner_div_styles.push "height: #{options[:height]}"
|
115
|
+
end
|
116
|
+
|
117
|
+
unless options[:width].blank?
|
118
|
+
inner_div_styles.push "width: #{options[:width]}"
|
119
|
+
end
|
120
|
+
|
121
|
+
unless inner_div_styles.blank?
|
122
|
+
inner_div_options[:style] = c(inner_div_styles)
|
123
|
+
|
124
|
+
end
|
125
|
+
inner_div_options[:style] ||= options[:inner_div_style] # can be overridden
|
126
|
+
|
127
|
+
############################################################################
|
128
|
+
# outer div
|
129
|
+
############################################################################
|
130
|
+
|
131
|
+
outer_div_options = { :class => c(outer_div_classes) }
|
132
|
+
outer_div_options[:style] = options[:outer_div_style]
|
133
|
+
|
134
|
+
############################################################################
|
135
|
+
# text div
|
136
|
+
############################################################################
|
137
|
+
|
138
|
+
text_div_options = {}
|
139
|
+
text_div_classes = []
|
140
|
+
|
141
|
+
text_div_classes.push "bigfont" if options[:bigfont] === true
|
142
|
+
text_div_classes.push "solid_background" if options[:solid_background] === true
|
143
|
+
|
144
|
+
text_div_options[:class] = c(text_div_classes)
|
145
|
+
|
146
|
+
############################################################################
|
147
|
+
# go render
|
148
|
+
############################################################################
|
149
|
+
|
150
|
+
# let's go, outer div
|
151
|
+
content_tag :div, outer_div_options do
|
152
|
+
content_tag :div, inner_div_options do
|
153
|
+
# heading
|
154
|
+
heading = ""
|
155
|
+
heading = content_tag :p, options[:heading], :class => c(heading_classes), :style => options[:heading_style] unless options[:heading].blank?
|
156
|
+
# text div
|
157
|
+
content_tag_ = content_tag :div, text_div_options do
|
158
|
+
content_tag :p, content, :class => "inner_p"
|
159
|
+
end
|
160
|
+
# do it!
|
161
|
+
heading + content_tag_
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
# If you want to put two boxes side by side, they both have to be float: left
|
167
|
+
# Add this tag after the last one to prevent other blocks from floating.
|
168
|
+
def clear_both
|
169
|
+
content_tag :div, nil, :class => "clear_both"
|
170
|
+
end
|
171
|
+
|
172
|
+
private
|
173
|
+
|
174
|
+
# c: convert array to string just like to_s but with a space between them.
|
175
|
+
def c(array = [])
|
176
|
+
str = ""
|
177
|
+
|
178
|
+
for a in array
|
179
|
+
str += a + " "
|
180
|
+
end
|
181
|
+
|
182
|
+
str.strip
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
data/lib/gridomatic.rb
ADDED
@@ -0,0 +1,209 @@
|
|
1
|
+
/* ========================================================================= */
|
2
|
+
/* begin gridomatic */
|
3
|
+
/* ========================================================================= */
|
4
|
+
|
5
|
+
/*
|
6
|
+
Text Boxes
|
7
|
+
|
8
|
+
supported heading colors:
|
9
|
+
|
10
|
+
(use textbox_*, e.g. textbox_red)
|
11
|
+
|
12
|
+
red
|
13
|
+
green
|
14
|
+
yellow
|
15
|
+
cyan
|
16
|
+
orange
|
17
|
+
purple
|
18
|
+
white
|
19
|
+
|
20
|
+
supported background colors:
|
21
|
+
|
22
|
+
(use *_background, e.g. blue_background)
|
23
|
+
|
24
|
+
blue
|
25
|
+
red
|
26
|
+
green
|
27
|
+
yellow
|
28
|
+
cyan
|
29
|
+
orange
|
30
|
+
purple
|
31
|
+
white
|
32
|
+
*/
|
33
|
+
|
34
|
+
/* text box */
|
35
|
+
|
36
|
+
div.textbox
|
37
|
+
{
|
38
|
+
/* steal green color from wikipedia */
|
39
|
+
background-color: #f5faff;
|
40
|
+
/* steal border from wikipedia */
|
41
|
+
border:1px solid #cef2e0;
|
42
|
+
width: 200px;
|
43
|
+
height: 200px;
|
44
|
+
padding: 0.5em;
|
45
|
+
margin: 0.5em;
|
46
|
+
|
47
|
+
opacity:0.8;filter:alpha(opacity=80);
|
48
|
+
}
|
49
|
+
|
50
|
+
div.solid_background
|
51
|
+
{
|
52
|
+
/* steal green color from wikipedia */
|
53
|
+
background-color: #f5faff;
|
54
|
+
/* steal border from wikipedia */
|
55
|
+
border:1px solid #cef2e0;
|
56
|
+
/* opacity */
|
57
|
+
opacity:0.95;filter:alpha(opacity=95);
|
58
|
+
}
|
59
|
+
|
60
|
+
/* hyperlinked text boxes */
|
61
|
+
|
62
|
+
/* we want a clickable text box to be different than a non-clickable one. */
|
63
|
+
|
64
|
+
a div.textbox
|
65
|
+
{
|
66
|
+
border: 1px solid #777777;
|
67
|
+
}
|
68
|
+
|
69
|
+
a:hover div.textbox
|
70
|
+
{
|
71
|
+
background-color: #c5e2ff;
|
72
|
+
border: 1px solid #aaaaaa;
|
73
|
+
|
74
|
+
opacity:1.0;filter:alpha(opacity=100);
|
75
|
+
}
|
76
|
+
|
77
|
+
/* heading */
|
78
|
+
|
79
|
+
div.textbox p.heading
|
80
|
+
{
|
81
|
+
color: black;
|
82
|
+
font-size: 130%;
|
83
|
+
font-weight: bold;
|
84
|
+
padding: 0.4em;
|
85
|
+
margin-top: 0.3em;
|
86
|
+
margin-bottom: 0;
|
87
|
+
border: 1px solid gray;
|
88
|
+
background-color: #afc6e9;
|
89
|
+
}
|
90
|
+
|
91
|
+
/* heading colors */
|
92
|
+
|
93
|
+
div.textbox_red p.heading
|
94
|
+
{
|
95
|
+
background-color: #ffaaaa;
|
96
|
+
}
|
97
|
+
|
98
|
+
div.textbox_green p.heading
|
99
|
+
{
|
100
|
+
background-color: #ccffaa;
|
101
|
+
}
|
102
|
+
|
103
|
+
div.textbox_yellow p.heading
|
104
|
+
{
|
105
|
+
background-color: #fff5aa;
|
106
|
+
}
|
107
|
+
|
108
|
+
div.textbox_cyan p.heading
|
109
|
+
{
|
110
|
+
background-color: #aafeff;
|
111
|
+
}
|
112
|
+
|
113
|
+
div.textbox_orange p.heading
|
114
|
+
{
|
115
|
+
background-color: #ffca3a;
|
116
|
+
}
|
117
|
+
|
118
|
+
div.textbox_purple p.heading
|
119
|
+
{
|
120
|
+
background-color: #ffc0f0;
|
121
|
+
}
|
122
|
+
|
123
|
+
div.textbox_white p.heading
|
124
|
+
{
|
125
|
+
background-color: white;
|
126
|
+
}
|
127
|
+
|
128
|
+
/* backgrounds */
|
129
|
+
|
130
|
+
div.textbox.blue_background
|
131
|
+
{
|
132
|
+
background-color: #afc6e9;
|
133
|
+
}
|
134
|
+
|
135
|
+
div.textbox.red_background
|
136
|
+
{
|
137
|
+
background-color: #ffaaaa;
|
138
|
+
}
|
139
|
+
|
140
|
+
div.textbox.green_background
|
141
|
+
{
|
142
|
+
background-color: #ccffaa;
|
143
|
+
}
|
144
|
+
|
145
|
+
div.textbox.yellow_background
|
146
|
+
{
|
147
|
+
background-color: #fff5aa;
|
148
|
+
}
|
149
|
+
|
150
|
+
div.textbox.cyan_background
|
151
|
+
{
|
152
|
+
background-color: #aafeff;
|
153
|
+
}
|
154
|
+
|
155
|
+
div.textbox.orange_background
|
156
|
+
{
|
157
|
+
background-color: #ffca3a;
|
158
|
+
}
|
159
|
+
|
160
|
+
div.textbox.purple_background
|
161
|
+
{
|
162
|
+
background-color: #ffc0f0;
|
163
|
+
}
|
164
|
+
|
165
|
+
div.textbox.white_background
|
166
|
+
{
|
167
|
+
background-color: #ffc0f0;
|
168
|
+
}
|
169
|
+
|
170
|
+
/* highlight */
|
171
|
+
|
172
|
+
div.textbox.highlight
|
173
|
+
{
|
174
|
+
border: 1px solid #000000;
|
175
|
+
}
|
176
|
+
|
177
|
+
/* dings */
|
178
|
+
|
179
|
+
.float_left
|
180
|
+
{
|
181
|
+
float: left;
|
182
|
+
}
|
183
|
+
|
184
|
+
.text_align_center
|
185
|
+
{
|
186
|
+
text-align: center;
|
187
|
+
}
|
188
|
+
|
189
|
+
.bigfont
|
190
|
+
{
|
191
|
+
font-size: 130%;
|
192
|
+
}
|
193
|
+
|
194
|
+
.clear_both
|
195
|
+
{
|
196
|
+
clear: both;
|
197
|
+
}
|
198
|
+
|
199
|
+
/* this class makes sure your text links contained by text boxes won't get underlined */
|
200
|
+
/* it's a workaround :( */
|
201
|
+
|
202
|
+
a.no_underline:hover
|
203
|
+
{
|
204
|
+
text-decoration: none;
|
205
|
+
}
|
206
|
+
|
207
|
+
/* ========================================================================= */
|
208
|
+
/* end gridomatic */
|
209
|
+
/* ========================================================================= */
|
data/script/console
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# File: script/console
|
3
|
+
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
4
|
+
|
5
|
+
libs = " -r irb/completion"
|
6
|
+
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
|
7
|
+
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
|
8
|
+
libs << " -r #{File.dirname(__FILE__) + '/../lib/gridomatic.rb'}"
|
9
|
+
puts "Loading gridomatic gem"
|
10
|
+
exec "#{irb} #{libs} --simple-prompt"
|
data/script/destroy
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/destroy'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
+
RubiGen::Scripts::Destroy.new.run(ARGV)
|
data/script/generate
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'rubigen'
|
6
|
+
rescue LoadError
|
7
|
+
require 'rubygems'
|
8
|
+
require 'rubigen'
|
9
|
+
end
|
10
|
+
require 'rubigen/scripts/generate'
|
11
|
+
|
12
|
+
ARGV.shift if ['--help', '-h'].include?(ARGV[0])
|
13
|
+
RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
|
14
|
+
RubiGen::Scripts::Generate.new.run(ARGV)
|
data/test/test_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gridomatic
|
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
|
+
- Commander Johnson
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-08-31 00:00:00 +02:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: hoe
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 47
|
30
|
+
segments:
|
31
|
+
- 2
|
32
|
+
- 8
|
33
|
+
- 0
|
34
|
+
version: 2.8.0
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id001
|
37
|
+
description: |-
|
38
|
+
Easy floatable grid structures for Rails.
|
39
|
+
|
40
|
+
Don't have too much data to display but still need to fill up that screen?
|
41
|
+
|
42
|
+
Why don't you present your data in a grid of boxes. Provided you color them right, boxes are very easy to the eyes because the mind understands its structure. Add to that custom coloring, (e.g. each controller can have its own color) background images and clickable boxes and you have a navigation that is not only great looking, but is also very easy to use on touchpad-enabled devices such as an iPad.
|
43
|
+
|
44
|
+
This is what it looks like:
|
45
|
+
https://github.com/cmdjohnson/gridomatic/blob/master/screenshots/overview.png
|
46
|
+
email:
|
47
|
+
- commanderjohnson@gmail.com
|
48
|
+
executables: []
|
49
|
+
|
50
|
+
extensions: []
|
51
|
+
|
52
|
+
extra_rdoc_files:
|
53
|
+
- History.txt
|
54
|
+
- Manifest.txt
|
55
|
+
files:
|
56
|
+
- History.txt
|
57
|
+
- Manifest.txt
|
58
|
+
- README.rdoc
|
59
|
+
- Rakefile
|
60
|
+
- app/helpers/gridomatic_helper.rb
|
61
|
+
- public/stylesheets/gridomatic.css
|
62
|
+
- lib/gridomatic.rb
|
63
|
+
- script/console
|
64
|
+
- script/destroy
|
65
|
+
- script/generate
|
66
|
+
- test/test_gridomatic.rb
|
67
|
+
- test/test_helper.rb
|
68
|
+
has_rdoc: true
|
69
|
+
homepage: http://github.com/cmdjohnson/gridomatic
|
70
|
+
licenses: []
|
71
|
+
|
72
|
+
post_install_message:
|
73
|
+
rdoc_options:
|
74
|
+
- --main
|
75
|
+
- README.rdoc
|
76
|
+
require_paths:
|
77
|
+
- lib
|
78
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
79
|
+
none: false
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
hash: 3
|
84
|
+
segments:
|
85
|
+
- 0
|
86
|
+
version: "0"
|
87
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
|
+
none: false
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
hash: 3
|
93
|
+
segments:
|
94
|
+
- 0
|
95
|
+
version: "0"
|
96
|
+
requirements: []
|
97
|
+
|
98
|
+
rubyforge_project: gridomatic
|
99
|
+
rubygems_version: 1.3.7
|
100
|
+
signing_key:
|
101
|
+
specification_version: 3
|
102
|
+
summary: Easy floatable grid structures for Rails
|
103
|
+
test_files:
|
104
|
+
- test/test_gridomatic.rb
|
105
|
+
- test/test_helper.rb
|