opal-rails 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 (58) hide show
  1. data/.gitignore +7 -3
  2. data/Gemfile +22 -0
  3. data/Rakefile +39 -2
  4. data/app/assets/images/opal-rails/.gitkeep +0 -0
  5. data/app/assets/javascripts/opal-rails/.gitkeep +0 -0
  6. data/app/assets/stylesheets/opal-rails/.gitkeep +0 -0
  7. data/app/controllers/.gitkeep +0 -0
  8. data/app/controllers/opal_spec_controller.rb +8 -0
  9. data/app/helpers/.gitkeep +0 -0
  10. data/app/mailers/.gitkeep +0 -0
  11. data/app/models/.gitkeep +0 -0
  12. data/app/views/.gitkeep +0 -0
  13. data/app/views/layouts/opal_spec.html.erb +17 -0
  14. data/config/routes.rb +3 -0
  15. data/lib/assets/javascripts/opal-spec-runner.js.rb +5 -0
  16. data/lib/assets/javascripts/opal-spec.js +819 -0
  17. data/lib/opal/rails/template_handler.rb +0 -1
  18. data/lib/opal/rails/version.rb +1 -1
  19. data/lib/tasks/opal-rails_tasks.rake +4 -0
  20. data/opal-rails.gemspec +3 -1
  21. data/script/rails +8 -0
  22. data/spec/integration/opal_spec.rb +9 -0
  23. data/spec/opal/rails/processor_spec.rb +4 -0
  24. data/spec/spec_helper.rb +20 -0
  25. data/test_app/.gitignore +15 -0
  26. data/test_app/Rakefile +7 -0
  27. data/test_app/app/assets/images/rails.png +0 -0
  28. data/test_app/app/assets/javascripts/application.js +15 -0
  29. data/test_app/app/assets/javascripts/spec/example_spec.js_spec.rb +5 -0
  30. data/test_app/app/assets/javascripts/spec.js +1 -0
  31. data/test_app/app/assets/stylesheets/application.css +13 -0
  32. data/test_app/app/controllers/application_controller.rb +3 -0
  33. data/test_app/app/views/layouts/application.html.erb +14 -0
  34. data/test_app/config/application.rb +68 -0
  35. data/test_app/config/boot.rb +6 -0
  36. data/test_app/config/environment.rb +5 -0
  37. data/test_app/config/environments/development.rb +31 -0
  38. data/test_app/config/environments/production.rb +64 -0
  39. data/test_app/config/environments/test.rb +35 -0
  40. data/test_app/config/initializers/backtrace_silencers.rb +7 -0
  41. data/test_app/config/initializers/inflections.rb +15 -0
  42. data/test_app/config/initializers/mime_types.rb +5 -0
  43. data/test_app/config/initializers/secret_token.rb +7 -0
  44. data/test_app/config/initializers/session_store.rb +8 -0
  45. data/test_app/config/initializers/wrap_parameters.rb +10 -0
  46. data/test_app/config/locales/en.yml +5 -0
  47. data/test_app/config/routes.rb +58 -0
  48. data/test_app/config.ru +4 -0
  49. data/test_app/lib/assets/.gitkeep +0 -0
  50. data/test_app/lib/tasks/.gitkeep +0 -0
  51. data/test_app/log/.gitkeep +0 -0
  52. data/test_app/public/404.html +26 -0
  53. data/test_app/public/422.html +26 -0
  54. data/test_app/public/500.html +25 -0
  55. data/test_app/public/favicon.ico +0 -0
  56. data/test_app/public/robots.txt +5 -0
  57. data/test_app/script/rails +6 -0
  58. metadata +80 -13
data/.gitignore CHANGED
@@ -1,4 +1,8 @@
1
- *.gem
2
- .bundle
1
+ /.bundle/
2
+ /log/*.log
3
+ /pkg/
4
+ /test_app/db/*.sqlite3
5
+ /test_app/log/*.log
6
+ /test_app/tmp/
7
+ /test_app/.sass-cache
3
8
  Gemfile.lock
4
- pkg/*
data/Gemfile CHANGED
@@ -2,3 +2,25 @@ source :rubygems
2
2
 
3
3
  # Dependencies specified in opal-rails.gemspec
4
4
  gemspec
5
+
6
+
7
+ # Test app stuff
8
+
9
+ gem 'rails', '3.2.6'
10
+
11
+ # Gems used only for assets and not required
12
+ # in production environments by default.
13
+ group :assets do
14
+ gem 'sass-rails', '~> 3.2.3'
15
+ gem 'coffee-rails', '~> 3.2.1'
16
+
17
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
18
+ # gem 'therubyracer', :platforms => :ruby
19
+ gem 'uglifier', '>= 1.0.3'
20
+ end
21
+
22
+ gem 'jquery-rails'
23
+
24
+ group :test do
25
+ gem 'capybara'
26
+ end
data/Rakefile CHANGED
@@ -1,5 +1,42 @@
1
- require 'bundler/gem_tasks'
1
+ #!/usr/bin/env rake
2
+
3
+
4
+ # BUNDLER
5
+
6
+ begin
7
+ require 'bundler/setup'
8
+ # require 'bundler/gem_tasks'
9
+ rescue LoadError
10
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
11
+ end
12
+
13
+ Bundler::GemHelper.install_tasks
14
+
15
+
16
+
17
+
18
+ # DOCS
19
+
20
+ begin
21
+ require 'rdoc/task'
22
+ rescue LoadError
23
+ require 'rdoc/rdoc'
24
+ require 'rake/rdoctask'
25
+ RDoc::Task = Rake::RDocTask
26
+ end
27
+
28
+ RDoc::Task.new(:doc) do |rdoc|
29
+ rdoc.rdoc_dir = 'rdoc'
30
+ rdoc.title = 'Opal::Rails'
31
+ rdoc.options << '--line-numbers'
32
+ rdoc.rdoc_files.include('README.md')
33
+ rdoc.rdoc_files.include('lib/**/*.rb')
34
+ end
35
+
36
+
37
+
38
+
39
+ # TEST
2
40
 
3
41
  require 'rspec/core/rake_task'
4
42
  RSpec::Core::RakeTask.new :default
5
-
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,8 @@
1
+ class OpalSpecController < ActionController::Base
2
+ def run
3
+ files = (params[:files] || 'spec').split(':')
4
+ render :nothing => true, :layout => 'opal_spec', :locals => {
5
+ :spec_files => files
6
+ }
7
+ end
8
+ end
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,17 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>Opal Spec Runner</title>
6
+ <%= javascript_include_tag 'opal' %>
7
+ <%= javascript_include_tag 'opal-spec' %>
8
+ <%= javascript_include_tag *spec_files %>
9
+ <style>
10
+ body { font-family: sans-serif; }
11
+ </style>
12
+ </head>
13
+ <body>
14
+ <b>Running: <%= spec_files.to_sentence %></b>
15
+ <%= javascript_include_tag 'opal-spec-runner' %>
16
+ </body>
17
+ </html>
data/config/routes.rb ADDED
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+ match '/opal_spec' => 'opal_spec#run' if Rails.env.development?
3
+ end
@@ -0,0 +1,5 @@
1
+ # = require opal-dom
2
+
3
+ Document.ready? do
4
+ Spec::Runner.new.run
5
+ end