KMQToolKitGem 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 +4 -4
- data/README.md +1 -0
- data/lib/KMQToolKitGem/color_plist_generator.rb +2 -1
- data/lib/KMQToolKitGem/error_plist_generator.rb +3 -2
- data/lib/KMQToolKitGem/version.rb +1 -1
- data/{templates → lib/templates}/NSError+ErrorCode.h.erb +0 -0
- data/{templates → lib/templates}/NSError+ErrorCode.m.erb +0 -0
- data/{templates → lib/templates}/NSError+ErrorDomain.h.erb +0 -0
- data/{templates → lib/templates}/NSError+ErrorDomain.m.erb +0 -0
- data/{templates → lib/templates}/UIColor+ColorName.h.erb +0 -0
- data/{templates → lib/templates}/UIColor+ColorName.m.erb +0 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb69743e041093534339859bd774ca6805205956
|
4
|
+
data.tar.gz: 7a582b146fff75ad4a2d18cf1452abad5aa7867a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 26515b34fe0f232701041830970999e9d83c9955b4934b9820902591ca1fbcf49982a9ab8d1ac9f506534c29570c9e525f5063f69474a02b8c232450ad4acb8e
|
7
|
+
data.tar.gz: 8101ecb319fdfc09485dfd9131a8b8ec9410b50bdd677f8f151749e312c8b884f7f76f333732705ffb3360df1869fb326cfaf833b9519103e1fba77849388434
|
data/README.md
CHANGED
@@ -5,6 +5,7 @@ class ColorPlistGenerator
|
|
5
5
|
attr_reader :plist_hash, :prefix, :base_path
|
6
6
|
|
7
7
|
def initialize(plist_hash, prefix, base_path)
|
8
|
+
@template_folder = File.expand_path('../../templates', __FILE__)
|
8
9
|
@plist_hash = plist_hash
|
9
10
|
@prefix = prefix
|
10
11
|
@base_path = base_path
|
@@ -21,7 +22,7 @@ class ColorPlistGenerator
|
|
21
22
|
|
22
23
|
def create_color_name_file(names, type)
|
23
24
|
file_name = "UIColor+#{@prefix}ColorName.#{type}"
|
24
|
-
template_path = "#{
|
25
|
+
template_path = "#{@template_folder}/UIColor+ColorName.#{type}.erb"
|
25
26
|
absolute_file_path = "#{@base_path}/#{file_name}"
|
26
27
|
variables = OpenStruct.new(names: names, prefix: @prefix)
|
27
28
|
Helper.write_to_file(absolute_file_path, template_path, variables.instance_eval{ binding })
|
@@ -5,6 +5,7 @@ class ErrorPlistGenerator
|
|
5
5
|
attr_reader :plist_hash, :prefix, :base_path
|
6
6
|
|
7
7
|
def initialize(plist_hash, prefix, base_path)
|
8
|
+
@template_folder = File.expand_path('../../templates', __FILE__)
|
8
9
|
@plist_hash = plist_hash
|
9
10
|
@prefix = prefix
|
10
11
|
@base_path = base_path
|
@@ -39,7 +40,7 @@ class ErrorPlistGenerator
|
|
39
40
|
# Generic NSError+ErrorCode.h and NSError+ErrorCode.m
|
40
41
|
def create_error_code_file(codes, type)
|
41
42
|
file_name = "NSError+#{@prefix}ErrorCode.#{type}"
|
42
|
-
template_path = "#{
|
43
|
+
template_path = "#{@template_folder}/NSError+ErrorCode.#{type}.erb"
|
43
44
|
absolute_file_path = "#{@base_path}/#{file_name}"
|
44
45
|
variables = OpenStruct.new(codes: codes, prefix: @prefix)
|
45
46
|
Helper.write_to_file(absolute_file_path, template_path, variables.instance_eval{ binding })
|
@@ -55,7 +56,7 @@ class ErrorPlistGenerator
|
|
55
56
|
# Generic NSError+ErrorDomain.h and NSError+ErrorDomain.m
|
56
57
|
def create_error_domain_file(domains, type)
|
57
58
|
file_name = "NSError+#{@prefix}ErrorDomain.#{type}"
|
58
|
-
template_path = "#{
|
59
|
+
template_path = "#{@template_folder}/NSError+ErrorDomain.#{type}.erb"
|
59
60
|
absolute_file_path = "#{@base_path}/#{file_name}"
|
60
61
|
variables = OpenStruct.new(domains: domains, prefix: @prefix)
|
61
62
|
Helper.write_to_file(absolute_file_path, template_path, variables.instance_eval{ binding })
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: KMQToolKitGem
|
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
|
- Weinan Qiu
|
@@ -106,14 +106,14 @@ files:
|
|
106
106
|
- lib/KMQToolKitGem/error_plist_generator.rb
|
107
107
|
- lib/KMQToolKitGem/helper.rb
|
108
108
|
- lib/KMQToolKitGem/version.rb
|
109
|
+
- lib/templates/NSError+ErrorCode.h.erb
|
110
|
+
- lib/templates/NSError+ErrorCode.m.erb
|
111
|
+
- lib/templates/NSError+ErrorDomain.h.erb
|
112
|
+
- lib/templates/NSError+ErrorDomain.m.erb
|
113
|
+
- lib/templates/UIColor+ColorName.h.erb
|
114
|
+
- lib/templates/UIColor+ColorName.m.erb
|
109
115
|
- sample/colors.plist
|
110
116
|
- sample/errors.plist
|
111
|
-
- templates/NSError+ErrorCode.h.erb
|
112
|
-
- templates/NSError+ErrorCode.m.erb
|
113
|
-
- templates/NSError+ErrorDomain.h.erb
|
114
|
-
- templates/NSError+ErrorDomain.m.erb
|
115
|
-
- templates/UIColor+ColorName.h.erb
|
116
|
-
- templates/UIColor+ColorName.m.erb
|
117
117
|
homepage: https://github.com/davidiamyou/KMQToolKitGem
|
118
118
|
licenses:
|
119
119
|
- MIT
|