ti 0.0.6 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/.gitignore +43 -0
  2. data/Gemfile +2 -19
  3. data/Gemfile.lock +27 -27
  4. data/LICENSE.txt +1 -1
  5. data/README.rdoc +1 -1
  6. data/Rakefile +0 -28
  7. data/TODO.mkd +1 -2
  8. data/lib/ti.rb +10 -10
  9. data/lib/ti/cli.rb +39 -6
  10. data/lib/ti/config.rb +22 -0
  11. data/lib/ti/generate/controller.rb +38 -0
  12. data/lib/ti/generate/model.rb +13 -7
  13. data/lib/ti/generate/project.rb +59 -13
  14. data/lib/ti/generate/view.rb +30 -9
  15. data/lib/ti/templates/app/controllers/controller.erb +0 -0
  16. data/lib/ti/templates/app/controllers/window.erb +3 -0
  17. data/lib/ti/templates/app/views/tabgroup.erb +0 -0
  18. data/lib/ti/templates/app/views/view.erb +0 -0
  19. data/lib/ti/templates/app/views/window.erb +3 -0
  20. data/lib/ti/templates/{guardfile → defaults/Guardfile.erb} +3 -3
  21. data/lib/ti/templates/defaults/Rakefile.erb +148 -0
  22. data/lib/ti/templates/defaults/Readme.mkd.erb +1 -0
  23. data/lib/ti/templates/{config → defaults/config.erb} +1 -1
  24. data/lib/ti/templates/gitignore +1 -1
  25. data/lib/ti/templates/specs/app_spec.coffee +2 -2
  26. data/lib/ti/utils.rb +70 -41
  27. data/lib/ti/version.rb +3 -0
  28. data/spec/cli/command_spec.rb +7 -11
  29. data/spec/fixtures/configs/tiapp.xml +34 -0
  30. data/spec/lib/config_spec.rb +34 -0
  31. data/spec/spec_helper.rb +8 -0
  32. data/spec/ti/generators/model_spec.rb +25 -0
  33. data/spec/ti/generators/project_spec.rb +121 -0
  34. data/spec/ti/generators/view_spec.rb +25 -0
  35. data/spec/ti/logger_spec.rb +25 -0
  36. data/spec/ti/utils_spec.rb +120 -0
  37. data/ti.gemspec +32 -103
  38. metadata +75 -47
  39. data/VERSION +0 -1
  40. data/lib/ti/options.rb +0 -64
  41. data/lib/ti/parse_options.rb +0 -48
  42. data/lib/ti/templates/readme +0 -1
data/ti.gemspec CHANGED
@@ -1,110 +1,39 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
1
  # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "ti/version"
5
4
 
6
5
  Gem::Specification.new do |s|
7
- s.name = %q{ti}
8
- s.version = "0.0.6"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Robert R Evans", "Julius Francisco", "Wynn Netherland", "Rupak Ganguly"]
12
- s.date = %q{2011-05-03}
13
- s.description = %q{Titanium Project Generator}
14
- s.email = %q{robert@codewranglers.org}
15
- s.executables = ["ti"]
16
- s.extra_rdoc_files = [
17
- "LICENSE.txt",
18
- "README.rdoc"
19
- ]
20
- s.files = [
21
- ".document",
22
- ".rvmrc",
23
- "Gemfile",
24
- "Gemfile.lock",
25
- "Guardfile",
26
- "LICENSE.txt",
27
- "README.rdoc",
28
- "Rakefile",
29
- "TODO.mkd",
30
- "VERSION",
31
- "bin/ti",
32
- "lib/ti.rb",
33
- "lib/ti/cli.rb",
34
- "lib/ti/generate/model.rb",
35
- "lib/ti/generate/project.rb",
36
- "lib/ti/generate/view.rb",
37
- "lib/ti/logger.rb",
38
- "lib/ti/options.rb",
39
- "lib/ti/parse_options.rb",
40
- "lib/ti/templates/app/app.coffee",
41
- "lib/ti/templates/config",
42
- "lib/ti/templates/gitignore",
43
- "lib/ti/templates/guardfile",
44
- "lib/ti/templates/rakefile",
45
- "lib/ti/templates/readme",
46
- "lib/ti/templates/specs/app_spec.coffee",
47
- "lib/ti/utils.rb",
48
- "spec/cli/command_spec.rb",
49
- "spec/spec_helper.rb",
50
- "ti.gemspec"
51
- ]
52
- s.homepage = %q{http://github.com/revans/ti}
53
- s.licenses = ["MIT"]
6
+ s.name = %q{ti}
7
+ s.version = Ti::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Robert R Evans", "Julius Francisco", "Wynn Netherland", "Rupak Ganguly"]
10
+ s.date = %q{2011-05-04}
11
+ s.email = %q{robert@codewranglers.org}
12
+ s.homepage = %q{http://github.com/revans/ti}
13
+ s.summary = %q{Ti}
14
+ s.description = %q{Titanium Project Generator}
15
+ s.license = "MIT"
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
54
19
  s.require_paths = ["lib"]
55
- s.rubygems_version = %q{1.7.2}
56
- s.summary = %q{Ti}
57
- s.test_files = [
58
- "spec/cli/command_spec.rb",
59
- "spec/spec_helper.rb"
60
- ]
61
-
62
- if s.respond_to? :specification_version then
63
- s.specification_version = 3
20
+
64
21
 
65
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
66
- s.add_runtime_dependency(%q<sass>, ["~> 3.1.1"])
67
- s.add_runtime_dependency(%q<guard-sass>, [">= 0"])
68
- s.add_runtime_dependency(%q<guard>, ["~> 0.3.4"])
69
- s.add_runtime_dependency(%q<guard-coffeescript>, ["~> 0.2.0"])
70
- s.add_runtime_dependency(%q<guard-livereload>, ["~> 0.1.10"])
71
- s.add_runtime_dependency(%q<jasmine>, ["~> 1.0.2.0"])
72
- s.add_runtime_dependency(%q<coffee-script>, ["~> 2.2.0"])
73
- s.add_runtime_dependency(%q<colored>, ["~> 1.2"])
74
- s.add_runtime_dependency(%q<rocco>, ["~> 0.6"])
75
- s.add_runtime_dependency(%q<rake>, ["~> 0.8.7"])
76
- s.add_development_dependency(%q<bundler>, ["~> 1.0.10"])
77
- s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
78
- s.add_development_dependency(%q<rspec>, ["~> 2.5.0"])
79
- else
80
- s.add_dependency(%q<sass>, ["~> 3.1.1"])
81
- s.add_dependency(%q<guard-sass>, [">= 0"])
82
- s.add_dependency(%q<guard>, ["~> 0.3.4"])
83
- s.add_dependency(%q<guard-coffeescript>, ["~> 0.2.0"])
84
- s.add_dependency(%q<guard-livereload>, ["~> 0.1.10"])
85
- s.add_dependency(%q<jasmine>, ["~> 1.0.2.0"])
86
- s.add_dependency(%q<coffee-script>, ["~> 2.2.0"])
87
- s.add_dependency(%q<colored>, ["~> 1.2"])
88
- s.add_dependency(%q<rocco>, ["~> 0.6"])
89
- s.add_dependency(%q<rake>, ["~> 0.8.7"])
90
- s.add_dependency(%q<bundler>, ["~> 1.0.10"])
91
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
92
- s.add_dependency(%q<rspec>, ["~> 2.5.0"])
93
- end
94
- else
95
- s.add_dependency(%q<sass>, ["~> 3.1.1"])
96
- s.add_dependency(%q<guard-sass>, [">= 0"])
97
- s.add_dependency(%q<guard>, ["~> 0.3.4"])
98
- s.add_dependency(%q<guard-coffeescript>, ["~> 0.2.0"])
99
- s.add_dependency(%q<guard-livereload>, ["~> 0.1.10"])
100
- s.add_dependency(%q<jasmine>, ["~> 1.0.2.0"])
101
- s.add_dependency(%q<coffee-script>, ["~> 2.2.0"])
102
- s.add_dependency(%q<colored>, ["~> 1.2"])
103
- s.add_dependency(%q<rocco>, ["~> 0.6"])
104
- s.add_dependency(%q<rake>, ["~> 0.8.7"])
105
- s.add_dependency(%q<bundler>, ["~> 1.0.10"])
106
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
107
- s.add_dependency(%q<rspec>, ["~> 2.5.0"])
108
- end
22
+ s.add_runtime_dependency(%q<sass>, ["~> 3.1.1"])
23
+ s.add_runtime_dependency(%q<guard-sass>, ["~> 0.0.6"])
24
+ s.add_runtime_dependency(%q<guard>, ["~> 0.3.4"])
25
+ s.add_runtime_dependency(%q<guard-coffeescript>, ["~> 0.2.0"])
26
+ s.add_runtime_dependency(%q<guard-livereload>, ["~> 0.1.10"])
27
+ s.add_runtime_dependency(%q<jasmine>, ["~> 1.0.2.0"])
28
+ s.add_runtime_dependency(%q<coffee-script>, ["~> 2.2.0"])
29
+ s.add_runtime_dependency(%q<colored>, ["~> 1.2"])
30
+ s.add_runtime_dependency(%q<rocco>, ["~> 0.6"])
31
+ s.add_runtime_dependency(%q<rake>, ["~> 0.8.7"])
32
+ s.add_runtime_dependency(%q<nokogiri>, ["~> 1.4.4"])
33
+ s.add_runtime_dependency(%q<erubis>, ["~> 2.7.0"])
34
+ # s.add_runtime_dependency(%q<betabuilder>, ["~> 0.4.1"])
35
+
36
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.10"])
37
+ s.add_development_dependency(%q<rspec>, ["~> 2.5.0"])
109
38
  end
110
39
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ti
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,11 +12,11 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2011-05-03 00:00:00.000000000Z
15
+ date: 2011-05-04 00:00:00.000000000Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: sass
19
- requirement: &2153713780 !ruby/object:Gem::Requirement
19
+ requirement: &2155510540 !ruby/object:Gem::Requirement
20
20
  none: false
21
21
  requirements:
22
22
  - - ~>
@@ -24,21 +24,21 @@ dependencies:
24
24
  version: 3.1.1
25
25
  type: :runtime
26
26
  prerelease: false
27
- version_requirements: *2153713780
27
+ version_requirements: *2155510540
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: guard-sass
30
- requirement: &2153713180 !ruby/object:Gem::Requirement
30
+ requirement: &2155501200 !ruby/object:Gem::Requirement
31
31
  none: false
32
32
  requirements:
33
- - - ! '>='
33
+ - - ~>
34
34
  - !ruby/object:Gem::Version
35
- version: '0'
35
+ version: 0.0.6
36
36
  type: :runtime
37
37
  prerelease: false
38
- version_requirements: *2153713180
38
+ version_requirements: *2155501200
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: guard
41
- requirement: &2153712580 !ruby/object:Gem::Requirement
41
+ requirement: &2155500480 !ruby/object:Gem::Requirement
42
42
  none: false
43
43
  requirements:
44
44
  - - ~>
@@ -46,10 +46,10 @@ dependencies:
46
46
  version: 0.3.4
47
47
  type: :runtime
48
48
  prerelease: false
49
- version_requirements: *2153712580
49
+ version_requirements: *2155500480
50
50
  - !ruby/object:Gem::Dependency
51
51
  name: guard-coffeescript
52
- requirement: &2153711980 !ruby/object:Gem::Requirement
52
+ requirement: &2155499880 !ruby/object:Gem::Requirement
53
53
  none: false
54
54
  requirements:
55
55
  - - ~>
@@ -57,10 +57,10 @@ dependencies:
57
57
  version: 0.2.0
58
58
  type: :runtime
59
59
  prerelease: false
60
- version_requirements: *2153711980
60
+ version_requirements: *2155499880
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: guard-livereload
63
- requirement: &2153711440 !ruby/object:Gem::Requirement
63
+ requirement: &2155499280 !ruby/object:Gem::Requirement
64
64
  none: false
65
65
  requirements:
66
66
  - - ~>
@@ -68,10 +68,10 @@ dependencies:
68
68
  version: 0.1.10
69
69
  type: :runtime
70
70
  prerelease: false
71
- version_requirements: *2153711440
71
+ version_requirements: *2155499280
72
72
  - !ruby/object:Gem::Dependency
73
73
  name: jasmine
74
- requirement: &2153690880 !ruby/object:Gem::Requirement
74
+ requirement: &2155498680 !ruby/object:Gem::Requirement
75
75
  none: false
76
76
  requirements:
77
77
  - - ~>
@@ -79,10 +79,10 @@ dependencies:
79
79
  version: 1.0.2.0
80
80
  type: :runtime
81
81
  prerelease: false
82
- version_requirements: *2153690880
82
+ version_requirements: *2155498680
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: coffee-script
85
- requirement: &2153690280 !ruby/object:Gem::Requirement
85
+ requirement: &2155498100 !ruby/object:Gem::Requirement
86
86
  none: false
87
87
  requirements:
88
88
  - - ~>
@@ -90,10 +90,10 @@ dependencies:
90
90
  version: 2.2.0
91
91
  type: :runtime
92
92
  prerelease: false
93
- version_requirements: *2153690280
93
+ version_requirements: *2155498100
94
94
  - !ruby/object:Gem::Dependency
95
95
  name: colored
96
- requirement: &2153689640 !ruby/object:Gem::Requirement
96
+ requirement: &2155497500 !ruby/object:Gem::Requirement
97
97
  none: false
98
98
  requirements:
99
99
  - - ~>
@@ -101,10 +101,10 @@ dependencies:
101
101
  version: '1.2'
102
102
  type: :runtime
103
103
  prerelease: false
104
- version_requirements: *2153689640
104
+ version_requirements: *2155497500
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: rocco
107
- requirement: &2153689000 !ruby/object:Gem::Requirement
107
+ requirement: &2155496960 !ruby/object:Gem::Requirement
108
108
  none: false
109
109
  requirements:
110
110
  - - ~>
@@ -112,10 +112,10 @@ dependencies:
112
112
  version: '0.6'
113
113
  type: :runtime
114
114
  prerelease: false
115
- version_requirements: *2153689000
115
+ version_requirements: *2155496960
116
116
  - !ruby/object:Gem::Dependency
117
117
  name: rake
118
- requirement: &2153688400 !ruby/object:Gem::Requirement
118
+ requirement: &2155496440 !ruby/object:Gem::Requirement
119
119
  none: false
120
120
  requirements:
121
121
  - - ~>
@@ -123,32 +123,43 @@ dependencies:
123
123
  version: 0.8.7
124
124
  type: :runtime
125
125
  prerelease: false
126
- version_requirements: *2153688400
126
+ version_requirements: *2155496440
127
127
  - !ruby/object:Gem::Dependency
128
- name: bundler
129
- requirement: &2153687800 !ruby/object:Gem::Requirement
128
+ name: nokogiri
129
+ requirement: &2155495840 !ruby/object:Gem::Requirement
130
130
  none: false
131
131
  requirements:
132
132
  - - ~>
133
133
  - !ruby/object:Gem::Version
134
- version: 1.0.10
135
- type: :development
134
+ version: 1.4.4
135
+ type: :runtime
136
+ prerelease: false
137
+ version_requirements: *2155495840
138
+ - !ruby/object:Gem::Dependency
139
+ name: erubis
140
+ requirement: &2155495260 !ruby/object:Gem::Requirement
141
+ none: false
142
+ requirements:
143
+ - - ~>
144
+ - !ruby/object:Gem::Version
145
+ version: 2.7.0
146
+ type: :runtime
136
147
  prerelease: false
137
- version_requirements: *2153687800
148
+ version_requirements: *2155495260
138
149
  - !ruby/object:Gem::Dependency
139
- name: jeweler
140
- requirement: &2153687200 !ruby/object:Gem::Requirement
150
+ name: bundler
151
+ requirement: &2155494720 !ruby/object:Gem::Requirement
141
152
  none: false
142
153
  requirements:
143
154
  - - ~>
144
155
  - !ruby/object:Gem::Version
145
- version: 1.5.2
156
+ version: 1.0.10
146
157
  type: :development
147
158
  prerelease: false
148
- version_requirements: *2153687200
159
+ version_requirements: *2155494720
149
160
  - !ruby/object:Gem::Dependency
150
161
  name: rspec
151
- requirement: &2153686600 !ruby/object:Gem::Requirement
162
+ requirement: &2155494200 !ruby/object:Gem::Requirement
152
163
  none: false
153
164
  requirements:
154
165
  - - ~>
@@ -156,17 +167,16 @@ dependencies:
156
167
  version: 2.5.0
157
168
  type: :development
158
169
  prerelease: false
159
- version_requirements: *2153686600
170
+ version_requirements: *2155494200
160
171
  description: Titanium Project Generator
161
172
  email: robert@codewranglers.org
162
173
  executables:
163
174
  - ti
164
175
  extensions: []
165
- extra_rdoc_files:
166
- - LICENSE.txt
167
- - README.rdoc
176
+ extra_rdoc_files: []
168
177
  files:
169
178
  - .document
179
+ - .gitignore
170
180
  - .rvmrc
171
181
  - Gemfile
172
182
  - Gemfile.lock
@@ -175,26 +185,39 @@ files:
175
185
  - README.rdoc
176
186
  - Rakefile
177
187
  - TODO.mkd
178
- - VERSION
179
188
  - bin/ti
180
189
  - lib/ti.rb
181
190
  - lib/ti/cli.rb
191
+ - lib/ti/config.rb
192
+ - lib/ti/generate/controller.rb
182
193
  - lib/ti/generate/model.rb
183
194
  - lib/ti/generate/project.rb
184
195
  - lib/ti/generate/view.rb
185
196
  - lib/ti/logger.rb
186
- - lib/ti/options.rb
187
- - lib/ti/parse_options.rb
188
197
  - lib/ti/templates/app/app.coffee
189
- - lib/ti/templates/config
198
+ - lib/ti/templates/app/controllers/controller.erb
199
+ - lib/ti/templates/app/controllers/window.erb
200
+ - lib/ti/templates/app/views/tabgroup.erb
201
+ - lib/ti/templates/app/views/view.erb
202
+ - lib/ti/templates/app/views/window.erb
203
+ - lib/ti/templates/defaults/Guardfile.erb
204
+ - lib/ti/templates/defaults/Rakefile.erb
205
+ - lib/ti/templates/defaults/Readme.mkd.erb
206
+ - lib/ti/templates/defaults/config.erb
190
207
  - lib/ti/templates/gitignore
191
- - lib/ti/templates/guardfile
192
208
  - lib/ti/templates/rakefile
193
- - lib/ti/templates/readme
194
209
  - lib/ti/templates/specs/app_spec.coffee
195
210
  - lib/ti/utils.rb
211
+ - lib/ti/version.rb
196
212
  - spec/cli/command_spec.rb
213
+ - spec/fixtures/configs/tiapp.xml
214
+ - spec/lib/config_spec.rb
197
215
  - spec/spec_helper.rb
216
+ - spec/ti/generators/model_spec.rb
217
+ - spec/ti/generators/project_spec.rb
218
+ - spec/ti/generators/view_spec.rb
219
+ - spec/ti/logger_spec.rb
220
+ - spec/ti/utils_spec.rb
198
221
  - ti.gemspec
199
222
  homepage: http://github.com/revans/ti
200
223
  licenses:
@@ -209,9 +232,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
209
232
  - - ! '>='
210
233
  - !ruby/object:Gem::Version
211
234
  version: '0'
212
- segments:
213
- - 0
214
- hash: 3627978724793494530
215
235
  required_rubygems_version: !ruby/object:Gem::Requirement
216
236
  none: false
217
237
  requirements:
@@ -226,4 +246,12 @@ specification_version: 3
226
246
  summary: Ti
227
247
  test_files:
228
248
  - spec/cli/command_spec.rb
249
+ - spec/fixtures/configs/tiapp.xml
250
+ - spec/lib/config_spec.rb
229
251
  - spec/spec_helper.rb
252
+ - spec/ti/generators/model_spec.rb
253
+ - spec/ti/generators/project_spec.rb
254
+ - spec/ti/generators/view_spec.rb
255
+ - spec/ti/logger_spec.rb
256
+ - spec/ti/utils_spec.rb
257
+ has_rdoc:
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.0.6
@@ -1,64 +0,0 @@
1
- module Ti
2
- class Options
3
-
4
- def self.parse(args)
5
- options = OpenStruct.new
6
-
7
- ParseOptions.new(args) do |opts|
8
-
9
- opts.value('new') do |name|
10
- options.name = name
11
- end
12
-
13
- opts.value('-i', '--id') do |id|
14
- options.device_id = id
15
- end
16
-
17
- opts.value('-p', '--platform') do |platform|
18
- options.platform = platform
19
- end
20
-
21
- opts.value('generate') do |generate|
22
- options.generate = !!generate
23
- end
24
-
25
- opts.value('g') do |g|
26
- options.generate = !!g
27
- end
28
-
29
- opts.value('model') do |model|
30
- options.model = model
31
- end
32
-
33
- opts.value('view') do |view|
34
- options.view = view
35
- end
36
-
37
- opts.help('help', '-h') do
38
- puts "
39
-
40
- Usage: ti new name
41
-
42
- Ti Options:
43
-
44
- new: The name of the ti project.
45
- e.g. ti new cool_iphone_app
46
- generate Generate a specific file type:
47
- e.g. ti generate model user
48
- g Shortcut for generate
49
- help View the Help Screen
50
- version View the current version of Ti
51
-
52
- "
53
- exit(0)
54
- end
55
-
56
- opts.version('-v', 'version') do
57
- puts "Ti's current version is #{Ti::VERSION}"
58
- exit(0)
59
- end
60
- end
61
- options
62
- end
63
- end
64
- end