r_kit 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/assets/stylesheets/r_kit/css/typography/lists.scss +9 -0
- data/lib/assets/stylesheets/r_kit/css/typography/titles.scss +2 -8
- data/lib/assets/stylesheets/r_kit/css/typography.scss +1 -0
- data/lib/assets/stylesheets/r_kit/mixins/box-shadows/curved-shadows.scss +34 -0
- data/lib/assets/stylesheets/r_kit/mixins/box-shadows/straight-shadows.scss +3 -0
- data/lib/assets/stylesheets/r_kit/mixins/box-shadows.scss +2 -0
- data/lib/assets/stylesheets/r_kit/mixins/titles.scss +18 -0
- data/lib/assets/stylesheets/r_kit/mixins.scss +3 -1
- data/lib/assets/stylesheets/r_kit/variables/colors.scss +1 -0
- data/lib/r_kit/core/object.rb +15 -0
- data/lib/r_kit/core/object_extension.rb +7 -0
- data/lib/r_kit/core.rb +8 -0
- data/lib/r_kit/decorator/active_record_extension.rb +2 -2
- data/lib/r_kit/decorator/base.rb +8 -2
- data/lib/r_kit/grid/action_view_extension.rb +10 -3
- data/lib/r_kit/version.rb +1 -1
- data/lib/r_kit.rb +3 -1
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YzM0ZTdlMTIxMWQ0NjBiNDQxMTQ5YmZlNDM5ODllN2NkOWRlYWIxOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzA4OTljZTFlNmY2NGQ0MTY2NmNiNGFkNjBjOWYzYjY1MDAyMWM0NQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NGE1NTQ3OWM4ZDBkYjM4ZDRlYTc4YzFkNDAyMzQ0MjUwYzAwODIwZmZhNGNl
|
10
|
+
ZWNkZjlmOWI4NzZkMWRmYTNjNTA2YzA3ODZhMGVmODk2YjBiNWI1M2U5ZDY4
|
11
|
+
NmI0NWRiNjJlYzVlNDY2YWYyMGY0YWJhNWIwMTQ5OWY0NDVhMjI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzdkNTAwZWM0Njg4MmRmYzE0OTBkNzFjM2Q2Mjc0ZDgyN2RkNmI5YjQ2ZWJi
|
14
|
+
NGMwYzE4YTA3MzU5NGUyODk5NWI5ZGE1Yjc0OWU4MzI0ZmIwMTU4MWI0MzFk
|
15
|
+
NmY5Yzc3ZDE2NmFlMzhkZGY3ZDMwYzRjNDIxNWIxM2Q5ZGY5MGU=
|
@@ -0,0 +1,34 @@
|
|
1
|
+
@mixin base-horizontal-curved-shadow() {
|
2
|
+
position: absolute;
|
3
|
+
width: 90%;
|
4
|
+
height: 10%;
|
5
|
+
left: 5%;
|
6
|
+
border-radius: 50%;
|
7
|
+
z-index: -1;
|
8
|
+
content: "";
|
9
|
+
box-shadow: 0 0 1em .25em black;
|
10
|
+
}
|
11
|
+
|
12
|
+
|
13
|
+
@mixin top-curved-shadow() {
|
14
|
+
position: relative;
|
15
|
+
|
16
|
+
&:before {
|
17
|
+
@include base-horizontal-curved-shadow;
|
18
|
+
top: 0%;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
@mixin bottom-curved-shadow() {
|
23
|
+
position: relative;
|
24
|
+
|
25
|
+
&:after {
|
26
|
+
@include base-horizontal-curved-shadow;
|
27
|
+
bottom: 0%;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
@mixin horizontal-curved-shadow() {
|
32
|
+
@include top-curved-shadow;
|
33
|
+
@include bottom-curved-shadow;
|
34
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class Object
|
2
|
+
core_extend :__class__ do
|
3
|
+
self.class
|
4
|
+
end
|
5
|
+
|
6
|
+
# should be able to use the method from "super"
|
7
|
+
#core_extend :super_method do |method_name|
|
8
|
+
# __class__.superclass.instance_method(method_name).bind(self).call
|
9
|
+
#end
|
10
|
+
# no working in prod context (seriable decarator, :title method)
|
11
|
+
|
12
|
+
core_extend :to_boolean do
|
13
|
+
ActiveRecord::ConnectionAdapters::Column.value_to_boolean self
|
14
|
+
end
|
15
|
+
end
|
data/lib/r_kit/core.rb
ADDED
@@ -18,8 +18,8 @@ module RKit::Decorator::ActiveRecordExtension
|
|
18
18
|
end
|
19
19
|
|
20
20
|
module InstanceMethods
|
21
|
-
def decorate view_context
|
22
|
-
self.class.decorator_class.new self, view_context
|
21
|
+
def decorate view_context, instance_variables = {}
|
22
|
+
self.class.decorator_class.new self, view_context, instance_variables
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
data/lib/r_kit/decorator/base.rb
CHANGED
@@ -1,12 +1,18 @@
|
|
1
1
|
require 'delegate'
|
2
2
|
|
3
3
|
class RKit::Decorator::Base < SimpleDelegator
|
4
|
-
|
4
|
+
alias :_base :__getobj__
|
5
|
+
|
6
|
+
def initialize base, view_context, instance_variables = {}
|
5
7
|
@view_context = view_context
|
6
8
|
|
9
|
+
instance_variables.each do |key, value|
|
10
|
+
instance_variable_set "@#{ key }", value
|
11
|
+
end
|
12
|
+
|
7
13
|
super(base)
|
8
14
|
end
|
9
|
-
|
15
|
+
|
10
16
|
def _h
|
11
17
|
@view_context
|
12
18
|
end
|
@@ -7,8 +7,14 @@ module RKit::Grid::ActionViewExtension
|
|
7
7
|
|
8
8
|
def html_options options = {}, defaults = {}
|
9
9
|
id = options[:id]
|
10
|
-
|
11
|
-
classes
|
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 " "
|
12
18
|
|
13
19
|
{
|
14
20
|
:id => id,
|
@@ -31,7 +37,7 @@ module RKit::Grid::ActionViewExtension
|
|
31
37
|
proc_options options[:instance], options
|
32
38
|
html_options = html_options(options, {class: "col-#{ options[:col_size] }"})
|
33
39
|
|
34
|
-
content_tag(options[:tag] || :div, html_options){ block.call(options[:instance]) }
|
40
|
+
content_tag(options[:tag] || :div, html_options){ block.call(*options[:instance]) }
|
35
41
|
end
|
36
42
|
|
37
43
|
|
@@ -51,6 +57,7 @@ module RKit::Grid::ActionViewExtension
|
|
51
57
|
|
52
58
|
def rows__tag col_size, collection, options = {}, &block
|
53
59
|
rows_buffer = collection
|
60
|
+
.to_a
|
54
61
|
.in_groups_of(12 / col_size, false)
|
55
62
|
.inject ActiveSupport::SafeBuffer.new do |safe_buffer, collection|
|
56
63
|
safe_buffer.safe_concat send("row_#{ col_size }_tag", collection, options, &block)
|
data/lib/r_kit/version.rb
CHANGED
data/lib/r_kit.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require "r_kit/version"
|
2
2
|
require "r_kit/engine"
|
3
3
|
|
4
|
+
require "r_kit/core"
|
4
5
|
require "r_kit/decorator"
|
5
6
|
require "r_kit/grid"
|
6
7
|
|
@@ -15,7 +16,8 @@ module RKit
|
|
15
16
|
const_get const_name
|
16
17
|
end
|
17
18
|
end
|
18
|
-
|
19
|
+
|
20
|
+
# rename add_service ???
|
19
21
|
def init_all!
|
20
22
|
services.each do |service|
|
21
23
|
if service.respond_to? :init!
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: r_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Petrachi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Library for rails projects
|
14
14
|
email:
|
@@ -39,16 +39,24 @@ files:
|
|
39
39
|
- lib/assets/stylesheets/r_kit/css/html.scss
|
40
40
|
- lib/assets/stylesheets/r_kit/css/typography.scss
|
41
41
|
- lib/assets/stylesheets/r_kit/css/typography/links.scss
|
42
|
+
- lib/assets/stylesheets/r_kit/css/typography/lists.scss
|
42
43
|
- lib/assets/stylesheets/r_kit/css/typography/paragraphs.scss
|
43
44
|
- lib/assets/stylesheets/r_kit/css/typography/titles.scss
|
44
45
|
- lib/assets/stylesheets/r_kit/mixins.scss
|
45
46
|
- lib/assets/stylesheets/r_kit/mixins/animation.scss
|
47
|
+
- lib/assets/stylesheets/r_kit/mixins/box-shadows.scss
|
48
|
+
- lib/assets/stylesheets/r_kit/mixins/box-shadows/curved-shadows.scss
|
49
|
+
- lib/assets/stylesheets/r_kit/mixins/box-shadows/straight-shadows.scss
|
46
50
|
- lib/assets/stylesheets/r_kit/mixins/keyframes.scss
|
51
|
+
- lib/assets/stylesheets/r_kit/mixins/titles.scss
|
47
52
|
- lib/assets/stylesheets/r_kit/variables.scss
|
48
53
|
- lib/assets/stylesheets/r_kit/variables/application.scss
|
49
54
|
- lib/assets/stylesheets/r_kit/variables/colors.scss
|
50
55
|
- lib/assets/stylesheets/r_kit/variables/typography.scss
|
51
56
|
- lib/r_kit.rb
|
57
|
+
- lib/r_kit/core.rb
|
58
|
+
- lib/r_kit/core/object.rb
|
59
|
+
- lib/r_kit/core/object_extension.rb
|
52
60
|
- lib/r_kit/decorator.rb
|
53
61
|
- lib/r_kit/decorator/active_record_extension.rb
|
54
62
|
- lib/r_kit/decorator/base.rb
|