ymdp 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. data/LICENSE +1 -1
  2. data/Rakefile +13 -19
  3. data/VERSION +1 -1
  4. data/lib/new_application/Gemfile +1 -0
  5. data/lib/ymdp/compiler/template_compiler.rb +19 -3
  6. data/lib/ymdp/config.rb +4 -0
  7. data/lib/ymdp/deploy/ymdt.rb +118 -0
  8. data/lib/ymdp/support/string_masker.rb +17 -0
  9. data/lib/ymdp/tasks/ymdp.rake +13 -61
  10. data/lib/ymdp/translator/base.rb +6 -3
  11. data/lib/ymdp.rb +3 -0
  12. data/spec/data/Rakefile +3 -0
  13. data/spec/data/VERSION +1 -0
  14. data/spec/data/app/.gitignore +1 -0
  15. data/spec/data/app/assets/images/lightbox/lightbox_bg.png +0 -0
  16. data/spec/data/app/assets/javascripts/OpenMailIntl.js +291 -0
  17. data/spec/data/app/assets/javascripts/controls.js +965 -0
  18. data/spec/data/app/assets/javascripts/date.js +104 -0
  19. data/spec/data/app/assets/javascripts/dragdrop.js +974 -0
  20. data/spec/data/app/assets/javascripts/effects.js +1123 -0
  21. data/spec/data/app/assets/javascripts/lowpro.js +320 -0
  22. data/spec/data/app/assets/javascripts/prototype.js +4874 -0
  23. data/spec/data/app/assets/javascripts/scriptaculous.js +68 -0
  24. data/spec/data/app/assets/yrb/en-US/application_en-US.pres +7 -0
  25. data/spec/data/app/helpers/application_helper.rb +3 -0
  26. data/spec/data/app/javascripts/application.js +580 -0
  27. data/spec/data/app/javascripts/debug.js +138 -0
  28. data/spec/data/app/javascripts/flash.js +96 -0
  29. data/spec/data/app/javascripts/header.js +13 -0
  30. data/spec/data/app/javascripts/help.js +76 -0
  31. data/spec/data/app/javascripts/i18n.js +235 -0
  32. data/spec/data/app/javascripts/launcher.js +159 -0
  33. data/spec/data/app/javascripts/logger.js +61 -0
  34. data/spec/data/app/javascripts/tag_helper.js +178 -0
  35. data/spec/data/app/stylesheets/application.css +0 -0
  36. data/spec/data/app/stylesheets/ie.css +0 -0
  37. data/spec/data/app/stylesheets/ie6.css +0 -0
  38. data/spec/data/app/stylesheets/ie7.css +0 -0
  39. data/spec/data/app/stylesheets/ie8.css +0 -0
  40. data/spec/data/app/stylesheets/lightbox.css +30 -0
  41. data/spec/data/app/stylesheets/non_ie.css +0 -0
  42. data/spec/data/app/views/layouts/application.html.haml +35 -0
  43. data/spec/data/app/views/page.html.haml +1 -0
  44. data/spec/data/app/views/shared/_error.html.haml +8 -0
  45. data/spec/data/app/views/shared/_flash.html.haml +2 -0
  46. data/spec/data/app/views/shared/_javascripts.html.haml +22 -0
  47. data/spec/data/app/views/shared/_loading.html.haml +13 -0
  48. data/spec/data/app/views/shared/_stylesheets.html.haml +23 -0
  49. data/spec/data/config/categories.yml +6 -0
  50. data/spec/data/config/config.yml +28 -0
  51. data/spec/data/config/config.yml.example +30 -0
  52. data/spec/data/config/constants.rb +54 -0
  53. data/spec/data/config/content.yml +2 -0
  54. data/spec/data/config/servers.yml +9 -0
  55. data/spec/data/config/servers.yml.example +9 -0
  56. data/spec/data/lib/init.rb +13 -0
  57. data/spec/data/lib/tasks/environment.rake +4 -0
  58. data/spec/data/lib/tasks/keys.rake +3 -0
  59. data/spec/data/lib/tasks/setup.rake +13 -0
  60. data/spec/data/lib/tasks/ymdp.rake +4 -0
  61. data/spec/data/script/build +9 -0
  62. data/spec/data/script/config +13 -0
  63. data/spec/data/script/destroy +18 -0
  64. data/spec/data/script/generate +4 -0
  65. data/spec/data/script/gitrm +17 -0
  66. data/spec/data/script/growl +6 -0
  67. data/spec/data/script/images +48 -0
  68. data/spec/data/script/jslint.js +5072 -0
  69. data/spec/data/script/langs +31 -0
  70. data/spec/data/script/translate +5 -0
  71. data/spec/data/script/ymdt +1895 -0
  72. data/spec/data/script/ymdt.old +1890 -0
  73. data/spec/data/script/yuicompressor-2.4.2.jar +0 -0
  74. data/spec/spec.opts +1 -0
  75. data/spec/spec_helper.rb +11 -0
  76. data/spec/translator_spec.rb +9 -0
  77. data/spec/ymdp_spec.rb +5 -0
  78. data/spec/ymdt_spec.rb +149 -0
  79. data/ymdp.gemspec +78 -6
  80. metadata +78 -6
  81. data/test/helper.rb +0 -10
  82. data/test/test_ymdp.rb +0 -4
@@ -0,0 +1,61 @@
1
+ /*
2
+ YMDP LOGGER
3
+
4
+ Send logging messages to OIB.
5
+
6
+ Messages are saved in log/ymdp.log
7
+
8
+ */
9
+
10
+
11
+ /* set asset version */
12
+
13
+ var LOGGER, Logger;
14
+
15
+ LOGGER = {
16
+ VERSION: "<%= @hash %>",
17
+ MESSAGE: "<%= @message %>",
18
+ DEPLOYED: <%= Time.now.to_i %>,
19
+ DEPLOYED_STRING: "<%= Time.now.to_s %>"
20
+ };
21
+
22
+ YAHOO.namespace("logger");
23
+
24
+ YAHOO.logger.write = function(level, message) {
25
+ if (YAHOO.oib.login !== undefined) {
26
+ message = "[login: " + YAHOO.oib.login + "] " + message;
27
+ }
28
+ if (YAHOO.oib.guid !== undefined) {
29
+ message = "[guid: " + YAHOO.oib.guid + "] " + message;
30
+ }
31
+ YAHOO.oib.callOIB("ymdp/log",
32
+ {
33
+ level: level,
34
+ message: message,
35
+ method: "POST"
36
+ },
37
+ function() {
38
+ // log message written successfully
39
+ });
40
+ };
41
+
42
+ YAHOO.logger.debug = function(message) {
43
+ YAHOO.logger.write("debug", message);
44
+ };
45
+ YAHOO.logger.info = function(message) {
46
+ YAHOO.logger.write("info", message);
47
+ };
48
+ YAHOO.logger.warn = function(message) {
49
+ YAHOO.logger.write("warn", message);
50
+ };
51
+ YAHOO.logger.error = function(message) {
52
+ YAHOO.logger.write("warn", message);
53
+ };
54
+ YAHOO.logger.fatal = function(message) {
55
+ YAHOO.logger.write("fatal", message);
56
+ };
57
+
58
+
59
+ Logger = YAHOO.logger;
60
+
61
+ // END YMDP LOGGER
@@ -0,0 +1,178 @@
1
+ /* TAG HELPERS */
2
+
3
+ var Tags;
4
+
5
+ function tagHelper(tag_name, text, options) {
6
+ var m, opts;
7
+
8
+ m = "";
9
+ opts = "";
10
+
11
+ Object.keys(options).each(function(key) {
12
+ opts = opts + " " + key + "='" + options[key] + "'";
13
+ });
14
+
15
+ m = m + "<" + tag_name + " " + opts + ">";
16
+ m = m + text;
17
+ m = m + "<\/" + tag_name + ">";
18
+ return m;
19
+ }
20
+
21
+ function optionTag(text, options) {
22
+ return tagHelper("option", text, options);
23
+ }
24
+
25
+ function selectTag(text, options) {
26
+ return tagHelper("select", text, options);
27
+ }
28
+
29
+ function spanTag(text, options) {
30
+ return tagHelper("span", text, options);
31
+ }
32
+
33
+ function liTag(text, options) {
34
+ return tagHelper("li", text, options);
35
+ }
36
+
37
+ function divTag(text, options) {
38
+ return tagHelper("div", text, options);
39
+ }
40
+
41
+ function tdTag(text, options) {
42
+ return tagHelper("td", text, options);
43
+ }
44
+
45
+ function inputTag(value, options) {
46
+ options['value'] = value;
47
+ return tagHelper("input", "", options);
48
+ }
49
+
50
+ function textField(value, options) {
51
+ return inputTag(value, options);
52
+ }
53
+
54
+ function submitTag(value, options) {
55
+ options['type'] = 'submit';
56
+ return inputTag(value, options);
57
+ }
58
+
59
+ function optionsForSelect(options, selected) {
60
+ var m;
61
+ m = "";
62
+ options.each(function(option) {
63
+ var key, value, opts;
64
+
65
+ if (Object.isArray(option)) {
66
+ key = option[0];
67
+ value = option[1];
68
+ } else {
69
+ key = option;
70
+ value = option;
71
+ }
72
+
73
+ opts = {
74
+ value: value
75
+ };
76
+
77
+ if (key === selected) {
78
+ opts.selected = 'selected';
79
+ }
80
+
81
+ m = m + optionTag(key, opts);
82
+ });
83
+ return m;
84
+ }
85
+
86
+ Tags = {
87
+ create: function(tag_name, text, options) {
88
+ options = options || {};
89
+ var m, opts;
90
+
91
+ m = "";
92
+ opts = "";
93
+
94
+ Object.keys(options).each(function(key) {
95
+ if (options[key]) {
96
+ opts = opts + " " + key + "='" + options[key] + "'";
97
+ }
98
+ });
99
+
100
+ m = m + "<" + tag_name + " " + opts + ">";
101
+ m = m + text;
102
+ m = m + "<\/" + tag_name + ">";
103
+ return m;
104
+ },
105
+
106
+ input: function(value, options) {
107
+ options = options || {};
108
+ options["value"] = value;
109
+ options["name"] = options["name"] || "";
110
+ options["id"] = options["id"] || options["name"];
111
+
112
+ return Tags.create("input", "", options);
113
+ },
114
+
115
+ hiddenInput: function(value, options) {
116
+ options = options || {};
117
+ options["type"] = "hidden";
118
+ return Tags.input(value, options);
119
+ },
120
+
121
+ checkBox: function(name, options) {
122
+ options = options || {};
123
+ var check_box, hidden_options, hidden_check_box;
124
+
125
+ options["type"] = "checkbox";
126
+ options["name"] = name;
127
+
128
+ if (options["checked"]) {
129
+ options["checked"] = "checked";
130
+ } else {
131
+ options["checked"] = undefined;
132
+ }
133
+
134
+ check_box = Tags.input("1", options);
135
+
136
+ hidden_options = {
137
+ "name": name
138
+ };
139
+ hidden_check_box = Tags.hiddenInput("0", hidden_options);
140
+
141
+ return check_box + " " + hidden_check_box;
142
+ },
143
+
144
+ submit: function(value, options) {
145
+ options = options || {};
146
+ options["value"] = value;
147
+ options["id"] = options["id"] || options["name"];
148
+ options["type"] = "submit";
149
+ return Tags.input(value, options);
150
+ },
151
+
152
+ linkToFunction: function(value, onclick, options) {
153
+ options = options || {};
154
+ var jv;
155
+
156
+ jv = "#";
157
+ options["href"] = options["href"] || jv;
158
+ options["onclick"] = onclick;
159
+ return Tags.a(value, options);
160
+ },
161
+
162
+ div: function(text, options) {
163
+ return new Element('div', options).update(text);
164
+ },
165
+
166
+ init: function() {
167
+ $w("li ul span div p a option select strong").each(function(tag_name) {
168
+ Tags[tag_name] = function(text, options) {
169
+ options = options || {};
170
+ return Tags.create(tag_name, text, options);
171
+ };
172
+ });
173
+ }
174
+ };
175
+
176
+ Tags.init();
177
+
178
+ /* END TAG HELPERS */
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,30 @@
1
+ .lightbox-wrapper {
2
+ background: transparent url('<%= @assets_directory %>/images/lightbox/lightbox_bg.png') 0 100% repeat;
3
+ position: fixed;
4
+ top: 0;
5
+ left: 0;
6
+ width: 100%;
7
+ height: 100%;
8
+ z-index: 10000;
9
+ }
10
+
11
+ .lightbox-container {
12
+ background-color: #fff;
13
+ margin: auto;
14
+ margin-top: 25px;
15
+ padding: 10px;
16
+ }
17
+
18
+ .lightbox-contents {
19
+ height: 100%;
20
+ width: 100%;
21
+ margin: auto;
22
+ text-align: center;
23
+ }
24
+
25
+ .close_link {
26
+ font-size: 14px;
27
+ text-align: right;
28
+ margin-top: -10px;
29
+ margin-right: 4px;
30
+ }
File without changes
@@ -0,0 +1,35 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ /
5
+ = "Sprint #{@version} #{@sprint_name}"
6
+ = "'#{@view}' view for #{@domain}: #{@server}"
7
+ = "built at #{Time.now}"
8
+ = "commit #{@hash}, '#{@message}'"
9
+
10
+ %title= "#{@view} view for #{@domain}: #{@server}"
11
+
12
+ = render :partial => 'stylesheets'
13
+
14
+ / Prototype
15
+
16
+ = javascript_include "prototype.js"
17
+ = javascript_include "scriptaculous.js"
18
+
19
+
20
+ %body{:class => @view}
21
+ = render :partial => 'loading'
22
+ = render :partial => 'flash'
23
+
24
+ #main{:style => "display: none;"}
25
+
26
+ #content
27
+ = @content
28
+
29
+ = render :partial => 'javascripts'
30
+
31
+ /
32
+ = "Sprint #{@version} #{@sprint_name}"
33
+ = "'#{@view}' view for #{@domain}: #{@server}"
34
+ = "built at #{Time.now}"
35
+ = "commit #{@hash}, '#{@message}'"
@@ -0,0 +1 @@
1
+ %p This is a page.
@@ -0,0 +1,8 @@
1
+ #error{:style => "display: none;"}
2
+ %h2#error_1 We're sorry, but something went wrong when we tried to contact the server.
3
+ %p#error_2 We've been notified about this issue and we'll take a look at it shortly.
4
+
5
+ %p
6
+ = button("Retry", :id => "retry", :onclick => "YAHOO.launcher.relaunchAuthorize(); return false;", :class => "t")
7
+
8
+ %p#error_details{:style => "display: none;"}
@@ -0,0 +1,2 @@
1
+ #flash{:style => "display: none;"}
2
+ #flash_message.message
@@ -0,0 +1,22 @@
1
+
2
+ / Required scripts for using the Yahoo! Mail Developer Platform API
3
+ = javascript_include "http://yui.yahooapis.com/2.7.0/build/yahoo-dom-event/yahoo-dom-event.js"
4
+ = javascript_include "http://yui.yahooapis.com/2.7.0/build/json/json-min.js"
5
+ = javascript_include "http://mail.yimg.com/a/lib/om/crossframe/1.0.19/crossframe-min.js"
6
+ = javascript_include "http://mail.yimg.com/a/lib/om/om_api_public/1.0.4/om_api_public.js"
7
+
8
+
9
+ / OIB JavaScript libraries
10
+
11
+ = javascript_include "OpenMailIntl.js"
12
+ = render :javascript => ['application', 'debug', 'tag_helper', 'launcher', 'logger', 'i18n', 'flash'], :filename => 'javascripts'
13
+
14
+ / Date
15
+
16
+ = javascript_include "date.js"
17
+
18
+ / Header
19
+ = render :javascript => 'header'
20
+ = render :javascript => @view
21
+
22
+ / = include_firebug_lite
@@ -0,0 +1,13 @@
1
+ #utility
2
+ .toolbar
3
+ = blank_image_tag(:class => "logo")
4
+ %h1#loading_heading Automatic Organizer
5
+
6
+ #loading
7
+ %h2#loading_subhead Organize. Prioritize. Summarize.
8
+
9
+ %p
10
+ = image_tag('spinner.gif', :alt => "Loading indicator", :class => 'spinner')
11
+ %span#loading_paragraph_1 Loading your Automatic Organizer settings...
12
+
13
+ = render :partial => 'error'
@@ -0,0 +1,23 @@
1
+ / Styles
2
+
3
+ = render :stylesheet => 'application'
4
+ = render :stylesheet => 'lightbox'
5
+ = render :stylesheet => @view
6
+
7
+
8
+ <!--[if IE]>
9
+ = render :stylesheet => 'ie'
10
+ <![endif]-->
11
+
12
+ <!--[if IE 6]>
13
+ = render :stylesheet => 'ie6'
14
+ <![endif]-->
15
+
16
+ <!--[if IE 7]>
17
+ = render :stylesheet => 'ie7'
18
+ <![endif]-->
19
+
20
+ <!--[if IE 8]>
21
+ = render :stylesheet => 'ie8'
22
+ <![endif]-->
23
+
@@ -0,0 +1,6 @@
1
+ categories:
2
+ views: views
3
+ assets: assets
4
+ javascripts: assets/javascripts
5
+ images: assets/images
6
+ # yrb: assets/yrb
@@ -0,0 +1,28 @@
1
+ config:
2
+ username: user
3
+ password: password
4
+ default_server: staging
5
+ production_server: my
6
+ doctype: HTML 4.0 Transitional
7
+ growl: false
8
+
9
+ verbose: false
10
+ compress:
11
+ obfuscate: true
12
+ css: true
13
+ embedded_js: true
14
+ js_assets: true
15
+ validate:
16
+ html:
17
+ build: true
18
+ deploy: true
19
+ embedded_js:
20
+ build: true
21
+ deploy: true
22
+ js_assets:
23
+ build: false
24
+ deploy: false
25
+ json_assets:
26
+ build: false
27
+ deploy: false
28
+
@@ -0,0 +1,30 @@
1
+ config:
2
+ username: aaron_otherinbox
3
+ password:
4
+ default_server: staging
5
+ production_server: my
6
+ doctype: HTML 4.0 Transitional
7
+ growl: true
8
+ version:
9
+ sprint_name:
10
+
11
+ verbose: false
12
+ compress:
13
+ obfuscate: true
14
+ css: true
15
+ embedded_js: true
16
+ js_assets: true
17
+ validate:
18
+ html:
19
+ build: true
20
+ deploy: true
21
+ embedded_js:
22
+ build: true
23
+ deploy: true
24
+ js_assets:
25
+ build: false
26
+ deploy: false
27
+ json_assets:
28
+ build: false
29
+ deploy: false
30
+
@@ -0,0 +1,54 @@
1
+ LOCALE_CODES = ["en-US","de-DE","en-AA","en-AU","en-MY","en-NZ","en-PH","en-SG","es-ES","es-MX","fr-FR","id-ID","it-IT","ko-KR","pt-BR","vi-VN","zh-Hans-CN","zh-Hant-HK","zh-Hant-TW"] unless defined?(LOCALE_CODES)
2
+
3
+ LOCALES = {
4
+ "en-US" => "English (United States)",
5
+ "en-AA" => "English (Asia)",
6
+ "en-AU" => "English (Australia)",
7
+ "en-MY" => "English (Malaysia)",
8
+ "en-NZ" => "English (New Zealand)",
9
+ "en-PH" => "English (Phillippines)",
10
+ "en-SG" => "English (Singapore)",
11
+ "de-DE" => "German",
12
+ "es-ES" => "Spanish (Spain)",
13
+ "es-MX" => "Spanish (Mexico)",
14
+ "fr-FR" => "French",
15
+ "id-ID" => "Indonesian",
16
+ "it-IT" => "Italian",
17
+ "ko-KR" => "Korean",
18
+ "pt-BR" => "Portuguese",
19
+ "vi-VN" => "Vietnamese",
20
+ "zh-Hans-CN" => "Chinese (China)",
21
+ "zh-Hant-HK" => "Chinese (Hong Kong)",
22
+ "zh-Hant-TW" => "Chinese (Taiwan)"
23
+ } unless defined?(LOCALES)
24
+
25
+ SORTED_LOCALES = LOCALES.sort do |a,b|
26
+ a[1] <=> b[1]
27
+ end unless defined?(SORTED_LOCALES)
28
+
29
+ YMDP_ROOT = "." unless defined?(YMDP_ROOT)
30
+
31
+ def file_not_found(filename)
32
+ puts
33
+ puts "Create #{filename} with the following command:\n\n ./script/config"
34
+ puts
35
+
36
+ raise "File not found: #{filename}"
37
+ end
38
+
39
+ servers = "#{YMDP_ROOT}/config/servers.yml"
40
+ config = "#{YMDP_ROOT}/config/config.yml"
41
+
42
+ if File.exists?(servers)
43
+ SERVERS = YAML.load_file("#{YMDP_ROOT}/config/servers.yml") unless defined?(SERVERS)
44
+ else
45
+ file_not_found(servers)
46
+ end
47
+
48
+ if File.exists?(config)
49
+ CONFIG = YAML.load_file("#{YMDP_ROOT}/config/config.yml")["config"] unless defined?(CONFIG)
50
+ else
51
+ file_not_found(config)
52
+ end
53
+
54
+ TMP_DIR = "./tmp" unless defined?(TMP_DIR)
@@ -0,0 +1,2 @@
1
+ version: 6
2
+ sprint_name: Felucia
@@ -0,0 +1,9 @@
1
+ development:
2
+ server: alpha
3
+ application_id: abcdefghijk
4
+ assets_id: abcdefghijk_1
5
+
6
+ staging:
7
+ server: staging
8
+ application_id: abcdefghijk
9
+ assets_id: abcdefghijk_1
@@ -0,0 +1,9 @@
1
+ development:
2
+ server: alpha
3
+ application_id: abcdefghijk
4
+ assets_id: abcdefghijk_1
5
+
6
+ staging:
7
+ server: staging
8
+ application_id: abcdefghijk
9
+ assets_id: abcdefghijk_1
@@ -0,0 +1,13 @@
1
+ require 'fileutils'
2
+ require 'erb'
3
+ require 'net/http'
4
+ require 'optparse'
5
+
6
+ Dir["./app/helpers/*.rb"].each do |path|
7
+ require path
8
+ end
9
+
10
+ require 'vendor/gems/environment'
11
+ Bundler.require_env
12
+
13
+ require 'constants'
@@ -0,0 +1,4 @@
1
+ task :environment do
2
+ require 'lib/init'
3
+ end
4
+
@@ -0,0 +1,3 @@
1
+ require 'lib/init'
2
+
3
+ load 'ymdp/tasks/keys.rake'
@@ -0,0 +1,13 @@
1
+ task :setup do
2
+ copy_from_example("config/config.yml")
3
+ copy_from_example("config/servers.yml")
4
+ end
5
+
6
+ def copy_from_example(filename)
7
+ if File.exists?("./#{filename}")
8
+ puts "#{filename} already exists."
9
+ else
10
+ system "cp ./#{filename}.example ./#{filename}"
11
+ puts "Copied #{filename}.example to #{filename}"
12
+ end
13
+ end
@@ -0,0 +1,4 @@
1
+ YMDP_ENV="deploy"
2
+ require "lib/init"
3
+
4
+ load 'ymdp/tasks/ymdp.rake'
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'lib/init'
4
+
5
+ YMDP_ENV = "build"
6
+
7
+ require 'compiler/template_compiler'
8
+
9
+ TemplateCompiler.compile
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ def copy_from_example(filename)
4
+ if File.exists?("./#{filename}")
5
+ puts "#{filename} already exists."
6
+ else
7
+ system "cp ./#{filename}.example ./#{filename}"
8
+ puts "Copied #{filename}.example to #{filename}"
9
+ end
10
+ end
11
+
12
+ copy_from_example("config/config.yml")
13
+ copy_from_example("config/servers.yml")
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ YMDP_ROOT = "."
4
+ APP_DIR = "#{YMDP_ROOT}/app"
5
+ ASSETS_DIR = "#{APP_DIR}/assets"
6
+ VIEWS_DIR = "#{APP_DIR}/views"
7
+ JAVASCRIPTS_DIR = "#{APP_DIR}/javascripts"
8
+ STYLESHEETS_DIR = "#{APP_DIR}/stylesheets"
9
+
10
+ @view = ARGV[0]
11
+
12
+ puts "Destroying #{@view} view..."
13
+
14
+ system "git rm #{VIEWS_DIR}/#{@view}.html*"
15
+
16
+ system "git rm #{JAVASCRIPTS_DIR}/#{@view}.js"
17
+
18
+ system "git rm #{STYLESHEETS_DIR}/#{@view}.css"
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'lib/init'
4
+ require 'commands/generate'
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ status = `git status`
3
+
4
+ deleted_part = false
5
+
6
+ status.split("\n").each do |line|
7
+ if line =~ /Changed but not updated/
8
+ deleted_part ||= true
9
+ end
10
+ if deleted_part
11
+ if line =~ /deleted: /
12
+ filename = line.gsub("# deleted: ", "")
13
+ puts filename
14
+ system "git rm #{filename}"
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'g'
5
+
6
+ g "Something requires your attention."