appjam 0.1.8.1 → 0.1.8.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +17 -9
- data/lib/appjam.rb +1 -1
- data/lib/appjam/generators/cli.rb +17 -36
- data/lib/appjam/generators/gist.rb +48 -46
- data/lib/appjam/generators/gist.yml +134 -6
- data/lib/appjam/generators/help.rb +81 -0
- data/lib/appjam/generators/lib.rb +3 -6
- data/lib/appjam/generators/{model.rb → mvc_model.rb} +2 -2
- data/lib/appjam/generators/{project.rb → mvc_project.rb} +2 -2
- data/lib/appjam/generators/search.rb +18 -17
- data/lib/appjam/utility.rb +30 -0
- data/lib/appjam/version.rb +1 -1
- metadata +15 -13
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
appjam
|
2
2
|
=======
|
3
|
-
Appjam is
|
4
|
-
|
5
|
-
for PureMVC framework, see http://trac.puremvc.org/PureMVC_ObjectiveC/
|
3
|
+
Appjam is an iOS code repository, including framework, snippet, generators, etc.
|
6
4
|
|
7
5
|
Prerequisites
|
8
6
|
=======
|
@@ -24,7 +22,17 @@ Installation
|
|
24
22
|
Usage
|
25
23
|
=======
|
26
24
|
![appjam usage](http://eiffelqiu.github.com/appjam/appjam.jpg)
|
27
|
-
|
25
|
+
|
26
|
+
Usage 1: search related function
|
27
|
+
-------
|
28
|
+
$ appjam search image
|
29
|
+
$ appjam search string
|
30
|
+
|
31
|
+
Usage 2: update latest gists index
|
32
|
+
-------
|
33
|
+
$ appjam gist update
|
34
|
+
|
35
|
+
Usage 3: generate iphone app project
|
28
36
|
-------
|
29
37
|
$ appjam project todo
|
30
38
|
|
@@ -34,7 +42,7 @@ Usage 1: generate iphone app project
|
|
34
42
|
|
35
43
|
Xcode build and run
|
36
44
|
|
37
|
-
Usage
|
45
|
+
Usage 4: add model to iphone app project
|
38
46
|
-------
|
39
47
|
$ cd todo
|
40
48
|
|
@@ -46,7 +54,7 @@ Add "Classes/user/" folder to the "Classes/apps" Group
|
|
46
54
|
|
47
55
|
Xcode build and run
|
48
56
|
|
49
|
-
Usage
|
57
|
+
Usage 5: add three20 submodule (## this require git installed)
|
50
58
|
-------
|
51
59
|
$ cd todo
|
52
60
|
|
@@ -59,7 +67,7 @@ Add "three20/src/Three20.bundle" folder to the "Other Sources" Group
|
|
59
67
|
|
60
68
|
Xcode build and run
|
61
69
|
|
62
|
-
Usage
|
70
|
+
Usage 6: add asihttp submodule (## this require git installed)
|
63
71
|
-------
|
64
72
|
$ cd todo
|
65
73
|
|
@@ -71,7 +79,7 @@ Add "asihttp" folder to the "Other Sources" Group
|
|
71
79
|
|
72
80
|
Xcode build and run
|
73
81
|
|
74
|
-
Usage
|
82
|
+
Usage 7: add json-framework submodule (## this require git installed)
|
75
83
|
-------
|
76
84
|
$ cd todo
|
77
85
|
|
@@ -83,7 +91,7 @@ Add "json-framework" folder to the "Other Sources" Group
|
|
83
91
|
|
84
92
|
Xcode build and run
|
85
93
|
|
86
|
-
Usage
|
94
|
+
Usage 8: add kissxml submodule (## this require mercurial installed)
|
87
95
|
-------
|
88
96
|
$ cd todo
|
89
97
|
|
data/lib/appjam.rb
CHANGED
@@ -57,6 +57,6 @@ end # Appjam
|
|
57
57
|
##
|
58
58
|
# We add our generators to Appjam::Genererator
|
59
59
|
#
|
60
|
-
Appjam::Generators.load_paths << Dir[File.dirname(__FILE__) + '/appjam/generators/{
|
60
|
+
Appjam::Generators.load_paths << Dir[File.dirname(__FILE__) + '/appjam/generators/{mvc_project,mvc_model,lib,gist,search,help}.rb']
|
61
61
|
|
62
62
|
|
@@ -18,9 +18,9 @@ module Appjam
|
|
18
18
|
RENDER_OPTIONS = { :fields => [:category,:command,:description] }
|
19
19
|
# Include related modules
|
20
20
|
include Thor::Actions
|
21
|
-
|
22
|
-
class_option :
|
23
|
-
|
21
|
+
desc "Appjam Version:\t#{Appjam::Version::STRING}"
|
22
|
+
class_option :help, :desc => "Help screen", :aliases => '-h', :type => :string
|
23
|
+
|
24
24
|
# We need to TRY to load boot because some of our app dependencies maybe have
|
25
25
|
# custom generators, so is necessary know who are.
|
26
26
|
def load_boot
|
@@ -37,22 +37,12 @@ module Appjam
|
|
37
37
|
|
38
38
|
generator_kind = ARGV.delete_at(0).to_s.downcase.to_sym if ARGV[0].present?
|
39
39
|
generator_class = Appjam::Generators.mappings[generator_kind]
|
40
|
-
|
41
40
|
if generator_class
|
42
|
-
args = ARGV.empty? && generator_class.require_arguments? ? ["-h"] : ARGV
|
43
|
-
generator_class.start(args)
|
44
|
-
else
|
41
|
+
args = ARGV.empty? && generator_class.require_arguments? ? ["-h"] : ARGV
|
42
|
+
generator_class.start(args)
|
43
|
+
else
|
45
44
|
puts colorize( "Appjam Version: #{Appjam::Version::STRING}", { :foreground => :red, :background => :white, :config => :underline } )
|
46
45
|
puts
|
47
|
-
puts colorize("Usage: appjam [OPTIONS] [ARGS]")
|
48
|
-
puts
|
49
|
-
puts colorize("Generator Options")
|
50
|
-
opt = [{ :category => "objective c (iphone)", :command => "appjam project todo", :description => "generate iphone project skeleton"},
|
51
|
-
{ :category => "objective c (iphone)", :command => "appjam model user", :description => "generate iphone project data model"}
|
52
|
-
]
|
53
|
-
View.render(opt, RENDER_OPTIONS)
|
54
|
-
puts
|
55
|
-
puts colorize("Appjam Options")
|
56
46
|
require 'yaml'
|
57
47
|
gistfile = File.expand_path("~") + '/.appjam/gist.yml'
|
58
48
|
Gist::update_gist unless File.exist?(gistfile)
|
@@ -61,27 +51,18 @@ module Appjam
|
|
61
51
|
rescue ArgumentError => e
|
62
52
|
g = YAML.load_file(File.expand_path(File.dirname(__FILE__) + '/gist.yml'))
|
63
53
|
end
|
64
|
-
g.
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
g[key].each { |k|
|
74
|
-
k.each_pair { |k1,v1|
|
75
|
-
if gname == 'lib'
|
76
|
-
gitopt << {:category => "#{key.gsub('_',' ')}", :command => "appjam lib #{k1}", :description => "#{k[k1][2]['description']}" }
|
77
|
-
else
|
78
|
-
gitopt << {:category => "#{key.gsub('_',' ')}", :command => "appjam gist #{k1}", :description => "#{k[k1][2]['description']}" }
|
79
|
-
end
|
80
|
-
}
|
81
|
-
}
|
82
|
-
View.render(gitopt, RENDER_OPTIONS)
|
83
|
-
}
|
54
|
+
puts "notice: a new version '#{g['info']}' released" if g['info'] and g['info'].strip != "#{Appjam::Version::STRING}"
|
55
|
+
puts
|
56
|
+
puts "Appjam is an iOS code repository, including framework, snippet, generators, etc."
|
57
|
+
puts
|
58
|
+
puts colorize("For more information")
|
59
|
+
puts
|
60
|
+
puts "appjam help"
|
61
|
+
puts
|
62
|
+
puts colorize("Update latest repository info")
|
84
63
|
puts
|
64
|
+
puts "appjam gist update"
|
65
|
+
puts
|
85
66
|
end
|
86
67
|
end
|
87
68
|
end # Cli
|
@@ -135,11 +135,9 @@ module Appjam
|
|
135
135
|
end
|
136
136
|
|
137
137
|
def create_git
|
138
|
-
if in_app_root?
|
139
138
|
valid_constant?(options[:gist] || name)
|
140
139
|
@gist_name = (options[:app] || name).gsub(/W/, "_").downcase
|
141
|
-
@class_name = (options[:app] || name).gsub(/W/, "_").capitalize
|
142
|
-
@xcode_project_name = File.basename(Dir.glob('*.xcodeproj')[0],'.xcodeproj').downcase
|
140
|
+
@class_name = (options[:app] || name).gsub(/W/, "_").capitalize
|
143
141
|
@developer = "eiffel"
|
144
142
|
@created_on = Date.today.to_s
|
145
143
|
self.destination_root = options[:root]
|
@@ -148,53 +146,57 @@ module Appjam
|
|
148
146
|
puts
|
149
147
|
|
150
148
|
unless @gist_name == 'update'
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
gcategory = key.downcase
|
168
|
-
unless gcategory == 'lib'
|
169
|
-
g[key].each { |k|
|
170
|
-
k.each_pair { |k1,v1|
|
171
|
-
if "#{k1}" == @gist_name
|
172
|
-
gid = k[k1][0]['id']
|
173
|
-
gname = k[k1][1]['name']
|
174
|
-
Gist::download_gist("#{gid}",gcategory,gname)
|
175
|
-
eval(File.read(__FILE__) =~ /^__END__/ && $' || '')
|
176
|
-
say "================================================================="
|
177
|
-
say "Your '#{gname.capitalize}' snippet code has been generated."
|
178
|
-
say "Check Gist/#{gcategory}/#{gname}/ for snippet"
|
179
|
-
say "Open #{@xcode_project_name.capitalize}.xcodeproj"
|
180
|
-
say "Add 'Gist/#{gcategory}/#{gname}/' folder to the 'Classes/apps' Group"
|
181
|
-
say "Build and Run"
|
182
|
-
say "================================================================="
|
183
|
-
end
|
184
|
-
}
|
185
|
-
}
|
149
|
+
if in_app_root?
|
150
|
+
require 'yaml'
|
151
|
+
@xcode_project_name = File.basename(Dir.glob('*.xcodeproj')[0],'.xcodeproj').downcase
|
152
|
+
# begin
|
153
|
+
# page_source = Net::HTTP.get(URI.parse("http://eiffelqiu.github.com/appjam/gist.yml"))
|
154
|
+
# rescue SocketError => e
|
155
|
+
# puts "can not access github.com, back to local version gist.yml"
|
156
|
+
# end
|
157
|
+
gistfile = File.expand_path("~") + '/.appjam/gist.yml'
|
158
|
+
Gist::update_gist unless File.exist?(gistfile)
|
159
|
+
begin
|
160
|
+
puts "fetching new gists ..."
|
161
|
+
g = YAML.load_file(gistfile)
|
162
|
+
rescue ArgumentError => e
|
163
|
+
puts "can't fetch new gists, loading local gists ..."
|
164
|
+
g = YAML.load_file(File.expand_path(File.dirname(__FILE__) + '/gist.yml'))
|
186
165
|
end
|
187
|
-
|
166
|
+
puts "notice: a new version '#{g['info']}' released" if g['info'] and g['info'].strip != "#{Appjam::Version::STRING}"
|
167
|
+
puts
|
168
|
+
g.each_pair {|key,value|
|
169
|
+
gcategory = key.downcase
|
170
|
+
unless (gcategory == 'lib' or gcategory == 'info')
|
171
|
+
g[key].each { |k|
|
172
|
+
k.each_pair { |k1,v1|
|
173
|
+
if "#{k1}" == @gist_name
|
174
|
+
gid = k[k1][0]['id']
|
175
|
+
gname = k[k1][1]['name']
|
176
|
+
Gist::download_gist("#{gid}",gcategory,gname)
|
177
|
+
eval(File.read(__FILE__) =~ /^__END__/ && $' || '')
|
178
|
+
say "================================================================="
|
179
|
+
say "Your '#{gname.capitalize}' snippet code has been generated."
|
180
|
+
say "Check Gist/#{gcategory}/#{gname}/ for snippet"
|
181
|
+
say "Open #{@xcode_project_name.capitalize}.xcodeproj"
|
182
|
+
say "Add 'Gist/#{gcategory}/#{gname}/' folder to the 'Classes/apps' Group"
|
183
|
+
say "Build and Run"
|
184
|
+
say "================================================================="
|
185
|
+
end
|
186
|
+
}
|
187
|
+
}
|
188
|
+
end
|
189
|
+
}
|
190
|
+
else
|
191
|
+
puts
|
192
|
+
puts '-'*70
|
193
|
+
puts "You are not in an iphone project folder"
|
194
|
+
puts '-'*70
|
195
|
+
puts
|
196
|
+
end
|
188
197
|
else
|
189
198
|
Gist::update_gist
|
190
199
|
end
|
191
|
-
else
|
192
|
-
puts
|
193
|
-
puts '-'*70
|
194
|
-
puts "You are not in an iphone project folder"
|
195
|
-
puts '-'*70
|
196
|
-
puts
|
197
|
-
end
|
198
200
|
end # create_gist
|
199
201
|
|
200
202
|
end # Gist
|
@@ -1,5 +1,9 @@
|
|
1
|
-
|
2
|
-
design_pattern:
|
1
|
+
info: new version 1.8.2 released
|
2
|
+
design_pattern:
|
3
|
+
- singleton_macro:
|
4
|
+
- id : git://github.com/cjhanson/Objective-C-Optimized-Singleton.git
|
5
|
+
- name : Objective-C-Optimized-Singleton
|
6
|
+
- description : A Singleton Macro that swaps method implementations at runtime
|
3
7
|
- singleton:
|
4
8
|
- id : 988211
|
5
9
|
- name : Singleton
|
@@ -11,13 +15,25 @@ design_pattern:
|
|
11
15
|
- injection:
|
12
16
|
- id : 986087
|
13
17
|
- name : Injection
|
14
|
-
- description : Ruby's injection method for Objective C
|
18
|
+
- description : Ruby's injection method for Objective C
|
19
|
+
- objc_patterns:
|
20
|
+
- id : git://github.com/zbyhoo/ObjC_Patterns_Kata.git
|
21
|
+
- name : ObjC_Patterns
|
22
|
+
- description : Objective-C implementation of Gang of Four design patterns
|
15
23
|
|
16
24
|
algorithm:
|
17
25
|
- binary_search:
|
18
26
|
- id : 988219
|
19
27
|
- name : Binary_Search
|
20
28
|
- description : A binary search algorithm written Objective C
|
29
|
+
- objective_sort:
|
30
|
+
- id : git://github.com/jkubicek/Objective-Sort.git
|
31
|
+
- name : Objective-Sort
|
32
|
+
- description : Implementations of various sorting algorithms in Objective C
|
33
|
+
- quick_sort:
|
34
|
+
- id : git://github.com/cdemyanovich/DemyanoSort.git
|
35
|
+
- name : QuickSort
|
36
|
+
- description : quicksort in Objective-C for 8LU
|
21
37
|
|
22
38
|
lib:
|
23
39
|
- three20:
|
@@ -69,7 +85,7 @@ lib:
|
|
69
85
|
- name : SparrowFramework
|
70
86
|
- description : Sparrow Framework for iPhone
|
71
87
|
|
72
|
-
|
88
|
+
utiliy:
|
73
89
|
- get_ip_address:
|
74
90
|
- id : 986132
|
75
91
|
- name : Get_IP_Address
|
@@ -97,8 +113,120 @@ utiliy_function:
|
|
97
113
|
- category_additions:
|
98
114
|
- id : git://github.com/mkernel/iphone-snippets.git
|
99
115
|
- name : CategoryAdditions
|
100
|
-
- description : Some important category additions Base64 Keychain
|
101
|
-
|
116
|
+
- description : Some important category additions Base64 Keychain
|
117
|
+
- calendar_component:
|
118
|
+
- id : git://github.com/klazuka/Kal.git
|
119
|
+
- name : CalendarComponent
|
120
|
+
- description : A calendar component for the iPhone
|
121
|
+
- ts_alert_view:
|
122
|
+
- id : git://github.com/TomSwift/TSAlertView.git
|
123
|
+
- name : TSAlertView
|
124
|
+
- description : UIAlertView drop-in replacement. Supports more
|
125
|
+
- dd_alert_prompt:
|
126
|
+
- id : git://github.com/digdog/DDAlertPrompt.git
|
127
|
+
- name : DDAlertPrompt
|
128
|
+
- description : DDAlertPrompt for iOS
|
129
|
+
- ego_text_field_alert_view:
|
130
|
+
- id : git://github.com/enormego/EGOTextFieldAlertView.git
|
131
|
+
- name : EGOTextFieldAlertView
|
132
|
+
- description : UIAlertView subclass that adds support for UITextFields
|
133
|
+
- lka_ccount_panel:
|
134
|
+
- id : git://github.com/lakesoft/LKAccountPanel.git
|
135
|
+
- name : LKAccountPanel
|
136
|
+
- description : Custom UIAlertView for iOS
|
137
|
+
- sb_table_alert:
|
138
|
+
- id : git://github.com/simonb/SBTableAlert.git
|
139
|
+
- name : SBTableAlert
|
140
|
+
- description : A great looking UIAlertView with an UITableView inside
|
141
|
+
- bubble_view:
|
142
|
+
- id : git://github.com/m5h/bubble-view.git
|
143
|
+
- name : Bubble View
|
144
|
+
- description : Some examples of drawing a popover bubble for iPhone.
|
145
|
+
- hg_page_scroll_view:
|
146
|
+
- id : git://github.com/100grams/HGPageScrollView.git
|
147
|
+
- name : HGPageScrollView
|
148
|
+
- description : UIScrollView for iPhone with horizontal paging like mobile Safari tabs.
|
149
|
+
- stack_scroll_view:
|
150
|
+
- id : git://github.com/raweng/StackScrollView.git
|
151
|
+
- name : StackScrollView
|
152
|
+
- description : Stack Scroll View Panel like Twitter Ipad app for iOS developers
|
153
|
+
- tweetie_bar:
|
154
|
+
- id : git://github.com/briancollins/BCTabBarController.git
|
155
|
+
- name : TweetieBar
|
156
|
+
- description : a Tweetie-style tab bar for the iPhone
|
157
|
+
- tab_bar_kit:
|
158
|
+
- id : git://github.com/davidmorford/TabBarKit.git
|
159
|
+
- name : TabBarKit
|
160
|
+
- description : A flexible Tab Bar implementation for iPhone and iPad
|
161
|
+
- ftutils:
|
162
|
+
- id : git://github.com/neror/ftutils.git
|
163
|
+
- name : FTUtils
|
164
|
+
- description : iPhone utilities mostly for Core Animation
|
165
|
+
- nyx_images_utilities:
|
166
|
+
- id : git://github.com/Nyx0uf/NYXImagesUtilities.git
|
167
|
+
- name : NYXImagesUtilities
|
168
|
+
- description : A set of handy categories for UIImage class.
|
169
|
+
- mg_image_utilities:
|
170
|
+
- id : git://github.com/mattgemmell/MGImageUtilities.git
|
171
|
+
- name : MGImageUtilities
|
172
|
+
- description : Useful UIImage categories for iPhone/iPad developers
|
173
|
+
- ma_collection_utilities:
|
174
|
+
- id : git://github.com/mikeash/MACollectionUtilities.git
|
175
|
+
- name : MACollectionUtilities
|
176
|
+
- description : Smalltalk-inspired collection utility methods and macros for Cocoa
|
177
|
+
- dc_introspect:
|
178
|
+
- id : git://github.com/domesticcatsoftware/DCIntrospect.git
|
179
|
+
- name : DCIntrospect
|
180
|
+
- description : Small library of visual debugging tools for iOS.
|
181
|
+
- long_weekend_dev_tools:
|
182
|
+
- id : git://github.com/LongWeekend/Long-Weekend-Dev-Tools.git
|
183
|
+
- name : Long-Weekend-Dev-Tools
|
184
|
+
- description : A free toolkit for professional iOS app developers
|
185
|
+
- cocoa_web_resource:
|
186
|
+
- id : git://github.com/robin/cocoa-web-resource.git
|
187
|
+
- name : cocoa-web-resource
|
188
|
+
- description : A file transfer solution for iPhone and iPod Touch. Support uploading and download.
|
189
|
+
- aq_grid_view:
|
190
|
+
- id : git://github.com/AlanQuatermain/AQGridView.git
|
191
|
+
- name : AQGridView
|
192
|
+
- description : An grid view for iPhone/iPad
|
193
|
+
- i_carousel:
|
194
|
+
- id : git://github.com/demosthenese/iCarousel.git
|
195
|
+
- name : iCarousel
|
196
|
+
- description : iCarousel is a class to simplify implementation of various types on iPhone/iPad
|
197
|
+
- dd_share_view_controller:
|
198
|
+
- id : git://github.com/digdog/DDShareViewController.git
|
199
|
+
- name : DDShareViewController
|
200
|
+
- description : Share facebook "Post" rapidly on small iOS devices.
|
201
|
+
- ios_streaming_browser:
|
202
|
+
- id : git://github.com/rubelw/IOS-Streaming-Browser.git
|
203
|
+
- name : IOS-Streaming-Browser
|
204
|
+
- description : An embedded HTTP server for iPhone or iPad
|
205
|
+
- dd_action_header_view:
|
206
|
+
- id : git://github.com/digdog/DDActionHeaderView.git
|
207
|
+
- name : DDActionHeaderView
|
208
|
+
- description : Header with title and actions and rapid UI component for iOS 4
|
209
|
+
- calendar_ui:
|
210
|
+
- id : git://github.com/muhku/calendar-ui.git
|
211
|
+
- name : calendar-ui
|
212
|
+
- description : MACalendarUI offers calendar user interface for iPhone applications
|
213
|
+
- sliding_tabs:
|
214
|
+
- id : git://github.com/MPiccinato/SlidingTabs.git
|
215
|
+
- name : SlidingTabs
|
216
|
+
- description : Sliding tabs UI element for iPhone
|
217
|
+
- ks_popover_view:
|
218
|
+
- id : git://github.com/katokichisoft/KSPopoverView.git
|
219
|
+
- name : KSPopoverView
|
220
|
+
- description : A pulldown menu UI for iOS
|
221
|
+
- tapkulibrary:
|
222
|
+
- id : git://github.com/devinross/tapkulibrary.git
|
223
|
+
- name : tapkulibrary
|
224
|
+
- description : a well crafted open source iOS framework for iPhone/iPad
|
225
|
+
- iphone_utils:
|
226
|
+
- id : git://github.com/jlopez/iphone-utils.git
|
227
|
+
- name : IphoneUtils
|
228
|
+
- description : Useful additions to Cocoa/UIKit/etc iPhone libraries
|
229
|
+
|
102
230
|
snippet:
|
103
231
|
- common_macro:
|
104
232
|
- id : 988462
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'cli-colorize'
|
3
|
+
require 'thor/group'
|
4
|
+
require 'hirb'
|
5
|
+
require File.dirname(__FILE__) + '/../view'
|
6
|
+
require File.dirname(__FILE__) + '/jam'
|
7
|
+
|
8
|
+
module Appjam
|
9
|
+
module Generators
|
10
|
+
class Help < Jam
|
11
|
+
include CLIColorize
|
12
|
+
|
13
|
+
CLIColorize.default_color = :red
|
14
|
+
RENDER_OPTIONS = { :fields => [:category,:command,:description] }
|
15
|
+
|
16
|
+
# Add this generator to our appjam
|
17
|
+
Appjam::Generators.add_generator(:help, self)
|
18
|
+
|
19
|
+
# Define the source root
|
20
|
+
def self.source_root; File.expand_path(File.dirname(__FILE__)); end
|
21
|
+
def self.banner; "appjam help"; end
|
22
|
+
|
23
|
+
# Include related modules
|
24
|
+
include Thor::Actions
|
25
|
+
include Appjam::Generators::Actions
|
26
|
+
|
27
|
+
desc "Description:\n\n\tappjam help screen"
|
28
|
+
argument :name, :default => ""
|
29
|
+
|
30
|
+
def create_help
|
31
|
+
@developer = "eiffel"
|
32
|
+
@created_on = Date.today.to_s
|
33
|
+
puts colorize( "Appjam Version: #{Appjam::Version::STRING}", { :foreground => :red, :background => :white, :config => :underline } )
|
34
|
+
puts
|
35
|
+
puts "Appjam is an iOS code repository, including framework, snippet, generators, etc."
|
36
|
+
puts
|
37
|
+
require 'yaml'
|
38
|
+
gistfile = File.expand_path("~") + '/.appjam/gist.yml'
|
39
|
+
Gist::update_gist unless File.exist?(gistfile)
|
40
|
+
begin
|
41
|
+
g = YAML.load_file(gistfile)
|
42
|
+
rescue ArgumentError => e
|
43
|
+
g = YAML.load_file(File.expand_path(File.dirname(__FILE__) + '/gist.yml'))
|
44
|
+
end
|
45
|
+
puts "notice: a new version '#{g['info']}' released" if g['info'] and g['info'].strip != "#{Appjam::Version::STRING}"
|
46
|
+
puts
|
47
|
+
puts colorize("Generator Options")
|
48
|
+
opt = [{ :category => "puremvc", :command => "appjam mvc_project todo", :description => "generate puremvc iphone project"},
|
49
|
+
{ :category => "puremvc", :command => "appjam mvc_model user", :description => "generate puremvc iphone model"}
|
50
|
+
]
|
51
|
+
View.render(opt, RENDER_OPTIONS)
|
52
|
+
puts
|
53
|
+
g.each_pair {|key,value|
|
54
|
+
gitopt = []
|
55
|
+
gname = key.downcase.gsub('_',' ')
|
56
|
+
puts
|
57
|
+
if gname == 'lib'
|
58
|
+
puts colorize("Framework Lib")
|
59
|
+
else
|
60
|
+
puts colorize("Gist Category [#{gname}]")
|
61
|
+
end
|
62
|
+
unless gname == 'info'
|
63
|
+
g[key].each { |k|
|
64
|
+
k.each_pair { |k1,v1|
|
65
|
+
if gname == 'lib'
|
66
|
+
gitopt << {:category => "#{key.gsub('_',' ')}", :command => "appjam lib #{k1}", :description => "#{k[k1][2]['description']}" }
|
67
|
+
else
|
68
|
+
gitopt << {:category => "#{key.gsub('_',' ')}", :command => "appjam gist #{k1}", :description => "#{k[k1][2]['description']}" }
|
69
|
+
end
|
70
|
+
}
|
71
|
+
}
|
72
|
+
end
|
73
|
+
View.render(gitopt, RENDER_OPTIONS)
|
74
|
+
}
|
75
|
+
puts
|
76
|
+
end
|
77
|
+
|
78
|
+
end # Search
|
79
|
+
end # Generators
|
80
|
+
end # Appjam
|
81
|
+
|
@@ -153,6 +153,8 @@ module Appjam
|
|
153
153
|
rescue ArgumentError => e
|
154
154
|
g = YAML.load_file(File.expand_path(File.dirname(__FILE__) + '/gist.yml'))
|
155
155
|
end
|
156
|
+
puts "notice: a new version '#{g['info']}' released" if g['info'] and g['info'].strip != "#{Appjam::Version::STRING}"
|
157
|
+
puts
|
156
158
|
g.each_pair {|key,value|
|
157
159
|
gcategory = key.downcase
|
158
160
|
if gcategory == 'lib'
|
@@ -165,10 +167,7 @@ module Appjam
|
|
165
167
|
Lib::download_gist("#{gid}",gcategory,gname)
|
166
168
|
eval(File.read(__FILE__) =~ /^__END__/ && $' || '')
|
167
169
|
say "================================================================="
|
168
|
-
say "Check Frameworks/#{gname}/ for
|
169
|
-
say "Open #{@xcode_project_name.capitalize}.xcodeproj"
|
170
|
-
say "Add 'Frameworks/#{gname}/' folder to the 'Classes' Group"
|
171
|
-
say "Build and Run"
|
170
|
+
say "Check Frameworks/#{gname}/ for new framework [#{gname}]"
|
172
171
|
say "================================================================="
|
173
172
|
end
|
174
173
|
}
|
@@ -193,8 +192,6 @@ unless File.exist?("./.git")
|
|
193
192
|
system "git init"
|
194
193
|
template "lib/gitignore.tt", "./.gitignore"
|
195
194
|
template "lib/gitattributes.tt", "./.gitattributes"
|
196
|
-
system "git add ."
|
197
|
-
system "git commit -m 'init commit'"
|
198
195
|
end
|
199
196
|
|
200
197
|
|
@@ -6,7 +6,7 @@ require File.dirname(__FILE__) + '/jam'
|
|
6
6
|
|
7
7
|
module Appjam
|
8
8
|
module Generators
|
9
|
-
class
|
9
|
+
class MvcModel < Jam
|
10
10
|
include CLIColorize
|
11
11
|
|
12
12
|
CLIColorize.default_color = :red
|
@@ -16,7 +16,7 @@ module Appjam
|
|
16
16
|
version Appjam::Version::STRING
|
17
17
|
|
18
18
|
# Add this generator to our appjam
|
19
|
-
Appjam::Generators.add_generator(:
|
19
|
+
Appjam::Generators.add_generator(:mvc_model, self)
|
20
20
|
|
21
21
|
init_generator
|
22
22
|
|
@@ -6,7 +6,7 @@ require File.dirname(__FILE__) + '/jam'
|
|
6
6
|
|
7
7
|
module Appjam
|
8
8
|
module Generators
|
9
|
-
class
|
9
|
+
class MvcProject < Jam
|
10
10
|
include CLIColorize
|
11
11
|
|
12
12
|
CLIColorize.default_color = :red
|
@@ -16,7 +16,7 @@ module Appjam
|
|
16
16
|
version Appjam::Version::STRING
|
17
17
|
|
18
18
|
# Add this generator to our appjam
|
19
|
-
Appjam::Generators.add_generator(:
|
19
|
+
Appjam::Generators.add_generator(:mvc_project, self)
|
20
20
|
|
21
21
|
init_generator
|
22
22
|
|
@@ -28,9 +28,6 @@ module Appjam
|
|
28
28
|
|
29
29
|
argument :name, :desc => "The name of option"
|
30
30
|
|
31
|
-
class_option :root, :desc => "The root destination", :aliases => '-r', :default => ".", :type => :string
|
32
|
-
class_option :destroy, :aliases => '-d', :default => false, :type => :boolean
|
33
|
-
|
34
31
|
def in_app_root?
|
35
32
|
File.exist?('Classes')
|
36
33
|
end
|
@@ -44,8 +41,6 @@ module Appjam
|
|
44
41
|
self.destination_root = options[:root]
|
45
42
|
puts colorize( "Appjam Version: #{Appjam::Version::STRING}", { :foreground => :red, :background => :white, :config => :underline } )
|
46
43
|
puts
|
47
|
-
puts colorize("Available Options contains [#{@gist_name}]")
|
48
|
-
puts
|
49
44
|
require 'yaml'
|
50
45
|
# begin
|
51
46
|
# page_source = Net::HTTP.get(URI.parse("http://eiffelqiu.github.com/appjam/gist.yml"))
|
@@ -64,22 +59,28 @@ module Appjam
|
|
64
59
|
g = YAML.load_file(File.expand_path(File.dirname(__FILE__) + '/gist.yml'))
|
65
60
|
end
|
66
61
|
gitopt = []
|
62
|
+
puts "notice: a new version '#{g['info']}' released" if g['info'] and g['info'].strip != "#{Appjam::Version::STRING}"
|
63
|
+
puts
|
64
|
+
puts colorize("Available Options contains [#{@gist_name}]")
|
65
|
+
puts
|
67
66
|
g.each_pair {|key,value|
|
68
67
|
# puts colorize("Gist Category [#{key.gsub('_',' ')}]")
|
69
68
|
gname = key.gsub('_',' ')
|
70
69
|
g[key].each { |k|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
70
|
+
unless key.downcase == 'info'
|
71
|
+
k.each_pair { |k1,v1|
|
72
|
+
gist_name = k1.downcase
|
73
|
+
gist_desc = k[k1][2]['description'].downcase
|
74
|
+
if gist_name.include?(@gist_name) or gist_desc.include?(@gist_name)
|
75
|
+
# gitopt << {:category => "#{key.gsub('_',' ')}", :command => "appjam gist #{k1}", :description => "#{k[k1][2]['description']}" }
|
76
|
+
if gname == 'lib'
|
77
|
+
gitopt << {:category => "#{key.gsub('_',' ')}", :command => "appjam lib #{k1}", :description => "#{k[k1][2]['description']}" }
|
78
|
+
else
|
79
|
+
gitopt << {:category => "#{key.gsub('_',' ')}", :command => "appjam gist #{k1}", :description => "#{k[k1][2]['description']}" }
|
80
|
+
end
|
81
|
+
end
|
82
|
+
}
|
83
|
+
end
|
83
84
|
}
|
84
85
|
}
|
85
86
|
View.render(gitopt, RENDER_OPTIONS)
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module Appjam
|
2
|
+
|
3
|
+
module Utility
|
4
|
+
class XcodeUUIDGenerator
|
5
|
+
|
6
|
+
def initialize
|
7
|
+
@num = [Time.now.to_i, Process.pid, getMAC]
|
8
|
+
end
|
9
|
+
|
10
|
+
# Get the ethernet hardware address ("MAC"). This version
|
11
|
+
# works on Mac OS X 10.6 (Snow Leopard); it has not been tested
|
12
|
+
# on other versions.
|
13
|
+
|
14
|
+
def getMAC(interface='en0')
|
15
|
+
addrMAC = `ifconfig #{interface} ether`.split("\n")[1]
|
16
|
+
addrMAC ? addrMAC.strip.split[1].gsub(':','').to_i(16) : 0
|
17
|
+
end
|
18
|
+
|
19
|
+
def generate
|
20
|
+
@num[0] += 1
|
21
|
+
self
|
22
|
+
end
|
23
|
+
|
24
|
+
def to_s
|
25
|
+
"%08X%04X%012X" % @num
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
data/lib/appjam/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appjam
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 99
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
9
|
- 8
|
10
|
-
-
|
11
|
-
version: 0.1.8.
|
10
|
+
- 2
|
11
|
+
version: 0.1.8.2
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Eiffel Q
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
19
|
+
date: 2011-06-19 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
type: :runtime
|
@@ -79,14 +79,14 @@ dependencies:
|
|
79
79
|
requirement: &id005 !ruby/object:Gem::Requirement
|
80
80
|
none: false
|
81
81
|
requirements:
|
82
|
-
- -
|
82
|
+
- - ~>
|
83
83
|
- !ruby/object:Gem::Version
|
84
|
-
hash:
|
84
|
+
hash: 63
|
85
85
|
segments:
|
86
86
|
- 0
|
87
|
-
-
|
88
|
-
-
|
89
|
-
version: 0.
|
87
|
+
- 9
|
88
|
+
- 2
|
89
|
+
version: 0.9.2
|
90
90
|
version_requirements: *id005
|
91
91
|
name: rake
|
92
92
|
prerelease: false
|
@@ -405,7 +405,7 @@ dependencies:
|
|
405
405
|
version_requirements: *id026
|
406
406
|
name: rdoc
|
407
407
|
prerelease: false
|
408
|
-
description:
|
408
|
+
description: Appjam is iOS code repository, including framework, snippet, generators, etc.
|
409
409
|
email: eiffelqiu@gmail.com
|
410
410
|
executables:
|
411
411
|
- appjam
|
@@ -421,13 +421,14 @@ files:
|
|
421
421
|
- lib/appjam/generators/cli.rb
|
422
422
|
- lib/appjam/generators/gist.rb
|
423
423
|
- lib/appjam/generators/gist.yml
|
424
|
+
- lib/appjam/generators/help.rb
|
424
425
|
- lib/appjam/generators/jam.rb
|
425
426
|
- lib/appjam/generators/lib.rb
|
426
427
|
- lib/appjam/generators/lib/gitattributes.tt
|
427
428
|
- lib/appjam/generators/lib/gitignore.tt
|
428
429
|
- lib/appjam/generators/lib/gitmodules.tt
|
429
|
-
- lib/appjam/generators/
|
430
|
-
- lib/appjam/generators/
|
430
|
+
- lib/appjam/generators/mvc_model.rb
|
431
|
+
- lib/appjam/generators/mvc_project.rb
|
431
432
|
- lib/appjam/generators/project/Classes/ContactsAppDelegate.h.tt
|
432
433
|
- lib/appjam/generators/project/Classes/ContactsAppDelegate.m.tt
|
433
434
|
- lib/appjam/generators/project/Classes/contacts/ApplicationFacade.h.tt
|
@@ -505,6 +506,7 @@ files:
|
|
505
506
|
- lib/appjam/generators/search.rb
|
506
507
|
- lib/appjam/tasks.rb
|
507
508
|
- lib/appjam/tasks/plugin.rb
|
509
|
+
- lib/appjam/utility.rb
|
508
510
|
- lib/appjam/version.rb
|
509
511
|
- lib/appjam/view.rb
|
510
512
|
- LICENSE.txt
|
@@ -545,7 +547,7 @@ rubyforge_project:
|
|
545
547
|
rubygems_version: 1.7.2
|
546
548
|
signing_key:
|
547
549
|
specification_version: 3
|
548
|
-
summary: an
|
550
|
+
summary: Appjam is an iOS code repository, including framework, snippet, generators, etc.
|
549
551
|
test_files:
|
550
552
|
- test/helper.rb
|
551
553
|
- test/test_model_generator.rb
|