mvcgen 0.1.11 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/basexcodetemplate/AppDelegate.swift +46 -0
- data/lib/basexcodetemplate/Assets.xcassets/AppIcon.appiconset/Contents.json +98 -0
- data/lib/basexcodetemplate/Assets.xcassets/Contents.json +6 -0
- data/lib/basexcodetemplate/Info.plist +45 -0
- data/lib/basexcodetemplate/LaunchScreen.storyboard +25 -0
- data/lib/basexcodetemplate/Main.storyboard +24 -0
- data/lib/mvcgen/generator.rb +29 -6
- data/lib/mvcgen/version.rb +1 -1
- metadata +7 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 751e9be161142a542aa1b6476c958c9e9992fe35
|
4
|
+
data.tar.gz: 8e113bc4776a6c07e6c181d30871bcfc476f220e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54df0effd6c136733b1fbcf8756d0213dd76162840ee6eb04088a14a4258ff78b5d483a95c20a23e7a1825a93e0573c87cf6cb30a5dcfdb1385e41fb0a322773
|
7
|
+
data.tar.gz: a10b148bb0567ddcc2e66a0857b5b7841455561518245fefbd006e052f0e25921ab0998f2c00ecb50302840f723a1264252c85c0f6ec8fd41dac4c5d595278e1
|
@@ -0,0 +1,46 @@
|
|
1
|
+
//
|
2
|
+
// AppDelegate.swift
|
3
|
+
// testing
|
4
|
+
//
|
5
|
+
// Created by Daniel Martinez on 7/24/18.
|
6
|
+
// Copyright © 2018 Houlak. All rights reserved.
|
7
|
+
//
|
8
|
+
|
9
|
+
import UIKit
|
10
|
+
|
11
|
+
@UIApplicationMain
|
12
|
+
class AppDelegate: UIResponder, UIApplicationDelegate {
|
13
|
+
|
14
|
+
var window: UIWindow?
|
15
|
+
|
16
|
+
|
17
|
+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
|
18
|
+
// Override point for customization after application launch.
|
19
|
+
return true
|
20
|
+
}
|
21
|
+
|
22
|
+
func applicationWillResignActive(_ application: UIApplication) {
|
23
|
+
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
24
|
+
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
|
25
|
+
}
|
26
|
+
|
27
|
+
func applicationDidEnterBackground(_ application: UIApplication) {
|
28
|
+
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
29
|
+
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
30
|
+
}
|
31
|
+
|
32
|
+
func applicationWillEnterForeground(_ application: UIApplication) {
|
33
|
+
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
|
34
|
+
}
|
35
|
+
|
36
|
+
func applicationDidBecomeActive(_ application: UIApplication) {
|
37
|
+
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
38
|
+
}
|
39
|
+
|
40
|
+
func applicationWillTerminate(_ application: UIApplication) {
|
41
|
+
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
42
|
+
}
|
43
|
+
|
44
|
+
|
45
|
+
}
|
46
|
+
|
@@ -0,0 +1,98 @@
|
|
1
|
+
{
|
2
|
+
"images" : [
|
3
|
+
{
|
4
|
+
"idiom" : "iphone",
|
5
|
+
"size" : "20x20",
|
6
|
+
"scale" : "2x"
|
7
|
+
},
|
8
|
+
{
|
9
|
+
"idiom" : "iphone",
|
10
|
+
"size" : "20x20",
|
11
|
+
"scale" : "3x"
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"idiom" : "iphone",
|
15
|
+
"size" : "29x29",
|
16
|
+
"scale" : "2x"
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"idiom" : "iphone",
|
20
|
+
"size" : "29x29",
|
21
|
+
"scale" : "3x"
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"idiom" : "iphone",
|
25
|
+
"size" : "40x40",
|
26
|
+
"scale" : "2x"
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"idiom" : "iphone",
|
30
|
+
"size" : "40x40",
|
31
|
+
"scale" : "3x"
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"idiom" : "iphone",
|
35
|
+
"size" : "60x60",
|
36
|
+
"scale" : "2x"
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"idiom" : "iphone",
|
40
|
+
"size" : "60x60",
|
41
|
+
"scale" : "3x"
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"idiom" : "ipad",
|
45
|
+
"size" : "20x20",
|
46
|
+
"scale" : "1x"
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"idiom" : "ipad",
|
50
|
+
"size" : "20x20",
|
51
|
+
"scale" : "2x"
|
52
|
+
},
|
53
|
+
{
|
54
|
+
"idiom" : "ipad",
|
55
|
+
"size" : "29x29",
|
56
|
+
"scale" : "1x"
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"idiom" : "ipad",
|
60
|
+
"size" : "29x29",
|
61
|
+
"scale" : "2x"
|
62
|
+
},
|
63
|
+
{
|
64
|
+
"idiom" : "ipad",
|
65
|
+
"size" : "40x40",
|
66
|
+
"scale" : "1x"
|
67
|
+
},
|
68
|
+
{
|
69
|
+
"idiom" : "ipad",
|
70
|
+
"size" : "40x40",
|
71
|
+
"scale" : "2x"
|
72
|
+
},
|
73
|
+
{
|
74
|
+
"idiom" : "ipad",
|
75
|
+
"size" : "76x76",
|
76
|
+
"scale" : "1x"
|
77
|
+
},
|
78
|
+
{
|
79
|
+
"idiom" : "ipad",
|
80
|
+
"size" : "76x76",
|
81
|
+
"scale" : "2x"
|
82
|
+
},
|
83
|
+
{
|
84
|
+
"idiom" : "ipad",
|
85
|
+
"size" : "83.5x83.5",
|
86
|
+
"scale" : "2x"
|
87
|
+
},
|
88
|
+
{
|
89
|
+
"idiom" : "ios-marketing",
|
90
|
+
"size" : "1024x1024",
|
91
|
+
"scale" : "1x"
|
92
|
+
}
|
93
|
+
],
|
94
|
+
"info" : {
|
95
|
+
"version" : 1,
|
96
|
+
"author" : "xcode"
|
97
|
+
}
|
98
|
+
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>CFBundleDevelopmentRegion</key>
|
6
|
+
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
7
|
+
<key>CFBundleExecutable</key>
|
8
|
+
<string>$(EXECUTABLE_NAME)</string>
|
9
|
+
<key>CFBundleIdentifier</key>
|
10
|
+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
11
|
+
<key>CFBundleInfoDictionaryVersion</key>
|
12
|
+
<string>6.0</string>
|
13
|
+
<key>CFBundleName</key>
|
14
|
+
<string>$(PRODUCT_NAME)</string>
|
15
|
+
<key>CFBundlePackageType</key>
|
16
|
+
<string>APPL</string>
|
17
|
+
<key>CFBundleShortVersionString</key>
|
18
|
+
<string>1.0</string>
|
19
|
+
<key>CFBundleVersion</key>
|
20
|
+
<string>1</string>
|
21
|
+
<key>LSRequiresIPhoneOS</key>
|
22
|
+
<true/>
|
23
|
+
<key>UILaunchStoryboardName</key>
|
24
|
+
<string>LaunchScreen</string>
|
25
|
+
<key>UIMainStoryboardFile</key>
|
26
|
+
<string>Main</string>
|
27
|
+
<key>UIRequiredDeviceCapabilities</key>
|
28
|
+
<array>
|
29
|
+
<string>armv7</string>
|
30
|
+
</array>
|
31
|
+
<key>UISupportedInterfaceOrientations</key>
|
32
|
+
<array>
|
33
|
+
<string>UIInterfaceOrientationPortrait</string>
|
34
|
+
<string>UIInterfaceOrientationLandscapeLeft</string>
|
35
|
+
<string>UIInterfaceOrientationLandscapeRight</string>
|
36
|
+
</array>
|
37
|
+
<key>UISupportedInterfaceOrientations~ipad</key>
|
38
|
+
<array>
|
39
|
+
<string>UIInterfaceOrientationPortrait</string>
|
40
|
+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
41
|
+
<string>UIInterfaceOrientationLandscapeLeft</string>
|
42
|
+
<string>UIInterfaceOrientationLandscapeRight</string>
|
43
|
+
</array>
|
44
|
+
</dict>
|
45
|
+
</plist>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" systemVersion="17A277" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
3
|
+
<dependencies>
|
4
|
+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
|
5
|
+
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
6
|
+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
7
|
+
</dependencies>
|
8
|
+
<scenes>
|
9
|
+
<!--View Controller-->
|
10
|
+
<scene sceneID="EHf-IW-A2E">
|
11
|
+
<objects>
|
12
|
+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
13
|
+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
14
|
+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
15
|
+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
16
|
+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
17
|
+
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
|
18
|
+
</view>
|
19
|
+
</viewController>
|
20
|
+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
21
|
+
</objects>
|
22
|
+
<point key="canvasLocation" x="53" y="375"/>
|
23
|
+
</scene>
|
24
|
+
</scenes>
|
25
|
+
</document>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" systemVersion="17A277" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
|
3
|
+
<dependencies>
|
4
|
+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
|
5
|
+
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
6
|
+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
7
|
+
</dependencies>
|
8
|
+
<scenes>
|
9
|
+
<!--View Controller-->
|
10
|
+
<scene sceneID="tne-QT-ifu">
|
11
|
+
<objects>
|
12
|
+
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
|
13
|
+
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
14
|
+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
15
|
+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
16
|
+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
17
|
+
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
|
18
|
+
</view>
|
19
|
+
</viewController>
|
20
|
+
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
21
|
+
</objects>
|
22
|
+
</scene>
|
23
|
+
</scenes>
|
24
|
+
</document>
|
data/lib/mvcgen/generator.rb
CHANGED
@@ -13,16 +13,39 @@ module MVCgen
|
|
13
13
|
puts "Template: #{template}"
|
14
14
|
puts "Language: #{language}"
|
15
15
|
puts "Name: #{name}"
|
16
|
-
puts "Path: "
|
17
|
-
proj = Xcodeproj::Project.new
|
16
|
+
puts "Path: #{path}"
|
17
|
+
proj = Xcodeproj::Project.new("#{path}/#{name}.xcodeproj")
|
18
18
|
app_target = proj.new_target(:application, "#{name} - Development", :ios, '10.0')
|
19
19
|
# header_ref = proj.main_group.new_file('./Class.h')
|
20
20
|
# implm_ref = proj.main_group.new_file('./Class.m')
|
21
|
-
#
|
22
|
-
proj.save_as("#{name}.xcodeproj")
|
23
|
-
podfile_path = "#{Gem.dir}/gems/#{MVCgen::NAME}-#{MVCgen::VERSION}/lib/podfile/Podfile"
|
21
|
+
basefiles_path = "#{Gem.dir}/gems/#{MVCgen::NAME}-#{MVCgen::VERSION}/lib/basexcodetemplate"
|
24
22
|
to_path = "#{path}/#{name}"
|
25
|
-
MVCgen::FileManager.copy(
|
23
|
+
MVCgen::FileManager.copy(basefiles_path, to_path)
|
24
|
+
files = MVCgen::FileManager.files_in_path(to_path)
|
25
|
+
self.addxcodefiles(to_path,proj.main_group,app_target)
|
26
|
+
# app_target.add_file_references([files])
|
27
|
+
proj.save
|
28
|
+
# podfile_path = "#{Gem.dir}/gems/#{MVCgen::NAME}-#{MVCgen::VERSION}/lib/podfile/Podfile"
|
29
|
+
# to_path = "#{path}/#{name}"
|
30
|
+
|
31
|
+
# MVCgen::FileManager.copy(podfile_path, to_path)
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.addxcodefiles(direc, current_group, main_target)
|
35
|
+
Dir.glob(direc) do |item|
|
36
|
+
next if item == '.' or item == '.DS_Store'
|
37
|
+
if File.directory?(item)
|
38
|
+
new_folder = File.basename(item)
|
39
|
+
created_group = current_group.new_group(new_folder)
|
40
|
+
self.addxcodefiles("#{item}/*", created_group, main_target)
|
41
|
+
# elsif item.include? ".xcassets"
|
42
|
+
# i = current_group.new_reference(item)
|
43
|
+
# main_target.add_file_references([item])
|
44
|
+
else
|
45
|
+
i = current_group.new_file(item)
|
46
|
+
main_target.add_file_references([i])
|
47
|
+
end
|
48
|
+
end
|
26
49
|
end
|
27
50
|
|
28
51
|
# Main method that generate the MVC files structure
|
data/lib/mvcgen/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mvcgen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Martinez
|
@@ -92,6 +92,12 @@ files:
|
|
92
92
|
- LICENSE
|
93
93
|
- README.md
|
94
94
|
- bin/mvcgen
|
95
|
+
- lib/basexcodetemplate/AppDelegate.swift
|
96
|
+
- lib/basexcodetemplate/Assets.xcassets/AppIcon.appiconset/Contents.json
|
97
|
+
- lib/basexcodetemplate/Assets.xcassets/Contents.json
|
98
|
+
- lib/basexcodetemplate/Info.plist
|
99
|
+
- lib/basexcodetemplate/LaunchScreen.storyboard
|
100
|
+
- lib/basexcodetemplate/Main.storyboard
|
95
101
|
- lib/mvcgen.rb
|
96
102
|
- lib/mvcgen/dirutils.rb
|
97
103
|
- lib/mvcgen/filemanager.rb
|