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
@@ -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
@@ -1 +0,0 @@
1
- # My Titanium Project - Generated by Ti