datum 0.9.2 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +25 -1
  3. data/README.md +2 -130
  4. data/Rakefile +3 -9
  5. data/lib/datum/container.rb +64 -0
  6. data/lib/datum/datum.rb +51 -0
  7. data/lib/datum/helpers.rb +58 -0
  8. data/lib/datum/version.rb +8 -27
  9. data/lib/datum.rb +21 -93
  10. data/lib/plan9/structures.rb +71 -0
  11. data/lib/support/scenario.rb +14 -0
  12. data/lib/support/test.rb +27 -0
  13. metadata +29 -124
  14. data/lib/datum/context.rb +0 -55
  15. data/lib/datum/db_tasks.rb +0 -108
  16. data/lib/datum/driver_helper.rb +0 -109
  17. data/lib/datum/enable_notification.rb +0 -27
  18. data/lib/datum/enable_task.rb +0 -148
  19. data/lib/datum/railtie.rb +0 -14
  20. data/lib/datum/verification_task.rb +0 -154
  21. data/lib/datum/verify_helpers/20120726105125_create_datum_versions.rb +0 -18
  22. data/lib/datum/verify_helpers/datum_version.rb +0 -8
  23. data/lib/datum/verify_helpers/datum_version_test.rb +0 -11
  24. data/lib/generators/datum/USAGE +0 -0
  25. data/lib/generators/datum/datum_generator.rb +0 -104
  26. data/lib/generators/datum/templates/datum_migration.rb +0 -21
  27. data/lib/generators/datum/templates/datum_model.rb +0 -6
  28. data/lib/tasks/datum.rake +0 -49
  29. data/test/datum_test.rb +0 -17
  30. data/test/dummy/README.rdoc +0 -261
  31. data/test/dummy/Rakefile +0 -7
  32. data/test/dummy/app/assets/javascripts/application.js +0 -15
  33. data/test/dummy/app/assets/stylesheets/application.css +0 -13
  34. data/test/dummy/app/controllers/application_controller.rb +0 -3
  35. data/test/dummy/app/helpers/application_helper.rb +0 -2
  36. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  37. data/test/dummy/config/application.rb +0 -61
  38. data/test/dummy/config/boot.rb +0 -10
  39. data/test/dummy/config/database.example +0 -42
  40. data/test/dummy/config/database.sqlite +0 -25
  41. data/test/dummy/config/database.yml +0 -55
  42. data/test/dummy/config/environment.rb +0 -5
  43. data/test/dummy/config/environments/development.rb +0 -37
  44. data/test/dummy/config/environments/production.rb +0 -67
  45. data/test/dummy/config/environments/test.rb +0 -37
  46. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  47. data/test/dummy/config/initializers/inflections.rb +0 -15
  48. data/test/dummy/config/initializers/mime_types.rb +0 -5
  49. data/test/dummy/config/initializers/secret_token.rb +0 -7
  50. data/test/dummy/config/initializers/session_store.rb +0 -8
  51. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  52. data/test/dummy/config/locales/en.yml +0 -5
  53. data/test/dummy/config/routes.rb +0 -58
  54. data/test/dummy/config.ru +0 -4
  55. data/test/dummy/db/schema.rb +0 -16
  56. data/test/dummy/public/404.html +0 -26
  57. data/test/dummy/public/422.html +0 -26
  58. data/test/dummy/public/500.html +0 -25
  59. data/test/dummy/public/favicon.ico +0 -0
  60. data/test/dummy/script/rails +0 -6
  61. data/test/dummy/test/lib/datum/utils/application.rb +0 -57
  62. data/test/dummy/test/lib/datum/utils/database.yml +0 -42
  63. data/test/dummy/test/test_helper.rb +0 -13
  64. data/test/dummy/test/unit/enable_task_test.rb +0 -70
  65. data/test/test_helper.rb +0 -10
@@ -1,57 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- require 'rails/all'
4
-
5
- Bundler.require
6
- require "datum"
7
-
8
- module Dummy
9
- class Application < Rails::Application
10
-
11
- # Settings in config/environments/* take precedence over those specified here.
12
- # Application configuration should go into files in config/initializers
13
- # -- all .rb files in that directory are automatically loaded.
14
-
15
- # Custom directories with classes and modules you want to be autoloadable.
16
- # config.autoload_paths += %W(#{config.root}/extras)
17
-
18
- # Only load the plugins named here, in the order given (default is alphabetical).
19
- # :all can be used as a placeholder for all plugins not explicitly named.
20
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
21
-
22
- # Activate observers that should always be running.
23
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
24
-
25
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
26
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
27
- # config.time_zone = 'Central Time (US & Canada)'
28
-
29
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
30
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
31
- # config.i18n.default_locale = :de
32
-
33
- # Configure the default encoding used in templates for Ruby 1.9.
34
- config.encoding = "utf-8"
35
-
36
- # Configure sensitive parameters which will be filtered from the log file.
37
- config.filter_parameters += [:password]
38
-
39
- # Use SQL instead of Active Record's schema dumper when creating the database.
40
- # This is necessary if your schema can't be completely dumped by the schema dumper,
41
- # like if you have constraints or database-specific column types
42
- # config.active_record.schema_format = :sql
43
-
44
- # Enforce whitelist mode for mass assignment.
45
- # This will create an empty whitelist of attributes available for mass-assignment for all models
46
- # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
47
- # parameters by using an attr_accessible or attr_protected declaration.
48
- # config.active_record.whitelist_attributes = true
49
-
50
- # Enable the asset pipeline
51
- config.assets.enabled = true
52
-
53
- # Version of your assets, change this if you want to expire all your assets
54
- config.assets.version = '1.0'
55
- end
56
- end
57
-
@@ -1,42 +0,0 @@
1
- # MySQL. Versions 4.1 and 5.0 are recommended.
2
- #
3
- # Install the MYSQL driver
4
- # gem install mysql2
5
- #
6
- # Ensure the MySQL gem is defined in your Gemfile
7
- # gem 'mysql2'
8
- #
9
- # And be sure to use new-style password hashing:
10
- # http://dev.mysql.com/doc/refman/5.0/en/old-client.html
11
- development:
12
- adapter: mysql2
13
- encoding: utf8
14
- reconnect: false
15
- database: datum_dummy_development
16
- pool: 5
17
- username: root
18
- password:
19
- socket: /tmp/mysql.sock
20
-
21
- # Warning: The database defined as "test" will be erased and
22
- # re-generated from your development database when you run "rake".
23
- # Do not set this db to the same as development or production.
24
- test:
25
- adapter: mysql2
26
- encoding: utf8
27
- reconnect: false
28
- database: datum_dummy_test
29
- pool: 5
30
- username: root
31
- password:
32
- socket: /tmp/mysql.sock
33
-
34
- production:
35
- adapter: mysql2
36
- encoding: utf8
37
- reconnect: false
38
- database: datum_dummy_production
39
- pool: 5
40
- username: root
41
- password:
42
- socket: /tmp/mysql.sock
@@ -1,13 +0,0 @@
1
- ENV["RAILS_ENV"] = "test"
2
- require File.expand_path('../../config/environment', __FILE__)
3
- require 'rails/test_help'
4
- class ActiveSupport::TestCase
5
-
6
- # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in
7
- # alphabetical order.
8
- #
9
- # Note: You'll currently still have to declare fixtures explicitly in
10
- # integration tests -- they do not yet inherit this setting
11
- fixtures :all
12
-
13
- end
@@ -1,70 +0,0 @@
1
- require 'test_helper'
2
- require "datum/enable_task"
3
-
4
- class EnableTaskTest < ActiveSupport::TestCase
5
-
6
- def setup
7
- @enableTask = Datum::EnableTask.new
8
- @enableTask.disable_user_questions
9
- @enableTask.disable_verification
10
- end
11
-
12
- def call_enable
13
- assert_nothing_raised do
14
- @enableTask.rock
15
- end
16
- end
17
-
18
- test "enable should create directories" do
19
- call_enable
20
- dirs = @enableTask.datum_directories
21
- assert_not_nil dirs, "Enable Task directories should not be nil"
22
-
23
- dirs.each { |directory|
24
- assert File.directory?(directory),
25
- "Enable Task did not create directory: #{directory}"
26
- }
27
- end
28
-
29
- test "post call to need_yml should return false" do
30
- call_enable
31
- assert false == @enableTask.send(:need_yml?),
32
- "need_yml? did not detect new yml section"
33
- end
34
-
35
- test "post call to need_app should return false" do
36
- call_enable
37
- assert false == @enableTask.send(:need_app?),
38
- "need_app? did not detect new config add-in"
39
- end
40
-
41
- test "clean database.yml should yield true need_yml" do
42
-
43
- clean_yml = "#{Rails.env}/dummy/test/lib/datum/utils/database.yml"
44
- config_dir = "#{Rails.env}/dummy/config/database.yml"
45
-
46
- FileUtils.cp(clean_yml, config_dir)
47
-
48
- assert true == @enableTask.send(:need_yml?),
49
- "need_yml? should have returned true with a clean yml"
50
-
51
- test_post_call_to_need_yml_should_return_false
52
- end
53
-
54
- test "clean application.rb should yield true need_app" do
55
-
56
- clean_app = "#{Rails.env}/dummy/test/lib/datum/utils/application.rb"
57
- config_app = "#{Rails.env}/dummy/config/application.rb"
58
-
59
- FileUtils.cp(clean_app, config_app)
60
-
61
- assert true == @enableTask.send(:need_app?),
62
- "need_app? should have returned true with a clean application.rb"
63
-
64
- test_post_call_to_need_app_should_return_false
65
-
66
- end
67
-
68
-
69
-
70
- end
data/test/test_helper.rb DELETED
@@ -1,10 +0,0 @@
1
- # Configure Rails Environment
2
- ENV["RAILS_ENV"] = "test"
3
-
4
- require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
- require "rails/test_help"
6
-
7
- Rails.backtrace_cleaner.remove_silencers!
8
-
9
- # Load support files
10
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }