maglevrecord 0.0.3 → 0.1.1

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 (161) hide show
  1. data/.gitignore +35 -0
  2. data/.travis.yml +19 -0
  3. data/Gemfile +13 -0
  4. data/README.md +89 -0
  5. data/Rakefile +22 -0
  6. data/install.sh +238 -0
  7. data/lib/maglev_record/base.rb +10 -62
  8. data/lib/maglev_record/enumerable.rb +13 -24
  9. data/lib/maglev_record/errors.rb +10 -0
  10. data/lib/maglev_record/integration.rb +7 -0
  11. data/lib/maglev_record/maglev_record.rb +13 -0
  12. data/lib/maglev_record/maglev_support/active_support_patch.rb +31 -0
  13. data/lib/maglev_record/maglev_support/concern.rb +19 -0
  14. data/lib/maglev_record/maglev_support/maglev_support.rb +15 -0
  15. data/lib/maglev_record/maglev_support/secure_password.rb +39 -0
  16. data/lib/maglev_record/migration/loader.rb +38 -0
  17. data/lib/maglev_record/migration/migration.rb +142 -0
  18. data/lib/maglev_record/migration/migrator.rb +40 -0
  19. data/lib/maglev_record/migration/operations.rb +92 -0
  20. data/lib/maglev_record/migration.rb +5 -0
  21. data/lib/maglev_record/persistence.rb +23 -48
  22. data/lib/maglev_record/raketasks.rb +9 -0
  23. data/lib/maglev_record/read_write.rb +20 -10
  24. data/lib/maglev_record/rooted_base.rb +8 -0
  25. data/lib/maglev_record/rooted_enumerable.rb +25 -0
  26. data/lib/maglev_record/rooted_persistence.rb +36 -0
  27. data/lib/maglev_record/sensible.rb +28 -0
  28. data/lib/maglev_record/snapshot/change.rb +53 -0
  29. data/lib/maglev_record/snapshot/snapshot.rb +67 -0
  30. data/lib/maglev_record/snapshot/snapshotable.rb +58 -0
  31. data/lib/maglev_record/snapshot.rb +5 -0
  32. data/lib/maglev_record/tools/object_reference.rb +189 -0
  33. data/lib/maglev_record/tools/submodule_finder.rb +42 -0
  34. data/lib/maglev_record/tools.rb +2 -0
  35. data/lib/maglev_record.rb +60 -4
  36. data/lib/tasks/database.rake +38 -0
  37. data/maglevrecord.gemspec +17 -0
  38. data/rails/init.rb +1 -0
  39. data/test/_test_object_reference.rb +70 -0
  40. data/test/example_model.rb +26 -13
  41. data/test/migration/dummy_migrations/migration_1.rb +8 -0
  42. data/test/migration/dummy_migrations/migration_2.rb +8 -0
  43. data/test/migration/dummy_migrations/migration_3.rb +8 -0
  44. data/test/migration/migrations/migration_1.rb +12 -0
  45. data/test/migration/migrations/migration_2.rb +12 -0
  46. data/test/migration/migrations/migration_3.rb +12 -0
  47. data/test/migration/operation_setup.rb +91 -0
  48. data/test/migration/projects/project1/.gitignore +15 -0
  49. data/test/migration/projects/project1/Gemfile +43 -0
  50. data/test/migration/projects/project1/Gemfile.lock +114 -0
  51. data/test/migration/projects/project1/README.rdoc +261 -0
  52. data/test/migration/projects/project1/Rakefile +17 -0
  53. data/test/migration/projects/project1/app/assets/images/rails.png +0 -0
  54. data/test/migration/projects/project1/app/assets/javascripts/application.js +15 -0
  55. data/test/migration/projects/project1/app/assets/stylesheets/application.css +13 -0
  56. data/test/migration/projects/project1/app/controllers/application_controller.rb +3 -0
  57. data/test/migration/projects/project1/app/helpers/application_helper.rb +2 -0
  58. data/test/migration/projects/project1/app/mailers/.gitkeep +0 -0
  59. data/test/migration/projects/project1/app/models/.gitkeep +0 -0
  60. data/test/migration/projects/project1/app/views/layouts/application.html.erb +14 -0
  61. data/test/migration/projects/project1/config/application.rb +62 -0
  62. data/test/migration/projects/project1/config/boot.rb +6 -0
  63. data/test/migration/projects/project1/config/database.yml +25 -0
  64. data/test/migration/projects/project1/config/environment.rb +5 -0
  65. data/test/migration/projects/project1/config/environments/development.rb +37 -0
  66. data/test/migration/projects/project1/config/environments/production.rb +67 -0
  67. data/test/migration/projects/project1/config/initializers/backtrace_silencers.rb +7 -0
  68. data/test/migration/projects/project1/config/initializers/inflections.rb +15 -0
  69. data/test/migration/projects/project1/config/initializers/mime_types.rb +5 -0
  70. data/test/migration/projects/project1/config/initializers/secret_token.rb +7 -0
  71. data/test/migration/projects/project1/config/initializers/session_store.rb +8 -0
  72. data/test/migration/projects/project1/config/initializers/wrap_parameters.rb +14 -0
  73. data/test/migration/projects/project1/config/locales/en.yml +5 -0
  74. data/test/migration/projects/project1/config/routes.rb +58 -0
  75. data/test/migration/projects/project1/config.ru +4 -0
  76. data/test/migration/projects/project1/db/seeds.rb +7 -0
  77. data/test/migration/projects/project1/lib/assets/.gitkeep +0 -0
  78. data/test/migration/projects/project1/lib/tasks/.gitkeep +0 -0
  79. data/test/migration/projects/project1/log/.gitkeep +0 -0
  80. data/test/migration/projects/project1/public/404.html +26 -0
  81. data/test/migration/projects/project1/public/422.html +26 -0
  82. data/test/migration/projects/project1/public/500.html +25 -0
  83. data/test/migration/projects/project1/public/favicon.ico +0 -0
  84. data/test/migration/projects/project1/public/index.html +241 -0
  85. data/test/migration/projects/project1/public/robots.txt +5 -0
  86. data/test/migration/projects/project1/script/rails +6 -0
  87. data/test/migration/projects/project2/.gitignore +15 -0
  88. data/test/migration/projects/project2/Gemfile +44 -0
  89. data/test/migration/projects/project2/Gemfile.lock +115 -0
  90. data/test/migration/projects/project2/README.rdoc +261 -0
  91. data/test/migration/projects/project2/Rakefile +17 -0
  92. data/test/migration/projects/project2/app/assets/images/rails.png +0 -0
  93. data/test/migration/projects/project2/app/assets/javascripts/application.js +15 -0
  94. data/test/migration/projects/project2/app/assets/stylesheets/application.css +13 -0
  95. data/test/migration/projects/project2/app/controllers/application_controller.rb +3 -0
  96. data/test/migration/projects/project2/app/helpers/application_helper.rb +2 -0
  97. data/test/migration/projects/project2/app/mailers/.gitkeep +0 -0
  98. data/test/migration/projects/project2/app/models/.gitkeep +0 -0
  99. data/test/migration/projects/project2/app/models/project_model.rb +8 -0
  100. data/test/migration/projects/project2/app/views/layouts/application.html.erb +14 -0
  101. data/test/migration/projects/project2/config/application.rb +62 -0
  102. data/test/migration/projects/project2/config/boot.rb +6 -0
  103. data/test/migration/projects/project2/config/database.yml +25 -0
  104. data/test/migration/projects/project2/config/environment.rb +5 -0
  105. data/test/migration/projects/project2/config/environments/development.rb +37 -0
  106. data/test/migration/projects/project2/config/environments/production.rb +67 -0
  107. data/test/migration/projects/project2/config/initializers/backtrace_silencers.rb +7 -0
  108. data/test/migration/projects/project2/config/initializers/inflections.rb +15 -0
  109. data/test/migration/projects/project2/config/initializers/mime_types.rb +5 -0
  110. data/test/migration/projects/project2/config/initializers/secret_token.rb +7 -0
  111. data/test/migration/projects/project2/config/initializers/session_store.rb +8 -0
  112. data/test/migration/projects/project2/config/initializers/wrap_parameters.rb +14 -0
  113. data/test/migration/projects/project2/config/locales/en.yml +5 -0
  114. data/test/migration/projects/project2/config/routes.rb +58 -0
  115. data/test/migration/projects/project2/config.ru +4 -0
  116. data/test/migration/projects/project2/db/seeds.rb +7 -0
  117. data/test/migration/projects/project2/lib/assets/.gitkeep +0 -0
  118. data/test/migration/projects/project2/lib/tasks/.gitkeep +0 -0
  119. data/test/migration/projects/project2/log/.gitkeep +0 -0
  120. data/test/migration/projects/project2/migrations/migration_2013-04-Apr-23_17.31.38.rb +16 -0
  121. data/test/migration/projects/project2/migrations/migration_2013-04-Apr-23_17.31.52.rb +16 -0
  122. data/test/migration/projects/project2/migrations/migration_2013-04-Apr-23_17.32.07.rb +16 -0
  123. data/test/migration/projects/project2/public/404.html +26 -0
  124. data/test/migration/projects/project2/public/422.html +26 -0
  125. data/test/migration/projects/project2/public/500.html +25 -0
  126. data/test/migration/projects/project2/public/favicon.ico +0 -0
  127. data/test/migration/projects/project2/public/index.html +241 -0
  128. data/test/migration/projects/project2/public/robots.txt +5 -0
  129. data/test/migration/projects/project2/script/rails +6 -0
  130. data/test/migration/test_loader.rb +78 -0
  131. data/test/migration/test_migration.rb +127 -0
  132. data/test/migration/test_nonexistent_classes.rb +120 -0
  133. data/test/migration/test_operations_fit_together.rb +68 -0
  134. data/test/migration/test_project.rb +105 -0
  135. data/test/migration/test_project1.slow.rb +58 -0
  136. data/test/migration/test_project2.slow.rb +34 -0
  137. data/test/migration/test_remove.rb +219 -0
  138. data/test/migration/test_rename.rb +238 -0
  139. data/test/migration/test_scenario.rb +37 -0
  140. data/test/migration/todo.txt +17 -0
  141. data/test/more_asserts.rb +63 -0
  142. data/test/snapshot/test_snapshot.rb +99 -0
  143. data/test/snapshot/test_snapshot_attributes.slow.rb +57 -0
  144. data/test/snapshot/test_snapshot_classes.slow.rb +32 -0
  145. data/test/snapshot/test_snapshotable.rb +53 -0
  146. data/test/test_accessors.rb +46 -0
  147. data/test/test_active_model_like_interface.rb +1 -1
  148. data/test/test_model_timestamps.rb +22 -0
  149. data/test/test_more_asserts.rb +68 -0
  150. data/test/test_naming.rb +22 -0
  151. data/test/test_persistence.rb +127 -0
  152. data/test/test_query_interface.rb +20 -25
  153. data/test/test_sensibles.rb +38 -0
  154. data/test/test_validation.rb +20 -57
  155. data/todo.txt +1 -0
  156. data/update.sh +180 -0
  157. metadata +156 -12
  158. data/lib/maglev_record/model_not_saved_or_reset.rb +0 -15
  159. data/test/test_dirty_object.rb +0 -50
  160. data/test/test_maglev_record_base.rb +0 -22
  161. data/test/test_maglev_simple_persistance.rb +0 -45
data/update.sh ADDED
@@ -0,0 +1,180 @@
1
+ #! /bin/bash
2
+
3
+ #=========================================================================
4
+ # Copyright (C) GemStone Systems, Inc. 2010.
5
+ #
6
+ # Name - update.sh
7
+ #
8
+ # Purpose - Automatically update to a new version of GemStone
9
+ # in an existing git repository cloned from MagLev on github.
10
+ # Be both verbose and idempotent, so we can easily diagnose
11
+ # any problems.
12
+ #
13
+ # $Id:$
14
+ #
15
+ # Description:
16
+ # Updates GemStone to a version corresponsing to $MAGLEV_HOME/version.txt
17
+ # Safe to run multiple times. Only saves one prior backup repository though.
18
+ #
19
+ # Actions:
20
+ # Download the GemStone archive into the parent directory
21
+ # Uncompress the GemStone archive in the parent directory
22
+ # Update the gemstone link to point to the new GemStone
23
+ # Backup any existing 'maglev' repository
24
+ # Wipeout any previous 'maglev' configuration file
25
+ # Create a new default repository called 'maglev'
26
+ # Generate the MagLev HTML documentation
27
+ # Print build version information
28
+ # Remind user to setup environment variables
29
+ #=========================================================================
30
+
31
+ if [ -x bin/maglev-ruby ]; then
32
+ # echo "[Info] using $PWD as MAGLEV_HOME"
33
+ export MAGLEV_HOME=$PWD
34
+ else
35
+ echo "[Error] $PWD is not a valid MagLev directory"
36
+ echo "To fix this, 'clone git://github.com:MagLev/maglev.git'"
37
+ echo "then run install.sh from the resulting directory."
38
+ exit 1
39
+ fi
40
+
41
+ # Check that the parent directory is writable
42
+ if [ ! -w ".." ]; then
43
+ echo "[Error] This script requires write permission on the MagLev parent directory."
44
+ /bin/ls -ld ..
45
+ echo "To fix this, 'chmod u+w ..'"
46
+ exit 1
47
+ fi
48
+
49
+ # We should run this as a normal user, not root.
50
+ if [ `id | cut -f2 -d= | cut -f1 -d\(` -eq 0 ]; then
51
+ echo "[Error] This script should be run as a normal user, not root."
52
+ exit 1
53
+ fi
54
+
55
+ # Detect operating system
56
+ PLATFORM="`uname -sm | tr ' ' '-'`"
57
+ # Macs with Core i7 use the same software as older Macs
58
+ [ $PLATFORM = "Darwin-x86_64" ] && PLATFORM="Darwin-i386"
59
+ gsvers=`grep ^GEMSTONE version.txt | cut -f2 -d-`
60
+ gss_name="GemStone-${gsvers}.${PLATFORM}"
61
+ gss_file=${gss_name}.tar.gz
62
+
63
+ # We're good to go. Let user know.
64
+ machine_name="`uname -n`"
65
+ echo "[Info] Installing $gss_name on $machine_name"
66
+
67
+ # Look for either wget or curl to download GemStone
68
+ if [ -e "`which wget 2>/dev/null`" ]; then
69
+ cmd="`which wget` --quiet"
70
+ elif [ -e "`which curl 2>/dev/null`" ]; then
71
+ cmd="`which curl` -s -O"
72
+ else
73
+ echo "[Error] Neither wget nor curl is available. Install one of them and rerun this script."
74
+ exit 1
75
+ fi
76
+
77
+ # IMPORTANT: Move to the parent directory of the MagLev git repository
78
+ cd $MAGLEV_HOME/..
79
+
80
+ # Download appropriate version of GemStone
81
+ if [ ! -e $gss_file ]; then
82
+ echo "[Info] Downloading $gss_file using ${cmd}"
83
+ $cmd http://glass-downloads.gemstone.com/maglev/$gss_file
84
+ else
85
+ echo "[Info] $gss_file already exists"
86
+ echo "to replace it, remove or rename it and rerun this script"
87
+ fi
88
+
89
+ # Uncompress the downloaded GemStone archive in the current directory
90
+ echo "[Info] Uncompressing $gss_file in $PWD"
91
+ if [ ! -e $gss_name ]; then
92
+ gunzip -c $gss_file | tar xf -
93
+ else
94
+ echo "[Warning] $gss_name already exists"
95
+ echo "to replace it, remove or rename it and rerun this script"
96
+ fi
97
+
98
+ # Create a link to the GemStone directory
99
+ echo "[Info] Linking $gss_name to ${MAGLEV_HOME}/gemstone"
100
+ rm -f $MAGLEV_HOME/gemstone
101
+ ln -sf ${PWD}/$gss_name $MAGLEV_HOME/gemstone
102
+
103
+ # Finally get back to the MagLev directory
104
+ cd $MAGLEV_HOME
105
+
106
+ # Make sure we have a locks directory
107
+ mkdir -p locks
108
+ # and the correct updated keyfile
109
+ rm -f etc/maglev.demo.key
110
+ ln -sf maglev.demo.key-$PLATFORM etc/maglev.demo.key
111
+ # Make sure we have specs and benchmarks.
112
+ echo "[Info] updating MSpec and RubySpec submodules"
113
+ git submodule --quiet update --init
114
+
115
+ # Create a default repository called "maglev" and generate the MagLev HTML documentation
116
+ # Check for existence of required executable rake
117
+ if [ -e "`which rake 2>/dev/null`" ]; then
118
+ # Backup any existing maglev repository
119
+ if [ -e data/maglev/extent/extent0.ruby.dbf ]; then
120
+ echo "[Info] Backing up existing 'maglev' repository to backups/previous_maglev_extent.tgz"
121
+ rake maglev:take_snapshot >/dev/null
122
+ mv backups/maglev_extent.tgz backups/previous_maglev_extent.tgz
123
+ fi
124
+ # create a clean slate
125
+ if [ -e etc/conf.d/maglev.conf ]; then
126
+ echo "[Info] Removing existing 'maglev' configuration file."
127
+ rake stone:destroy[maglev] >/dev/null
128
+ fi
129
+
130
+ if [ ! -e bin/extent0.ruby.dbf ]; then
131
+ extent0='gemstone/bin/extent0.dbf'
132
+ echo "[Info] Building new extent0.ruby.dbf from $extent0 and creating default maglev stone"
133
+ echo "This could take a while..."
134
+ if [ -e $extent0 ]; then
135
+ # NOTE: build:maglev will also create the maglev stone
136
+ if rake build:maglev ; then
137
+ echo "[Info] Generating the MagLev HTML documentation"
138
+ rake rdoc >/dev/null 2>&1
139
+ else
140
+ echo "[Warning] Could not build new ruby extent"
141
+ fi
142
+ else
143
+ echo "[Warning] Can't find ${extent0}: Skip building ruby extent"
144
+ fi
145
+ else
146
+ if [ ! -e etc/conf.d/maglev.conf ]; then
147
+ echo "[Info] Creating new default 'maglev' repository"
148
+ rake stone:create[maglev] >/dev/null
149
+ fi
150
+ fi
151
+ echo "[Info] Starting MagLev stone (loading kernel classes)"
152
+ rake maglev:start
153
+ else
154
+ echo "[Warning] rake not found!"
155
+ echo "Skipping creation of default 'maglev' repository and HTML documentation."
156
+ fi
157
+
158
+ echo
159
+ echo "[Info] Finished upgrade to $gss_name on $machine_name"
160
+ echo ""
161
+ echo "[Info] MagLev version information:"
162
+ cat version.txt
163
+ echo "[Info] GemStone version information:"
164
+ cat gemstone/version.txt
165
+
166
+ # Reminder to setup environment variables
167
+ echo ""
168
+ echo "[Info] Adding these to your .bashrc will make it easier to run MagLev"
169
+ echo "export MAGLEV_HOME=${PWD}"
170
+ echo 'export PATH=$MAGLEV_HOME/bin:$PATH'
171
+
172
+ # Reminder to generate Smalltalk FFI
173
+ echo ""
174
+ echo "[Info] If you want to call GemStone Smalltalk methods from Ruby, run"
175
+ echo " rake stwrappers"
176
+ echo "after this upgrade has finished. This will generate .rb files you can use"
177
+ echo "in \$MAGLEV_HOME/lib/ruby/site_ruby/1.8/smalltalk/"
178
+
179
+ # End of script
180
+ exit 0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maglevrecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2013-01-10 00:00:00.000000000 Z
16
+ date: 2013-05-06 00:00:00.000000000 Z
17
17
  dependencies: []
18
18
  description: Library for using to MagLev to persist your data in a Rails app.
19
19
  email: bp2012h1@hpi.uni-potsdam.de
@@ -21,20 +21,163 @@ executables: []
21
21
  extensions: []
22
22
  extra_rdoc_files: []
23
23
  files:
24
- - lib/maglev_record/model_not_saved_or_reset.rb
24
+ - .gitignore
25
+ - .travis.yml
26
+ - Gemfile
27
+ - README.md
28
+ - Rakefile
29
+ - install.sh
30
+ - lib/maglev_record.rb
31
+ - lib/maglev_record/base.rb
25
32
  - lib/maglev_record/enumerable.rb
26
- - lib/maglev_record/read_write.rb
33
+ - lib/maglev_record/errors.rb
34
+ - lib/maglev_record/integration.rb
35
+ - lib/maglev_record/maglev_record.rb
36
+ - lib/maglev_record/maglev_support/active_support_patch.rb
37
+ - lib/maglev_record/maglev_support/concern.rb
38
+ - lib/maglev_record/maglev_support/maglev_support.rb
39
+ - lib/maglev_record/maglev_support/secure_password.rb
40
+ - lib/maglev_record/migration.rb
41
+ - lib/maglev_record/migration/loader.rb
42
+ - lib/maglev_record/migration/migration.rb
43
+ - lib/maglev_record/migration/migrator.rb
44
+ - lib/maglev_record/migration/operations.rb
27
45
  - lib/maglev_record/persistence.rb
28
- - lib/maglev_record/base.rb
29
- - lib/maglev_record.rb
46
+ - lib/maglev_record/raketasks.rb
47
+ - lib/maglev_record/read_write.rb
48
+ - lib/maglev_record/rooted_base.rb
49
+ - lib/maglev_record/rooted_enumerable.rb
50
+ - lib/maglev_record/rooted_persistence.rb
51
+ - lib/maglev_record/sensible.rb
52
+ - lib/maglev_record/snapshot.rb
53
+ - lib/maglev_record/snapshot/change.rb
54
+ - lib/maglev_record/snapshot/snapshot.rb
55
+ - lib/maglev_record/snapshot/snapshotable.rb
56
+ - lib/maglev_record/tools.rb
57
+ - lib/maglev_record/tools/object_reference.rb
58
+ - lib/maglev_record/tools/submodule_finder.rb
59
+ - lib/tasks/database.rake
60
+ - maglevrecord.gemspec
61
+ - rails/init.rb
62
+ - test/_test_object_reference.rb
30
63
  - test/example_model.rb
31
- - test/test_validation.rb
32
- - test/test_maglev_simple_persistance.rb
33
- - test/test_maglev_record_base.rb
34
64
  - test/lint.rb
35
- - test/test_query_interface.rb
36
- - test/test_dirty_object.rb
65
+ - test/migration/dummy_migrations/migration_1.rb
66
+ - test/migration/dummy_migrations/migration_2.rb
67
+ - test/migration/dummy_migrations/migration_3.rb
68
+ - test/migration/migrations/migration_1.rb
69
+ - test/migration/migrations/migration_2.rb
70
+ - test/migration/migrations/migration_3.rb
71
+ - test/migration/operation_setup.rb
72
+ - test/migration/projects/project1/.gitignore
73
+ - test/migration/projects/project1/Gemfile
74
+ - test/migration/projects/project1/Gemfile.lock
75
+ - test/migration/projects/project1/README.rdoc
76
+ - test/migration/projects/project1/Rakefile
77
+ - test/migration/projects/project1/app/assets/images/rails.png
78
+ - test/migration/projects/project1/app/assets/javascripts/application.js
79
+ - test/migration/projects/project1/app/assets/stylesheets/application.css
80
+ - test/migration/projects/project1/app/controllers/application_controller.rb
81
+ - test/migration/projects/project1/app/helpers/application_helper.rb
82
+ - test/migration/projects/project1/app/mailers/.gitkeep
83
+ - test/migration/projects/project1/app/models/.gitkeep
84
+ - test/migration/projects/project1/app/views/layouts/application.html.erb
85
+ - test/migration/projects/project1/config.ru
86
+ - test/migration/projects/project1/config/application.rb
87
+ - test/migration/projects/project1/config/boot.rb
88
+ - test/migration/projects/project1/config/database.yml
89
+ - test/migration/projects/project1/config/environment.rb
90
+ - test/migration/projects/project1/config/environments/development.rb
91
+ - test/migration/projects/project1/config/environments/production.rb
92
+ - test/migration/projects/project1/config/initializers/backtrace_silencers.rb
93
+ - test/migration/projects/project1/config/initializers/inflections.rb
94
+ - test/migration/projects/project1/config/initializers/mime_types.rb
95
+ - test/migration/projects/project1/config/initializers/secret_token.rb
96
+ - test/migration/projects/project1/config/initializers/session_store.rb
97
+ - test/migration/projects/project1/config/initializers/wrap_parameters.rb
98
+ - test/migration/projects/project1/config/locales/en.yml
99
+ - test/migration/projects/project1/config/routes.rb
100
+ - test/migration/projects/project1/db/seeds.rb
101
+ - test/migration/projects/project1/lib/assets/.gitkeep
102
+ - test/migration/projects/project1/lib/tasks/.gitkeep
103
+ - test/migration/projects/project1/log/.gitkeep
104
+ - test/migration/projects/project1/public/404.html
105
+ - test/migration/projects/project1/public/422.html
106
+ - test/migration/projects/project1/public/500.html
107
+ - test/migration/projects/project1/public/favicon.ico
108
+ - test/migration/projects/project1/public/index.html
109
+ - test/migration/projects/project1/public/robots.txt
110
+ - test/migration/projects/project1/script/rails
111
+ - test/migration/projects/project2/.gitignore
112
+ - test/migration/projects/project2/Gemfile
113
+ - test/migration/projects/project2/Gemfile.lock
114
+ - test/migration/projects/project2/README.rdoc
115
+ - test/migration/projects/project2/Rakefile
116
+ - test/migration/projects/project2/app/assets/images/rails.png
117
+ - test/migration/projects/project2/app/assets/javascripts/application.js
118
+ - test/migration/projects/project2/app/assets/stylesheets/application.css
119
+ - test/migration/projects/project2/app/controllers/application_controller.rb
120
+ - test/migration/projects/project2/app/helpers/application_helper.rb
121
+ - test/migration/projects/project2/app/mailers/.gitkeep
122
+ - test/migration/projects/project2/app/models/.gitkeep
123
+ - test/migration/projects/project2/app/models/project_model.rb
124
+ - test/migration/projects/project2/app/views/layouts/application.html.erb
125
+ - test/migration/projects/project2/config.ru
126
+ - test/migration/projects/project2/config/application.rb
127
+ - test/migration/projects/project2/config/boot.rb
128
+ - test/migration/projects/project2/config/database.yml
129
+ - test/migration/projects/project2/config/environment.rb
130
+ - test/migration/projects/project2/config/environments/development.rb
131
+ - test/migration/projects/project2/config/environments/production.rb
132
+ - test/migration/projects/project2/config/initializers/backtrace_silencers.rb
133
+ - test/migration/projects/project2/config/initializers/inflections.rb
134
+ - test/migration/projects/project2/config/initializers/mime_types.rb
135
+ - test/migration/projects/project2/config/initializers/secret_token.rb
136
+ - test/migration/projects/project2/config/initializers/session_store.rb
137
+ - test/migration/projects/project2/config/initializers/wrap_parameters.rb
138
+ - test/migration/projects/project2/config/locales/en.yml
139
+ - test/migration/projects/project2/config/routes.rb
140
+ - test/migration/projects/project2/db/seeds.rb
141
+ - test/migration/projects/project2/lib/assets/.gitkeep
142
+ - test/migration/projects/project2/lib/tasks/.gitkeep
143
+ - test/migration/projects/project2/log/.gitkeep
144
+ - test/migration/projects/project2/migrations/migration_2013-04-Apr-23_17.31.38.rb
145
+ - test/migration/projects/project2/migrations/migration_2013-04-Apr-23_17.31.52.rb
146
+ - test/migration/projects/project2/migrations/migration_2013-04-Apr-23_17.32.07.rb
147
+ - test/migration/projects/project2/public/404.html
148
+ - test/migration/projects/project2/public/422.html
149
+ - test/migration/projects/project2/public/500.html
150
+ - test/migration/projects/project2/public/favicon.ico
151
+ - test/migration/projects/project2/public/index.html
152
+ - test/migration/projects/project2/public/robots.txt
153
+ - test/migration/projects/project2/script/rails
154
+ - test/migration/test_loader.rb
155
+ - test/migration/test_migration.rb
156
+ - test/migration/test_nonexistent_classes.rb
157
+ - test/migration/test_operations_fit_together.rb
158
+ - test/migration/test_project.rb
159
+ - test/migration/test_project1.slow.rb
160
+ - test/migration/test_project2.slow.rb
161
+ - test/migration/test_remove.rb
162
+ - test/migration/test_rename.rb
163
+ - test/migration/test_scenario.rb
164
+ - test/migration/todo.txt
165
+ - test/more_asserts.rb
166
+ - test/snapshot/test_snapshot.rb
167
+ - test/snapshot/test_snapshot_attributes.slow.rb
168
+ - test/snapshot/test_snapshot_classes.slow.rb
169
+ - test/snapshot/test_snapshotable.rb
170
+ - test/test_accessors.rb
37
171
  - test/test_active_model_like_interface.rb
172
+ - test/test_model_timestamps.rb
173
+ - test/test_more_asserts.rb
174
+ - test/test_naming.rb
175
+ - test/test_persistence.rb
176
+ - test/test_query_interface.rb
177
+ - test/test_sensibles.rb
178
+ - test/test_validation.rb
179
+ - todo.txt
180
+ - update.sh
38
181
  homepage: https://github.com/knub/maglevrecord
39
182
  licenses: []
40
183
  post_install_message:
@@ -55,8 +198,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
198
  version: '0'
56
199
  requirements: []
57
200
  rubyforge_project:
58
- rubygems_version: 1.8.11
201
+ rubygems_version: 1.8.24
59
202
  signing_key:
60
203
  specification_version: 3
61
204
  summary: MagLev persistence with an ActiveRecord-like interface!
62
205
  test_files: []
206
+ has_rdoc:
@@ -1,15 +0,0 @@
1
- # Maglev.persistent do
2
- # Object.remove_const(:NotSavedOnReset)
3
- # end
4
- # Maglev.commit_transaction
5
-
6
- module MaglevRecord
7
- Maglev.transient do
8
- class ModelNotSavedOrReset
9
- @instance = self.new
10
- def self.new
11
- @instance
12
- end
13
- end
14
- end
15
- end
@@ -1,50 +0,0 @@
1
- # Maglev.persistent do
2
- # Object.remove_const(:NotSavedOnReset)
3
- # end
4
- # Maglev.commit_transaction
5
-
6
- # Maglev.transient do
7
- # class ModelNotSavedOrReset
8
- # end
9
- # end
10
-
11
- # Maglev::PERSISTENT_ROOT['tmp'] = NotSavedOnReset.new
12
- # Maglev.commit_transaction
13
-
14
- require 'rubygems'
15
- require 'test/unit'
16
-
17
- class DirtyObjectTest < Test::Unit::TestCase
18
-
19
- def setup
20
- Maglev.abort_transaction
21
- @book = Book.dummy
22
- @book.save
23
- Maglev.commit_transaction
24
- end
25
-
26
- def test_no_save_or_reset_throws_error
27
- @book.author = "Shakespeare"
28
- assert_raise TransactionError do
29
- Maglev.commit_transaction
30
- end
31
- end
32
-
33
- def test_reset_throws_no_error
34
- @book.author = "Shakespeare"
35
- @book.reset!
36
- assert_nothing_raised Exception do
37
- Maglev.commit_transaction
38
- end
39
- assert_equal "Joanne K. Rowling", @book.author
40
- end
41
-
42
- def test_save_throws_no_error
43
- @book.author = "Shakespeare"
44
- @book.save
45
- assert_nothing_raised Exception do
46
- Maglev.commit_transaction
47
- end
48
- assert_equal @book.author, "Shakespeare"
49
- end
50
- end
@@ -1,22 +0,0 @@
1
- #require 'bacon'
2
- #require 'maglev_record'
3
-
4
- #class ExampleStudent
5
- # include Maglev::Base
6
- #
7
- # attr_accessible :name
8
- #
9
- # def initialize(name)
10
- # name = name
11
- # end
12
- #end
13
-
14
- #describe 'ExampleStudent' do
15
- # let(:student) { ExampleStudent.new('Ferdinand') }
16
- #
17
- # it "should know its name" do
18
- # subject.name.should equal('Ferdinand')
19
- # end
20
- #
21
- #end
22
-
@@ -1,45 +0,0 @@
1
- require "test/unit"
2
- require "maglev_record"
3
- require "example_model"
4
-
5
- class MaglevSimplePersistanceTest < Test::Unit::TestCase
6
-
7
- def run_with_new_transaction
8
- Maglev.abort_transaction
9
- yield
10
- Maglev.commit_transaction
11
- end
12
-
13
- def test_model_is_persisted
14
- run_with_new_transaction do
15
- book = Book.new(:title => "The Magician's Guild", :author => "Trudi Canavan")
16
- book.save
17
- end
18
-
19
- run_with_new_transaction do
20
- assert_equal Book.find { |b| b.title == "The Magician's Guild"}.author, "Trudi Canavan"
21
- end
22
- end
23
-
24
- def test_model_is_deleted
25
- run_with_new_transaction do
26
- book = Book.new(:title => "Harry Potter and the Philosopher's stone", :author => "Joanne K. Rowling")
27
- book.save
28
- end
29
-
30
- run_with_new_transaction do
31
- Book.find { |b| b.title == "Harry Potter and the Philosopher's stone"}.delete
32
- end
33
-
34
- run_with_new_transaction do
35
- assert_nil Book.find { |b| b.title == "Harry Potter and the Philosopher's stone"}
36
- end
37
- end
38
-
39
- def teardown
40
- run_with_new_transaction do
41
- Book.clear
42
- end
43
- end
44
-
45
- end