desert 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +4 -0
- data/README.rdoc +20 -3
- data/Rakefile +48 -27
- data/lib/desert/plugin_migrations/2.1/extensions/schema_statements.rb +5 -2
- metadata +29 -29
data/CHANGES
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
0.3.4
|
2
|
+
- Fix problems with plugin migrations numbered higher than 7
|
3
|
+
- Cleanups to specs: cruise rake task, improved docs, and specs run on OSX
|
4
|
+
|
1
5
|
0.3.3
|
2
6
|
- Fixed [#20770] Can't get specs to run for desert-based plugin bug (http://rubyforge.org/tracker/index.php?func=detail&aid=20770&group_id=6426&atid=24920)
|
3
7
|
- Fixed [#21564] Can't see desert rake tasks (http://rubyforge.org/tracker/index.php?func=detail&aid=21564&group_id=6426&atid=24920)
|
data/README.rdoc
CHANGED
@@ -273,13 +273,30 @@ test/specs for all installed plugins, which may not be what you want.
|
|
273
273
|
|
274
274
|
To run specs, you need to:
|
275
275
|
|
276
|
-
* Make sure you have the necessary gems installed
|
276
|
+
* Make sure you have the necessary gems installed:
|
277
|
+
|
278
|
+
sudo geminstaller
|
279
|
+
|
280
|
+
* On OSX, you may have to manually install sqlite3-ruby gem
|
281
|
+
|
282
|
+
sudo env ARCHFLAGS="-arch i386" gem install sqlite3-ruby
|
283
|
+
|
284
|
+
* If sqlite3-ruby fails to compile, install it.
|
285
|
+
|
286
|
+
OSX: sudo port install sqlite3
|
287
|
+
Debian: sudo aptitude install sqlite sqlite3 libsqlite-dev libsqlite3-dev
|
288
|
+
|
277
289
|
* Install git http://git.or.cz/
|
278
|
-
* Create a database named desert_test
|
279
|
-
* Update the database.yml file in <tt>spec/rails_root/config/database.yml</tt>
|
280
290
|
* Install the dependencies
|
291
|
+
|
292
|
+
rake install_dependencies
|
293
|
+
|
281
294
|
* Run the specs
|
282
295
|
|
296
|
+
rake
|
297
|
+
|
298
|
+
== Notes on Rails version dependencies
|
299
|
+
|
283
300
|
Desert is a library that heavily monkey patches Rails. To ensure that Desert works with
|
284
301
|
multiple versions of Rails, its tests are run against the supported versions of Rails.
|
285
302
|
|
data/Rakefile
CHANGED
@@ -6,12 +6,12 @@ require 'rake/testtask'
|
|
6
6
|
require 'rake/rdoctask'
|
7
7
|
|
8
8
|
desc "Runs the Rspec suite"
|
9
|
-
task
|
9
|
+
task :default do
|
10
10
|
run_suite
|
11
11
|
end
|
12
12
|
|
13
13
|
desc "Runs the Rspec suite"
|
14
|
-
task
|
14
|
+
task :spec do
|
15
15
|
run_suite
|
16
16
|
end
|
17
17
|
|
@@ -21,12 +21,12 @@ def run_suite
|
|
21
21
|
end
|
22
22
|
|
23
23
|
desc "Copies the trunk to a tag with the name of the current release"
|
24
|
-
task
|
24
|
+
task :tag_release do
|
25
25
|
tag_release
|
26
26
|
end
|
27
27
|
|
28
28
|
PKG_NAME = "desert"
|
29
|
-
PKG_VERSION = "0.3.
|
29
|
+
PKG_VERSION = "0.3.4"
|
30
30
|
PKG_FILES = FileList[
|
31
31
|
'[A-Z]*',
|
32
32
|
'*.rb',
|
@@ -36,29 +36,44 @@ PKG_FILES = FileList[
|
|
36
36
|
'examples/**/*.rb'
|
37
37
|
]
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
39
|
+
def gemspec
|
40
|
+
Gem::Specification.new do |s|
|
41
|
+
s.name = PKG_NAME
|
42
|
+
s.version = PKG_VERSION
|
43
|
+
s.summary = "Desert is a component framework for Rails that allows your plugins to be packaged as mini Rails apps."
|
44
|
+
s.test_files = "examples/spec_suite.rb"
|
45
|
+
s.description = s.summary
|
46
|
+
|
47
|
+
s.files = PKG_FILES.to_a
|
48
|
+
s.require_path = 'lib'
|
49
|
+
|
50
|
+
s.has_rdoc = true
|
51
|
+
s.extra_rdoc_files = [ "README.rdoc", "CHANGES" ]
|
52
|
+
s.rdoc_options = ["--main", "README.rdoc", "--inline-source", "--line-numbers"]
|
53
|
+
|
54
|
+
s.test_files = Dir.glob('spec/*_spec.rb')
|
55
|
+
s.require_path = 'lib'
|
56
|
+
s.author = "Pivotal Labs"
|
57
|
+
s.email = "opensource@pivotallabs.com"
|
58
|
+
s.homepage = "http://pivotallabs.com"
|
59
|
+
s.rubyforge_project = "pivotalrb"
|
60
|
+
end
|
59
61
|
end
|
60
62
|
|
61
|
-
|
63
|
+
desc 'Generate updated gemspec with unique version, which will cause gem to be auto-built on github.'
|
64
|
+
task :update_gemspec do
|
65
|
+
spec = gemspec
|
66
|
+
spec.version = PKG_VERSION + '.' + Time.now.strftime('%Y%m%d%H%M%S')
|
67
|
+
File.open('desert.gemspec', 'w') do |output|
|
68
|
+
output << spec.to_ruby
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# desc "Creates a gem and also updates desert.gemspec to keep github version in sync"
|
73
|
+
# task :update_gem_and_
|
74
|
+
#
|
75
|
+
Rake::GemPackageTask.new(gemspec) do |pkg|
|
76
|
+
Rake::Task['update_gemspec'].invoke
|
62
77
|
pkg.need_zip = true
|
63
78
|
pkg.need_tar = true
|
64
79
|
end
|
@@ -70,7 +85,7 @@ def tag_release
|
|
70
85
|
end
|
71
86
|
|
72
87
|
desc "Install dependencies to run the build. This task uses Git."
|
73
|
-
task
|
88
|
+
task :install_dependencies do
|
74
89
|
require "lib/desert/supported_rails_versions"
|
75
90
|
system("git clone git://github.com/rails/rails.git spec/rails_root/vendor/rails_versions/edge")
|
76
91
|
Dir.chdir("spec/rails_root/vendor/rails_versions/edge") do
|
@@ -88,6 +103,12 @@ task(:install_dependencies) do
|
|
88
103
|
end
|
89
104
|
|
90
105
|
desc "Updates the dependencies to run the build. This task uses Git."
|
91
|
-
task
|
106
|
+
task :update_dependencies do
|
92
107
|
system "cd spec/rails_root/vendor/rails_versions/edge; git pull origin"
|
93
108
|
end
|
109
|
+
|
110
|
+
desc "Runs the CI build"
|
111
|
+
task :cruise => :install_dependencies do
|
112
|
+
run_suite
|
113
|
+
end
|
114
|
+
|
@@ -11,13 +11,16 @@ ActiveRecord::ConnectionAdapters::SchemaStatements.module_eval do
|
|
11
11
|
migration_versions = Dir["#{plugin.migration_path}/*.rb"].map do |path|
|
12
12
|
File.basename(path, ".rb")
|
13
13
|
end.select do |migration|
|
14
|
-
Integer
|
14
|
+
# Make sure versions don't start with zero, or Integer will interpret them as octal
|
15
|
+
version_from_table_stripped = version.sub(/^0*/, '')
|
16
|
+
migration_version_stripped = migration.split("_").first.sub(/^0*/, '')
|
17
|
+
Integer(migration_version_stripped) <= Integer(version_from_table_stripped)
|
15
18
|
end
|
16
19
|
migration_versions.each do |migration_version|
|
17
20
|
insert_sql = ActiveRecord::Base.send(:sanitize_sql, [
|
18
21
|
"INSERT INTO #{Desert::PluginMigrations::Migrator.schema_migrations_table_name}(plugin_name, version) VALUES(?, ?)",
|
19
22
|
plugin_name,
|
20
|
-
Integer(migration_version.split("_").first)
|
23
|
+
Integer(migration_version.split("_").first.sub(/^0*/, ''))
|
21
24
|
])
|
22
25
|
execute insert_sql
|
23
26
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: desert
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pivotal Labs
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-03-04 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -23,49 +23,49 @@ extra_rdoc_files:
|
|
23
23
|
- README.rdoc
|
24
24
|
- CHANGES
|
25
25
|
files:
|
26
|
+
- CHANGES
|
26
27
|
- MIT-LICENSE
|
27
|
-
- README.rdoc
|
28
28
|
- Rakefile
|
29
|
-
-
|
29
|
+
- README.rdoc
|
30
30
|
- init.rb
|
31
|
-
- lib/desert.rb
|
32
|
-
- lib/desert/plugin_templates.rb
|
33
|
-
- lib/desert/rails/dependencies.rb
|
34
|
-
- lib/desert/rails/2.0.0/plugin.rb
|
35
|
-
- lib/desert/rails/1.2.0/initializer.rb
|
36
|
-
- lib/desert/rails/migration.rb
|
37
|
-
- lib/desert/rails/route_set.rb
|
38
|
-
- lib/desert/rails.rb
|
39
31
|
- lib/desert/manager.rb
|
40
|
-
- lib/desert/
|
41
|
-
- lib/desert/ruby/object.rb
|
42
|
-
- lib/desert/supported_rails_versions.rb
|
43
|
-
- lib/desert/ruby.rb
|
44
|
-
- lib/desert/version_checker.rb
|
45
|
-
- lib/desert/tasks.rb
|
46
|
-
- lib/desert/plugin_migrations/2.1/extensions/schema_statements.rb
|
47
|
-
- lib/desert/plugin_migrations/2.1/migrator.rb
|
32
|
+
- lib/desert/plugin.rb
|
48
33
|
- lib/desert/plugin_migrations/1.2/extensions/schema_statements.rb
|
49
34
|
- lib/desert/plugin_migrations/1.2/migrator.rb
|
35
|
+
- lib/desert/plugin_migrations/2.1/extensions/schema_statements.rb
|
36
|
+
- lib/desert/plugin_migrations/2.1/migrator.rb
|
50
37
|
- lib/desert/plugin_migrations/migrator.rb
|
51
|
-
- lib/desert/
|
52
|
-
- lib/desert/plugin_templates/
|
53
|
-
- lib/desert/plugin_templates/
|
38
|
+
- lib/desert/plugin_migrations.rb
|
39
|
+
- lib/desert/plugin_templates/1.2.0/action_mailer.rb
|
40
|
+
- lib/desert/plugin_templates/1.2.0/action_view.rb
|
54
41
|
- lib/desert/plugin_templates/1.99.0/action_mailer.rb
|
55
42
|
- lib/desert/plugin_templates/1.99.0/action_view.rb
|
56
43
|
- lib/desert/plugin_templates/2.0.0/action_mailer.rb
|
57
|
-
- lib/desert/plugin_templates/2.1.0/action_view.rb
|
58
44
|
- lib/desert/plugin_templates/2.0.2/action_view.rb
|
45
|
+
- lib/desert/plugin_templates/2.1.0/action_view.rb
|
46
|
+
- lib/desert/plugin_templates/action_controller.rb
|
59
47
|
- lib/desert/plugin_templates/action_view.rb
|
60
|
-
- lib/desert/plugin_templates/
|
61
|
-
- lib/desert/plugin_templates
|
48
|
+
- lib/desert/plugin_templates/edge/action_view.rb
|
49
|
+
- lib/desert/plugin_templates.rb
|
50
|
+
- lib/desert/rails/1.2.0/initializer.rb
|
51
|
+
- lib/desert/rails/2.0.0/plugin.rb
|
52
|
+
- lib/desert/rails/dependencies.rb
|
53
|
+
- lib/desert/rails/migration.rb
|
54
|
+
- lib/desert/rails/route_set.rb
|
55
|
+
- lib/desert/rails.rb
|
56
|
+
- lib/desert/ruby/object.rb
|
57
|
+
- lib/desert/ruby.rb
|
58
|
+
- lib/desert/supported_rails_versions.rb
|
59
|
+
- lib/desert/tasks.rb
|
60
|
+
- lib/desert/version_checker.rb
|
61
|
+
- lib/desert.rb
|
62
62
|
- generators/desert_plugin
|
63
|
+
- generators/desert_plugin/desert_plugin_generator.rb
|
63
64
|
- generators/desert_plugin/templates
|
64
|
-
- generators/desert_plugin/templates/
|
65
|
+
- generators/desert_plugin/templates/empty_file
|
65
66
|
- generators/desert_plugin/templates/plugin_migration.rb
|
67
|
+
- generators/desert_plugin/templates/routes.rb
|
66
68
|
- generators/desert_plugin/templates/spec_helper.rb
|
67
|
-
- generators/desert_plugin/templates/empty_file
|
68
|
-
- generators/desert_plugin/desert_plugin_generator.rb
|
69
69
|
- generators/desert_plugin/USAGE
|
70
70
|
has_rdoc: true
|
71
71
|
homepage: http://pivotallabs.com
|