motion-mastr 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2833f7e9ad2ff27188a0dd9a720cb3372f2ed2c3
4
- data.tar.gz: 26e8487689649201c36cc45b47c415c99ef9732e
3
+ metadata.gz: 89846c3bcfb9a52fa5060a59d9802902fcc5c912
4
+ data.tar.gz: 236cd9bc61563be1badfdc59b1aff926dc8f45a6
5
5
  SHA512:
6
- metadata.gz: f596e78fcf9c6e9dae1f8b18dfbf8cf1bb002cbabe2502f3e508244d9aebdaf1aa16fd50ab0fe663516cd8c85c713a9c7a70f2017d4efb659871f7e32d39be11
7
- data.tar.gz: b42fab78b38998393917ccc30d623b56288d03783ce8f6a91536efb161a57f8135ce5acf0d3f2c3e6df3d40c40667c67012c39a27c6d19ffffe936f402467146
6
+ metadata.gz: 16efa29873aeb5425b26d10cfc5e8e74095b02fa6314197199de2860c5932ed04e8e6939cf142fd0d3b8b78bf40a47cf33854bad0bcf7b3354625ff8f4ee6e54
7
+ data.tar.gz: a2e0eeeabe94bc5a2ef04b3a479eea026264189ce6a9f26c2c56ed527a71ea9d2383ebbcf2996385b5718345209defd6fc8f307393dc9d75219e43e269762ec0
data/README.md CHANGED
@@ -89,9 +89,11 @@ expansion # :default or Float
89
89
  first_line_head_indent # 0.0 and up
90
90
  font # UIFont
91
91
  foreground_color # UIColor
92
+ color # ^
92
93
  head_indent # 0.0 and up
93
94
  hyphenation_factor # 0.0 up to 1.0
94
95
  kern # :default, Float
96
+ kerning # ^
95
97
  ligature # :off, :on
96
98
  line_break_mode # :word, :char, :clip, :head, :tail, :middle
97
99
  line_height_multiple # :default, 0.0 and up
@@ -124,4 +126,14 @@ For details, check out the NSAttributedString docs. Or just play around.
124
126
  * Go easy on obliqueness, don't get hurt.
125
127
 
126
128
 
129
+ # HISTORY
130
+
131
+ ### 0.3.0 | May 3rd, 2015
132
+ * [new] mastr now optional supports being called with _just_ a Hash of styles
133
+ * [new] the style :color is now alias for :foreground_color
134
+
135
+ ### 0.2.0 | May 2nd, 2015
136
+ * [feature] first release
137
+
138
+
127
139
 
@@ -8,6 +8,7 @@ module MotionMastr
8
8
  def foreground_color_attribute(styles={})
9
9
  return nil if styles.nil?
10
10
  value = styles[:foreground_color]
11
+ value ||= styles[:color]
11
12
  return nil unless value && value.is_a?(UIColor)
12
13
  value
13
14
  end
@@ -1,14 +1,18 @@
1
1
  module MotionMastr
2
2
 
3
3
  # make a MastrBuilder
4
- def mastr(text=nil, default_styles={})
5
- b = MastrBuilder.new default_styles
6
- b.add text
4
+ def mastr(text=nil, default_styles=nil)
5
+ styles = {}
6
+ styles.merge!(text) if text.is_a?(Hash)
7
+ styles.merge!(default_styles) if default_styles.is_a? Hash
8
+
9
+ b = MastrBuilder.new styles
10
+ b.add(text) unless text.nil? || text.is_a?(Hash)
7
11
  b
8
12
  end
9
13
 
10
14
  # make and build a NSMutableAttributedString
11
- def mastr!(text=nil, default_styles={})
15
+ def mastr!(text=nil, default_styles=nil)
12
16
  mastr(text, default_styles).build
13
17
  end
14
18
 
@@ -1,3 +1,3 @@
1
1
  module MotionMastr
2
- VERSION = "0.2.0" unless defined?(MotionMastr::VERSION)
2
+ VERSION = "0.3.0" unless defined?(MotionMastr::VERSION)
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-mastr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Kellock
@@ -24,7 +24,7 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '10.0'
27
- description: Get your NSMutableAttributedString on!
27
+ description: Get your NSMutableAttributedString on with RubyMotion!
28
28
  email:
29
29
  - steve@kellock.ca
30
30
  executables: []