appjam 0.1.8.pre13 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
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/{project,model,submodule,gist,search}.rb']
60
+ Appjam::Generators.load_paths << Dir[File.dirname(__FILE__) + '/appjam/generators/{project,model,lib,gist,search}.rb']
61
61
 
62
62
 
@@ -44,39 +44,37 @@ module Appjam
44
44
  else
45
45
  puts colorize("Usage: appjam [OPTIONS] [ARGS]")
46
46
  puts
47
- puts colorize("Project Options")
47
+ puts colorize("Generator Options")
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
50
  ]
51
51
  View.render(opt, RENDER_OPTIONS)
52
- puts
53
- puts colorize("Submodule Options")
54
- puts
55
- opt = [
56
- { :category => "objective c (iphone)", :command => "appjam submodule three20", :description => "fetch three20 subproject from github.com"},
57
- { :category => "objective c (iphone)", :command => "appjam submodule asihttp", :description => "fetch asi-http-request subproject from github.com"},
58
- { :category => "objective c (iphone)", :command => "appjam submodule json", :description => "fetch json-framework subproject from github.com"},
59
- { :category => "objective c (iphone)", :command => "appjam submodule kissxml", :description => "fetch kissxml subproject from code.google.com"}]
60
- View.render(opt, RENDER_OPTIONS)
61
52
  puts
62
- puts colorize("Gist Options")
53
+ puts colorize("Appjam Options")
63
54
  require 'yaml'
64
- begin
65
- page_source = Net::HTTP.get(URI.parse("http://eiffelqiu.github.com/appjam/gist.yml"))
66
- rescue SocketError => e
67
- end
55
+ gistfile = File.expand_path("~") + '/.appjam/gist.yml'
56
+ Gist::update_gist unless File.exist?(gistfile)
68
57
  begin
69
- g = YAML::load(page_source)
58
+ g = YAML.load_file(gistfile)
70
59
  rescue ArgumentError => e
71
60
  g = YAML.load_file(File.expand_path(File.dirname(__FILE__) + '/gist.yml'))
72
61
  end
73
62
  g.each_pair {|key,value|
74
63
  gitopt = []
64
+ gname = key.gsub('_',' ')
75
65
  puts
76
- puts colorize("Gist Category [#{key.gsub('_',' ')}]")
66
+ if gname == 'lib'
67
+ puts colorize("Framework Lib")
68
+ else
69
+ puts colorize("Gist Category [#{gname}]")
70
+ end
77
71
  g[key].each { |k|
78
72
  k.each_pair { |k1,v1|
79
- gitopt << {:category => "#{key.gsub('_',' ')}", :command => "appjam gist #{k1}", :description => "#{k[k1][2]['description']}" }
73
+ if gname == 'lib'
74
+ gitopt << {:category => "#{key.gsub('_',' ')}", :command => "appjam lib #{k1}", :description => "#{k[k1][2]['description']}" }
75
+ else
76
+ gitopt << {:category => "#{key.gsub('_',' ')}", :command => "appjam gist #{k1}", :description => "#{k[k1][2]['description']}" }
77
+ end
80
78
  }
81
79
  }
82
80
  View.render(gitopt, RENDER_OPTIONS)
@@ -49,6 +49,21 @@ module Appjam
49
49
  end
50
50
  end
51
51
 
52
+ def update_gist
53
+ appjam_dir = '~/.appjam'
54
+ appjam_gist = File.expand_path("~") + '/.appjam/gist.yml'
55
+ system "mkdir -p #{appjam_dir}" unless File.exist?(appjam_dir)
56
+ begin
57
+ puts "fetching new gist list from server ... "
58
+ page_source = Net::HTTP.get(URI.parse("http://eiffelqiu.github.com/appjam/gist.yml"))
59
+ File.open(appjam_gist, 'w') {|f| f.write(page_source) }
60
+ rescue SocketError => e
61
+ puts "can not access github.com, back to local version gist.yml"
62
+ origin_gist = File.expand_path(File.dirname(__FILE__) + '/gist.yml')
63
+ system "cp #{origin_gist} #{appjam_gist}"
64
+ end
65
+ end
66
+
52
67
  def download_gists(username, page=1)
53
68
  puts "-- Downloading page #{page} of gists --"
54
69
  url = URI.parse("http://gist.github.com")
@@ -92,10 +107,6 @@ module Appjam
92
107
  end
93
108
  end
94
109
 
95
- gist_name "singleton"
96
- gist_id "https://gist.github.com/979981"
97
- gist_description "Singletons in Objective C"
98
-
99
110
  # Add this generator to our appjam
100
111
  Appjam::Generators.add_generator(:gist, self)
101
112
 
@@ -128,39 +139,47 @@ module Appjam
128
139
  @created_on = Date.today.to_s
129
140
  self.destination_root = options[:root]
130
141
 
131
- require 'yaml'
132
- begin
133
- page_source = Net::HTTP.get(URI.parse("http://eiffelqiu.github.com/appjam/gist.yml"))
134
- rescue SocketError => e
135
- puts "can not access github.com, back to local version gist.yml"
136
- end
137
- begin
138
- puts "fetching new gists ..."
139
- g = YAML::load(page_source)
140
- rescue ArgumentError => e
141
- puts "can't fetch new gists, loading local gists ..."
142
- g = YAML.load_file(File.expand_path(File.dirname(__FILE__) + '/gist.yml'))
143
- end
144
- g.each_pair {|key,value|
145
- gcategory = key.downcase
146
- g[key].each { |k|
147
- k.each_pair { |k1,v1|
148
- if "#{k1}" == @gist_name
149
- gid = k[k1][0]['id']
150
- gname = k[k1][1]['name']
151
- Gist::download_gist("#{gid}",gcategory,gname)
152
- eval(File.read(__FILE__) =~ /^__END__/ && $' || '')
153
- say "================================================================="
154
- say "Your '#{gname.capitalize}' snippet code has been generated."
155
- say "Check Gist/#{gcategory}/#{gname}/ for snippet"
156
- say "Open #{@xcode_project_name.capitalize}.xcodeproj"
157
- say "Add 'Gist/#{gcategory}/#{gname}/' folder to the 'Classes/apps' Group"
158
- say "Build and Run"
159
- say "================================================================="
160
- end
161
- }
142
+ unless @gist_name == 'update'
143
+ require 'yaml'
144
+ # begin
145
+ # page_source = Net::HTTP.get(URI.parse("http://eiffelqiu.github.com/appjam/gist.yml"))
146
+ # rescue SocketError => e
147
+ # puts "can not access github.com, back to local version gist.yml"
148
+ # end
149
+ gistfile = File.expand_path("~") + '/.appjam/gist.yml'
150
+ Gist::update_gist unless File.exist?(gistfile)
151
+ begin
152
+ puts "fetching new gists ..."
153
+ g = YAML.load_file(gistfile)
154
+ rescue ArgumentError => e
155
+ puts "can't fetch new gists, loading local gists ..."
156
+ g = YAML.load_file(File.expand_path(File.dirname(__FILE__) + '/gist.yml'))
157
+ end
158
+ g.each_pair {|key,value|
159
+ gcategory = key.downcase
160
+ unless gcategory == 'lib'
161
+ g[key].each { |k|
162
+ k.each_pair { |k1,v1|
163
+ if "#{k1}" == @gist_name
164
+ gid = k[k1][0]['id']
165
+ gname = k[k1][1]['name']
166
+ Gist::download_gist("#{gid}",gcategory,gname)
167
+ eval(File.read(__FILE__) =~ /^__END__/ && $' || '')
168
+ say "================================================================="
169
+ say "Your '#{gname.capitalize}' snippet code has been generated."
170
+ say "Check Gist/#{gcategory}/#{gname}/ for snippet"
171
+ say "Open #{@xcode_project_name.capitalize}.xcodeproj"
172
+ say "Add 'Gist/#{gcategory}/#{gname}/' folder to the 'Classes/apps' Group"
173
+ say "Build and Run"
174
+ say "================================================================="
175
+ end
176
+ }
177
+ }
178
+ end
162
179
  }
163
- }
180
+ else
181
+ Gist::update_gist
182
+ end
164
183
  else
165
184
  puts
166
185
  puts '-'*70
@@ -168,7 +187,7 @@ module Appjam
168
187
  puts '-'*70
169
188
  puts
170
189
  end
171
- end
190
+ end # create_gist
172
191
 
173
192
  end # Gist
174
193
  end # Generators
@@ -11,13 +11,63 @@ design_pattern:
11
11
  - injection:
12
12
  - id : 986087
13
13
  - name : Injection
14
- - description : Ruby's injection method for Objective C
14
+ - description : Ruby's injection method for Objective C
15
15
 
16
16
  algorithm:
17
17
  - binary_search:
18
18
  - id : 988219
19
19
  - name : Binary_Search
20
20
  - description : A binary search algorithm written Objective C
21
+
22
+ lib:
23
+ - three20:
24
+ - id : git://github.com/facebook/three20.git
25
+ - name : Three20
26
+ - description : three20 frameworks
27
+ - asi:
28
+ - id : git://github.com/pokeb/asi-http-request.git
29
+ - name : AsiHttpRequest
30
+ - description : asi http request frameworks
31
+ - json:
32
+ - id : git://github.com/stig/json-framework
33
+ - name : JsonFramework
34
+ - description : json framework
35
+ - facebook:
36
+ - id : git://github.com/facebook/facebook-ios-sdk.git
37
+ - name : FacebookIOSSdk
38
+ - description : facebook-ios-sdk framework
39
+ - yajl:
40
+ - id : git://github.com/gabriel/yajl-objc.git
41
+ - name : YAJLFramework
42
+ - description : YAJL Framework
43
+ - oauth:
44
+ - id : git://github.com/jdg/oauthconsumer.git
45
+ - name : OauthConsumer
46
+ - description : oauth consumer
47
+ - fmdb:
48
+ - id : git://github.com/ccgus/fmdb.git
49
+ - name : fmdb
50
+ - description : A Cocoa / Objective-C wrapper around
51
+ - touchxml:
52
+ - id : git://github.com/TouchCode/TouchXML.git
53
+ - name : TouchXML
54
+ - description : TouchXML Framework
55
+ - touchjson:
56
+ - id : git://github.com/TouchCode/TouchJSON.git
57
+ - name : TouchJSON
58
+ - description : TouchJSON Framework
59
+ - kissxml:
60
+ - id : https://kissxml.googlecode.com/hg/
61
+ - name : KissXML
62
+ - description : KissXML Framework
63
+ - cocos2d:
64
+ - id : git://github.com/cocos2d/cocos2d-iphone.git
65
+ - name : Cocos2dIphone
66
+ - description : Cocos2d iPhone Framework
67
+ - sparrow:
68
+ - id : git://github.com/PrimaryFeather/Sparrow-Framework.git
69
+ - name : SparrowFramework
70
+ - description : Sparrow Framework for iPhone
21
71
 
22
72
  utiliy_function:
23
73
  - get_ip_address:
@@ -74,9 +124,9 @@ snippet:
74
124
  - id : 990090
75
125
  - name : Get_Random_Number_In_A_Range
76
126
  - description : Get random number in Objective C
77
- - mailComposeViewController_usage:
127
+ - mail_usage:
78
128
  - id : 990122
79
- - name : MFMailComposeViewController_Usage
129
+ - name : mail_usage
80
130
  - description : MFMailComposeViewController with availability check
81
131
  - nsstring_md5:
82
132
  - id : 990141
@@ -0,0 +1,193 @@
1
+ require 'rubygems'
2
+ require 'fileutils'
3
+ require 'net/http'
4
+ require 'net/https'
5
+ require 'uri'
6
+ require "open-uri"
7
+ require 'tempfile'
8
+ require File.dirname(__FILE__) + '/jam'
9
+ require File.dirname(__FILE__) + '/gist'
10
+
11
+ module Appjam
12
+ module Generators
13
+ class Lib < Jam
14
+
15
+ class << self
16
+ def self.attr_rw(*attrs)
17
+ attrs.each do |attr|
18
+ class_eval %Q{
19
+ def #{attr}(val=nil)
20
+ val.nil? ? @#{attr} : @#{attr} = val
21
+ end
22
+ }
23
+ end
24
+ end
25
+ attr_rw :gist_name, :gist_description, :gist_id, :gist_body
26
+ def preview_gist(gid)
27
+ uri = URI("https://gist.github.com/#{gid}.txt")
28
+ http = Net::HTTP.new(uri.host, uri.port)
29
+ if uri.scheme == 'https'
30
+ http.use_ssl = true
31
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
32
+ end
33
+
34
+ result = http.start {|h| h.request(Net::HTTP::Get.new(uri.path))}
35
+ tempfile = Tempfile.new('gist')
36
+ tempfile.puts(result)
37
+ tempfile.close
38
+
39
+ if system('which qlmanage')
40
+ system("qlmanage -p #{tempfile.path} >& /dev/null")
41
+ end
42
+ end
43
+
44
+ def download_gists(username, page=1)
45
+ puts "-- Downloading page #{page} of gists --"
46
+ url = URI.parse("http://gist.github.com")
47
+ res = Net::HTTP.start(url.host, url.port) do |http|
48
+ response = http.get("/#{username}?page=#{page}")
49
+ if response.code == '200'
50
+ links = get_links(response.body)
51
+ links.each do |link, gist_id|
52
+ puts "git://gist.github.com/#{gist_id}.git"
53
+ if File.directory?("Gist/#{gist_id}")
54
+ `cd Gist/#{gist_id} && git pull ; cd ..`
55
+ else
56
+ `git clone git://gist.github.com/#{gist_id}.git Gist/#{gist_id}`
57
+ end
58
+ end
59
+ download_gists(username, page+1) unless links.empty?
60
+ end
61
+ end
62
+ end
63
+
64
+ def download_gist(gist_id,git_category,gist_name)
65
+ puts "-- fetching [#{gist_name}] lib --"
66
+ # require 'uri'
67
+ # require 'yajl/http_stream'
68
+ #
69
+ # uri = URI.parse("http://gist.github.com/api/v1/json/#{gist_id}")
70
+ # Yajl::HttpStream.get(uri, :symbolize_keys => true) do |hash|
71
+ #
72
+ # end
73
+ # if @submodule_name == 'kissxml'
74
+ # eval(File.read(__FILE__) =~ /^__END__\n/ && $' || '')
75
+ #
76
+ # system "rm -rf kissxml"
77
+ # system "hg clone https://kissxml.googlecode.com/hg/ Frameworks/kissxml"
78
+ # system "git add ."
79
+ # system "git commit -m 'import kissxml submodule'"
80
+ # say (<<-TEXT).gsub(/ {10}/,'')
81
+ if gist_id.include?('github.com')
82
+ if File.directory?("Frameworks/#{gist_name.downcase}")
83
+ `rm -rf Frameworks/#{gist_name.downcase}`
84
+ end
85
+ if("#{gist_id}".is_numeric?)
86
+ `git clone git://gist.github.com/#{gist_id}.git Frameworks/#{gist_name.downcase} && rm -rf Frameworks/#{gist_name.downcase}/.git`
87
+ else
88
+ `git clone #{gist_id} Frameworks/#{gist_name.downcase} && rm -rf Frameworks/#{gist_name.downcase}/.git`
89
+ end
90
+ else
91
+ if system('which hg') != nil
92
+ system "rm -rf Frameworks/#{gist_name.downcase}"
93
+ system "hg clone https://kissxml.googlecode.com/hg/ Frameworks/#{gist_name.downcase}"
94
+ system "git add ."
95
+ system "git commit -m 'import #{gist_name.downcase} submodule'"
96
+ else
97
+ say "="*70
98
+ say "Mercurial was not installed!! check http://mercurial.selenic.com/ for installation."
99
+ say "="*70
100
+ end
101
+ end
102
+ end
103
+ end
104
+
105
+ # Add this generator to our appjam
106
+ Appjam::Generators.add_generator(:lib, self)
107
+
108
+ # Define the source lib root
109
+ def self.source_root; File.expand_path(File.dirname(__FILE__)); end
110
+ def self.banner; "appjam lib [name]"; end
111
+
112
+ # Include related modules
113
+ include Thor::Actions
114
+ include Appjam::Generators::Actions
115
+
116
+ desc "Description:\n\n\tappjam will generates an new PureMvc Model for iphone"
117
+
118
+ argument :name, :desc => "The name of your lib"
119
+
120
+ class_option :root, :desc => "The root destination", :aliases => '-r', :default => ".", :type => :string
121
+ class_option :destroy, :aliases => '-d', :default => false, :type => :boolean
122
+
123
+ def in_app_root?
124
+ File.exist?('Classes')
125
+ end
126
+
127
+ def create_lib
128
+ if in_app_root?
129
+ valid_constant?(options[:lib] || name)
130
+ @lib_name = (options[:app] || name).gsub(/W/, "_").downcase
131
+ @xcode_project_name = File.basename(Dir.glob('*.xcodeproj')[0],'.xcodeproj').downcase
132
+ @class_name = (options[:app] || name).gsub(/W/, "_").capitalize
133
+ @developer = "eiffel"
134
+ @created_on = Date.today.to_s
135
+ self.destination_root = options[:root]
136
+
137
+ require 'yaml'
138
+ # begin
139
+ # page_source = Net::HTTP.get(URI.parse("http://eiffelqiu.github.com/appjam/gist.yml"))
140
+ # rescue SocketError => e
141
+ # end
142
+ gistfile = File.expand_path("~") + '/.appjam/gist.yml'
143
+ Gist::update_gist unless File.exist?(gistfile)
144
+ begin
145
+ g = YAML.load_file(gistfile)
146
+ rescue ArgumentError => e
147
+ g = YAML.load_file(File.expand_path(File.dirname(__FILE__) + '/gist.yml'))
148
+ end
149
+ g.each_pair {|key,value|
150
+ gcategory = key.downcase
151
+ if gcategory == 'lib'
152
+ g[key].each { |k|
153
+ k.each_pair { |k1,v1|
154
+ if "#{k1}" == @lib_name
155
+ gid = k[k1][0]['id']
156
+ gname = k[k1][1]['name']
157
+ eval(File.read(__FILE__) =~ /^__END__\n/ && $' || '')
158
+ Lib::download_gist("#{gid}",gcategory,gname)
159
+ eval(File.read(__FILE__) =~ /^__END__/ && $' || '')
160
+ say "================================================================="
161
+ say "Check Frameworks/#{gcategory}/#{gname}/ for lib"
162
+ say "Open #{@xcode_project_name.capitalize}.xcodeproj"
163
+ say "Add 'Frameworks/#{gcategory}/#{gname}/' folder to the 'Classes' Group"
164
+ say "Build and Run"
165
+ say "================================================================="
166
+ end
167
+ }
168
+ }
169
+ end
170
+ }
171
+ else
172
+ puts
173
+ puts '-'*70
174
+ puts "You are not in an iphone project folder"
175
+ puts '-'*70
176
+ puts
177
+ end
178
+ end
179
+
180
+ end # Submodule
181
+ end # Generators
182
+ end # Appjam
183
+
184
+ __END__
185
+ unless File.exist?("./.git")
186
+ system "git init"
187
+ template "lib/gitignore.tt", "./.gitignore"
188
+ template "lib/gitattributes.tt", "./.gitattributes"
189
+ system "git add ."
190
+ system "git commit -m 'init commit'"
191
+ end
192
+
193
+
@@ -2,7 +2,7 @@
2
2
  .DS_Store
3
3
  profile
4
4
  xcuserdata
5
- Gist
5
+ Gist/*
6
6
 
7
7
  # Textmate - if you build your xcode projects with it
8
8
  *.tm_build_errors
@@ -72,6 +72,8 @@ empty_directory "#{@project_name}/Classes/utils"
72
72
 
73
73
  empty_directory "#{@project_name}/Gist"
74
74
 
75
+ empty_directory "#{@project_name}/Frameworks"
76
+
75
77
  copy_file "project/utils/NSStringWhiteSpace.h", "#{@project_name}/Classes/utils/NSStringWhiteSpace.h"
76
78
  copy_file "project/utils/NSStringWhiteSpace.m", "#{@project_name}/Classes/utils/NSStringWhiteSpace.m"
77
79
  copy_file "project/utils/UIDevice.h", "#{@project_name}/Classes/utils/UIDevice.h"
@@ -46,24 +46,37 @@ module Appjam
46
46
  puts colorize("Available Options contains [#{@gist_name}]")
47
47
  puts
48
48
  require 'yaml'
49
- begin
50
- page_source = Net::HTTP.get(URI.parse("http://eiffelqiu.github.com/appjam/gist.yml"))
51
- rescue SocketError => e
52
- end
49
+ # begin
50
+ # page_source = Net::HTTP.get(URI.parse("http://eiffelqiu.github.com/appjam/gist.yml"))
51
+ # rescue SocketError => e
52
+ # end
53
+ # begin
54
+ # g = YAML::load(page_source)
55
+ # rescue ArgumentError => e
56
+ # g = YAML.load_file(File.expand_path(File.dirname(__FILE__) + '/gist.yml'))
57
+ # end
58
+ gistfile = File.expand_path("~") + '/.appjam/gist.yml'
59
+ Gist::update_gist unless File.exist?(gistfile)
53
60
  begin
54
- g = YAML::load(page_source)
61
+ g = YAML.load_file(gistfile)
55
62
  rescue ArgumentError => e
56
63
  g = YAML.load_file(File.expand_path(File.dirname(__FILE__) + '/gist.yml'))
57
- end
64
+ end
58
65
  gitopt = []
59
66
  g.each_pair {|key,value|
60
- # puts colorize("Gist Category [#{key.gsub('_',' ')}]")
67
+ # puts colorize("Gist Category [#{key.gsub('_',' ')}]")
68
+ gname = key.gsub('_',' ')
61
69
  g[key].each { |k|
62
70
  k.each_pair { |k1,v1|
63
71
  gist_name = k1.downcase
64
72
  gist_desc = k[k1][2]['description'].downcase
65
73
  if gist_name.include?(@gist_name) or gist_desc.include?(@gist_name)
66
- gitopt << {:category => "#{key.gsub('_',' ')}", :command => "appjam gist #{k1}", :description => "#{k[k1][2]['description']}" }
74
+ # gitopt << {:category => "#{key.gsub('_',' ')}", :command => "appjam gist #{k1}", :description => "#{k[k1][2]['description']}" }
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
67
80
  end
68
81
  }
69
82
  }
@@ -3,7 +3,7 @@ module Appjam
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
5
  PATCH = 8
6
- BUILD = 'pre13'
6
+ BUILD = ''
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.').chomp('.')
9
9
  end
metadata CHANGED
@@ -1,15 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appjam
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1923832035
5
- prerelease: 6
4
+ hash: 11
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
9
  - 8
10
- - pre
11
- - 13
12
- version: 0.1.8.pre13
10
+ version: 0.1.8
13
11
  platform: ruby
14
12
  authors:
15
13
  - Eiffel Q
@@ -17,8 +15,7 @@ autorequire:
17
15
  bindir: bin
18
16
  cert_chain: []
19
17
 
20
- date: 2011-05-27 00:00:00 +08:00
21
- default_executable: appjam
18
+ date: 2011-05-29 00:00:00 Z
22
19
  dependencies:
23
20
  - !ruby/object:Gem::Dependency
24
21
  type: :runtime
@@ -31,8 +28,8 @@ dependencies:
31
28
  segments:
32
29
  - 0
33
30
  version: "0"
34
- name: thor
35
31
  version_requirements: *id001
32
+ name: thor
36
33
  prerelease: false
37
34
  - !ruby/object:Gem::Dependency
38
35
  type: :runtime
@@ -45,8 +42,8 @@ dependencies:
45
42
  segments:
46
43
  - 0
47
44
  version: "0"
48
- name: activesupport
49
45
  version_requirements: *id002
46
+ name: activesupport
50
47
  prerelease: false
51
48
  - !ruby/object:Gem::Dependency
52
49
  type: :runtime
@@ -59,8 +56,8 @@ dependencies:
59
56
  segments:
60
57
  - 0
61
58
  version: "0"
62
- name: cli-colorize
63
59
  version_requirements: *id003
60
+ name: cli-colorize
64
61
  prerelease: false
65
62
  - !ruby/object:Gem::Dependency
66
63
  type: :runtime
@@ -73,26 +70,12 @@ dependencies:
73
70
  segments:
74
71
  - 0
75
72
  version: "0"
76
- name: hirb
77
73
  version_requirements: *id004
78
- prerelease: false
79
- - !ruby/object:Gem::Dependency
80
- type: :runtime
81
- requirement: &id005 !ruby/object:Gem::Requirement
82
- none: false
83
- requirements:
84
- - - ">="
85
- - !ruby/object:Gem::Version
86
- hash: 3
87
- segments:
88
- - 0
89
- version: "0"
90
- name: yajl-ruby
91
- version_requirements: *id005
74
+ name: hirb
92
75
  prerelease: false
93
76
  - !ruby/object:Gem::Dependency
94
77
  type: :development
95
- requirement: &id006 !ruby/object:Gem::Requirement
78
+ requirement: &id005 !ruby/object:Gem::Requirement
96
79
  none: false
97
80
  requirements:
98
81
  - - ">="
@@ -103,12 +86,12 @@ dependencies:
103
86
  - 8
104
87
  - 7
105
88
  version: 0.8.7
89
+ version_requirements: *id005
106
90
  name: rake
107
- version_requirements: *id006
108
91
  prerelease: false
109
92
  - !ruby/object:Gem::Dependency
110
93
  type: :development
111
- requirement: &id007 !ruby/object:Gem::Requirement
94
+ requirement: &id006 !ruby/object:Gem::Requirement
112
95
  none: false
113
96
  requirements:
114
97
  - - ">="
@@ -119,12 +102,12 @@ dependencies:
119
102
  - 9
120
103
  - 8
121
104
  version: 0.9.8
105
+ version_requirements: *id006
122
106
  name: mocha
123
- version_requirements: *id007
124
107
  prerelease: false
125
108
  - !ruby/object:Gem::Dependency
126
109
  type: :development
127
- requirement: &id008 !ruby/object:Gem::Requirement
110
+ requirement: &id007 !ruby/object:Gem::Requirement
128
111
  none: false
129
112
  requirements:
130
113
  - - ">="
@@ -135,12 +118,12 @@ dependencies:
135
118
  - 5
136
119
  - 0
137
120
  version: 0.5.0
121
+ version_requirements: *id007
138
122
  name: rack-test
139
- version_requirements: *id008
140
123
  prerelease: false
141
124
  - !ruby/object:Gem::Dependency
142
125
  type: :development
143
- requirement: &id009 !ruby/object:Gem::Requirement
126
+ requirement: &id008 !ruby/object:Gem::Requirement
144
127
  none: false
145
128
  requirements:
146
129
  - - ">="
@@ -151,12 +134,12 @@ dependencies:
151
134
  - 2
152
135
  - 8
153
136
  version: 1.2.8
137
+ version_requirements: *id008
154
138
  name: fakeweb
155
- version_requirements: *id009
156
139
  prerelease: false
157
140
  - !ruby/object:Gem::Dependency
158
141
  type: :development
159
- requirement: &id010 !ruby/object:Gem::Requirement
142
+ requirement: &id009 !ruby/object:Gem::Requirement
160
143
  none: false
161
144
  requirements:
162
145
  - - "="
@@ -167,12 +150,12 @@ dependencies:
167
150
  - 5
168
151
  - 1
169
152
  version: 0.5.1
153
+ version_requirements: *id009
170
154
  name: webrat
171
- version_requirements: *id010
172
155
  prerelease: false
173
156
  - !ruby/object:Gem::Dependency
174
157
  type: :development
175
- requirement: &id011 !ruby/object:Gem::Requirement
158
+ requirement: &id010 !ruby/object:Gem::Requirement
176
159
  none: false
177
160
  requirements:
178
161
  - - ">="
@@ -183,12 +166,12 @@ dependencies:
183
166
  - 10
184
167
  - 3
185
168
  version: 2.10.3
169
+ version_requirements: *id010
186
170
  name: shoulda
187
- version_requirements: *id011
188
171
  prerelease: false
189
172
  - !ruby/object:Gem::Dependency
190
173
  type: :development
191
- requirement: &id012 !ruby/object:Gem::Requirement
174
+ requirement: &id011 !ruby/object:Gem::Requirement
192
175
  none: false
193
176
  requirements:
194
177
  - - ">="
@@ -199,12 +182,12 @@ dependencies:
199
182
  - 3
200
183
  - 1
201
184
  version: 2.3.1
185
+ version_requirements: *id011
202
186
  name: uuid
203
- version_requirements: *id012
204
187
  prerelease: false
205
188
  - !ruby/object:Gem::Dependency
206
189
  type: :development
207
- requirement: &id013 !ruby/object:Gem::Requirement
190
+ requirement: &id012 !ruby/object:Gem::Requirement
208
191
  none: false
209
192
  requirements:
210
193
  - - ">="
@@ -215,12 +198,12 @@ dependencies:
215
198
  - 1
216
199
  - 2
217
200
  version: 2.1.2
201
+ version_requirements: *id012
218
202
  name: builder
219
- version_requirements: *id013
220
203
  prerelease: false
221
204
  - !ruby/object:Gem::Dependency
222
205
  type: :development
223
- requirement: &id014 !ruby/object:Gem::Requirement
206
+ requirement: &id013 !ruby/object:Gem::Requirement
224
207
  none: false
225
208
  requirements:
226
209
  - - ~>
@@ -231,12 +214,12 @@ dependencies:
231
214
  - 5
232
215
  - 2
233
216
  version: 1.5.2
217
+ version_requirements: *id013
234
218
  name: jeweler
235
- version_requirements: *id014
236
219
  prerelease: false
237
220
  - !ruby/object:Gem::Dependency
238
221
  type: :development
239
- requirement: &id015 !ruby/object:Gem::Requirement
222
+ requirement: &id014 !ruby/object:Gem::Requirement
240
223
  none: false
241
224
  requirements:
242
225
  - - ~>
@@ -247,8 +230,22 @@ dependencies:
247
230
  - 9
248
231
  - 8
249
232
  version: 0.9.8
233
+ version_requirements: *id014
250
234
  name: rcov
235
+ prerelease: false
236
+ - !ruby/object:Gem::Dependency
237
+ type: :development
238
+ requirement: &id015 !ruby/object:Gem::Requirement
239
+ none: false
240
+ requirements:
241
+ - - ">="
242
+ - !ruby/object:Gem::Version
243
+ hash: 3
244
+ segments:
245
+ - 0
246
+ version: "0"
251
247
  version_requirements: *id015
248
+ name: grit
252
249
  prerelease: false
253
250
  - !ruby/object:Gem::Dependency
254
251
  type: :development
@@ -261,8 +258,8 @@ dependencies:
261
258
  segments:
262
259
  - 0
263
260
  version: "0"
264
- name: grit
265
261
  version_requirements: *id016
262
+ name: i18n
266
263
  prerelease: false
267
264
  - !ruby/object:Gem::Dependency
268
265
  type: :development
@@ -275,8 +272,8 @@ dependencies:
275
272
  segments:
276
273
  - 0
277
274
  version: "0"
278
- name: i18n
279
275
  version_requirements: *id017
276
+ name: rdoc
280
277
  prerelease: false
281
278
  - !ruby/object:Gem::Dependency
282
279
  type: :development
@@ -289,8 +286,8 @@ dependencies:
289
286
  segments:
290
287
  - 0
291
288
  version: "0"
292
- name: rdoc
293
289
  version_requirements: *id018
290
+ name: yajl-ruby
294
291
  prerelease: false
295
292
  - !ruby/object:Gem::Dependency
296
293
  type: :development
@@ -305,8 +302,8 @@ dependencies:
305
302
  - 9
306
303
  - 1
307
304
  version: 0.9.1
308
- name: ruby-prof
309
305
  version_requirements: *id019
306
+ name: ruby-prof
310
307
  prerelease: false
311
308
  - !ruby/object:Gem::Dependency
312
309
  type: :development
@@ -320,8 +317,8 @@ dependencies:
320
317
  - 1
321
318
  - 0
322
319
  version: "1.0"
323
- name: system_timer
324
320
  version_requirements: *id020
321
+ name: system_timer
325
322
  prerelease: false
326
323
  - !ruby/object:Gem::Dependency
327
324
  type: :runtime
@@ -334,8 +331,8 @@ dependencies:
334
331
  segments:
335
332
  - 0
336
333
  version: "0"
337
- name: activesupport
338
334
  version_requirements: *id021
335
+ name: activesupport
339
336
  prerelease: false
340
337
  - !ruby/object:Gem::Dependency
341
338
  type: :runtime
@@ -348,8 +345,8 @@ dependencies:
348
345
  segments:
349
346
  - 0
350
347
  version: "0"
351
- name: grit
352
348
  version_requirements: *id022
349
+ name: grit
353
350
  prerelease: false
354
351
  - !ruby/object:Gem::Dependency
355
352
  type: :runtime
@@ -362,8 +359,8 @@ dependencies:
362
359
  segments:
363
360
  - 0
364
361
  version: "0"
365
- name: i18n
366
362
  version_requirements: *id023
363
+ name: i18n
367
364
  prerelease: false
368
365
  - !ruby/object:Gem::Dependency
369
366
  type: :runtime
@@ -376,8 +373,8 @@ dependencies:
376
373
  segments:
377
374
  - 0
378
375
  version: "0"
379
- name: hirb
380
376
  version_requirements: *id024
377
+ name: hirb
381
378
  prerelease: false
382
379
  - !ruby/object:Gem::Dependency
383
380
  type: :runtime
@@ -390,8 +387,8 @@ dependencies:
390
387
  segments:
391
388
  - 0
392
389
  version: "0"
393
- name: cli-colorize
394
390
  version_requirements: *id025
391
+ name: cli-colorize
395
392
  prerelease: false
396
393
  - !ruby/object:Gem::Dependency
397
394
  type: :runtime
@@ -404,22 +401,8 @@ dependencies:
404
401
  segments:
405
402
  - 0
406
403
  version: "0"
407
- name: rdoc
408
404
  version_requirements: *id026
409
- prerelease: false
410
- - !ruby/object:Gem::Dependency
411
- type: :runtime
412
- requirement: &id027 !ruby/object:Gem::Requirement
413
- none: false
414
- requirements:
415
- - - ">="
416
- - !ruby/object:Gem::Version
417
- hash: 3
418
- segments:
419
- - 0
420
- version: "0"
421
- name: yajl-ruby
422
- version_requirements: *id027
405
+ name: rdoc
423
406
  prerelease: false
424
407
  description: generate iphone app skeleton based on pure mvc framework
425
408
  email: eiffelqiu@gmail.com
@@ -438,6 +421,10 @@ files:
438
421
  - lib/appjam/generators/gist.rb
439
422
  - lib/appjam/generators/gist.yml
440
423
  - lib/appjam/generators/jam.rb
424
+ - lib/appjam/generators/lib.rb
425
+ - lib/appjam/generators/lib/gitattributes.tt
426
+ - lib/appjam/generators/lib/gitignore.tt
427
+ - lib/appjam/generators/lib/gitmodules.tt
441
428
  - lib/appjam/generators/model.rb
442
429
  - lib/appjam/generators/project.rb
443
430
  - lib/appjam/generators/project/Classes/ContactsAppDelegate.h.tt
@@ -515,10 +502,6 @@ files:
515
502
  - lib/appjam/generators/project/utils/URLEncodeString.h
516
503
  - lib/appjam/generators/project/utils/URLEncodeString.m
517
504
  - lib/appjam/generators/search.rb
518
- - lib/appjam/generators/submodule.rb
519
- - lib/appjam/generators/submodule/gitattributes.tt
520
- - lib/appjam/generators/submodule/gitignore.tt
521
- - lib/appjam/generators/submodule/gitmodules.tt
522
505
  - lib/appjam/tasks.rb
523
506
  - lib/appjam/tasks/plugin.rb
524
507
  - lib/appjam/version.rb
@@ -529,7 +512,6 @@ files:
529
512
  - test/test_model_generator.rb
530
513
  - test/test_project_generator.rb
531
514
  - bin/appjam
532
- has_rdoc: true
533
515
  homepage: http://github.com/eiffelqiu/appjam
534
516
  licenses:
535
517
  - MIT
@@ -550,18 +532,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
550
532
  required_rubygems_version: !ruby/object:Gem::Requirement
551
533
  none: false
552
534
  requirements:
553
- - - ">"
535
+ - - ">="
554
536
  - !ruby/object:Gem::Version
555
- hash: 25
537
+ hash: 3
556
538
  segments:
557
- - 1
558
- - 3
559
- - 1
560
- version: 1.3.1
539
+ - 0
540
+ version: "0"
561
541
  requirements: []
562
542
 
563
543
  rubyforge_project:
564
- rubygems_version: 1.5.3
544
+ rubygems_version: 1.7.2
565
545
  signing_key:
566
546
  specification_version: 3
567
547
  summary: an iphone app generator
@@ -1,168 +0,0 @@
1
- require File.dirname(__FILE__) + '/jam'
2
-
3
- module Appjam
4
- module Generators
5
- class Submodule < Jam
6
-
7
- # Add this generator to our appjam
8
- Appjam::Generators.add_generator(:submodule, self)
9
-
10
- # Define the source submodule root
11
- def self.source_root; File.expand_path(File.dirname(__FILE__)); end
12
- def self.banner; "appjam submodule [name]"; end
13
-
14
- # Include related modules
15
- include Thor::Actions
16
- include Appjam::Generators::Actions
17
-
18
- desc "Description:\n\n\tappjam will generates an new PureMvc Model for iphone"
19
-
20
- argument :name, :desc => "The name of your puremvc submodule"
21
-
22
- class_option :root, :desc => "The root destination", :aliases => '-r', :default => ".", :type => :string
23
- class_option :destroy, :aliases => '-d', :default => false, :type => :boolean
24
-
25
- def in_app_root?
26
- File.exist?('Classes')
27
- end
28
-
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
-
77
- if which('git') != nil
78
- if in_app_root?
79
- if @submodule_name == 'three20'
80
-
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
-
88
- say (<<-TEXT).gsub(/ {10}/,'')
89
-
90
- =================================================================
91
- Three20 submodule has been imported
92
-
93
- Open #{@xcode_project_name.capitalize}.xcodeproj
94
- Add "three20/src/Three20/Three20.xcodeproj" folder to the "Other Sources" Group
95
- Add "three20/src/Three20.bundle" folder to the "Other Sources" Group
96
- Build and Run
97
- =================================================================
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
134
- else
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
140
- end
141
- else
142
- puts
143
- puts '-'*70
144
- puts "You are not in an iphone project folder"
145
- puts '-'*70
146
- puts
147
- end
148
- else
149
- say "="*70
150
- say "Git was not installed!! check http://git-scm.com/ for installation."
151
- say "="*70
152
- end
153
- end
154
-
155
- end # Submodule
156
- end # Generators
157
- end # Appjam
158
-
159
- __END__
160
- unless File.exist?("./.git")
161
- system "git init"
162
- template "submodule/gitignore.tt", "./.gitignore"
163
- template "submodule/gitattributes.tt", "./.gitattributes"
164
- system "git add ."
165
- system "git commit -m 'init commit'"
166
- end
167
-
168
-