osheet 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. data/Gemfile.lock +24 -4
  2. data/examples/basic_with_templates.rb +1 -1
  3. data/examples/formats.rb +1 -1
  4. data/examples/styles.rb +1 -1
  5. data/examples/trivial.rb +1 -1
  6. data/lib/osheet/associations.rb +5 -9
  7. data/lib/osheet/cell.rb +24 -20
  8. data/lib/osheet/column.rb +19 -15
  9. data/lib/osheet/instance.rb +32 -0
  10. data/lib/osheet/railtie.rb +9 -0
  11. data/lib/osheet/row.rb +19 -15
  12. data/lib/osheet/style.rb +13 -8
  13. data/lib/osheet/styled_element.rb +1 -1
  14. data/lib/osheet/template.rb +13 -4
  15. data/lib/osheet/template_handler/rails.rb +44 -0
  16. data/lib/osheet/template_handler/tilt.rb +42 -0
  17. data/lib/osheet/template_handler.rb +2 -0
  18. data/lib/osheet/version.rb +1 -1
  19. data/lib/osheet/workbook.rb +22 -11
  20. data/lib/osheet/workbook_element.rb +10 -14
  21. data/lib/osheet/worksheet.rb +10 -6
  22. data/lib/osheet/worksheet_element.rb +3 -4
  23. data/lib/osheet/xmlss_writer/base.rb +5 -5
  24. data/lib/osheet.rb +16 -1
  25. data/osheet.gemspec +6 -1
  26. data/test/app_helper.rb +66 -0
  27. data/test/cell_test.rb +30 -14
  28. data/test/column_test.rb +24 -8
  29. data/test/helper.rb +4 -3
  30. data/test/mixin_test.rb +1 -2
  31. data/test/mixins.rb +1 -1
  32. data/test/osheet_test.rb +4 -2
  33. data/test/rails/three/.gitignore +4 -0
  34. data/test/rails/three/Gemfile +5 -0
  35. data/test/rails/three/Gemfile.lock +88 -0
  36. data/test/rails/three/app/controllers/application_controller.rb +3 -0
  37. data/test/rails/three/app/controllers/things_controller.rb +10 -0
  38. data/test/rails/three/app/helpers/application_helper.rb +2 -0
  39. data/test/rails/three/app/views/layouts/application.html.erb +14 -0
  40. data/test/rails/three/app/views/things/index.xls.osheet +15 -0
  41. data/test/rails/three/config/application.rb +42 -0
  42. data/test/rails/three/config/boot.rb +13 -0
  43. data/test/rails/three/config/database.yml +22 -0
  44. data/test/rails/three/config/environment.rb +5 -0
  45. data/test/rails/three/config/environments/development.rb +26 -0
  46. data/test/rails/three/config/environments/production.rb +49 -0
  47. data/test/rails/three/config/environments/test.rb +35 -0
  48. data/test/rails/three/config/initializers/app.rb +0 -0
  49. data/test/rails/three/config/initializers/backtrace_silencers.rb +7 -0
  50. data/test/rails/three/config/initializers/inflections.rb +10 -0
  51. data/test/rails/three/config/initializers/mime_types.rb +5 -0
  52. data/test/rails/three/config/initializers/secret_token.rb +7 -0
  53. data/test/rails/three/config/initializers/session_store.rb +8 -0
  54. data/test/rails/three/config/locales/en.yml +5 -0
  55. data/test/rails/three/config/routes.rb +3 -0
  56. data/test/rails/three/config.ru +4 -0
  57. data/test/rails/three/db/seeds.rb +7 -0
  58. data/test/rails/three/doc/README_FOR_APP +2 -0
  59. data/test/rails/three/lib/tasks/.gitkeep +0 -0
  60. data/test/rails/three/script/rails +6 -0
  61. data/test/rails/two/.bundle/config +2 -0
  62. data/test/rails/two/Booting +0 -0
  63. data/test/rails/two/Gemfile +5 -0
  64. data/test/rails/two/Gemfile.lock +45 -0
  65. data/test/rails/two/Rails +0 -0
  66. data/test/rails/two/app/controllers/application_controller.rb +20 -0
  67. data/test/rails/two/app/controllers/things_controller.rb +10 -0
  68. data/test/rails/two/app/helpers/application_helper.rb +3 -0
  69. data/test/rails/two/app/views/things/index.xls.osheet +15 -0
  70. data/test/rails/two/config/boot.rb +128 -0
  71. data/test/rails/two/config/database.yml +22 -0
  72. data/test/rails/two/config/environment.rb +41 -0
  73. data/test/rails/two/config/environments/development.rb +17 -0
  74. data/test/rails/two/config/environments/production.rb +28 -0
  75. data/test/rails/two/config/environments/test.rb +28 -0
  76. data/test/rails/two/config/initializers/app.rb +2 -0
  77. data/test/rails/two/config/initializers/backtrace_silencers.rb +7 -0
  78. data/test/rails/two/config/initializers/cookie_verification_secret.rb +7 -0
  79. data/test/rails/two/config/initializers/inflections.rb +10 -0
  80. data/test/rails/two/config/initializers/mime_types.rb +5 -0
  81. data/test/rails/two/config/initializers/new_rails_defaults.rb +21 -0
  82. data/test/rails/two/config/initializers/session_store.rb +15 -0
  83. data/test/rails/two/config/locales/en.yml +5 -0
  84. data/test/rails/two/config/routes.rb +3 -0
  85. data/test/rails/two/db/development.sqlite3 +0 -0
  86. data/test/rails/two/db/seeds.rb +7 -0
  87. data/test/rails/two/script/about +4 -0
  88. data/test/rails/two/script/console +3 -0
  89. data/test/rails/two/script/dbconsole +3 -0
  90. data/test/rails/two/script/destroy +3 -0
  91. data/test/rails/two/script/generate +3 -0
  92. data/test/rails/two/script/performance/benchmarker +3 -0
  93. data/test/rails/two/script/performance/profiler +3 -0
  94. data/test/rails/two/script/plugin +3 -0
  95. data/test/rails/two/script/runner +3 -0
  96. data/test/rails/two/script/server +3 -0
  97. data/test/rails/two/tmp/pids/server.pid +1 -0
  98. data/test/rails_test.rb +38 -0
  99. data/test/row_test.rb +24 -8
  100. data/test/sinatra/app.rb +16 -0
  101. data/test/sinatra/views/index.osheet +13 -0
  102. data/test/sinatra_test.rb +19 -0
  103. data/test/style_test.rb +19 -3
  104. data/test/template_test.rb +19 -0
  105. data/test/workbook_test.rb +18 -3
  106. data/test/worksheet_test.rb +18 -2
  107. metadata +232 -11
@@ -0,0 +1,35 @@
1
+ Three::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Log error messages when you accidentally call methods on nil.
11
+ config.whiny_nils = true
12
+
13
+ # Show full error reports and disable caching
14
+ config.consider_all_requests_local = true
15
+ config.action_controller.perform_caching = false
16
+
17
+ # Raise exceptions instead of rendering exception templates
18
+ config.action_dispatch.show_exceptions = false
19
+
20
+ # Disable request forgery protection in test environment
21
+ config.action_controller.allow_forgery_protection = false
22
+
23
+ # Tell Action Mailer not to deliver emails to the real world.
24
+ # The :test delivery method accumulates sent emails in the
25
+ # ActionMailer::Base.deliveries array.
26
+ config.action_mailer.delivery_method = :test
27
+
28
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
29
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
30
+ # like if you have constraints or database-specific column types
31
+ # config.active_record.schema_format = :sql
32
+
33
+ # Print deprecation notices to the stderr
34
+ config.active_support.deprecation = :stderr
35
+ end
File without changes
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,10 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Three::Application.config.secret_token = 'f7c41559c25c57eace738a3b9b27af5b737f807f9062cf98922678ed3af5c5664e88efd833c4d13fd62f06f06f444b1ceee3488aafdd5b968dcd6c31ef27ec92'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Three::Application.config.session_store :cookie_store, :key => '_three_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Three::Application.config.session_store :active_record_store
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,3 @@
1
+ Three::Application.routes.draw do
2
+ resources :things
3
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Three::Application
@@ -0,0 +1,7 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
7
+ # Mayor.create(:name => 'Daley', :city => cities.first)
@@ -0,0 +1,2 @@
1
+ Use this README file to introduce your application and point to useful places in the API for learning more.
2
+ Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.
File without changes
@@ -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,2 @@
1
+ ---
2
+ BUNDLE_DISABLE_SHARED_GEMS: "1"
File without changes
@@ -0,0 +1,5 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rails', '2.3.11'
4
+ gem 'sqlite3-ruby', :require => 'sqlite3'
5
+ gem "osheet", :path => "../../.." # -> rails/test/osheet
@@ -0,0 +1,45 @@
1
+ PATH
2
+ remote: ../../..
3
+ specs:
4
+ osheet (0.4.0)
5
+ enumeration (~> 1.1.0)
6
+ xmlss (~> 0.2.0)
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ actionmailer (2.3.11)
12
+ actionpack (= 2.3.11)
13
+ actionpack (2.3.11)
14
+ activesupport (= 2.3.11)
15
+ rack (~> 1.1.0)
16
+ activerecord (2.3.11)
17
+ activesupport (= 2.3.11)
18
+ activeresource (2.3.11)
19
+ activesupport (= 2.3.11)
20
+ activesupport (2.3.11)
21
+ enumeration (1.1.0)
22
+ nokogiri (1.4.4)
23
+ rack (1.1.2)
24
+ rails (2.3.11)
25
+ actionmailer (= 2.3.11)
26
+ actionpack (= 2.3.11)
27
+ activerecord (= 2.3.11)
28
+ activeresource (= 2.3.11)
29
+ activesupport (= 2.3.11)
30
+ rake (>= 0.8.3)
31
+ rake (0.8.7)
32
+ sqlite3 (1.3.3)
33
+ sqlite3-ruby (1.3.3)
34
+ sqlite3 (>= 1.3.3)
35
+ xmlss (0.2.0)
36
+ enumeration (~> 1.1.0)
37
+ nokogiri (~> 1.4.0)
38
+
39
+ PLATFORMS
40
+ ruby
41
+
42
+ DEPENDENCIES
43
+ osheet!
44
+ rails (= 2.3.11)
45
+ sqlite3-ruby
File without changes
@@ -0,0 +1,20 @@
1
+ # Filters added to this controller apply to all controllers in the application.
2
+ # Likewise, all the methods added will be available for all controllers.
3
+
4
+ class ApplicationController < ActionController::Base
5
+ helper :all # include all helpers, all the time
6
+ protect_from_forgery # See ActionController::RequestForgeryProtection for details
7
+
8
+ # Scrub sensitive parameters from your log
9
+ # filter_parameter_logging :password
10
+
11
+ def osheet
12
+ respond_to do |format|
13
+ format.html { render 500 }
14
+ format.xls {
15
+ puts "HERE"
16
+ }
17
+ end
18
+ end
19
+
20
+ end
@@ -0,0 +1,10 @@
1
+ class ThingsController < ApplicationController
2
+
3
+ def index
4
+ @times = 2
5
+ respond_to do |format|
6
+ format.xls { }
7
+ end
8
+ end
9
+
10
+ end
@@ -0,0 +1,3 @@
1
+ # Methods added to this helper will be available to all templates in the application.
2
+ module ApplicationHelper
3
+ end
@@ -0,0 +1,15 @@
1
+ # TODO: make instance vars available
2
+
3
+ title "rails two test"
4
+
5
+ worksheet {
6
+ name 'from rails two'
7
+
8
+ row {
9
+ 1.upto(@times) do |n|
10
+ cell {
11
+ data n
12
+ }
13
+ end
14
+ }
15
+ }
@@ -0,0 +1,128 @@
1
+ require 'rubygems'
2
+
3
+ # Set up gems listed in the Gemfile.
4
+ gemfile = File.expand_path('../../Gemfile', __FILE__)
5
+ begin
6
+ ENV['BUNDLE_GEMFILE'] = gemfile
7
+ require 'bundler'
8
+ Bundler.setup
9
+ rescue Bundler::GemNotFound => e
10
+ STDERR.puts e.message
11
+ STDERR.puts "Try running `bundle install`."
12
+ exit!
13
+ end if File.exist?(gemfile)
14
+
15
+ # Don't change this file!
16
+ # Configure your app in config/environment.rb and config/environments/*.rb
17
+
18
+ RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
19
+
20
+ module Rails
21
+ class << self
22
+ def boot!
23
+ unless booted?
24
+ preinitialize
25
+ pick_boot.run
26
+ end
27
+ end
28
+
29
+ def booted?
30
+ defined? Rails::Initializer
31
+ end
32
+
33
+ def pick_boot
34
+ (vendor_rails? ? VendorBoot : GemBoot).new
35
+ end
36
+
37
+ def vendor_rails?
38
+ File.exist?("#{RAILS_ROOT}/vendor/rails")
39
+ end
40
+
41
+ def preinitialize
42
+ load(preinitializer_path) if File.exist?(preinitializer_path)
43
+ end
44
+
45
+ def preinitializer_path
46
+ "#{RAILS_ROOT}/config/preinitializer.rb"
47
+ end
48
+ end
49
+
50
+ class Boot
51
+ def run
52
+ load_initializer
53
+ Rails::Initializer.run(:set_load_path)
54
+ end
55
+ end
56
+
57
+ class VendorBoot < Boot
58
+ def load_initializer
59
+ require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
60
+ Rails::Initializer.run(:install_gem_spec_stubs)
61
+ Rails::GemDependency.add_frozen_gem_path
62
+ end
63
+ end
64
+
65
+ class GemBoot < Boot
66
+ def load_initializer
67
+ self.class.load_rubygems
68
+ load_rails_gem
69
+ require 'initializer'
70
+ end
71
+
72
+ def load_rails_gem
73
+ if version = self.class.gem_version
74
+ gem 'rails', version
75
+ else
76
+ gem 'rails'
77
+ end
78
+ rescue Gem::LoadError => load_error
79
+ if load_error.message =~ /Could not find RubyGem rails/
80
+ STDERR.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
81
+ exit 1
82
+ else
83
+ raise
84
+ end
85
+ end
86
+
87
+ class << self
88
+ def rubygems_version
89
+ Gem::RubyGemsVersion rescue nil
90
+ end
91
+
92
+ def gem_version
93
+ if defined? RAILS_GEM_VERSION
94
+ RAILS_GEM_VERSION
95
+ elsif ENV.include?('RAILS_GEM_VERSION')
96
+ ENV['RAILS_GEM_VERSION']
97
+ else
98
+ parse_gem_version(read_environment_rb)
99
+ end
100
+ end
101
+
102
+ def load_rubygems
103
+ min_version = '1.3.2'
104
+ require 'rubygems'
105
+ unless rubygems_version >= min_version
106
+ $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
107
+ exit 1
108
+ end
109
+
110
+ rescue LoadError
111
+ $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
112
+ exit 1
113
+ end
114
+
115
+ def parse_gem_version(text)
116
+ $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
117
+ end
118
+
119
+ private
120
+ def read_environment_rb
121
+ File.read("#{RAILS_ROOT}/config/environment.rb")
122
+ end
123
+ end
124
+ end
125
+ end
126
+
127
+ # All that for this:
128
+ Rails.boot!
@@ -0,0 +1,22 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3-ruby (not necessary on OS X Leopard)
3
+ development:
4
+ adapter: sqlite3
5
+ database: db/development.sqlite3
6
+ pool: 5
7
+ timeout: 5000
8
+
9
+ # Warning: The database defined as "test" will be erased and
10
+ # re-generated from your development database when you run "rake".
11
+ # Do not set this db to the same as development or production.
12
+ test:
13
+ adapter: sqlite3
14
+ database: db/test.sqlite3
15
+ pool: 5
16
+ timeout: 5000
17
+
18
+ production:
19
+ adapter: sqlite3
20
+ database: db/production.sqlite3
21
+ pool: 5
22
+ timeout: 5000
@@ -0,0 +1,41 @@
1
+ # Be sure to restart your server when you modify this file
2
+
3
+ # Specifies gem version of Rails to use when vendor/rails is not present
4
+ RAILS_GEM_VERSION = '2.3.11' unless defined? RAILS_GEM_VERSION
5
+
6
+ # Bootstrap the Rails environment, frameworks, and default configuration
7
+ require File.join(File.dirname(__FILE__), 'boot')
8
+
9
+ Rails::Initializer.run do |config|
10
+ # Settings in config/environments/* take precedence over those specified here.
11
+ # Application configuration should go into files in config/initializers
12
+ # -- all .rb files in that directory are automatically loaded.
13
+
14
+ # Add additional load paths for your own custom dirs
15
+ # config.autoload_paths += %W( #{RAILS_ROOT}/extras )
16
+
17
+ # Specify gems that this application depends on and have them installed with rake gems:install
18
+ # config.gem "bj"
19
+ # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
20
+ # config.gem "sqlite3-ruby", :lib => "sqlite3"
21
+ # config.gem "aws-s3", :lib => "aws/s3"
22
+
23
+ # Only load the plugins named here, in the order given (default is alphabetical).
24
+ # :all can be used as a placeholder for all plugins not explicitly named
25
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
26
+
27
+ # Skip frameworks you're not going to use. To use Rails without a database,
28
+ # you must remove the Active Record framework.
29
+ # config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
30
+
31
+ # Activate observers that should always be running
32
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
33
+
34
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
35
+ # Run "rake -D time" for a list of tasks for finding time zone names.
36
+ config.time_zone = 'UTC'
37
+
38
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
39
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
40
+ # config.i18n.default_locale = :de
41
+ end
@@ -0,0 +1,17 @@
1
+ # Settings specified here will take precedence over those in config/environment.rb
2
+
3
+ # In the development environment your application's code is reloaded on
4
+ # every request. This slows down response time but is perfect for development
5
+ # since you don't have to restart the webserver when you make code changes.
6
+ config.cache_classes = false
7
+
8
+ # Log error messages when you accidentally call methods on nil.
9
+ config.whiny_nils = true
10
+
11
+ # Show full error reports and disable caching
12
+ config.action_controller.consider_all_requests_local = true
13
+ config.action_view.debug_rjs = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send
17
+ config.action_mailer.raise_delivery_errors = false
@@ -0,0 +1,28 @@
1
+ # Settings specified here will take precedence over those in config/environment.rb
2
+
3
+ # The production environment is meant for finished, "live" apps.
4
+ # Code is not reloaded between requests
5
+ config.cache_classes = true
6
+
7
+ # Full error reports are disabled and caching is turned on
8
+ config.action_controller.consider_all_requests_local = false
9
+ config.action_controller.perform_caching = true
10
+ config.action_view.cache_template_loading = true
11
+
12
+ # See everything in the log (default is :info)
13
+ # config.log_level = :debug
14
+
15
+ # Use a different logger for distributed setups
16
+ # config.logger = SyslogLogger.new
17
+
18
+ # Use a different cache store in production
19
+ # config.cache_store = :mem_cache_store
20
+
21
+ # Enable serving of images, stylesheets, and javascripts from an asset server
22
+ # config.action_controller.asset_host = "http://assets.example.com"
23
+
24
+ # Disable delivery errors, bad email addresses will be ignored
25
+ # config.action_mailer.raise_delivery_errors = false
26
+
27
+ # Enable threaded mode
28
+ # config.threadsafe!
@@ -0,0 +1,28 @@
1
+ # Settings specified here will take precedence over those in config/environment.rb
2
+
3
+ # The test environment is used exclusively to run your application's
4
+ # test suite. You never need to work with it otherwise. Remember that
5
+ # your test database is "scratch space" for the test suite and is wiped
6
+ # and recreated between test runs. Don't rely on the data there!
7
+ config.cache_classes = true
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.action_controller.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+ config.action_view.cache_template_loading = true
16
+
17
+ # Disable request forgery protection in test environment
18
+ config.action_controller.allow_forgery_protection = false
19
+
20
+ # Tell Action Mailer not to deliver emails to the real world.
21
+ # The :test delivery method accumulates sent emails in the
22
+ # ActionMailer::Base.deliveries array.
23
+ config.action_mailer.delivery_method = :test
24
+
25
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
26
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
27
+ # like if you have constraints or database-specific column types
28
+ # config.active_record.schema_format = :sql
@@ -0,0 +1,2 @@
1
+ require 'osheet'
2
+ ::Osheet.register
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying do debug a problem that might steem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ ActionController::Base.cookie_verifier_secret = '333fe7d3ef3795beaf5fc58fc7fa2661939bfceab67b50dca239f6c97761788023f6aabdb466307d8d7c521af03d9f53aac1ce70888434c72302a88df857400d';
@@ -0,0 +1,10 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,21 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # These settings change the behavior of Rails 2 apps and will be defaults
4
+ # for Rails 3. You can remove this initializer when Rails 3 is released.
5
+
6
+ if defined?(ActiveRecord)
7
+ # Include Active Record class name as root for JSON serialized output.
8
+ ActiveRecord::Base.include_root_in_json = true
9
+
10
+ # Store the full class name (including module namespace) in STI type column.
11
+ ActiveRecord::Base.store_full_sti_class = true
12
+ end
13
+
14
+ ActionController::Routing.generate_best_match = false
15
+
16
+ # Use ISO 8601 format for JSON serialized times and dates.
17
+ ActiveSupport.use_standard_json_time_format = true
18
+
19
+ # Don't escape HTML entities in JSON, leave that for the #json_escape helper.
20
+ # if you're including raw json in an HTML page.
21
+ ActiveSupport.escape_html_entities_in_json = false
@@ -0,0 +1,15 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying cookie session data integrity.
4
+ # If you change this key, all old sessions will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ ActionController::Base.session = {
8
+ :key => '_two_session',
9
+ :secret => '4bd519bd5597758c71c72236b1a977acdf48b308fbcb21df409357967e902e9972809c4b8efaa3726758f3e8a9f2a0e7a90f69fb726f2e5e4d7c6bc524bec00a'
10
+ }
11
+
12
+ # Use the database for sessions instead of the cookie-based default,
13
+ # which shouldn't be used to store highly confidential information
14
+ # (create the session table with "rake db:sessions:create")
15
+ # ActionController::Base.session_store = :active_record_store
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,3 @@
1
+ ActionController::Routing::Routes.draw do |map|
2
+ map.resources :things
3
+ end
@@ -0,0 +1,7 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
7
+ # Major.create(:name => 'Daley', :city => cities.first)
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ $LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
4
+ require 'commands/about'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/console'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/dbconsole'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/destroy'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/generate'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../../config/boot', __FILE__)
3
+ require 'commands/performance/benchmarker'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../../config/boot', __FILE__)
3
+ require 'commands/performance/profiler'