r_kit 0.2.1.1 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/LICENSE.txt +1 -1
- data/lib/r_kit/backtrace/kernel_extend.rb +20 -0
- data/lib/r_kit/backtrace.rb +5 -0
- data/lib/r_kit/core/configurer.rb +69 -0
- data/lib/r_kit/core/engineer.rb +42 -0
- data/lib/r_kit/core/loader.rb +132 -0
- data/lib/r_kit/core.rb +60 -6
- data/lib/{assets/stylesheets/r_kit/css → r_kit/css/lib/assets/stylesheets/r_kit/base}/alignments.scss +0 -0
- data/lib/{assets/stylesheets/r_kit/css → r_kit/css/lib/assets/stylesheets/r_kit/base}/displays.scss +0 -0
- data/lib/{assets/stylesheets/r_kit/css → r_kit/css/lib/assets/stylesheets/r_kit/base}/html.scss +0 -0
- data/lib/{assets/stylesheets/r_kit/css → r_kit/css/lib/assets/stylesheets/r_kit/base}/typography/links.scss +1 -1
- data/lib/{assets/stylesheets/r_kit/css → r_kit/css/lib/assets/stylesheets/r_kit/base}/typography/lists.scss +0 -0
- data/lib/{assets/stylesheets/r_kit/css → r_kit/css/lib/assets/stylesheets/r_kit/base}/typography/paragraphs.scss +0 -0
- data/lib/{assets/stylesheets/r_kit/css → r_kit/css/lib/assets/stylesheets/r_kit/base}/typography/titles.scss +0 -0
- data/lib/{assets/stylesheets/r_kit/css → r_kit/css/lib/assets/stylesheets/r_kit/base}/typography.scss +0 -0
- data/lib/r_kit/css/lib/assets/stylesheets/r_kit/base.scss +4 -0
- data/lib/{assets → r_kit/css/lib/assets}/stylesheets/r_kit/components/btn.scss +2 -2
- data/lib/{assets → r_kit/css/lib/assets}/stylesheets/r_kit/components.scss +0 -0
- data/lib/{assets → r_kit/css/lib/assets}/stylesheets/r_kit/mixins/animation.scss +0 -0
- data/lib/{assets → r_kit/css/lib/assets}/stylesheets/r_kit/mixins/box-shadows/curved-shadows.scss +0 -0
- data/lib/{assets → r_kit/css/lib/assets}/stylesheets/r_kit/mixins/box-shadows/straight-shadows.scss +0 -0
- data/lib/{assets → r_kit/css/lib/assets}/stylesheets/r_kit/mixins/box-shadows.scss +0 -0
- data/lib/{assets → r_kit/css/lib/assets}/stylesheets/r_kit/mixins/keyframes.scss +0 -0
- data/lib/r_kit/css/lib/assets/stylesheets/r_kit/mixins/links.scss +5 -0
- data/lib/{assets → r_kit/css/lib/assets}/stylesheets/r_kit/mixins/titles.scss +0 -0
- data/lib/{assets → r_kit/css/lib/assets}/stylesheets/r_kit/mixins.scss +1 -0
- data/lib/{assets → r_kit/css/lib/assets}/stylesheets/r_kit/variables/colors.scss +10 -16
- data/lib/{assets → r_kit/css/lib/assets}/stylesheets/r_kit/variables.scss +0 -0
- data/lib/{assets/stylesheets/r_kit.scss → r_kit/css/lib/assets/stylesheets/r_kit.scss.erb} +1 -3
- data/lib/r_kit/css/sass_extend.rb +8 -0
- data/lib/r_kit/css.rb +35 -0
- data/lib/r_kit/decorator/active_record_extend.rb +59 -0
- data/lib/r_kit/decorator/base.rb +8 -13
- data/lib/r_kit/decorator.rb +8 -6
- data/lib/r_kit/grid/base/grid.rb +31 -0
- data/lib/r_kit/grid/base/grid_col.rb +26 -0
- data/lib/r_kit/grid/base/grid_row.rb +29 -0
- data/lib/r_kit/grid/base.rb +48 -0
- data/lib/r_kit/grid/binding.rb +80 -0
- data/lib/r_kit/grid/enumerable_extend.rb +5 -0
- data/lib/r_kit/grid/kernel_extend.rb +14 -0
- data/lib/r_kit/grid/lib/assets/stylesheets/r_kit/base/grid.scss +27 -0
- data/lib/{assets/stylesheets/r_kit/css → r_kit/grid/lib/assets/stylesheets/r_kit}/grid.scss +34 -4
- data/lib/{assets/.gitkeep → r_kit/grid/lib/assets/stylesheets/r_kit/mixins/gris.scss} +0 -0
- data/lib/r_kit/grid/lib/assets/stylesheets/r_kit/variables/grid.scss +1 -0
- data/lib/r_kit/grid/sass_extend.rb +13 -0
- data/lib/r_kit/grid.rb +23 -6
- data/lib/r_kit/version.rb +1 -1
- data/lib/r_kit.rb +34 -22
- data/r_kit.gemspec +1 -1
- metadata +44 -36
- data/lib/assets/javascripts/r_kit/base.js +0 -2
- data/lib/assets/javascripts/r_kit/dom_manipulation/class_manipulation.js +0 -14
- data/lib/assets/javascripts/r_kit/dom_manipulation.js +0 -1
- data/lib/assets/javascripts/r_kit.js +0 -3
- data/lib/assets/stylesheets/r_kit/animations/fast_load.scss +0 -11
- data/lib/assets/stylesheets/r_kit/animations.scss +0 -1
- data/lib/assets/stylesheets/r_kit/css.scss +0 -5
- data/lib/r_kit/core/object.rb +0 -15
- data/lib/r_kit/core/object_extension.rb +0 -7
- data/lib/r_kit/decorator/active_record_extension.rb +0 -25
- data/lib/r_kit/engine.rb +0 -4
- data/lib/r_kit/grid/action_view_extension.rb +0 -89
@@ -1,89 +0,0 @@
|
|
1
|
-
module RKit::Grid::ActionViewExtension
|
2
|
-
def proc_options instance, options = {}
|
3
|
-
(options[:proc_options] || []).each do |key, proc|
|
4
|
-
options[key] = proc.call(instance)
|
5
|
-
end
|
6
|
-
end
|
7
|
-
|
8
|
-
def html_options options = {}, defaults = {}
|
9
|
-
id = options[:id]
|
10
|
-
|
11
|
-
classes = [defaults[:class], options[:class]]
|
12
|
-
classes << "off-#{ options[:offset] }" if options[:offset]
|
13
|
-
classes = classes
|
14
|
-
.compact
|
15
|
-
.map(&:to_s)
|
16
|
-
.map(&:dasherize)
|
17
|
-
.join " "
|
18
|
-
|
19
|
-
{
|
20
|
-
:id => id,
|
21
|
-
:class => classes
|
22
|
-
}
|
23
|
-
end
|
24
|
-
|
25
|
-
|
26
|
-
def container_tag options = {}, &block
|
27
|
-
html_options = html_options(options, {class: :container})
|
28
|
-
content_tag options[:tag] || :div, html_options, &block
|
29
|
-
end
|
30
|
-
|
31
|
-
def row_tag options = {}, &block
|
32
|
-
html_options = html_options(options, {class: :row})
|
33
|
-
content_tag options[:tag] || :div, html_options, &block
|
34
|
-
end
|
35
|
-
|
36
|
-
def col_tag options = {}, &block
|
37
|
-
proc_options options[:instance], options
|
38
|
-
html_options = html_options(options, {class: "col-#{ options[:col_size] }"})
|
39
|
-
|
40
|
-
content_tag(options[:tag] || :div, html_options){ block.call(*options[:instance]) }
|
41
|
-
end
|
42
|
-
|
43
|
-
|
44
|
-
def col__tag col_size, options = {}, &block
|
45
|
-
col_tag options.merge(col_size: col_size), &block
|
46
|
-
end
|
47
|
-
|
48
|
-
def row__tag col_size, collection, options = {}, &block
|
49
|
-
col_options = options[:cols] || {}
|
50
|
-
|
51
|
-
cols_buffer = collection.inject ActiveSupport::SafeBuffer.new do |safe_buffer, instance|
|
52
|
-
safe_buffer.safe_concat send("col_#{ col_size }_tag", col_options.merge(instance: instance), &block)
|
53
|
-
end
|
54
|
-
|
55
|
-
row_tag(options){ cols_buffer }
|
56
|
-
end
|
57
|
-
|
58
|
-
def rows__tag col_size, collection, options = {}, &block
|
59
|
-
rows_buffer = collection
|
60
|
-
.to_a
|
61
|
-
.in_groups_of(12 / col_size, false)
|
62
|
-
.inject ActiveSupport::SafeBuffer.new do |safe_buffer, collection|
|
63
|
-
safe_buffer.safe_concat send("row_#{ col_size }_tag", collection, options, &block)
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
def container__tag col_size, collection, options = {}, &block
|
68
|
-
row_options = options.delete(:rows) || {}
|
69
|
-
container_tag(options){ send("rows_#{ col_size}_tag", collection, row_options, &block) }
|
70
|
-
end
|
71
|
-
|
72
|
-
1.upto 12 do |col_size|
|
73
|
-
define_method "col_#{ col_size }_tag" do |options = {}, &block|
|
74
|
-
col__tag col_size, options, &block
|
75
|
-
end
|
76
|
-
|
77
|
-
define_method "row_#{ col_size }_tag" do |collection, options = {}, &block|
|
78
|
-
row__tag col_size, collection, options, &block
|
79
|
-
end
|
80
|
-
|
81
|
-
define_method "rows_#{ col_size }_tag" do |collection, options = {}, &block|
|
82
|
-
rows__tag col_size, collection, options, &block
|
83
|
-
end
|
84
|
-
|
85
|
-
define_method "container_#{ col_size }_tag" do |collection, options = {}, &block|
|
86
|
-
container__tag col_size, collection, options, &block
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|