toxic 0.1.0 → 0.1.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/toxic/source/project.rb +14 -4
- data/lib/toxic/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6c56348e42d597019f3576c5ee3329f12cca67e5ac6af4a46f5a35b8f7b567d
|
4
|
+
data.tar.gz: 598ed0ab773ba5320ed28b05c7258150e4272c09ed6dc105f9d25492669f062d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31fbe3e77b6398e32689c06b69bc54b02b7c8fdd9d95808e7c75c06cac682c0851a5d678e9ac203dcdb5d3f4fb932616d2694e58f7ac7fe15190a693e846a8b4
|
7
|
+
data.tar.gz: c665b7f5012f7e37edeb5ea67d218b40c3ea3e229a0fdaa5b0bab066cf1b1f2692d8e03b76ff63d77d9597d19d7c61b62a82f07d5aa170cf5633d100b972995b
|
data/README.md
CHANGED
data/lib/toxic/source/project.rb
CHANGED
@@ -29,6 +29,7 @@ module Toxic
|
|
29
29
|
raise "A name for the project is required." unless name
|
30
30
|
raise "The project name cannot contain spaces." if name =~ /\s/
|
31
31
|
raise "The project name cannot begin with a '.'" if name[0, 1] == '.'
|
32
|
+
puts CLI::UI.fmt("{{green: validate! pass")
|
32
33
|
end
|
33
34
|
|
34
35
|
def clone_template
|
@@ -43,12 +44,15 @@ module Toxic
|
|
43
44
|
end
|
44
45
|
end
|
45
46
|
system "git clone #{@template_url} #{name}"
|
47
|
+
|
48
|
+
puts CLI::UI.fmt("{{green: clone_template pass")
|
46
49
|
end
|
47
50
|
|
48
51
|
def get_template_info
|
49
|
-
template_path = Dir.glob("./#{name}
|
52
|
+
template_path = Dir.glob("./#{name}/**/**/*.xcodeproj").first
|
50
53
|
@template_name = File.basename(template_path, '.xcodeproj')
|
51
54
|
@template_author, @template_organization = template_author_organization
|
55
|
+
puts CLI::UI.fmt("{{green: get_template_info pass")
|
52
56
|
end
|
53
57
|
|
54
58
|
def ask_info_for_new
|
@@ -57,6 +61,8 @@ module Toxic
|
|
57
61
|
@author = CLI::UI.ask('author for the project:')
|
58
62
|
@organization = CLI::UI.ask('organization for the project:')
|
59
63
|
@repository_address = CLI::UI.ask('repository address for the project:')
|
64
|
+
|
65
|
+
puts CLI::UI.fmt("{{green: ask_info_for_new pass")
|
60
66
|
end
|
61
67
|
|
62
68
|
def remove_useless
|
@@ -64,15 +70,19 @@ module Toxic
|
|
64
70
|
system "rm -rf ./#{name}/**/xcuserdata/"
|
65
71
|
system "rm -rf ./#{name}/**/**/xcuserdata/"
|
66
72
|
system "rm -rf ./#{name}/**/**/xcshareddata"
|
73
|
+
puts CLI::UI.fmt("{{green: remove_useless pass")
|
67
74
|
end
|
68
75
|
|
69
76
|
def configure_template
|
70
77
|
traverse_dir(Pathname("./#{name}"))
|
78
|
+
puts CLI::UI.fmt("{{green: configure_template pass")
|
71
79
|
end
|
72
80
|
|
73
81
|
def set_bundle_identifiers
|
74
82
|
puts CLI::UI.fmt("{{cyan: Let's setup your bundle identifiers}}")
|
75
|
-
|
83
|
+
|
84
|
+
project_path = Dir.glob("./#{name}/**/**/#{name}.xcodeproj").first
|
85
|
+
project = Xcodeproj::Project.open(project_path)
|
76
86
|
project.targets.each do |target|
|
77
87
|
target.build_configurations.each do |config|
|
78
88
|
original_bundle_identifier = config.build_settings["PRODUCT_BUNDLE_IDENTIFIER"]
|
@@ -89,8 +99,8 @@ module Toxic
|
|
89
99
|
puts CLI::UI.fmt("{{green: initializing git}}")
|
90
100
|
system "git init"
|
91
101
|
system "git remote add origin #{repository_address}" unless repository_address.empty?
|
92
|
-
project = "./#{name}.xcworkspace"
|
93
|
-
project = "./#{name}.xcodeproj" unless Dir.glob(project).any?
|
102
|
+
project = Dir.glob("./#{name}/**/**/#{name}.xcworkspace").first
|
103
|
+
project = Dir.glob("./#{name}/**/**/#{name}.xcodeproj") unless Dir.glob(project).any?
|
94
104
|
system "open #{project}"
|
95
105
|
end
|
96
106
|
end
|
data/lib/toxic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toxic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- liubo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
version: '0'
|
124
124
|
requirements: []
|
125
125
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.7.
|
126
|
+
rubygems_version: 2.7.6
|
127
127
|
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: create xcode project from template
|