prime_awesome 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NzE5NGRmNDQ4NDg0ZTJmM2M3OGQwZjA0Y2IzOGUxMzEyNTE1ODEzNQ==
5
+ data.tar.gz: !binary |-
6
+ NjhjMGM5ZTA5YmM5YTE0YWRlMjU2ODFkOWFmOTFkZDhmYjY4YmQ4MA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NjkyYmVjMzQwNDg3NGQ3OGM4ZjU5NTFmYjBjZjdkNTQ0MWQ4ZWRkYTQ0NzIz
10
+ NTgxYmMwYTBhN2M1NzFmN2U5MjM3OWYxZjc1YTg5MzFlZDYzY2IyOWQ5NzUz
11
+ NDNjYWQyZDJhNDkzMjBkNzJiZWZlZTgyOTIzOTkzZGRiYWQwNzc=
12
+ data.tar.gz: !binary |-
13
+ MzU0YTE4NmY3MzUyNTVkMTE5ZDYxNjA4ZTNiNmFhYzVhYmMzZjQyMWRmZDgy
14
+ NDBjN2E1YTRkYTU5MjI5MzAyNjY3NzFkYmZiNmY0ZmQ3ZDQxNTFjMzZkNGQz
15
+ MGVkMzVjZWRiYmU2MGUzZjgyZGUxYjFkNjE3YWJmZDQ1YWFhZDc=
data/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # PrimeAwesome
2
+
3
+ Add font awesome support to MotionPrime.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'prime_awesome'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ ## Usage
16
+
17
+ ```ruby
18
+ class FooSection < Prime::Section
19
+ element :icon, fa_icon: :anchor, fa_size: 20
20
+ end
21
+ ```
22
+
23
+
24
+ ## Contributing
25
+
26
+ 1. Fork it
27
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
28
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
29
+ 4. Push to the branch (`git push origin my-new-feature`)
30
+ 5. Create new Pull Request
@@ -0,0 +1,23 @@
1
+ module PrimeAwesome
2
+ module LabelDrawElement
3
+
4
+ def self.included(base)
5
+ base.class_eval do
6
+ alias_method :draw_options!, :draw_options
7
+ def draw_options
8
+ if icon = computed_options[:fa_icon]
9
+ draw_options!.merge(
10
+ text: MotionAwesome.hex_for_icon(icon.to_s.gsub('_', '-')),
11
+ force_attributed: true,
12
+ font: 'FontAwesome'.uifont(computed_options[:fa_size] || 14)
13
+ )
14
+ else
15
+ draw_options!
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+
23
+ MotionPrime::LabelDrawElement.send :include, PrimeAwesome::LabelDrawElement
@@ -0,0 +1,3 @@
1
+ module PrimeAwesome
2
+ VERSION = '0.0.1'
3
+ end
@@ -0,0 +1,21 @@
1
+ module PrimeAwesome
2
+ module ViewStyler
3
+
4
+ def self.included(base)
5
+ base.class_eval do
6
+ alias_method :_prepare_options!, :prepare_options!
7
+ def prepare_options!
8
+ if icon = options.delete(:fa_icon)
9
+ options[:attributed_text] = attributed_string(
10
+ font: 'FontAwesome'.uifont(options.delete(:fa_size) || 14),
11
+ text: MotionAwesome.hex_for_icon(icon.to_s.gsub('_', '-'))
12
+ )
13
+ end
14
+ _prepare_options!
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+
21
+ MotionPrime::ViewStyler.send :include, PrimeAwesome::ViewStyler
@@ -0,0 +1,13 @@
1
+ require 'motion-cocoapods'
2
+ require 'motion-prime'
3
+ require 'motion-awesome'
4
+
5
+ unless defined?(Motion::Project::Config)
6
+ raise "This file must be required within a RubyMotion project Rakefile."
7
+ end
8
+
9
+ Motion::Require.all(Dir.glob(File.expand_path('../prime_awesome/**/*.rb', __FILE__)))
10
+
11
+ Motion::Project::App.setup do |app|
12
+
13
+ end
metadata ADDED
@@ -0,0 +1,105 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: prime_awesome
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Iskander Haziev
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-03-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: cocoapods
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ! '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ! '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: motion-cocoapods
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ! '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: motion-require
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: motion-awesome
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Add Font Awesome support to MotionPrime.
70
+ email:
71
+ - gvalmon@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - lib/prime_awesome/draw_label.rb
77
+ - lib/prime_awesome/version.rb
78
+ - lib/prime_awesome/view_styler.rb
79
+ - lib/prime_awesome.rb
80
+ - README.md
81
+ homepage: ''
82
+ licenses:
83
+ - MIT
84
+ metadata: {}
85
+ post_install_message:
86
+ rdoc_options: []
87
+ require_paths:
88
+ - lib
89
+ required_ruby_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ required_rubygems_version: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ! '>='
97
+ - !ruby/object:Gem::Version
98
+ version: '0'
99
+ requirements: []
100
+ rubyforge_project:
101
+ rubygems_version: 2.0.5
102
+ signing_key:
103
+ specification_version: 4
104
+ summary: Add Font Awesome support to MotionPrime.
105
+ test_files: []