cloudfuji 0.0.37

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. data/.gitignore +7 -0
  2. data/.rspec +4 -0
  3. data/Gemfile +17 -0
  4. data/README.md +3 -0
  5. data/Rakefile +36 -0
  6. data/app/controllers/cloudfuji/data_controller.rb +33 -0
  7. data/app/controllers/cloudfuji/envs_controller.rb +31 -0
  8. data/app/controllers/cloudfuji/mail_controller.rb +37 -0
  9. data/bin/cloudfuji +86 -0
  10. data/cloudfuji.gemspec +26 -0
  11. data/config/routes.rb +1 -0
  12. data/lib/cloudfuji.rb +53 -0
  13. data/lib/cloudfuji/action_mailer.rb +35 -0
  14. data/lib/cloudfuji/app.rb +202 -0
  15. data/lib/cloudfuji/bar.rb +19 -0
  16. data/lib/cloudfuji/base.rb +23 -0
  17. data/lib/cloudfuji/command.rb +110 -0
  18. data/lib/cloudfuji/config.rb +12 -0
  19. data/lib/cloudfuji/data.rb +52 -0
  20. data/lib/cloudfuji/data_helper.rb +1 -0
  21. data/lib/cloudfuji/dns.rb +195 -0
  22. data/lib/cloudfuji/engine.rb +21 -0
  23. data/lib/cloudfuji/envs.rb +6 -0
  24. data/lib/cloudfuji/envs_helper.rb +1 -0
  25. data/lib/cloudfuji/event.rb +63 -0
  26. data/lib/cloudfuji/event_observer.rb +20 -0
  27. data/lib/cloudfuji/mail_helper.rb +1 -0
  28. data/lib/cloudfuji/mail_route.rb +186 -0
  29. data/lib/cloudfuji/middleware.rb +42 -0
  30. data/lib/cloudfuji/models.rb +59 -0
  31. data/lib/cloudfuji/notification.rb +0 -0
  32. data/lib/cloudfuji/orm/active_record.rb +44 -0
  33. data/lib/cloudfuji/orm/mongoid.rb +31 -0
  34. data/lib/cloudfuji/platform.rb +47 -0
  35. data/lib/cloudfuji/schema.rb +42 -0
  36. data/lib/cloudfuji/smtp.rb +24 -0
  37. data/lib/cloudfuji/user.rb +59 -0
  38. data/lib/cloudfuji/user_helper.rb +7 -0
  39. data/lib/cloudfuji/utils.rb +53 -0
  40. data/lib/cloudfuji/version.rb +4 -0
  41. data/lib/generators/active_record/cloudfuji_generator.rb +28 -0
  42. data/lib/generators/active_record/templates/migration.rb +20 -0
  43. data/lib/generators/cloudfuji/auth_migration_generator.rb +46 -0
  44. data/lib/generators/cloudfuji/cloudfuji_generator.rb +14 -0
  45. data/lib/generators/cloudfuji/hooks_generator.rb +43 -0
  46. data/lib/generators/cloudfuji/install_generator.rb +24 -0
  47. data/lib/generators/cloudfuji/mail_routes_generator.rb +45 -0
  48. data/lib/generators/cloudfuji/orm_helpers.rb +21 -0
  49. data/lib/generators/cloudfuji/routes_generator.rb +22 -0
  50. data/lib/generators/mongoid/cloudfuji_generator.rb +17 -0
  51. data/lib/generators/templates/README +5 -0
  52. data/lib/generators/templates/cloudfuji.rb +10 -0
  53. data/lib/hooks.rb +36 -0
  54. data/lib/rails/routes.rb +42 -0
  55. data/lib/tasks/cloudfuji.rake +6 -0
  56. data/spec/app_spec/controllers/envs_controller_spec.rb +25 -0
  57. data/spec/app_spec/controllers/mail_controller_spec.rb +28 -0
  58. data/spec/app_spec/integration/app_claim_spec.rb +16 -0
  59. data/spec/gem_spec/base_spec.rb +24 -0
  60. data/spec/gem_spec/command_spec.rb +181 -0
  61. data/spec/gem_spec/config_spec.rb +9 -0
  62. data/spec/gem_spec/data_spec.rb +13 -0
  63. data/spec/gem_spec/hooks_spec.rb +5 -0
  64. data/spec/gem_spec/mail_route_spec.rb +168 -0
  65. data/spec/gem_spec/platform_spec.rb +9 -0
  66. data/spec/gem_spec/user_spec.rb +45 -0
  67. data/spec/spec_helper.rb +21 -0
  68. data/spec/test_apps/rails-2.3/.gitignore +13 -0
  69. data/spec/test_apps/rails-2.3/Gemfile +13 -0
  70. data/spec/test_apps/rails-2.3/README +243 -0
  71. data/spec/test_apps/rails-2.3/Rakefile +10 -0
  72. data/spec/test_apps/rails-2.3/app/controllers/application_controller.rb +10 -0
  73. data/spec/test_apps/rails-2.3/app/helpers/application_helper.rb +3 -0
  74. data/spec/test_apps/rails-2.3/config/boot.rb +114 -0
  75. data/spec/test_apps/rails-2.3/config/environment.rb +41 -0
  76. data/spec/test_apps/rails-2.3/config/environments/development.rb +17 -0
  77. data/spec/test_apps/rails-2.3/config/environments/production.rb +28 -0
  78. data/spec/test_apps/rails-2.3/config/environments/test.rb +30 -0
  79. data/spec/test_apps/rails-2.3/config/initializers/backtrace_silencers.rb +7 -0
  80. data/spec/test_apps/rails-2.3/config/initializers/cookie_verification_secret.rb +7 -0
  81. data/spec/test_apps/rails-2.3/config/initializers/inflections.rb +10 -0
  82. data/spec/test_apps/rails-2.3/config/initializers/mime_types.rb +5 -0
  83. data/spec/test_apps/rails-2.3/config/initializers/new_rails_defaults.rb +21 -0
  84. data/spec/test_apps/rails-2.3/config/initializers/session_store.rb +15 -0
  85. data/spec/test_apps/rails-2.3/config/locales/en.yml +5 -0
  86. data/spec/test_apps/rails-2.3/config/routes.rb +43 -0
  87. data/spec/test_apps/rails-2.3/db/seeds.rb +7 -0
  88. data/spec/test_apps/rails-2.3/doc/README_FOR_APP +2 -0
  89. data/spec/test_apps/rails-2.3/lib/tasks/rspec.rake +144 -0
  90. data/spec/test_apps/rails-2.3/public/404.html +30 -0
  91. data/spec/test_apps/rails-2.3/public/422.html +30 -0
  92. data/spec/test_apps/rails-2.3/public/500.html +30 -0
  93. data/spec/test_apps/rails-2.3/public/favicon.ico +0 -0
  94. data/spec/test_apps/rails-2.3/public/images/rails.png +0 -0
  95. data/spec/test_apps/rails-2.3/public/javascripts/application.js +2 -0
  96. data/spec/test_apps/rails-2.3/public/javascripts/controls.js +963 -0
  97. data/spec/test_apps/rails-2.3/public/javascripts/dragdrop.js +973 -0
  98. data/spec/test_apps/rails-2.3/public/javascripts/effects.js +1128 -0
  99. data/spec/test_apps/rails-2.3/public/javascripts/prototype.js +4320 -0
  100. data/spec/test_apps/rails-2.3/public/robots.txt +5 -0
  101. data/spec/test_apps/rails-2.3/script/about +4 -0
  102. data/spec/test_apps/rails-2.3/script/autospec +6 -0
  103. data/spec/test_apps/rails-2.3/script/console +3 -0
  104. data/spec/test_apps/rails-2.3/script/dbconsole +3 -0
  105. data/spec/test_apps/rails-2.3/script/destroy +3 -0
  106. data/spec/test_apps/rails-2.3/script/generate +3 -0
  107. data/spec/test_apps/rails-2.3/script/performance/benchmarker +3 -0
  108. data/spec/test_apps/rails-2.3/script/performance/profiler +3 -0
  109. data/spec/test_apps/rails-2.3/script/plugin +3 -0
  110. data/spec/test_apps/rails-2.3/script/runner +3 -0
  111. data/spec/test_apps/rails-2.3/script/server +3 -0
  112. data/spec/test_apps/rails-2.3/script/spec +10 -0
  113. data/spec/test_apps/rails-2.3/spec/all_spec.rb +5 -0
  114. data/spec/test_apps/rails-2.3/spec/rcov.opts +2 -0
  115. data/spec/test_apps/rails-2.3/spec/spec.opts +4 -0
  116. data/spec/test_apps/rails-2.3/spec/spec_helper.rb +83 -0
  117. data/spec/test_apps/rails-2.3/test/performance/browsing_test.rb +9 -0
  118. data/spec/test_apps/rails-2.3/test/test_helper.rb +38 -0
  119. data/spec/test_apps/rails-3.0/.gitignore +4 -0
  120. data/spec/test_apps/rails-3.0/.rspec +2 -0
  121. data/spec/test_apps/rails-3.0/Gemfile +10 -0
  122. data/spec/test_apps/rails-3.0/README +256 -0
  123. data/spec/test_apps/rails-3.0/Rakefile +7 -0
  124. data/spec/test_apps/rails-3.0/app/controllers/application_controller.rb +3 -0
  125. data/spec/test_apps/rails-3.0/app/controllers/static_controller.rb +4 -0
  126. data/spec/test_apps/rails-3.0/app/helpers/application_helper.rb +2 -0
  127. data/spec/test_apps/rails-3.0/app/helpers/static_helper.rb +2 -0
  128. data/spec/test_apps/rails-3.0/app/views/layouts/application.html.erb +14 -0
  129. data/spec/test_apps/rails-3.0/app/views/static/home.html.erb +1 -0
  130. data/spec/test_apps/rails-3.0/config.ru +4 -0
  131. data/spec/test_apps/rails-3.0/config/application.rb +46 -0
  132. data/spec/test_apps/rails-3.0/config/boot.rb +6 -0
  133. data/spec/test_apps/rails-3.0/config/environment.rb +5 -0
  134. data/spec/test_apps/rails-3.0/config/environments/development.rb +26 -0
  135. data/spec/test_apps/rails-3.0/config/environments/production.rb +49 -0
  136. data/spec/test_apps/rails-3.0/config/environments/test.rb +35 -0
  137. data/spec/test_apps/rails-3.0/config/initializers/backtrace_silencers.rb +7 -0
  138. data/spec/test_apps/rails-3.0/config/initializers/inflections.rb +10 -0
  139. data/spec/test_apps/rails-3.0/config/initializers/mime_types.rb +5 -0
  140. data/spec/test_apps/rails-3.0/config/initializers/secret_token.rb +7 -0
  141. data/spec/test_apps/rails-3.0/config/initializers/session_store.rb +8 -0
  142. data/spec/test_apps/rails-3.0/config/locales/en.yml +5 -0
  143. data/spec/test_apps/rails-3.0/config/routes.rb +62 -0
  144. data/spec/test_apps/rails-3.0/db/schema.rb +15 -0
  145. data/spec/test_apps/rails-3.0/db/seeds.rb +7 -0
  146. data/spec/test_apps/rails-3.0/doc/README_FOR_APP +2 -0
  147. data/spec/test_apps/rails-3.0/lib/tasks/.gitkeep +0 -0
  148. data/spec/test_apps/rails-3.0/public/404.html +26 -0
  149. data/spec/test_apps/rails-3.0/public/422.html +26 -0
  150. data/spec/test_apps/rails-3.0/public/500.html +26 -0
  151. data/spec/test_apps/rails-3.0/public/favicon.ico +0 -0
  152. data/spec/test_apps/rails-3.0/public/images/rails.png +0 -0
  153. data/spec/test_apps/rails-3.0/public/index.html +239 -0
  154. data/spec/test_apps/rails-3.0/public/javascripts/application.js +2 -0
  155. data/spec/test_apps/rails-3.0/public/javascripts/controls.js +965 -0
  156. data/spec/test_apps/rails-3.0/public/javascripts/dragdrop.js +974 -0
  157. data/spec/test_apps/rails-3.0/public/javascripts/effects.js +1123 -0
  158. data/spec/test_apps/rails-3.0/public/javascripts/prototype.js +6001 -0
  159. data/spec/test_apps/rails-3.0/public/javascripts/rails.js +191 -0
  160. data/spec/test_apps/rails-3.0/public/robots.txt +5 -0
  161. data/spec/test_apps/rails-3.0/public/stylesheets/.gitkeep +0 -0
  162. data/spec/test_apps/rails-3.0/script/rails +6 -0
  163. data/spec/test_apps/rails-3.0/spec/all_spec.rb +5 -0
  164. data/spec/test_apps/rails-3.0/spec/spec_helper.rb +78 -0
  165. data/spec/test_apps/rails-3.0/test/performance/browsing_test.rb +9 -0
  166. data/spec/test_apps/rails-3.0/test/test_helper.rb +13 -0
  167. data/spec/test_apps/rails-3.0/vendor/plugins/.gitkeep +0 -0
  168. data/tasks/cover_me.rake +11 -0
  169. data/test_app/spec/views/home.html.erb_spec.rb +15 -0
  170. metadata +261 -0
@@ -0,0 +1,191 @@
1
+ (function() {
2
+ // Technique from Juriy Zaytsev
3
+ // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
4
+ function isEventSupported(eventName) {
5
+ var el = document.createElement('div');
6
+ eventName = 'on' + eventName;
7
+ var isSupported = (eventName in el);
8
+ if (!isSupported) {
9
+ el.setAttribute(eventName, 'return;');
10
+ isSupported = typeof el[eventName] == 'function';
11
+ }
12
+ el = null;
13
+ return isSupported;
14
+ }
15
+
16
+ function isForm(element) {
17
+ return Object.isElement(element) && element.nodeName.toUpperCase() == 'FORM'
18
+ }
19
+
20
+ function isInput(element) {
21
+ if (Object.isElement(element)) {
22
+ var name = element.nodeName.toUpperCase()
23
+ return name == 'INPUT' || name == 'SELECT' || name == 'TEXTAREA'
24
+ }
25
+ else return false
26
+ }
27
+
28
+ var submitBubbles = isEventSupported('submit'),
29
+ changeBubbles = isEventSupported('change')
30
+
31
+ if (!submitBubbles || !changeBubbles) {
32
+ // augment the Event.Handler class to observe custom events when needed
33
+ Event.Handler.prototype.initialize = Event.Handler.prototype.initialize.wrap(
34
+ function(init, element, eventName, selector, callback) {
35
+ init(element, eventName, selector, callback)
36
+ // is the handler being attached to an element that doesn't support this event?
37
+ if ( (!submitBubbles && this.eventName == 'submit' && !isForm(this.element)) ||
38
+ (!changeBubbles && this.eventName == 'change' && !isInput(this.element)) ) {
39
+ // "submit" => "emulated:submit"
40
+ this.eventName = 'emulated:' + this.eventName
41
+ }
42
+ }
43
+ )
44
+ }
45
+
46
+ if (!submitBubbles) {
47
+ // discover forms on the page by observing focus events which always bubble
48
+ document.on('focusin', 'form', function(focusEvent, form) {
49
+ // special handler for the real "submit" event (one-time operation)
50
+ if (!form.retrieve('emulated:submit')) {
51
+ form.on('submit', function(submitEvent) {
52
+ var emulated = form.fire('emulated:submit', submitEvent, true)
53
+ // if custom event received preventDefault, cancel the real one too
54
+ if (emulated.returnValue === false) submitEvent.preventDefault()
55
+ })
56
+ form.store('emulated:submit', true)
57
+ }
58
+ })
59
+ }
60
+
61
+ if (!changeBubbles) {
62
+ // discover form inputs on the page
63
+ document.on('focusin', 'input, select, texarea', function(focusEvent, input) {
64
+ // special handler for real "change" events
65
+ if (!input.retrieve('emulated:change')) {
66
+ input.on('change', function(changeEvent) {
67
+ input.fire('emulated:change', changeEvent, true)
68
+ })
69
+ input.store('emulated:change', true)
70
+ }
71
+ })
72
+ }
73
+
74
+ function handleRemote(element) {
75
+ var method, url, params;
76
+
77
+ var event = element.fire("ajax:before");
78
+ if (event.stopped) return false;
79
+
80
+ if (element.tagName.toLowerCase() === 'form') {
81
+ method = element.readAttribute('method') || 'post';
82
+ url = element.readAttribute('action');
83
+ params = element.serialize();
84
+ } else {
85
+ method = element.readAttribute('data-method') || 'get';
86
+ url = element.readAttribute('href');
87
+ params = {};
88
+ }
89
+
90
+ new Ajax.Request(url, {
91
+ method: method,
92
+ parameters: params,
93
+ evalScripts: true,
94
+
95
+ onComplete: function(request) { element.fire("ajax:complete", request); },
96
+ onSuccess: function(request) { element.fire("ajax:success", request); },
97
+ onFailure: function(request) { element.fire("ajax:failure", request); }
98
+ });
99
+
100
+ element.fire("ajax:after");
101
+ }
102
+
103
+ function handleMethod(element) {
104
+ var method = element.readAttribute('data-method'),
105
+ url = element.readAttribute('href'),
106
+ csrf_param = $$('meta[name=csrf-param]')[0],
107
+ csrf_token = $$('meta[name=csrf-token]')[0];
108
+
109
+ var form = new Element('form', { method: "POST", action: url, style: "display: none;" });
110
+ element.parentNode.insert(form);
111
+
112
+ if (method !== 'post') {
113
+ var field = new Element('input', { type: 'hidden', name: '_method', value: method });
114
+ form.insert(field);
115
+ }
116
+
117
+ if (csrf_param) {
118
+ var param = csrf_param.readAttribute('content'),
119
+ token = csrf_token.readAttribute('content'),
120
+ field = new Element('input', { type: 'hidden', name: param, value: token });
121
+ form.insert(field);
122
+ }
123
+
124
+ form.submit();
125
+ }
126
+
127
+
128
+ document.on("click", "*[data-confirm]", function(event, element) {
129
+ var message = element.readAttribute('data-confirm');
130
+ if (!confirm(message)) event.stop();
131
+ });
132
+
133
+ document.on("click", "a[data-remote]", function(event, element) {
134
+ if (event.stopped) return;
135
+ handleRemote(element);
136
+ event.stop();
137
+ });
138
+
139
+ document.on("click", "a[data-method]", function(event, element) {
140
+ if (event.stopped) return;
141
+ handleMethod(element);
142
+ event.stop();
143
+ });
144
+
145
+ document.on("submit", function(event) {
146
+ var element = event.findElement(),
147
+ message = element.readAttribute('data-confirm');
148
+ if (message && !confirm(message)) {
149
+ event.stop();
150
+ return false;
151
+ }
152
+
153
+ var inputs = element.select("input[type=submit][data-disable-with]");
154
+ inputs.each(function(input) {
155
+ input.disabled = true;
156
+ input.writeAttribute('data-original-value', input.value);
157
+ input.value = input.readAttribute('data-disable-with');
158
+ });
159
+
160
+ var element = event.findElement("form[data-remote]");
161
+ if (element) {
162
+ handleRemote(element);
163
+ event.stop();
164
+ }
165
+ });
166
+
167
+ document.on("ajax:after", "form", function(event, element) {
168
+ var inputs = element.select("input[type=submit][disabled=true][data-disable-with]");
169
+ inputs.each(function(input) {
170
+ input.value = input.readAttribute('data-original-value');
171
+ input.removeAttribute('data-original-value');
172
+ input.disabled = false;
173
+ });
174
+ });
175
+
176
+ Ajax.Responders.register({
177
+ onCreate: function(request) {
178
+ var csrf_meta_tag = $$('meta[name=csrf-token]')[0];
179
+
180
+ if (csrf_meta_tag) {
181
+ var header = 'X-CSRF-Token',
182
+ token = csrf_meta_tag.readAttribute('content');
183
+
184
+ if (!request.options.requestHeaders) {
185
+ request.options.requestHeaders = {};
186
+ }
187
+ request.options.requestHeaders[header] = token;
188
+ }
189
+ }
190
+ });
191
+ })();
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-Agent: *
5
+ # Disallow: /
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ Dir[Rails.root.join('../spec/**/*.rb')].each do |f|
4
+ require f
5
+ end
@@ -0,0 +1,78 @@
1
+ #require File.expand_path('../boot', __FILE__)
2
+
3
+ ENV["RAILS_ENV"] ||= 'test'
4
+
5
+ rvm_lib_path = "#{`echo $rvm_path`.strip}/lib"
6
+ $LOAD_PATH.unshift(rvm_lib_path) unless $LOAD_PATH.include?(rvm_lib_path)
7
+ require 'rvm'
8
+ RVM.use("1.9.2")
9
+ RVM.gemset_use! "cloudfujigem-30xtest"
10
+ RVM.run "gem install bundler --no-ri --no-rdoc && bundle"
11
+
12
+
13
+ require File.expand_path("../../config/environment", __FILE__)
14
+ require 'rspec/rails'
15
+
16
+ # Requires supporting ruby files with custom matchers and macros, etc,
17
+ # in spec/support/ and its subdirectories.
18
+
19
+ Dir[Rails.root.join("../../spec/support/**/*.rb")].each {|f| require f}
20
+
21
+ require "action_controller/railtie"
22
+ require "action_mailer/railtie"
23
+ require "active_resource/railtie"
24
+
25
+ # Add this to load Capybara integration:
26
+ require 'capybara/rspec'
27
+ require 'capybara/rails'
28
+
29
+ # If you have a Gemfile, require the gems listed there, including any gems
30
+ # you've limited to :test, :development, or :production.
31
+ Bundler.require(:default, Rails.env) if defined?(Bundler)
32
+
33
+ module TestApp
34
+ class Application < Rails::Application
35
+ # Settings in config/environments/* take precedence over those specified here.
36
+ # Application configuration should go into files in config/initializers
37
+ # -- all .rb files in that directory are automatically loaded.
38
+
39
+ # Custom directories with classes and modules you want to be autoloadable.
40
+ # config.autoload_paths += %W(#{config.root}/extras)
41
+
42
+ # Only load the plugins named here, in the order given (default is alphabetical).
43
+ # :all can be used as a placeholder for all plugins not explicitly named.
44
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
45
+
46
+ # Activate observers that should always be running.
47
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
48
+
49
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
50
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
51
+ # config.time_zone = 'Central Time (US & Canada)'
52
+
53
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
54
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
55
+ # config.i18n.default_locale = :de
56
+
57
+ # JavaScript files you want as :defaults (application.js is always included).
58
+ # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
59
+
60
+ # Configure the default encoding used in templates for Ruby 1.9.
61
+ config.encoding = "utf-8"
62
+
63
+ # Configure sensitive parameters which will be filtered from the log file.
64
+ config.filter_parameters += [:password]
65
+ end
66
+ end
67
+
68
+
69
+ def preserve_envs(*keys, &block)
70
+ cache = {}
71
+ keys.each { |key| cache[key] = ENV[key] }
72
+
73
+ begin
74
+ yield
75
+ ensure
76
+ keys.each { |key| ENV[key] = cache[key] }
77
+ end
78
+ end
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+ require 'rails/performance_test_help'
3
+
4
+ # Profiling results for each test method are written to tmp/performance.
5
+ class BrowsingTest < ActionDispatch::PerformanceTest
6
+ def test_homepage
7
+ get '/'
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+ require File.expand_path('../../config/environment', __FILE__)
3
+ require 'rails/test_help'
4
+
5
+ class ActiveSupport::TestCase
6
+ # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
7
+ #
8
+ # Note: You'll currently still have to declare fixtures explicitly in integration tests
9
+ # -- they do not yet inherit this setting
10
+ fixtures :all
11
+
12
+ # Add more helper methods to be used by all tests here...
13
+ end
File without changes
@@ -0,0 +1,11 @@
1
+ require 'cover_me'
2
+
3
+ namespace :cover_me do
4
+ desc "Generate coverage report after running specs"
5
+ task :report do
6
+ puts "Reporting!"
7
+ CoverMe.config.formatter = CoverMe::EmmaFormatter
8
+ CoverMe.config.at_exit = Proc.new {}
9
+ CoverMe.complete!
10
+ end
11
+ end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ describe "static/home" do
4
+ it "should have claimed = false in the source when unclaimed" do
5
+ render
6
+
7
+ rendered.should have_tag("script", :text => "")
8
+ end
9
+
10
+ it "should have claimed = true in the source when unclaimed" do
11
+ render
12
+
13
+ rendered.should contain("var _cloudfuji_claimed = true;")
14
+ end
15
+ end
metadata ADDED
@@ -0,0 +1,261 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cloudfuji
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.37
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Sean Grove
9
+ - Kev Zettler
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2012-04-15 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rest-client
17
+ requirement: &8129800 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: 1.6.1
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: *8129800
26
+ - !ruby/object:Gem::Dependency
27
+ name: json
28
+ requirement: &8129300 !ruby/object:Gem::Requirement
29
+ none: false
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: 1.4.6
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: *8129300
37
+ - !ruby/object:Gem::Dependency
38
+ name: highline
39
+ requirement: &8128840 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: 1.6.1
45
+ type: :runtime
46
+ prerelease: false
47
+ version_requirements: *8128840
48
+ - !ruby/object:Gem::Dependency
49
+ name: orm_adapter
50
+ requirement: &8128320 !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ~>
54
+ - !ruby/object:Gem::Version
55
+ version: 0.0.3
56
+ type: :runtime
57
+ prerelease: false
58
+ version_requirements: *8128320
59
+ description: A module for integrating the Cloudfuji platform into a rails app
60
+ email:
61
+ - support@cloudfuji.com
62
+ - s@cloudfuji.com
63
+ executables:
64
+ - cloudfuji
65
+ extensions: []
66
+ extra_rdoc_files: []
67
+ files:
68
+ - .gitignore
69
+ - .rspec
70
+ - Gemfile
71
+ - README.md
72
+ - Rakefile
73
+ - app/controllers/cloudfuji/data_controller.rb
74
+ - app/controllers/cloudfuji/envs_controller.rb
75
+ - app/controllers/cloudfuji/mail_controller.rb
76
+ - bin/cloudfuji
77
+ - cloudfuji.gemspec
78
+ - config/routes.rb
79
+ - lib/cloudfuji.rb
80
+ - lib/cloudfuji/action_mailer.rb
81
+ - lib/cloudfuji/app.rb
82
+ - lib/cloudfuji/bar.rb
83
+ - lib/cloudfuji/base.rb
84
+ - lib/cloudfuji/command.rb
85
+ - lib/cloudfuji/config.rb
86
+ - lib/cloudfuji/data.rb
87
+ - lib/cloudfuji/data_helper.rb
88
+ - lib/cloudfuji/dns.rb
89
+ - lib/cloudfuji/engine.rb
90
+ - lib/cloudfuji/envs.rb
91
+ - lib/cloudfuji/envs_helper.rb
92
+ - lib/cloudfuji/event.rb
93
+ - lib/cloudfuji/event_observer.rb
94
+ - lib/cloudfuji/mail_helper.rb
95
+ - lib/cloudfuji/mail_route.rb
96
+ - lib/cloudfuji/middleware.rb
97
+ - lib/cloudfuji/models.rb
98
+ - lib/cloudfuji/notification.rb
99
+ - lib/cloudfuji/orm/active_record.rb
100
+ - lib/cloudfuji/orm/mongoid.rb
101
+ - lib/cloudfuji/platform.rb
102
+ - lib/cloudfuji/schema.rb
103
+ - lib/cloudfuji/smtp.rb
104
+ - lib/cloudfuji/user.rb
105
+ - lib/cloudfuji/user_helper.rb
106
+ - lib/cloudfuji/utils.rb
107
+ - lib/cloudfuji/version.rb
108
+ - lib/generators/active_record/cloudfuji_generator.rb
109
+ - lib/generators/active_record/templates/migration.rb
110
+ - lib/generators/cloudfuji/auth_migration_generator.rb
111
+ - lib/generators/cloudfuji/cloudfuji_generator.rb
112
+ - lib/generators/cloudfuji/hooks_generator.rb
113
+ - lib/generators/cloudfuji/install_generator.rb
114
+ - lib/generators/cloudfuji/mail_routes_generator.rb
115
+ - lib/generators/cloudfuji/orm_helpers.rb
116
+ - lib/generators/cloudfuji/routes_generator.rb
117
+ - lib/generators/mongoid/cloudfuji_generator.rb
118
+ - lib/generators/templates/README
119
+ - lib/generators/templates/cloudfuji.rb
120
+ - lib/hooks.rb
121
+ - lib/rails/routes.rb
122
+ - lib/tasks/cloudfuji.rake
123
+ - spec/app_spec/controllers/envs_controller_spec.rb
124
+ - spec/app_spec/controllers/mail_controller_spec.rb
125
+ - spec/app_spec/integration/app_claim_spec.rb
126
+ - spec/gem_spec/base_spec.rb
127
+ - spec/gem_spec/command_spec.rb
128
+ - spec/gem_spec/config_spec.rb
129
+ - spec/gem_spec/data_spec.rb
130
+ - spec/gem_spec/hooks_spec.rb
131
+ - spec/gem_spec/mail_route_spec.rb
132
+ - spec/gem_spec/platform_spec.rb
133
+ - spec/gem_spec/user_spec.rb
134
+ - spec/spec_helper.rb
135
+ - spec/test_apps/rails-2.3/.gitignore
136
+ - spec/test_apps/rails-2.3/Gemfile
137
+ - spec/test_apps/rails-2.3/README
138
+ - spec/test_apps/rails-2.3/Rakefile
139
+ - spec/test_apps/rails-2.3/app/controllers/application_controller.rb
140
+ - spec/test_apps/rails-2.3/app/helpers/application_helper.rb
141
+ - spec/test_apps/rails-2.3/config/boot.rb
142
+ - spec/test_apps/rails-2.3/config/environment.rb
143
+ - spec/test_apps/rails-2.3/config/environments/development.rb
144
+ - spec/test_apps/rails-2.3/config/environments/production.rb
145
+ - spec/test_apps/rails-2.3/config/environments/test.rb
146
+ - spec/test_apps/rails-2.3/config/initializers/backtrace_silencers.rb
147
+ - spec/test_apps/rails-2.3/config/initializers/cookie_verification_secret.rb
148
+ - spec/test_apps/rails-2.3/config/initializers/inflections.rb
149
+ - spec/test_apps/rails-2.3/config/initializers/mime_types.rb
150
+ - spec/test_apps/rails-2.3/config/initializers/new_rails_defaults.rb
151
+ - spec/test_apps/rails-2.3/config/initializers/session_store.rb
152
+ - spec/test_apps/rails-2.3/config/locales/en.yml
153
+ - spec/test_apps/rails-2.3/config/routes.rb
154
+ - spec/test_apps/rails-2.3/db/seeds.rb
155
+ - spec/test_apps/rails-2.3/doc/README_FOR_APP
156
+ - spec/test_apps/rails-2.3/lib/tasks/rspec.rake
157
+ - spec/test_apps/rails-2.3/public/404.html
158
+ - spec/test_apps/rails-2.3/public/422.html
159
+ - spec/test_apps/rails-2.3/public/500.html
160
+ - spec/test_apps/rails-2.3/public/favicon.ico
161
+ - spec/test_apps/rails-2.3/public/images/rails.png
162
+ - spec/test_apps/rails-2.3/public/javascripts/application.js
163
+ - spec/test_apps/rails-2.3/public/javascripts/controls.js
164
+ - spec/test_apps/rails-2.3/public/javascripts/dragdrop.js
165
+ - spec/test_apps/rails-2.3/public/javascripts/effects.js
166
+ - spec/test_apps/rails-2.3/public/javascripts/prototype.js
167
+ - spec/test_apps/rails-2.3/public/robots.txt
168
+ - spec/test_apps/rails-2.3/script/about
169
+ - spec/test_apps/rails-2.3/script/autospec
170
+ - spec/test_apps/rails-2.3/script/console
171
+ - spec/test_apps/rails-2.3/script/dbconsole
172
+ - spec/test_apps/rails-2.3/script/destroy
173
+ - spec/test_apps/rails-2.3/script/generate
174
+ - spec/test_apps/rails-2.3/script/performance/benchmarker
175
+ - spec/test_apps/rails-2.3/script/performance/profiler
176
+ - spec/test_apps/rails-2.3/script/plugin
177
+ - spec/test_apps/rails-2.3/script/runner
178
+ - spec/test_apps/rails-2.3/script/server
179
+ - spec/test_apps/rails-2.3/script/spec
180
+ - spec/test_apps/rails-2.3/spec/all_spec.rb
181
+ - spec/test_apps/rails-2.3/spec/rcov.opts
182
+ - spec/test_apps/rails-2.3/spec/spec.opts
183
+ - spec/test_apps/rails-2.3/spec/spec_helper.rb
184
+ - spec/test_apps/rails-2.3/test/performance/browsing_test.rb
185
+ - spec/test_apps/rails-2.3/test/test_helper.rb
186
+ - spec/test_apps/rails-3.0/.gitignore
187
+ - spec/test_apps/rails-3.0/.rspec
188
+ - spec/test_apps/rails-3.0/Gemfile
189
+ - spec/test_apps/rails-3.0/README
190
+ - spec/test_apps/rails-3.0/Rakefile
191
+ - spec/test_apps/rails-3.0/app/controllers/application_controller.rb
192
+ - spec/test_apps/rails-3.0/app/controllers/static_controller.rb
193
+ - spec/test_apps/rails-3.0/app/helpers/application_helper.rb
194
+ - spec/test_apps/rails-3.0/app/helpers/static_helper.rb
195
+ - spec/test_apps/rails-3.0/app/views/layouts/application.html.erb
196
+ - spec/test_apps/rails-3.0/app/views/static/home.html.erb
197
+ - spec/test_apps/rails-3.0/config.ru
198
+ - spec/test_apps/rails-3.0/config/application.rb
199
+ - spec/test_apps/rails-3.0/config/boot.rb
200
+ - spec/test_apps/rails-3.0/config/environment.rb
201
+ - spec/test_apps/rails-3.0/config/environments/development.rb
202
+ - spec/test_apps/rails-3.0/config/environments/production.rb
203
+ - spec/test_apps/rails-3.0/config/environments/test.rb
204
+ - spec/test_apps/rails-3.0/config/initializers/backtrace_silencers.rb
205
+ - spec/test_apps/rails-3.0/config/initializers/inflections.rb
206
+ - spec/test_apps/rails-3.0/config/initializers/mime_types.rb
207
+ - spec/test_apps/rails-3.0/config/initializers/secret_token.rb
208
+ - spec/test_apps/rails-3.0/config/initializers/session_store.rb
209
+ - spec/test_apps/rails-3.0/config/locales/en.yml
210
+ - spec/test_apps/rails-3.0/config/routes.rb
211
+ - spec/test_apps/rails-3.0/db/schema.rb
212
+ - spec/test_apps/rails-3.0/db/seeds.rb
213
+ - spec/test_apps/rails-3.0/doc/README_FOR_APP
214
+ - spec/test_apps/rails-3.0/lib/tasks/.gitkeep
215
+ - spec/test_apps/rails-3.0/public/404.html
216
+ - spec/test_apps/rails-3.0/public/422.html
217
+ - spec/test_apps/rails-3.0/public/500.html
218
+ - spec/test_apps/rails-3.0/public/favicon.ico
219
+ - spec/test_apps/rails-3.0/public/images/rails.png
220
+ - spec/test_apps/rails-3.0/public/index.html
221
+ - spec/test_apps/rails-3.0/public/javascripts/application.js
222
+ - spec/test_apps/rails-3.0/public/javascripts/controls.js
223
+ - spec/test_apps/rails-3.0/public/javascripts/dragdrop.js
224
+ - spec/test_apps/rails-3.0/public/javascripts/effects.js
225
+ - spec/test_apps/rails-3.0/public/javascripts/prototype.js
226
+ - spec/test_apps/rails-3.0/public/javascripts/rails.js
227
+ - spec/test_apps/rails-3.0/public/robots.txt
228
+ - spec/test_apps/rails-3.0/public/stylesheets/.gitkeep
229
+ - spec/test_apps/rails-3.0/script/rails
230
+ - spec/test_apps/rails-3.0/spec/all_spec.rb
231
+ - spec/test_apps/rails-3.0/spec/spec_helper.rb
232
+ - spec/test_apps/rails-3.0/test/performance/browsing_test.rb
233
+ - spec/test_apps/rails-3.0/test/test_helper.rb
234
+ - spec/test_apps/rails-3.0/vendor/plugins/.gitkeep
235
+ - tasks/cover_me.rake
236
+ - test_app/spec/views/home.html.erb_spec.rb
237
+ homepage: https://github.com/sgrove/cloudfujigem
238
+ licenses: []
239
+ post_install_message:
240
+ rdoc_options: []
241
+ require_paths:
242
+ - lib
243
+ required_ruby_version: !ruby/object:Gem::Requirement
244
+ none: false
245
+ requirements:
246
+ - - ! '>='
247
+ - !ruby/object:Gem::Version
248
+ version: '0'
249
+ required_rubygems_version: !ruby/object:Gem::Requirement
250
+ none: false
251
+ requirements:
252
+ - - ! '>='
253
+ - !ruby/object:Gem::Version
254
+ version: '0'
255
+ requirements: []
256
+ rubyforge_project: cloudfuji
257
+ rubygems_version: 1.8.10
258
+ signing_key:
259
+ specification_version: 3
260
+ summary: Cloudfuji integration
261
+ test_files: []