appjam 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -57,6 +57,42 @@ Add "three20/src/Three20.bundle" folder to the "Other Sources" Group
57
57
 
58
58
  Xcode build and run
59
59
 
60
+ ==== Usage 4: add asihttp submodule (## this require git installed)
61
+
62
+ $ cd todo
63
+
64
+ $ appjam submodule asihttp
65
+
66
+ $ open Todo.xcodeproj
67
+
68
+ Add "asihttp" folder to the "Other Sources" Group
69
+
70
+ Xcode build and run
71
+
72
+ ==== Usage 5: add json-framework submodule (## this require git installed)
73
+
74
+ $ cd todo
75
+
76
+ $ appjam submodule json
77
+
78
+ $ open Todo.xcodeproj
79
+
80
+ Add "json-framework" folder to the "Other Sources" Group
81
+
82
+ Xcode build and run
83
+
84
+ ==== Usage 6: add kissxml submodule (## this require mercurial installed)
85
+
86
+ $ cd todo
87
+
88
+ $ appjam submodule json
89
+
90
+ $ open Todo.xcodeproj
91
+
92
+ Add "kissxml" folder to the "Other Sources" Group
93
+
94
+ Xcode build and run
95
+
60
96
  == Contributing to appjam
61
97
 
62
98
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
@@ -47,7 +47,11 @@ module Appjam
47
47
  puts colorize("APPJAM OPTIONS", { :foreground => :blue})
48
48
  opt = [{ :category => "objective c (iphone)", :command => "appjam project todo", :description => "generate iphone project skeleton"},
49
49
  { :category => "objective c (iphone)", :command => "appjam model user", :description => "generate iphone project data model"},
50
- { :category => "objective c (iphone)", :command => "appjam submodule three20", :description => "fetch three20 subproject from github.com"}]
50
+ { :category => "objective c (iphone)", :command => "appjam submodule three20", :description => "fetch three20 subproject from github.com"},
51
+ { :category => "objective c (iphone)", :command => "appjam submodule asihttp", :description => "fetch asi-http-request subproject from github.com"},
52
+ { :category => "objective c (iphone)", :command => "appjam submodule json", :description => "fetch json-framework subproject from github.com"},
53
+ { :category => "objective c (iphone)", :command => "appjam submodule kissxml", :description => "fetch kissxml subproject from code.google.com"}
54
+ ]
51
55
  View.render(opt, RENDER_OPTIONS)
52
56
  puts
53
57
  end
@@ -70,6 +70,8 @@ template "project/main.m.tt", "#{@project_name}/main.m"
70
70
 
71
71
  empty_directory "#{@project_name}/Classes/utils"
72
72
 
73
+ empty_directory "#{@project_name}/Support"
74
+
73
75
  copy_file "project/utils/NSStringWhiteSpace.h", "#{@project_name}/Classes/utils/NSStringWhiteSpace.h"
74
76
  copy_file "project/utils/NSStringWhiteSpace.m", "#{@project_name}/Classes/utils/NSStringWhiteSpace.m"
75
77
  copy_file "project/utils/UIDevice.h", "#{@project_name}/Classes/utils/UIDevice.h"
@@ -26,21 +26,65 @@ module Appjam
26
26
  File.exist?('Classes')
27
27
  end
28
28
 
29
- def create_app
29
+ def create_submodule
30
+ valid_constant?(options[:submodule] || name)
31
+ @submodule_name = (options[:app] || name).gsub(/W/, "_").downcase
32
+ @xcode_project_name = File.basename(Dir.glob('*.xcodeproj')[0],'.xcodeproj').downcase
33
+ @class_name = (options[:app] || name).gsub(/W/, "_").capitalize
34
+ @developer = "eiffel"
35
+ @created_on = Date.today.to_s
36
+ self.destination_root = options[:root]
37
+
38
+ if which('hg') != nil
39
+ if in_app_root?
40
+ if @submodule_name == 'kissxml'
41
+ eval(File.read(__FILE__) =~ /^__END__\n/ && $' || '')
42
+
43
+ system "rm -rf kissxml"
44
+ system "hg clone https://kissxml.googlecode.com/hg/ kissxml"
45
+ system "git add ."
46
+ system "git commit -m 'import kissxml submodule'"
47
+ say (<<-TEXT).gsub(/ {10}/,'')
48
+
49
+ =================================================================
50
+ kissxml submodule has been imported
51
+
52
+ Open #{@xcode_project_name.capitalize}.xcodeproj
53
+ Add "kissxml" folder to the "Other Sources" Group
54
+ Build and Run
55
+ =================================================================
56
+ TEXT
57
+ else
58
+ unless %w(three20 sihttp json-framework kissxml).include?(@submodule_name)
59
+ say "="*70
60
+ say "Only support three20,asihttp,json-framework,kissxml submodule now!"
61
+ say "="*70
62
+ end
63
+ end
64
+ else
65
+ puts
66
+ puts '-'*70
67
+ puts "You are not in an iphone project folder"
68
+ puts '-'*70
69
+ puts
70
+ end
71
+ else
72
+ say "="*70
73
+ say "Mercurial was not installed!! check http://mercurial.selenic.com/ for installation."
74
+ say "="*70
75
+ end
76
+
30
77
  if which('git') != nil
31
78
  if in_app_root?
32
- valid_constant?(options[:submodule] || name)
33
- @submodule_name = (options[:app] || name).gsub(/W/, "_").downcase
34
- @xcode_project_name = File.basename(Dir.glob('*.xcodeproj')[0],'.xcodeproj').downcase
35
- @class_name = (options[:app] || name).gsub(/W/, "_").capitalize
36
- @developer = "eiffel"
37
- @created_on = Date.today.to_s
38
- self.destination_root = options[:root]
39
-
40
79
  if @submodule_name == 'three20'
41
80
 
42
- eval(File.read(__FILE__) =~ /^__END__\n/ && $' || '')
43
-
81
+ eval(File.read(__FILE__) =~ /^__END__\n/ && $' || '')
82
+
83
+ system "rm -rf three20"
84
+ system "git submodule add git://github.com/facebook/three20.git three20"
85
+ system "git add ."
86
+ system "git commit -m 'import three20 submodule'"
87
+
44
88
  say (<<-TEXT).gsub(/ {10}/,'')
45
89
 
46
90
  =================================================================
@@ -52,10 +96,47 @@ module Appjam
52
96
  Build and Run
53
97
  =================================================================
54
98
  TEXT
99
+ elsif @submodule_name == 'asihttp'
100
+ eval(File.read(__FILE__) =~ /^__END__\n/ && $' || '')
101
+
102
+ system "rm -rf asihttp"
103
+ system "git submodule add git://github.com/pokeb/asi-http-request.git asihttp"
104
+ system "git add ."
105
+ system "git commit -m 'import asihttp submodule'"
106
+
107
+ say (<<-TEXT).gsub(/ {10}/,'')
108
+
109
+ =================================================================
110
+ Asihttp submodule has been imported
111
+
112
+ Open #{@xcode_project_name.capitalize}.xcodeproj
113
+ Add "asihttp" folder to the "Other Sources" Group
114
+ Build and Run
115
+ =================================================================
116
+ TEXT
117
+ elsif @submodule_name == 'json'
118
+ eval(File.read(__FILE__) =~ /^__END__\n/ && $' || '')
119
+
120
+ system "rm -rf json-framework"
121
+ system "git submodule add git://github.com/stig/json-framework json-framework"
122
+ system "git add ."
123
+ system "git commit -m 'import json-framework submodule'"
124
+ say (<<-TEXT).gsub(/ {10}/,'')
125
+
126
+ =================================================================
127
+ json-framework submodule has been imported
128
+
129
+ Open #{@xcode_project_name.capitalize}.xcodeproj
130
+ Add "json-framework" folder to the "Other Sources" Group
131
+ Build and Run
132
+ =================================================================
133
+ TEXT
55
134
  else
56
- say "="*70
57
- say "Only support three20 submodule now!"
58
- say "="*70
135
+ unless %w(three20 sihttp json-framework kissxml).include?(@submodule_name)
136
+ say "="*70
137
+ say "Only support three20,asihttp,json-framework,kissxml submodule now!"
138
+ say "="*70
139
+ end
59
140
  end
60
141
  else
61
142
  puts
@@ -82,8 +163,5 @@ template "submodule/gitignore.tt", "./.gitignore"
82
163
  system "git add ."
83
164
  system "git commit -m 'init commit'"
84
165
  end
85
- system "rm -rf three20"
86
- system "git submodule add git://github.com/facebook/three20.git three20"
87
- system "git add ."
88
- system "git commit -m 'import three20 submodule'"
166
+
89
167
 
@@ -1,2 +1,3 @@
1
1
  .DS_Store
2
- build/
2
+ build
3
+ .hg
@@ -2,7 +2,7 @@ module Appjam
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- PATCH = 6
5
+ PATCH = 7
6
6
  BUILD = ''
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.').chomp('.')
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appjam
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 6
10
- version: 0.1.6
9
+ - 7
10
+ version: 0.1.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - Eiffel Q
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-05-17 00:00:00 Z
18
+ date: 2011-05-18 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  type: :runtime