motion-awesome 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +3 -1
- data/lib/motion-awesome/core_ext/ui_label.rb +8 -8
- data/lib/motion-awesome/version.rb +1 -1
- data/lib/utils/generator.rb +3 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
Zjk3MzNkODNkMWIyMTY4ODkwMDk4YWE5NzViM2JkZTViODYxZWEyNw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OWQxMGM0Mjk1NWViOWRmZTE5ODZlZWU2ZjBlZWY3YmE2MmI4YzVhOA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDYyZjA3ZWRhYTMyZDA4MWFjZGU5NDk1Zjc0MmM5MDY5YTJhOTJjYzg2NmVk
|
10
|
+
MWY2NzI2ZDc0OGE5MDhjODRjNjhlODVhNmE5YmI2YzBlMGExNTI4ZDZmZjNm
|
11
|
+
MTc1NDg2N2UyNWRlOTQwYTNjZjI1NjA1M2E4YjJkMDFlMzZkYTI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZDk0YTQ2NTFlYmU2ZTE2MjA3ODQzNDNlZjNjZDMwMGVhMjhlMDk0OGE3ZDVh
|
14
|
+
MTg2ODFmMjAyMWVlZTdjNmM2N2Q2ZDEzYzliMWRjNWU0ODIwODUxNzZkMGUy
|
15
|
+
N2IyZmE2Y2U3Nzc4OWQ5ODE4ZDM0YzBlNjI5ZTdhMTRmZDkyNGI=
|
data/README.md
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
class UILabel
|
2
2
|
attr_accessor :awesome_color
|
3
3
|
|
4
|
-
def awesome
|
5
|
-
(self.text =~ /\A\W/) != nil
|
6
|
-
end
|
4
|
+
def awesome?; self.text =~ /\A\W/ end
|
7
5
|
|
8
6
|
def font=( font )
|
9
7
|
super
|
10
8
|
return unless awesome?
|
11
9
|
|
12
|
-
attr_text = self.attributedText
|
13
|
-
|
14
|
-
|
15
|
-
|
10
|
+
attr_text = self.attributedText
|
11
|
+
attr_text.addAttribute( NSFontAttributeName,
|
12
|
+
value:font,
|
13
|
+
range:(2..attr_text.length-1) ) if attr_text.length > 1
|
16
14
|
attr_text.addAttribute( NSFontAttributeName,
|
17
15
|
value:MotionAwesome.font(font.pointSize),
|
18
16
|
range:(0...1) )
|
19
|
-
attr_text.addAttribute( NSForegroundColorAttributeName,
|
17
|
+
attr_text.addAttribute( NSForegroundColorAttributeName,
|
18
|
+
value:awesome_color,
|
19
|
+
range:(0...1) ) if awesome_color
|
20
20
|
end
|
21
21
|
end
|
data/lib/utils/generator.rb
CHANGED
@@ -10,21 +10,17 @@ module MotionAwesome
|
|
10
10
|
parser = CssParser::Parser.new
|
11
11
|
parser.load_file!( css )
|
12
12
|
fonts = {}
|
13
|
-
parser.each_selector do |selector, declarations,
|
13
|
+
parser.each_selector do |selector, declarations, _|
|
14
14
|
next if selector !~ /\A.icon/
|
15
15
|
name = selector[/\.(.*)\:before/,1]
|
16
16
|
next unless name and name != 'icon-large'
|
17
|
-
|
18
|
-
puts "#{name} : #{hex_val.inspect}"
|
19
|
-
fonts[name] = hex_val
|
17
|
+
fonts[name] = "0x#{declarations[/(f.*)"/, 1]}"
|
20
18
|
end
|
21
19
|
write( fonts )
|
22
20
|
end
|
23
21
|
|
24
22
|
def self.write( fonts )
|
25
|
-
File.open( plist, 'w' )
|
26
|
-
f << fonts.to_plist
|
27
|
-
end
|
23
|
+
File.open( plist, 'w' ) { |f| f << fonts.to_plist }
|
28
24
|
end
|
29
25
|
end
|
30
26
|
end
|