motion-iconic 0.0.1

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.
@@ -0,0 +1,43 @@
1
+ module Motion
2
+ module Iconic
3
+ class Icon
4
+ CLASSES = {
5
+ awesome: :FAKFontAwesome,
6
+ foundation: :FAKFoundationIcons,
7
+ ion: :FAKIonIcons,
8
+ zocial: :FAKZocial
9
+ }
10
+
11
+ def self.icon(icon, withSize:size, inCollection:collection)
12
+ unless Motion::Iconic::Constants::ICONS.has_key? collection
13
+ raise Motion::Iconic::InvalidIconCollectionError.new collection
14
+ end
15
+
16
+ unless Motion::Iconic::Constants::ICONS[collection].include? icon
17
+ raise Motion::Iconic::InvalidIconError.new icon
18
+ end
19
+
20
+ Kernel.const_get(CLASSES[collection]).send("#{icon}IconWithSize", size)
21
+ end
22
+
23
+ def self.awesomeIcon(icon, withSize:size)
24
+ icon(icon, withSize:size, inCollection: :awesome)
25
+ end
26
+
27
+ def self.foundationIcon(icon, withSize:size)
28
+ icon(icon, withSize:size, inCollection: :foundation)
29
+ end
30
+
31
+ def self.ionIcon(icon, withSize:size)
32
+ alloc.initWithIonIcon(icon, withSize:size)
33
+ icon(icon, withSize:size, inCollection: :ion)
34
+ end
35
+
36
+ def self.zocialIcon(icon, withSize:size)
37
+ icon(icon, withSize:size, inCollection: :zocial)
38
+ end
39
+ end
40
+ end
41
+ end
42
+
43
+ Mic = Motion::Iconic::Icon unless defined? Mic
@@ -0,0 +1,6 @@
1
+ module Motion
2
+ module Iconic
3
+ version_file = File.expand_path("../../VERSION", File.dirname(File.realpath(__FILE__)))
4
+ VERSION = File.read(version_file).freeze
5
+ end
6
+ end
@@ -0,0 +1,13 @@
1
+ unless defined?(Motion::Project::Config)
2
+ raise "This file must be required within a RubyMotion project Rakefile."
3
+ end
4
+
5
+ require "motion-cocoapods"
6
+
7
+ Motion::Project::App.setup do |app|
8
+ app.files += Dir.glob(File.join(File.dirname(__FILE__), "motion-iconic", "**", "*.rb"))
9
+
10
+ app.pods do
11
+ pod "FontAwesomeKit", "~> 2.1.0"
12
+ end
13
+ end
@@ -0,0 +1,20 @@
1
+ require_relative "./lib/motion-iconic/version"
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "motion-iconic"
5
+ spec.version = Motion::Iconic::VERSION
6
+ spec.authors = ["Aziz Light"]
7
+ spec.email = ["aziz@azizlight.me"]
8
+ spec.summary = "Awesome icons for RubyMotion"
9
+ spec.description = "RubyMotion wrapper around FontAwesomeKit"
10
+ spec.homepage = "https://github.com/AzizLight/motion-iconic"
11
+ spec.license = "MIT"
12
+
13
+ spec.files = `git ls-files -z`.split("\x0")
14
+ spec.require_paths = ["lib"]
15
+
16
+ spec.add_runtime_dependency "motion-cocoapods", "~> 1.4.0"
17
+
18
+ spec.add_development_dependency "bundler", "~> 1.5"
19
+ spec.add_development_dependency "rake"
20
+ end
metadata ADDED
@@ -0,0 +1,103 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: motion-iconic
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Aziz Light
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-01-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: motion-cocoapods
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 1.4.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 1.4.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.5'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.5'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: RubyMotion wrapper around FontAwesomeKit
56
+ email:
57
+ - aziz@azizlight.me
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - .gitignore
63
+ - Gemfile
64
+ - LICENSE
65
+ - README.md
66
+ - Rakefile
67
+ - VERSION
68
+ - lib/motion-iconic.rb
69
+ - lib/motion-iconic/constants.rb
70
+ - lib/motion-iconic/dummy/font_awesome.rb
71
+ - lib/motion-iconic/dummy/foundation.rb
72
+ - lib/motion-iconic/dummy/ion.rb
73
+ - lib/motion-iconic/dummy/zocial.rb
74
+ - lib/motion-iconic/exceptions/invalid_icon.rb
75
+ - lib/motion-iconic/exceptions/invalid_icon_collection.rb
76
+ - lib/motion-iconic/icon.rb
77
+ - lib/motion-iconic/version.rb
78
+ - motion-iconic.gemspec
79
+ homepage: https://github.com/AzizLight/motion-iconic
80
+ licenses:
81
+ - MIT
82
+ metadata: {}
83
+ post_install_message:
84
+ rdoc_options: []
85
+ require_paths:
86
+ - lib
87
+ required_ruby_version: !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - '>='
90
+ - !ruby/object:Gem::Version
91
+ version: '0'
92
+ required_rubygems_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ requirements: []
98
+ rubyforge_project:
99
+ rubygems_version: 2.0.14
100
+ signing_key:
101
+ specification_version: 4
102
+ summary: Awesome icons for RubyMotion
103
+ test_files: []