ti 0.0.6 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +43 -0
- data/Gemfile +2 -19
- data/Gemfile.lock +27 -27
- data/LICENSE.txt +1 -1
- data/README.rdoc +1 -1
- data/Rakefile +0 -28
- data/TODO.mkd +1 -2
- data/lib/ti.rb +10 -10
- data/lib/ti/cli.rb +39 -6
- data/lib/ti/config.rb +22 -0
- data/lib/ti/generate/controller.rb +38 -0
- data/lib/ti/generate/model.rb +13 -7
- data/lib/ti/generate/project.rb +59 -13
- data/lib/ti/generate/view.rb +30 -9
- data/lib/ti/templates/app/controllers/controller.erb +0 -0
- data/lib/ti/templates/app/controllers/window.erb +3 -0
- data/lib/ti/templates/app/views/tabgroup.erb +0 -0
- data/lib/ti/templates/app/views/view.erb +0 -0
- data/lib/ti/templates/app/views/window.erb +3 -0
- data/lib/ti/templates/{guardfile → defaults/Guardfile.erb} +3 -3
- data/lib/ti/templates/defaults/Rakefile.erb +148 -0
- data/lib/ti/templates/defaults/Readme.mkd.erb +1 -0
- data/lib/ti/templates/{config → defaults/config.erb} +1 -1
- data/lib/ti/templates/gitignore +1 -1
- data/lib/ti/templates/specs/app_spec.coffee +2 -2
- data/lib/ti/utils.rb +70 -41
- data/lib/ti/version.rb +3 -0
- data/spec/cli/command_spec.rb +7 -11
- data/spec/fixtures/configs/tiapp.xml +34 -0
- data/spec/lib/config_spec.rb +34 -0
- data/spec/spec_helper.rb +8 -0
- data/spec/ti/generators/model_spec.rb +25 -0
- data/spec/ti/generators/project_spec.rb +121 -0
- data/spec/ti/generators/view_spec.rb +25 -0
- data/spec/ti/logger_spec.rb +25 -0
- data/spec/ti/utils_spec.rb +120 -0
- data/ti.gemspec +32 -103
- metadata +75 -47
- data/VERSION +0 -1
- data/lib/ti/options.rb +0 -64
- data/lib/ti/parse_options.rb +0 -48
- data/lib/ti/templates/readme +0 -1
data/lib/ti/parse_options.rb
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
class ParseOptions
|
2
|
-
|
3
|
-
##
|
4
|
-
# Initialize
|
5
|
-
#
|
6
|
-
def initialize(args, &block)
|
7
|
-
@args = args
|
8
|
-
instance_eval(&block) if block_given?
|
9
|
-
end
|
10
|
-
|
11
|
-
|
12
|
-
##
|
13
|
-
# Help Menu
|
14
|
-
#
|
15
|
-
def help(value, value2='', &block)
|
16
|
-
puts yield(block) if display_message?(value, value2)
|
17
|
-
end
|
18
|
-
alias_method :version, :help
|
19
|
-
|
20
|
-
|
21
|
-
##
|
22
|
-
# Scan for values
|
23
|
-
#
|
24
|
-
def scan_for_value(v1, v2='', &block)
|
25
|
-
found = nil
|
26
|
-
@args.each_with_index do |value, index|
|
27
|
-
next if found
|
28
|
-
found = @args[index + 1] if (v1.to_s == value.to_s || v2.to_s == value.to_s)
|
29
|
-
end
|
30
|
-
yield found
|
31
|
-
end
|
32
|
-
alias_method :value, :scan_for_value
|
33
|
-
|
34
|
-
|
35
|
-
##
|
36
|
-
# Boolean
|
37
|
-
#
|
38
|
-
def boolean(v1, v2='', &block)
|
39
|
-
found = false
|
40
|
-
@args.each do |value|
|
41
|
-
next if found
|
42
|
-
found = true if (v1.to_s == value.to_s || v2.to_s == value.to_s)
|
43
|
-
end
|
44
|
-
block_given? ? yield(found) : found
|
45
|
-
end
|
46
|
-
alias_method :display_message?, :boolean
|
47
|
-
|
48
|
-
end
|
data/lib/ti/templates/readme
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
# My Titanium Project - Generated by Ti
|